selinux: add proper NULL termination to the secclass_map permissions
authorPaul Moore <paul@paul-moore.com>
Thu, 22 Apr 2021 01:15:36 +0000 (21:15 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:49:59 +0000 (09:49 +0200)
commit4c0ddc8712d9cd26459091c9f0c9e1a9f64815dc
treed4b583577dc750246fa608a0d30794a5a7d83022
parentbb27aecf06a3b50e077bdd01c75a63eb3a3b7bb4
selinux: add proper NULL termination to the secclass_map permissions

commit e4c82eafb609c2badc56f4e11bc50fcf44b8e9eb upstream.

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: stable@vger.kernel.org
Fixes: ec27c3568a34 ("selinux: bpf: Add selinux check for eBPF syscall operations")
Fixes: da97e18458fb ("perf_event: Add support for LSM and SELinux checks")
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
security/selinux/include/classmap.h