linux-stable/drivers/crypto/ccp
Tom Lendacky f831d2882c crypto: ccp - During shutdown, check SEV data pointer before using
[ Upstream commit 1b05ece0c9 ]

On shutdown, each CCP device instance performs shutdown processing.
However, __sev_platform_shutdown_locked() uses the controlling psp
structure to obtain the pointer to the sev_device structure. However,
during driver initialization, it is possible that an error can be received
from the firmware that results in the sev_data pointer being cleared from
the controlling psp structure. The __sev_platform_shutdown_locked()
function does not check for this situation and will segfault.

While not common, this scenario should be accounted for. Add a check for a
NULL sev_device structure before attempting to use it.

Fixes: 5441a07a12 ("crypto: ccp - shutdown SEV firmware on kexec")
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-17 14:23:23 +02:00
..
ccp-crypto-aes-cmac.c
ccp-crypto-aes-galois.c
ccp-crypto-aes-xts.c
ccp-crypto-aes.c
ccp-crypto-des3.c
ccp-crypto-main.c crypto: ccp - Use DEFINE_SPINLOCK() for spinlock 2021-04-09 17:41:06 +10:00
ccp-crypto-rsa.c
ccp-crypto-sha.c
ccp-crypto.h
ccp-debugfs.c
ccp-dev-v3.c
ccp-dev-v5.c
ccp-dev.c crypto: ccp: ccp-dev: Fix a little doc-rot 2021-05-28 15:11:45 +08:00
ccp-dev.h
ccp-dmaengine.c crypto: ccp - ccp_dmaengine_unregister release dma channels 2022-04-08 14:23:09 +02:00
ccp-ops.c crypto: ccp - fix resource leaks in ccp_run_aes_gcm_cmd() 2021-09-24 15:58:41 +08:00
Kconfig
Makefile
psp-dev.c
psp-dev.h
sev-dev.c crypto: ccp - During shutdown, check SEV data pointer before using 2022-08-17 14:23:23 +02:00
sev-dev.h crypto: ccp: Use the stack and common buffer for INIT command 2021-04-21 12:20:07 -04:00
sp-dev.c crypto: ccp - Make ccp_dev_suspend and ccp_dev_resume void functions 2021-04-22 17:31:31 +10:00
sp-dev.h crypto: ccp - Make ccp_dev_suspend and ccp_dev_resume void functions 2021-04-22 17:31:31 +10:00
sp-pci.c crypto: ccp - Add support for new CCP/PSP device ID 2021-08-27 16:30:18 +08:00
sp-platform.c
tee-dev.c crypto: ccp - fix command queuing to TEE ring buffer 2021-03-26 20:02:34 +11:00
tee-dev.h crypto: ccp - fix command queuing to TEE ring buffer 2021-03-26 20:02:34 +11:00