Pull keys update from Jarkko Sakkinen: "This contains only bug fixes" * tag 'for-next-keys-7.2-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd: keys: keyctl_pkey: replace BUG with return -EOPNOTSUPP keys: request_key: replace BUG with return -EINVAL keys: Pin request_key_auth payload in instantiate paths keys: prevent slab cache merging for key_jar keys: Replace strcpy(derived_buf, "AUTH_KEY") with strscpy(..., HASH_SIZE) KEYS: Use acquire when reading state in keyring search keys/trusted_keys: mark 'migratable' as __ro_after_init keys: use kmalloc_flex in user_preparse KEYS: trusted: Debugging as a feature KEYS: encrypted: Remove unnecessary selection of CRYPTO_RNG KEYS: fix overflow in keyctl_pkey_params_get_2()
Showing the changes to include (2 of 17 files). Show all
Unified · Split
| @@ -9,12 +9,14 @@ · 8 unmodified lines | |||
| 9 | #define _KEYS_REQUEST_KEY_AUTH_TYPE_H | 9 | #define _KEYS_REQUEST_KEY_AUTH_TYPE_H |
| 10 | 10 | ||
| 11 | #include <linux/key.h> | 11 | #include <linux/key.h> |
| 12 | #include <linux/refcount.h> | ||
| 12 | 13 | ||
| 13 | /* | 14 | /* |
| 14 | * Authorisation record for request_key(). | 15 | * Authorisation record for request_key(). |
| 15 | */ | 16 | */ |
| 16 | struct request_key_auth { | 17 | struct request_key_auth { |
| 17 | struct rcu_head rcu; | 18 | struct rcu_head rcu; |
| 19 | refcount_t usage; | ||
| 18 | struct key *target_key; | 20 | struct key *target_key; |
| 19 | struct key *dest_keyring; | 21 | struct key *dest_keyring; |
| 20 | const struct cred *cred; | 22 | const struct cred *cred; |
| @@ -83,18 +83,21 @@ struct trusted_key_source { · 82 unmodified lines | |||
| 83 | 83 | ||
| 84 | extern struct key_type key_type_trusted; | 84 | extern struct key_type key_type_trusted; |
| 85 | 85 | ||
| 86 | #define TRUSTED_DEBUG 0 | 86 | #ifdef CONFIG_TRUSTED_KEYS_DEBUG |
| 87 | extern bool trusted_debug; | ||
| 87 | 88 | ||
| 88 | #if TRUSTED_DEBUG | ||
| 89 | static inline void dump_payload(struct trusted_key_payload *p) | 89 | static inline void dump_payload(struct trusted_key_payload *p) |
| 90 | { | 90 | { |
| 91 | pr_info("key_len %d\n", p->key_len); | 91 | if (!trusted_debug) |
| 92 | print_hex_dump(KERN_INFO, "key ", DUMP_PREFIX_NONE, | 92 | return; |
| 93 | 16, 1, p->key, p->key_len, 0); | 93 | |
| 94 | pr_info("bloblen %d\n", p->blob_len); | 94 | pr_debug("key_len %d\n", p->key_len); |
| 95 | print_hex_dump(KERN_INFO, "blob ", DUMP_PREFIX_NONE, | 95 | print_hex_dump_debug("key ", DUMP_PREFIX_NONE, |
| 96 | 16, 1, p->blob, p->blob_len, 0); | 96 | 16, 1, p->key, p->key_len, 0); |
| 97 | pr_info("migratable %d\n", p->migratable); | 97 | pr_debug("bloblen %d\n", p->blob_len); |
| 98 | print_hex_dump_debug("blob ", DUMP_PREFIX_NONE, | ||
| 99 | 16, 1, p->blob, p->blob_len, 0); | ||
| 100 | pr_debug("migratable %d\n", p->migratable); | ||
| 98 | } | 101 | } |
| 99 | #else | 102 | #else |
| 100 | static inline void dump_payload(struct trusted_key_payload *p) | 103 | static inline void dump_payload(struct trusted_key_payload *p) |