lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3603d3a2-4527-4ac4-82aa-7533f33e92db@kernel.org>
Date: Wed, 3 Sep 2025 09:54:13 -0500
From: Mario Limonciello <superm1@...nel.org>
To: Yunseong Kim <ysk@...lloc.com>, Herbert Xu <herbert@...dor.apana.org.au>,
 Tom Lendacky <thomas.lendacky@....com>, John Allen <john.allen@....com>,
 "David S. Miller" <davem@...emloft.net>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: ccp: Fix incorrect payload size calculation in
 psp_poulate_hsti()

On 9/3/25 8:16 AM, Yunseong Kim wrote:
> payload_size field of the request header is incorrectly calculated using
> sizeof(req). Since 'req' is a pointer (struct hsti_request *), sizeof(req)
> returns the size of the pointer itself (e.g., 8 bytes on a 64-bit system),
> rather than the size of the structure it points to. This leads to an
> incorrect payload size being sent to the Platform Security Processor (PSP),
> potentially causing the HSTI query command to fail.
> 
> Fix this by using sizeof(*req) to correctly calculate the size of the
> struct hsti_request.
> 
> Signed-off-by: Yunseong Kim <ysk@...lloc.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@...nel.org>> ---
>   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)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ