]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KEYS: Don't permit request_key() to construct a new keyring
authorDavid Howells <dhowells@redhat.com>
Mon, 19 Oct 2015 10:20:28 +0000 (11:20 +0100)
committerBrian Maly <brian.maly@oracle.com>
Wed, 27 Feb 2019 19:46:59 +0000 (14:46 -0500)
commit3fa39ea26b570f0beaf9dca1a3ff7abff536b3db
treeaebdfc69419144045e15e29ac22e52137ed0d26c
parent63d787e112422b99ff2bdd53d5f15c3560de8747
KEYS: Don't permit request_key() to construct a new keyring

If request_key() is used to find a keyring, only do the search part - don't
do the construction part if the keyring was not found by the search.  We
don't really want keyrings in the negative instantiated state since the
rejected/negative instantiation error value in the payload is unioned with
keyring metadata.

Now the kernel gives an error:

request_key("keyring", "#selinux,bdekeyring", "keyring", KEY_SPEC_USER_SESSION_KEYRING) = -1 EPERM (Operation not permitted)

Signed-off-by: David Howells <dhowells@redhat.com>
(cherry picked from commit 911b79cde95c7da0ec02f48105358a36636b7a71)

Orabug: 29304551
CVE: CVE-2017-17807

Reviewed-by: John Donnelly <John.p.donnelly@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
security/keys/request_key.c