]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: restrict /proc/keys by credentials at open time
authorEric Biggers <ebiggers@google.com>
Mon, 18 Sep 2017 18:38:29 +0000 (11:38 -0700)
committerDavid Howells <dhowells@redhat.com>
Mon, 25 Sep 2017 14:19:57 +0000 (15:19 +0100)
commit7e47ccb61d85eda4e230546a8bd00fb395498425
treed8ca3fbc77070caa26fd327fd5d7e21a322add34
parenta73bcd12cdfc22da7c9e69f56f6e674c19a43ce0
KEYS: restrict /proc/keys by credentials at open time

When checking for permission to view keys whilst reading from
/proc/keys, we should use the credentials with which the /proc/keys file
was opened.  This is because, in a classic type of exploit, it can be
possible to bypass checks for the *current* credentials by passing the
file descriptor to a suid program.

Following commit 00a363939f3a ("Make file credentials available to the
seqfile interfaces") we can finally fix it.  So let's do it.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
security/keys/proc.c