security: introduce CONFIG_SECURITY_WRITABLE_HOOKS

Subsequent patches will add RO hardening to LSM hooks, however, SELinux
still needs to be able to perform runtime disablement after init to handle
architectures where init-time disablement via boot parameters is not feasible.

Introduce a new kernel configuration parameter CONFIG_SECURITY_WRITABLE_HOOKS,
and a helper macro __lsm_ro_after_init, to handle this case.

Signed-off-by: James Morris <[email protected]>
Acked-by: Stephen Smalley <[email protected]>
Acked-by: Casey Schaufler <[email protected]>
Acked-by: Kees Cook <[email protected]>
This commit is contained in:
James Morris 2017-02-15 00:17:24 +11:00 • committed by James Morris
commit dd0859dccb
3 changed files with 18 additions and 0 deletions

View file

@ -31,6 +31,11 @@ config SECURITY
If you are unsure how to answer this question, answer N.
config SECURITY_WRITABLE_HOOKS
depends on SECURITY
bool
default n
config SECURITYFS
bool "Enable the securityfs filesystem"
help