diff options
author | Ingo Molnar <[email protected]> | 2017-11-10 08:21:08 +0100 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2017-11-10 08:21:08 +0100 |
commit | b5cd3b51e247473e290be5cd09e77171e466cd89 (patch) | |
tree | ac8c87e1b38f61a4c879c574dc9373db41f3df01 /fs/crypto/keyinfo.c | |
parent | 376f3bcebdc999cc737d9052109cc33b573b3a8b (diff) | |
parent | 1c9dbd4615fd751e5e0b99807a3c7c8612e28e20 (diff) |
Merge branch 'linus' into x86/platform, to refresh the branch
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'fs/crypto/keyinfo.c')
-rw-r--r-- | fs/crypto/keyinfo.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/crypto/keyinfo.c b/fs/crypto/keyinfo.c index 018c588c7ac3..a38630214058 100644 --- a/fs/crypto/keyinfo.c +++ b/fs/crypto/keyinfo.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* * key management facility for FS encryption support. * @@ -109,6 +110,11 @@ static int validate_user_key(struct fscrypt_info *crypt_info, goto out; } ukp = user_key_payload_locked(keyring_key); + if (!ukp) { + /* key was revoked before we acquired its semaphore */ + res = -EKEYREVOKED; + goto out; + } if (ukp->datalen != sizeof(struct fscrypt_key)) { res = -EINVAL; goto out; |