summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2020-02-12 13:58:35 +0000
committerDavid Howells <dhowells@redhat.com>2020-05-19 15:16:08 +0100
commit998f50407ffc9370565c7ed3fcd1366adccdfbbf (patch)
treef3c28ad22a9d75c557e399d83ac4d06426dd5c8e /security
parentc73be61cede5882f9605a852414db559c0ebedfd (diff)
downloadlinux-998f50407ffc9370565c7ed3fcd1366adccdfbbf.tar.bz2
security: Add hooks to rule on setting a watch
Add security hooks that will allow an LSM to rule on whether or not a watch may be set. More than one hook is required as the watches watch different types of object. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: James Morris <jamorris@linux.microsoft.com> cc: Casey Schaufler <casey@schaufler-ca.com> cc: Stephen Smalley <sds@tycho.nsa.gov> cc: linux-security-module@vger.kernel.org
Diffstat (limited to 'security')
-rw-r--r--security/security.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/security/security.c b/security/security.c
index 7d55607120b4..c73334ab2882 100644
--- a/security/security.c
+++ b/security/security.c
@@ -2016,6 +2016,13 @@ int security_post_notification(const struct cred *w_cred,
}
#endif /* CONFIG_WATCH_QUEUE */
+#ifdef CONFIG_KEY_NOTIFICATIONS
+int security_watch_key(struct key *key)
+{
+ return call_int_hook(watch_key, 0, key);
+}
+#endif
+
#ifdef CONFIG_SECURITY_NETWORK
int security_unix_stream_connect(struct sock *sock, struct sock *other, struct sock *newsk)