summaryrefslogtreecommitdiffstats
path: root/kernel/security/keys/request_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/security/keys/request_key.c')
-rw-r--r--kernel/security/keys/request_key.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/security/keys/request_key.c b/kernel/security/keys/request_key.c
index 486ef6fa3..c7a117c9a 100644
--- a/kernel/security/keys/request_key.c
+++ b/kernel/security/keys/request_key.c
@@ -271,7 +271,7 @@ static void construct_get_dest_keyring(struct key **_dest_keyring)
if (cred->request_key_auth) {
authkey = cred->request_key_auth;
down_read(&authkey->sem);
- rka = authkey->payload.data;
+ rka = authkey->payload.data[0];
if (!test_bit(KEY_FLAG_REVOKED,
&authkey->flags))
dest_keyring =
@@ -440,6 +440,9 @@ static struct key *construct_key_and_link(struct keyring_search_context *ctx,
kenter("");
+ if (ctx->index_key.type == &key_type_keyring)
+ return ERR_PTR(-EPERM);
+
user = key_user_lookup(current_fsuid());
if (!user)
return ERR_PTR(-ENOMEM);
@@ -593,7 +596,7 @@ int wait_for_key_construction(struct key *key, bool intr)
return -ERESTARTSYS;
if (test_bit(KEY_FLAG_NEGATIVE, &key->flags)) {
smp_rmb();
- return key->type_data.reject_error;
+ return key->reject_error;
}
return key_validate(key);
}