[PATCH] ccp/hsti: Fix bogus sizeof in psp_populate_hsti

Teddy Astie posted 1 patch 4 months, 1 week ago
drivers/crypto/ccp/hsti.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] ccp/hsti: Fix bogus sizeof in psp_populate_hsti
Posted by Teddy Astie 4 months, 1 week ago
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@vates.tech>
Fixes: 82f9327f774c ("crypto: ccp - Add support for getting security attributes on some older systems")
---
CC: Mario Limonciello <mario.limonciello@amd.com>
CC: Tom Lendacky <thomas.lendacky@amd.com>
CC: John Allen <john.allen@amd.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>
CC: "David S. Miller" <davem@davemloft.net>
---
 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)
-- 
2.51.0



--
 | Vates

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech
Re: [PATCH] ccp/hsti: Fix bogus sizeof in psp_populate_hsti
Posted by Tom Lendacky 4 months, 1 week ago
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@vates.tech>
> Fixes: 82f9327f774c ("crypto: ccp - Add support for getting security attributes on some older systems")
> ---
> CC: Mario Limonciello <mario.limonciello@amd.com>
> CC: Tom Lendacky <thomas.lendacky@amd.com>
> CC: John Allen <john.allen@amd.com>
> CC: Herbert Xu <herbert@gondor.apana.org.au>
> CC: "David S. Miller" <davem@davemloft.net>

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)