selinux: Implement the watch_key security hook
authorDavid Howells <dhowells@redhat.com>
Tue, 14 Jan 2020 17:07:13 +0000 (17:07 +0000)
committerDavid Howells <dhowells@redhat.com>
Tue, 19 May 2020 14:47:15 +0000 (15:47 +0100)
commit3e412ccc22e25666772094fb5ca01af056c54471
treeadf880d0ca933b12eef91835374adf0edaa9f8a0
parent8c0637e950d68933a67f7438f779d79b049b5e5c
selinux: Implement the watch_key security hook

Implement the watch_key security hook to make sure that a key grants the
caller View permission in order to set a watch on a key.

For the moment, the watch_devices security hook is left unimplemented as
it's not obvious what the object should be since the queue is global and
didn't previously exist.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Reviewed-by: James Morris <jamorris@linux.microsoft.com>
security/selinux/hooks.c