Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'keys-next-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd

Pull keys update from Jarkko Sakkinen:
"This contains only three fixes"

* tag 'keys-next-6.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
keys: Fix grammar and formatting in 'struct key_type' comments
keys: Replace deprecated strncpy in ecryptfs_fill_auth_tok
keys: Remove redundant less-than-zero checks

+13 -11
+6 -3
include/linux/key-type.h
··· 107 107 */ 108 108 int (*match_preparse)(struct key_match_data *match_data); 109 109 110 - /* Free preparsed match data (optional). This should be supplied it 111 - * ->match_preparse() is supplied. */ 110 + /* 111 + * Free preparsed match data (optional). This should be supplied if 112 + * ->match_preparse() is supplied. 113 + */ 112 114 void (*match_free)(struct key_match_data *match_data); 113 115 114 - /* clear some of the data from a key on revokation (optional) 116 + /* 117 + * Clear some of the data from a key on revocation (optional). 115 118 * - the key's semaphore will be write-locked by the caller 116 119 */ 117 120 void (*revoke)(struct key *key);
+1 -1
security/keys/big_key.c
··· 66 66 67 67 BUILD_BUG_ON(sizeof(*payload) != sizeof(prep->payload.data)); 68 68 69 - if (datalen <= 0 || datalen > 1024 * 1024 || !prep->data) 69 + if (datalen == 0 || datalen > 1024 * 1024 || !prep->data) 70 70 return -EINVAL; 71 71 72 72 /* Set an arbitrary quota */
+1 -2
security/keys/encrypted-keys/ecryptfs_format.c
··· 54 54 auth_tok->version = (((uint16_t)(major << 8) & 0xFF00) 55 55 | ((uint16_t)minor & 0x00FF)); 56 56 auth_tok->token_type = ECRYPTFS_PASSWORD; 57 - strncpy((char *)auth_tok->token.password.signature, key_desc, 58 - ECRYPTFS_PASSWORD_SIG_SIZE); 57 + strscpy_pad(auth_tok->token.password.signature, key_desc); 59 58 auth_tok->token.password.session_key_encryption_key_bytes = 60 59 ECRYPTFS_MAX_KEY_BYTES; 61 60 /*
+2 -2
security/keys/encrypted-keys/encrypted.c
··· 795 795 size_t datalen = prep->datalen; 796 796 int ret; 797 797 798 - if (datalen <= 0 || datalen > 32767 || !prep->data) 798 + if (datalen == 0 || datalen > 32767 || !prep->data) 799 799 return -EINVAL; 800 800 801 801 datablob = kmalloc(datalen + 1, GFP_KERNEL); ··· 856 856 857 857 if (key_is_negative(key)) 858 858 return -ENOKEY; 859 - if (datalen <= 0 || datalen > 32767 || !prep->data) 859 + if (datalen == 0 || datalen > 32767 || !prep->data) 860 860 return -EINVAL; 861 861 862 862 buf = kmalloc(datalen + 1, GFP_KERNEL);
+2 -2
security/keys/trusted-keys/trusted_core.c
··· 157 157 int key_cmd; 158 158 size_t key_len; 159 159 160 - if (datalen <= 0 || datalen > 32767 || !prep->data) 160 + if (datalen == 0 || datalen > 32767 || !prep->data) 161 161 return -EINVAL; 162 162 163 163 orig_datablob = datablob = kmalloc(datalen + 1, GFP_KERNEL); ··· 240 240 p = key->payload.data[0]; 241 241 if (!p->migratable) 242 242 return -EPERM; 243 - if (datalen <= 0 || datalen > 32767 || !prep->data) 243 + if (datalen == 0 || datalen > 32767 || !prep->data) 244 244 return -EINVAL; 245 245 246 246 orig_datablob = datablob = kmalloc(datalen + 1, GFP_KERNEL);
+1 -1
security/keys/user_defined.c
··· 61 61 struct user_key_payload *upayload; 62 62 size_t datalen = prep->datalen; 63 63 64 - if (datalen <= 0 || datalen > 32767 || !prep->data) 64 + if (datalen == 0 || datalen > 32767 || !prep->data) 65 65 return -EINVAL; 66 66 67 67 upayload = kmalloc(sizeof(*upayload) + datalen, GFP_KERNEL);