]> asedeno.scripts.mit.edu Git - linux.git/commit
selinux: make default_noexec read-only after init
authorStephen Smalley <sds@tycho.nsa.gov>
Wed, 8 Jan 2020 17:23:56 +0000 (12:23 -0500)
committerPaul Moore <paul@paul-moore.com>
Fri, 10 Jan 2020 17:26:20 +0000 (12:26 -0500)
commitb78b7d59bdbe6028ab362c2551dc684872f2052a
tree0fdca3b57d0e335a61ea3de4a5b5469dd05df296
parentfe49c7e4f85a9b2c3628e2f21e973ea6e26d2be7
selinux: make default_noexec read-only after init

SELinux checks whether VM_EXEC is set in the VM_DATA_DEFAULT_FLAGS
during initialization and saves the result in default_noexec for use
in its mmap and mprotect hook function implementations to decide
whether to apply EXECMEM, EXECHEAP, EXECSTACK, and EXECMOD checks.
Mark default_noexec as ro_after_init to prevent later clearing it
and thereby disabling these checks.  It is only set legitimately from
init code.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c