summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorDavid Gstir <david@sigma-star.at>2024-07-17 13:28:44 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-08-29 17:35:37 +0200
commit652563a7294b59f36419db1445d141d82f9286e4 (patch)
tree700266b28b42b5a618008499d7fab6d5ce08ad3b /security
parent505c65de8987dd85162ddefbd8543af1f0e9fe52 (diff)
downloadlinux-652563a7294b59f36419db1445d141d82f9286e4.tar.gz
linux-652563a7294b59f36419db1445d141d82f9286e4.tar.bz2
linux-652563a7294b59f36419db1445d141d82f9286e4.zip
KEYS: trusted: fix DCP blob payload length assignment
commit 6486cad00a8b7f8585983408c152bbe33dda529b upstream. 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: stable@vger.kernel.org # v6.10+ Fixes: 2e8a0f40a39c ("KEYS: trusted: Introduce NXP DCP-backed trusted keys") Suggested-by: Richard Weinberger <richard@nod.at> Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202405240610.fj53EK0q-lkp@intel.com/ Signed-off-by: David Gstir <david@sigma-star.at> Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'security')
-rw-r--r--security/keys/trusted-keys/trusted_dcp.c2
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;
}