Skip to content
Commit 05def5ca authored by Jacky Li's avatar Jacky Li Committed by Herbert Xu
Browse files

crypto: ccp - Fix the INIT_EX data file open failure



There are 2 common cases when INIT_EX data file might not be
opened successfully and fail the sev initialization:

1. In user namespaces, normal user tasks (e.g. VMM) can change their
   current->fs->root to point to arbitrary directories. While
   init_ex_path is provided as a module param related to root file
   system. Solution: use the root directory of init_task to avoid
   accessing the wrong file.

2. Normal user tasks (e.g. VMM) don't have the privilege to access
   the INIT_EX data file. Solution: open the file as root and
   restore permissions immediately.

Fixes: 3d725965 ("crypto: ccp - Add SEV_INIT_EX support")
Signed-off-by: default avatarJacky Li <jackyli@google.com>
Reviewed-by: default avatarPeter Gonda <pgonda@google.com>
Acked-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent c6d3ffae
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment