Files
linux-cryptodev-2.6/drivers/crypto/ccp
Alper Ak 889b0e2721 crypto: ccp - Fix use-after-free on error path
In the error path of sev_tsm_init_locked(), the code dereferences 't'
after it has been freed with kfree(). The pr_err() statement attempts
to access t->tio_en and t->tio_init_done after the memory has been
released.

Move the pr_err() call before kfree(t) to access the fields while the
memory is still valid.

This issue reported by Smatch static analyser

Fixes:4be423572da1 ("crypto/ccp: Implement SEV-TIO PCIe IDE (phase1)")
Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2026-02-28 12:51:58 +09:00
..
2022-06-10 16:40:18 +08:00
2024-12-14 17:21:43 +08:00
2025-12-04 18:14:08 -08:00
2026-01-21 10:51:59 +02:00
2026-01-21 10:51:59 +02:00
2026-01-21 10:51:59 +02:00
2026-01-21 10:51:59 +02:00
2026-01-21 10:51:59 +02:00