Commit 6486cad0 authored by David Gstir's avatar David Gstir Committed by Jarkko Sakkinen
Browse files

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: stable@vger.kernel.org # v6.10+
Fixes: 2e8a0f40 ("KEYS: trusted: Introduce NXP DCP-backed trusted keys")
Suggested-by: default avatarRichard Weinberger <richard@nod.at>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202405240610.fj53EK0q-lkp@intel.com/


Signed-off-by: default avatarDavid Gstir <david@sigma-star.at>
Reviewed-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
parent a4a35f6c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}