]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: simplify away security_policydb_len()
authorOndrej Mosnacek <omosnace@redhat.com>
Thu, 27 Aug 2020 16:27:53 +0000 (18:27 +0200)
committerPaul Moore <paul@paul-moore.com>
Mon, 31 Aug 2020 14:00:14 +0000 (10:00 -0400)
commitc2aa4b283c86215ca11f59dda16e41a775419b43
tree45914d8e221deb583c42bb24e84bc8f4eca0c51e
parenta1753bd93e8013248ca37e32d09837e77dbbdc24
selinux: simplify away security_policydb_len()

Remove the security_policydb_len() calls from sel_open_policy() and
instead update the inode size from the size returned from
security_read_policy().

Since after this change security_policydb_len() is only called from
security_load_policy(), remove it entirely and just open-code it there.

Also, since security_load_policy() is always called with policy_mutex
held, make it dereference the policy pointer directly and drop the
unnecessary RCU locking.

Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/include/security.h
security/selinux/selinuxfs.c
security/selinux/ss/services.c