Commit dc4972e
committed
crypto: ccp - Fix incorrect payload size calculation in psp_poulate_hsti()
JIRA: https://issues.redhat.com/browse/RHEL-106909
JIRA: https://issues.redhat.com/browse/RHEL-107608
Upstream Status: merged into herbert/crypto-2.6.git
commit 2b0dc40
Author: Yunseong Kim <ysk@kzalloc.com>
Date: Wed Sep 3 22:16:43 2025 +0900
crypto: ccp - Fix incorrect payload size calculation in psp_poulate_hsti()
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@kzalloc.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>> ---
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Vladis Dronov <vdronov@redhat.com>1 parent 24225cd commit dc4972e
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
0 commit comments