diff options
author | David Gstir <[email protected]> | 2024-07-17 13:28:44 +0200 |
---|---|---|
committer | Jarkko Sakkinen <[email protected]> | 2024-08-15 22:01:14 +0300 |
commit | 6486cad00a8b7f8585983408c152bbe33dda529b (patch) | |
tree | f7f5e5b412a73f80e830e3b001f4144be5ae956c | |
parent | a4a35f6cbebbf9466b6c412506ab89299d567f51 (diff) |
KEYS: trusted: fix DCP blob payload length assignment
The DCP trusted key type uses the wrong helper function to store
the blob's payload length which can lead to the wrong byte order
being used in case this would ever run on big endian architectures.
Fix by using correct helper function.
Cc: [email protected] # v6.10+
Fixes: 2e8a0f40a39c ("KEYS: trusted: Introduce NXP DCP-backed trusted keys")
Suggested-by: Richard Weinberger <[email protected]>
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: David Gstir <[email protected]>
Reviewed-by: Jarkko Sakkinen <[email protected]>
Signed-off-by: Jarkko Sakkinen <[email protected]>
-rw-r--r-- | security/keys/trusted-keys/trusted_dcp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/keys/trusted-keys/trusted_dcp.c b/security/keys/trusted-keys/trusted_dcp.c index b5f81a05be36..b0947f072a98 100644 --- a/security/keys/trusted-keys/trusted_dcp.c +++ b/security/keys/trusted-keys/trusted_dcp.c @@ -222,7 +222,7 @@ static int trusted_dcp_seal(struct trusted_key_payload *p, char *datablob) return ret; } - b->payload_len = get_unaligned_le32(&p->key_len); + put_unaligned_le32(p->key_len, &b->payload_len); p->blob_len = blen; return 0; } |