Re: [PATCH] ccp/hsti: Fix bogus sizeof in psp_populate_hsti
From: Tom Lendacky
Date: Thu Oct 02 2025 - 15:18:46 EST
On 10/2/25 13:04, Teddy Astie wrote:
> Payload is actually struct hsti_request and not a pointer which
> makes the considered payload size smaller than it should be.
>
> Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
> Fixes: 82f9327f774c ("crypto: ccp - Add support for getting security attributes on some older systems")
> ---
> CC: Mario Limonciello <mario.limonciello@xxxxxxx>
> CC: Tom Lendacky <thomas.lendacky@xxxxxxx>
> CC: John Allen <john.allen@xxxxxxx>
> CC: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
> CC: "David S. Miller" <davem@xxxxxxxxxxxxx>
Already fixed by 2b0dc40ac6ca ("crypto: ccp - Fix incorrect payload size
calculation in psp_poulate_hsti()")
Thanks,
Tom
> ---
> drivers/crypto/ccp/hsti.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/crypto/ccp/hsti.c b/drivers/crypto/ccp/hsti.c
> index 1b39a4fb55c0..0e6b73b55dbf 100644
> --- a/drivers/crypto/ccp/hsti.c
> +++ b/drivers/crypto/ccp/hsti.c
> @@ -88,7 +88,7 @@ static int psp_poulate_hsti(struct psp_device *psp)
> if (!req)
> return -ENOMEM;
>
> - req->header.payload_size = sizeof(req);
> + req->header.payload_size = sizeof(*req);
>
> ret = psp_send_platform_access_msg(PSP_CMD_HSTI_QUERY, (struct psp_request *)req);
> if (ret)