Re: [PATCH net-next 2/4] security: bpf: Add LSM hooks for bpf object related syscall

2017-10-11 Thread James Morris
On Wed, 4 Oct 2017, Chenbo Feng wrote: > int bpf_map_new_fd(struct bpf_map *map, int flags) > { > + if (security_bpf_map(map, OPEN_FMODE(flags))) > + return -EPERM; > + Don't hardcode -EPERM here, return the actual error from security_bpf_map(). > + if (security_bpf_prog(p

[PATCH net-next 2/4] security: bpf: Add LSM hooks for bpf object related syscall

2017-10-04 Thread Chenbo Feng
From: Chenbo Feng Introduce several LSM hooks for the syscalls that will allow the userspace to access to eBPF object such as eBPF programs and eBPF maps. The security check is aimed to enforce a per object security protection for eBPF object so only processes with the right priviliges can read/w