crypto: ccp - Fail the PSP initialization when writing psp data file failed
authorJacky Li <jackyli@google.com>
Tue, 16 Aug 2022 19:32:09 +0000 (19:32 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 26 Aug 2022 10:50:07 +0000 (18:50 +0800)
commitefb4b01c1c993d245e6608076684ff2162cf9dc6
tree38be91d35b403f1421c6db06fb5d4589a89f6302
parentd8da2da21fdb1f5964c11c00f0cc84fb0edf31d0
crypto: ccp - Fail the PSP initialization when writing psp data file failed

Currently the OS continues the PSP initialization when there is a write
failure to the init_ex_file. Therefore, the userspace would be told that
SEV is properly INIT'd even though the psp data file is not updated.
This is problematic because later when asked for the SEV data, the OS
won't be able to provide it.

Fixes: 3d725965f836 ("crypto: ccp - Add SEV_INIT_EX support")
Reported-by: Peter Gonda <pgonda@google.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Jacky Li <jackyli@google.com>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/sev-dev.c