diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/keys/key.c | 4 | ||||
-rw-r--r-- | security/keys/keyring.c | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/security/keys/key.c b/security/keys/key.c index a057e3311aad..b6061fa29da7 100644 --- a/security/keys/key.c +++ b/security/keys/key.c | |||
@@ -785,6 +785,10 @@ key_ref_t key_create_or_update(key_ref_t keyring_ref, | |||
785 | 785 | ||
786 | key_check(keyring); | 786 | key_check(keyring); |
787 | 787 | ||
788 | key_ref = ERR_PTR(-ENOTDIR); | ||
789 | if (keyring->type != &key_type_keyring) | ||
790 | goto error_2; | ||
791 | |||
788 | down_write(&keyring->sem); | 792 | down_write(&keyring->sem); |
789 | 793 | ||
790 | /* if we're going to allocate a new key, we're going to have | 794 | /* if we're going to allocate a new key, we're going to have |
diff --git a/security/keys/keyring.c b/security/keys/keyring.c index d65a180f888d..bffa924c1f88 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c | |||
@@ -437,6 +437,7 @@ EXPORT_SYMBOL(keyring_search); | |||
437 | /* | 437 | /* |
438 | * search the given keyring only (no recursion) | 438 | * search the given keyring only (no recursion) |
439 | * - keyring must be locked by caller | 439 | * - keyring must be locked by caller |
440 | * - caller must guarantee that the keyring is a keyring | ||
440 | */ | 441 | */ |
441 | key_ref_t __keyring_search_one(key_ref_t keyring_ref, | 442 | key_ref_t __keyring_search_one(key_ref_t keyring_ref, |
442 | const struct key_type *ktype, | 443 | const struct key_type *ktype, |