linux/security/keys
David Howells ca564ff22a KEYS: Don't permit request_key() to construct a new keyring
commit 911b79cde9 upstream.

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>
Cc: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2015-10-28 10:33:23 +00:00
..
encrypted-keys KEYS: Fix stale key registration at error path 2015-01-15 10:43:37 +00:00
big_key.c security: shmem: implement kernel private shmem inodes 2013-12-02 11:24:19 +00:00
compat.c security/compat: convert to COMPAT_SYSCALL_DEFINE 2014-03-06 16:30:42 +01:00
gc.c KEYS: Fix crash when attempt to garbage collect an uninstantiated keyring 2015-10-28 10:33:23 +00:00
internal.h KEYS: Move the flags representing required permission to linux/key.h 2014-03-14 17:44:49 +00:00
Kconfig KEYS: Make BIG_KEYS boolean 2013-10-30 11:15:23 +00:00
key.c KEYS: Move the flags representing required permission to linux/key.h 2014-03-14 17:44:49 +00:00
keyctl.c KEYS: Move the flags representing required permission to linux/key.h 2014-03-14 17:44:49 +00:00
keyring.c KEYS: ensure we free the assoc array edit if edit is valid 2015-08-11 09:57:27 +01:00
Makefile KEYS: Add per-user_namespace registers for persistent per-UID kerberos caches 2013-09-24 10:35:19 +01:00
permission.c KEYS: Move the flags representing required permission to linux/key.h 2014-03-14 17:44:49 +00:00
persistent.c KEYS: Move the flags representing required permission to linux/key.h 2014-03-14 17:44:49 +00:00
proc.c KEYS: Move the flags representing required permission to linux/key.h 2014-03-14 17:44:49 +00:00
process_keys.c KEYS: initialize root uid and session keyrings early 2013-09-25 17:17:01 +01:00
request_key.c KEYS: Don't permit request_key() to construct a new keyring 2015-10-28 10:33:23 +00:00
request_key_auth.c KEYS: Search for auth-key by name rather than target key ID 2013-09-24 10:35:16 +01:00
sysctl.c security: Convert use of typedef ctl_table to struct ctl_table 2014-04-15 13:39:58 +10:00
trusted.c security: replace strict_strto*() with kstrto*() 2014-02-06 19:11:04 +11:00
trusted.h trusted-keys: rename trusted_defined files to trusted 2011-01-24 10:14:22 +11:00
user_defined.c KEYS: Introduce a search context structure 2013-09-24 10:35:15 +01:00