mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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
This commit is contained in:
@@ -66,7 +66,7 @@ int big_key_preparse(struct key_preparsed_payload *prep)
|
||||
|
||||
BUILD_BUG_ON(sizeof(*payload) != sizeof(prep->payload.data));
|
||||
|
||||
if (datalen <= 0 || datalen > 1024 * 1024 || !prep->data)
|
||||
if (datalen == 0 || datalen > 1024 * 1024 || !prep->data)
|
||||
return -EINVAL;
|
||||
|
||||
/* Set an arbitrary quota */
|
||||
|
||||
@@ -54,8 +54,7 @@ int ecryptfs_fill_auth_tok(struct ecryptfs_auth_tok *auth_tok,
|
||||
auth_tok->version = (((uint16_t)(major << 8) & 0xFF00)
|
||||
| ((uint16_t)minor & 0x00FF));
|
||||
auth_tok->token_type = ECRYPTFS_PASSWORD;
|
||||
strncpy((char *)auth_tok->token.password.signature, key_desc,
|
||||
ECRYPTFS_PASSWORD_SIG_SIZE);
|
||||
strscpy_pad(auth_tok->token.password.signature, key_desc);
|
||||
auth_tok->token.password.session_key_encryption_key_bytes =
|
||||
ECRYPTFS_MAX_KEY_BYTES;
|
||||
/*
|
||||
|
||||
@@ -795,7 +795,7 @@ static int encrypted_instantiate(struct key *key,
|
||||
size_t datalen = prep->datalen;
|
||||
int ret;
|
||||
|
||||
if (datalen <= 0 || datalen > 32767 || !prep->data)
|
||||
if (datalen == 0 || datalen > 32767 || !prep->data)
|
||||
return -EINVAL;
|
||||
|
||||
datablob = kmalloc(datalen + 1, GFP_KERNEL);
|
||||
@@ -856,7 +856,7 @@ static int encrypted_update(struct key *key, struct key_preparsed_payload *prep)
|
||||
|
||||
if (key_is_negative(key))
|
||||
return -ENOKEY;
|
||||
if (datalen <= 0 || datalen > 32767 || !prep->data)
|
||||
if (datalen == 0 || datalen > 32767 || !prep->data)
|
||||
return -EINVAL;
|
||||
|
||||
buf = kmalloc(datalen + 1, GFP_KERNEL);
|
||||
|
||||
@@ -157,7 +157,7 @@ static int trusted_instantiate(struct key *key,
|
||||
int key_cmd;
|
||||
size_t key_len;
|
||||
|
||||
if (datalen <= 0 || datalen > 32767 || !prep->data)
|
||||
if (datalen == 0 || datalen > 32767 || !prep->data)
|
||||
return -EINVAL;
|
||||
|
||||
orig_datablob = datablob = kmalloc(datalen + 1, GFP_KERNEL);
|
||||
@@ -240,7 +240,7 @@ static int trusted_update(struct key *key, struct key_preparsed_payload *prep)
|
||||
p = key->payload.data[0];
|
||||
if (!p->migratable)
|
||||
return -EPERM;
|
||||
if (datalen <= 0 || datalen > 32767 || !prep->data)
|
||||
if (datalen == 0 || datalen > 32767 || !prep->data)
|
||||
return -EINVAL;
|
||||
|
||||
orig_datablob = datablob = kmalloc(datalen + 1, GFP_KERNEL);
|
||||
|
||||
@@ -61,7 +61,7 @@ int user_preparse(struct key_preparsed_payload *prep)
|
||||
struct user_key_payload *upayload;
|
||||
size_t datalen = prep->datalen;
|
||||
|
||||
if (datalen <= 0 || datalen > 32767 || !prep->data)
|
||||
if (datalen == 0 || datalen > 32767 || !prep->data)
|
||||
return -EINVAL;
|
||||
|
||||
upayload = kmalloc(sizeof(*upayload) + datalen, GFP_KERNEL);
|
||||
|
||||
Reference in New Issue
Block a user