]> git.baikalelectronics.ru Git - kernel.git/commit
selinux: Add helper functions to get and set checkreqprot
authorLakshmi Ramasubramanian <nramas@linux.microsoft.com>
Mon, 14 Sep 2020 17:31:57 +0000 (10:31 -0700)
committerPaul Moore <paul@paul-moore.com>
Tue, 15 Sep 2020 18:36:28 +0000 (14:36 -0400)
commit3a04d7ead544e4a1187b995175f6b65433542d3c
treed84b9add18050b651baf37d28579b5d5e10f9301
parentdb15926f2d612136c799283d5255a014a580261b
selinux: Add helper functions to get and set checkreqprot

checkreqprot data member in selinux_state struct is accessed directly by
SELinux functions to get and set. This could cause unexpected read or
write access to this data member due to compiler optimizations and/or
compiler's reordering of access to this field.

Add helper functions to get and set checkreqprot data member in
selinux_state struct. These helper functions use READ_ONCE and
WRITE_ONCE macros to ensure atomic read or write of memory for
this data member.

Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Suggested-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Suggested-by: Paul Moore <paul@paul-moore.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c
security/selinux/include/security.h
security/selinux/selinuxfs.c