Skip to content

Commit e4c82ea

Browse files
committed
selinux: add proper NULL termination to the secclass_map permissions
This patch adds the missing NULL termination to the "bpf" and "perf_event" object class permission lists. This missing NULL termination should really only affect the tools under scripts/selinux, with the most important being genheaders.c, although in practice this has not been an issue on any of my dev/test systems. If the problem were to manifest itself it would likely result in bogus permissions added to the end of the object class; thankfully with no access control checks using these bogus permissions and no policies defining these permissions the impact would likely be limited to some noise about undefined permissions during policy load. Cc: [email protected] Fixes: ec27c35 ("selinux: bpf: Add selinux check for eBPF syscall operations") Fixes: da97e18 ("perf_event: Add support for LSM and SELinux checks") Signed-off-by: Paul Moore <[email protected]>
1 parent 1fb057d commit e4c82ea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

security/selinux/include/classmap.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,12 @@ struct security_class_mapping secclass_map[] = {
242242
{ "infiniband_endport",
243243
{ "manage_subnet", NULL } },
244244
{ "bpf",
245-
{"map_create", "map_read", "map_write", "prog_load", "prog_run"} },
245+
{ "map_create", "map_read", "map_write", "prog_load", "prog_run",
246+
NULL } },
246247
{ "xdp_socket",
247248
{ COMMON_SOCK_PERMS, NULL } },
248249
{ "perf_event",
249-
{"open", "cpu", "kernel", "tracepoint", "read", "write"} },
250+
{ "open", "cpu", "kernel", "tracepoint", "read", "write", NULL } },
250251
{ "lockdown",
251252
{ "integrity", "confidentiality", NULL } },
252253
{ "anon_inode",

0 commit comments

Comments
 (0)