]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
crypto: ccp - Avoid discarding errors in psp_send_platform_access_msg()
authorMario Limonciello <mario.limonciello@amd.com>
Tue, 13 Feb 2024 17:34:28 +0000 (11:34 -0600)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:51 +0000 (18:19 -0400)
commit6a28ba59e4771483d1e85ca11ded5944071406af
tree2eb764ea39ae54d2538fff902016d9dd972a4106
parent7baf1151c336e862245c278c3a8e5fbe144d93fd
crypto: ccp - Avoid discarding errors in psp_send_platform_access_msg()

[ Upstream commit 0e8fca2f12ceb77c3a6b6f210135031f264aa612 ]

Errors can potentially occur in the "processing" of PSP commands or
commands can be processed successfully but still return an error code in
the header.

This second case was being discarded because PSP communication worked but
the command returned an error code in the payload header.

Capture both cases and return them to the caller as -EIO for the caller
to investigate. The caller can detect the latter by looking at
`req->header->status`.

Reported-and-tested-by: Tim Van Patten <timvp@google.com>
Fixes: 7ccc4f4e2e50 ("crypto: ccp - Add support for an interface for platform features")
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/crypto/ccp/platform-access.c