summaryrefslogtreecommitdiff
path: root/security/keys/key.c
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2017-09-28 09:11:28 +1000
committerJames Morris <james.l.morris@oracle.com>2017-09-28 09:11:28 +1000
commit2569e7e1d684e418ba7ffc9d0ad9a5f5247df0a0 (patch)
tree61ed98d4a5c453dca511c548213d364ce75711d0 /security/keys/key.c
parent9cd6681cb1169e815c41af0265165dd1b872f228 (diff)
parent428490e38b2e352812e0b765d8bceafab0ec441d (diff)
Merge commit 'keys-fixes-20170927' into fixes-v4.14-rc3
From David Howells: "There are two sets of patches here: (1) A bunch of core keyrings bug fixes from Eric Biggers. (2) Fixing big_key to use safe crypto from Jason A. Donenfeld."
Diffstat (limited to 'security/keys/key.c')
-rw-r--r--security/keys/key.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/security/keys/key.c b/security/keys/key.c
index 83da68d98b40..eb914a838840 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -54,10 +54,10 @@ void __key_check(const struct key *key)
struct key_user *key_user_lookup(kuid_t uid)
{
struct key_user *candidate = NULL, *user;
- struct rb_node *parent = NULL;
- struct rb_node **p;
+ struct rb_node *parent, **p;
try_again:
+ parent = NULL;
p = &key_user_tree.rb_node;
spin_lock(&key_user_lock);
@@ -302,6 +302,8 @@ struct key *key_alloc(struct key_type *type, const char *desc,
key->flags |= 1 << KEY_FLAG_IN_QUOTA;
if (flags & KEY_ALLOC_BUILT_IN)
key->flags |= 1 << KEY_FLAG_BUILTIN;
+ if (flags & KEY_ALLOC_UID_KEYRING)
+ key->flags |= 1 << KEY_FLAG_UID_KEYRING;
#ifdef KEY_DEBUGGING
key->magic = KEY_DEBUG_MAGIC;