]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: bpf: Add addtional check for bpf object file receive
authorChenbo Feng <fengc@google.com>
Wed, 18 Oct 2017 20:00:26 +0000 (13:00 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Oct 2017 12:32:59 +0000 (13:32 +0100)
commit39b3954b287b27eefb45399f955aec03c80c2b92
tree75ca1e0f1847c469ac9e6a6aed6cb0534d97a50b
parent2ce141207bc961243653bcc906befa3338452600
selinux: bpf: Add addtional check for bpf object file receive

Introduce a bpf object related check when sending and receiving files
through unix domain socket as well as binder. It checks if the receiving
process have privilege to read/write the bpf map or use the bpf program.
This check is necessary because the bpf maps and programs are using a
anonymous inode as their shared inode so the normal way of checking the
files and sockets when passing between processes cannot work properly on
eBPF object. This check only works when the BPF_SYSCALL is configured.

Signed-off-by: Chenbo Feng <fengc@google.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Reviewed-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/bpf.h
kernel/bpf/syscall.c
security/selinux/hooks.c