Skip to content

Commit 6486cad

Browse files
iokilljarkkojs
authored andcommitted
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: 2e8a0f4 ("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]>
1 parent a4a35f6 commit 6486cad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/keys/trusted-keys/trusted_dcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static int trusted_dcp_seal(struct trusted_key_payload *p, char *datablob)
222222
return ret;
223223
}
224224

225-
b->payload_len = get_unaligned_le32(&p->key_len);
225+
put_unaligned_le32(p->key_len, &b->payload_len);
226226
p->blob_len = blen;
227227
return 0;
228228
}

0 commit comments

Comments
 (0)