]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: ccp - Fix a case where SNP_SHUTDOWN is missed
authorTom Lendacky <thomas.lendacky@amd.com>
Mon, 5 Jan 2026 17:22:17 +0000 (10:22 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 23 Jan 2026 05:48:44 +0000 (13:48 +0800)
commit551120148b67e04527b405c5ec33a31593846ba4
tree91c5dadf529f4c8de3fe68830e3cb0a5ae574afc
parentf7738c07b5fed94a712d71b1d88cd2aa9c11210c
crypto: ccp - Fix a case where SNP_SHUTDOWN is missed

If page reclaim fails in sev_ioctl_do_snp_platform_status() and SNP was
moved from UNINIT to INIT for the function, SNP is not moved back to
UNINIT state. Additionally, SNP is not required to be initialized in order
to execute the SNP_PLATFORM_STATUS command, so don't attempt to move to
INIT state and let SNP_PLATFORM_STATUS report the status as is.

Fixes: ceac7fb89e8d ("crypto: ccp - Ensure implicit SEV/SNP init and shutdown in ioctls")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Tycho Andersen (AMD) <tycho@kernel.org>
Reviewed-by: Alexey Kardashevskiy <aik@amd.com>
Signed-off-by: Tycho Andersen (AMD) <tycho@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/sev-dev.c