Re: [PATCH bpf-next 2/2] bpf: Add tests for bpf_lsm_set_bprm_opts

2020-11-16 Thread KP Singh
[...] > + > +#include "vmlinux.h" > +#include > +#include > +#include > + > +char _license[] SEC("license") = "GPL"; > + > +struct { > + __uint(type, BPF_MAP_TYPE_TASK_STORAGE); > + __uint(map_flags, BPF_F_NO_PREALLOC); > + __type(key, int); > + __type(value, int); > +}

[PATCH bpf-next 2/2] bpf: Add tests for bpf_lsm_set_bprm_opts

2020-11-16 Thread KP Singh
From: KP Singh The test forks a child process, updates the local storage to set/unset the securexec bit. The BPF program in the test attaches to bprm_creds_for_exec which checks the local storage of the current task to set the secureexec bit on the binary parameters (bprm). The child then