diff options
author | Chenbo Feng <fengc@google.com> | 2017-10-18 22:00:25 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-20 14:32:59 +0200 |
commit | ec27c3568a34c7fe5fcf4ac0a354eda77687f7eb (patch) | |
tree | e37f2897f3c6228d26a9a15892e61ae63aa2e4fc /security/selinux/include/objsec.h | |
parent | security: bpf: Add LSM hooks for bpf object related syscall (diff) | |
download | linux-ec27c3568a34c7fe5fcf4ac0a354eda77687f7eb.tar.xz linux-ec27c3568a34c7fe5fcf4ac0a354eda77687f7eb.zip |
selinux: bpf: Add selinux check for eBPF syscall operations
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 creation
of eBPF object are also checked at the general bpf check hook and new
cmd introduced to eBPF domain can also be checked there.
Signed-off-by: Chenbo Feng <fengc@google.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'security/selinux/include/objsec.h')
-rw-r--r-- | security/selinux/include/objsec.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h index 1649cd18eb0b..3d54468ce334 100644 --- a/security/selinux/include/objsec.h +++ b/security/selinux/include/objsec.h @@ -150,6 +150,10 @@ struct pkey_security_struct { u32 sid; /* SID of pkey */ }; +struct bpf_security_struct { + u32 sid; /*SID of bpf obj creater*/ +}; + extern unsigned int selinux_checkreqprot; #endif /* _SELINUX_OBJSEC_H_ */ |