linux-kernelorg-stable/drivers/crypto/ccp
Guenter Roeck 5c52607c43 crypto: ccp - Fix leaking the same page twice
Commit 551120148b ("crypto: ccp - Fix a case where SNP_SHUTDOWN is
missed") fixed a case where SNP is left in INIT state if page reclaim
fails. It removes the transition to the INIT state for this command and
adjusts the page state management.

While doing this, it added a call to snp_leak_pages() after a call to
snp_reclaim_pages() failed. Since snp_reclaim_pages() already calls
snp_leak_pages() internally on the pages it fails to reclaim, calling
it again leaks the exact same page twice.

Fix by removing the extra call to snp_leak_pages().

The problem was found by an experimental code review agent based on
gemini-3.1-pro while reviewing backports into v6.18.y.

Assisted-by: Gemini:gemini-3.1-pro
Fixes: 551120148b ("crypto: ccp - Fix a case where SNP_SHUTDOWN is missed")
Cc: Tycho Andersen (AMD) <tycho@kernel.org>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Tycho Andersen (AMD) <tycho@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2026-03-14 14:01:37 +09:00
..
Kconfig crypto/ccp: Fix CONFIG_PCI=n build 2025-12-04 18:14:08 -08:00
Makefile crypto/ccp: Implement SEV-TIO PCIe IDE (phase1) 2025-12-02 12:50:33 -08:00
ccp-crypto-aes-cmac.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ccp-crypto-aes-galois.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ccp-crypto-aes-xts.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ccp-crypto-aes.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ccp-crypto-des3.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ccp-crypto-main.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
ccp-crypto-rsa.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ccp-crypto-sha.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ccp-crypto.h
ccp-debugfs.c crypto: ccp - Fix crash when rebind ccp device for ccp.ko 2025-07-07 15:31:43 +12:00
ccp-dev-v3.c
ccp-dev-v5.c
ccp-dev.c crypto: ccp - use min() instead of min_t() 2025-11-24 17:44:14 +08:00
ccp-dev.h
ccp-dmaengine.c
ccp-ops.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dbc.c
dbc.h
hsti.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hsti.h
platform-access.c
platform-access.h
psp-dev.c crypto: ccp - Add an S4 restore flow 2026-01-21 10:51:59 +02:00
psp-dev.h crypto: ccp - Add sysfs attribute for boot integrity 2026-02-06 18:36:08 +08:00
sev-dev-tio.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sev-dev-tio.h crypto/ccp: Implement SEV-TIO PCIe IDE (phase1) 2025-12-02 12:50:33 -08:00
sev-dev-tsm.c crypto: ccp - Fix use-after-free on error path 2026-02-28 12:51:58 +09:00
sev-dev.c crypto: ccp - Fix leaking the same page twice 2026-03-14 14:01:37 +09:00
sev-dev.h crypto/ccp: Implement SEV-TIO PCIe IDE (phase1) 2025-12-02 12:50:33 -08:00
sfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
sfs.h crypto: ccp - Add AMD Seamless Firmware Servicing (SFS) driver 2025-09-17 12:17:05 +02:00
sp-dev.c crypto: ccp - Add an S4 restore flow 2026-01-21 10:51:59 +02:00
sp-dev.h crypto: ccp - Add an S4 restore flow 2026-01-21 10:51:59 +02:00
sp-pci.c crypto: ccp - Add an S4 restore flow 2026-01-21 10:51:59 +02:00
sp-platform.c crypto: ccp - Simplify with of_device_get_match_data() 2025-11-14 18:15:49 +08:00
tee-dev.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
tee-dev.h crypto: ccp - Add an S4 restore flow 2026-01-21 10:51:59 +02:00