UPSTREAM: security: Add a "locked down" LSM hook

Add a mechanism to allow LSMs to make a policy decision around whether
kernel functionality that would allow tampering with or examining the
runtime state of the kernel should be permitted.

Change-Id: Ie70dc489691e2f8413fe593c633a00e6e97bd63a
Signed-off-by: Matthew Garrett <mjg59@google.com>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: Sorayukii <sorayukii69@gmail.com>
This commit is contained in:
Matthew Garrett 2019-08-19 17:17:38 -07:00 • committed by Sorayukii
commit 4429a0e046

View file

@ -1741,3 +1741,10 @@ int security_perf_event_write(struct perf_event *event)
return call_int_hook(perf_event_write, 0, event);
}
#endif /* CONFIG_PERF_EVENTS */
int security_locked_down(enum lockdown_reason what)
{
return call_int_hook(locked_down, 0, what);
}
EXPORT_SYMBOL(security_locked_down);