]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: ccp - Initialize data during __sev_snp_init_locked()
authorTycho Andersen (AMD) <tycho@kernel.org>
Wed, 8 Apr 2026 14:32:59 +0000 (08:32 -0600)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 7 May 2026 08:09:58 +0000 (16:09 +0800)
commitfed613c1230277105bb512bce6e1fda8f316d178
tree5200578a64d0c1059f018c02f9f4ac52953aaadb
parenta8d5370eef00eca132a292b1901c9914c817e385
crypto: ccp - Initialize data during __sev_snp_init_locked()

Sashiko notes:

> is the stack variable data left uninitialized when taking the else branch?
> Since data.tio_en is later evaluated unconditionally, could stack garbage
> cause it to evaluate to true, leading to erroneous attempts to allocate
> pages and initialize SEV-TIO on unsupported hardware?

If the firmware is too old to support SEV_INIT_EX, data is left
uninitialized but used in the debug logging about whether TIO is enabled or
not.

Fixes: 4be423572da1 ("crypto/ccp: Implement SEV-TIO PCIe IDE (phase1)")
Reported-by: Sashiko
Assisted-by: Gemini:gemini-3.1-pro-preview
Link: https://sashiko.dev/#/patchset/20260324161301.1353976-1-tycho%40kernel.org
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