From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0CDE24466D; Tue, 11 Nov 2025 01:18:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762823930; cv=none; b=FXiehLjiWVoX+jwTSJ1DyFqwRqP6OhtCpzYJRpd73dC1WPaOleXiuDgoY/c6hURiipC9EvCU13NtYKoDJT9/v5Cd4HKA4K9JkU9Dsiik8xKHpigeG6hPvP+5XxubjmjS9fv8up5qTFtc7Nyl8HR0jNXZ4TlaspXQaF90Q7JrWPo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762823930; c=relaxed/simple; bh=8iH5CFWg5gONxRHkiGvtGkD3TNOm+tCAtf2Zu/wMv6o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hSJuABB0bhRXanrTfeEwTceQb5rIKcrhROnTi7aerh7FLO9bmcsbwWydHFnazWSOQ0sIZ88wXdPoyZX3h+jomw/4lCzfupOM1Y0yqJ6S0RFK+nx06q9meDe22vgw/NmxjyQfTX2LFQ+uFgj0NgZv6xuNB/Xgr/eirw/dOFSYGAg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=k6T1b8EG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="k6T1b8EG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F412CC2BCB0; Tue, 11 Nov 2025 01:18:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1762823930; bh=8iH5CFWg5gONxRHkiGvtGkD3TNOm+tCAtf2Zu/wMv6o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k6T1b8EGKm1+1ytgvSMkmZIm3fYtSynkimI7C+jWROhor5oUOavjO3WLi6tjbckEP ZMW67t9RJJ8IROgUYH2RL5dCBakZfKIsLqwFlOMUHK2rKwOpi2/uX8wI2lwkvPNaJo feNe5sktqjg+a/FWiEJ7oZqM1VrTcE62tPazw1cE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yunseong Kim , Herbert Xu , Sasha Levin , "Mario Limonciello (AMD)" Subject: [PATCH 6.12 352/565] crypto: ccp - Fix incorrect payload size calculation in psp_poulate_hsti() Date: Tue, 11 Nov 2025 09:43:28 +0900 Message-ID: <20251111004534.792492679@linuxfoundation.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251111004526.816196597@linuxfoundation.org> References: <20251111004526.816196597@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yunseong Kim [ Upstream commit 2b0dc40ac6ca16ee0c489927f4856cf9cd3874c7 ] 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 Reviewed-by: Mario Limonciello (AMD) > --- Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- 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 1b39a4fb55c06..0e6b73b55dbf7 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