Re: [PATCH net-next 3/4] selinux: bpf: Add selinux check for eBPF syscall operations

2017-10-05 Thread Daniel Borkmann
On 10/05/2017 03:28 PM, Stephen Smalley wrote: [...] +static int selinux_bpf_prog(struct bpf_prog *prog) +{ + u32 sid = current_sid(); + struct bpf_security_struct *bpfsec; + + bpfsec = prog->aux->security; I haven't looked closely at the bpf code, but is it guaranteed that pr

Re: [PATCH net-next 3/4] selinux: bpf: Add selinux check for eBPF syscall operations

2017-10-05 Thread Stephen Smalley
On Wed, 2017-10-04 at 11:29 -0700, Chenbo Feng wrote: > From: Chenbo Feng > > Implement the actual checks introduced to eBPF related syscalls. This > implementation use the security field inside bpf object to store a > sid that > identify the bpf object. And when processes try to access the objec

[PATCH net-next 3/4] selinux: bpf: Add selinux check for eBPF syscall operations

2017-10-04 Thread Chenbo Feng
From: Chenbo Feng Implement the actual checks introduced to eBPF related syscalls. This implementation use the security field inside bpf object to store a sid that identify the bpf object. And when processes try to access the object, selinux will check if processes have the right privileges. The