diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-11-08 12:17:15 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-11-08 12:17:15 +0300 |
commit | 8a103df440afea30c91ebd42e61dc644e647f4bd (patch) | |
tree | 2cfa99e9c6e1e138e1404bce4294e46cb0034cce /fs/crypto/keyinfo.c | |
parent | a9903f04e0a4ea522d959c2f287cdf0ab029e324 (diff) | |
parent | fbc3edf7d7731d7a22c483c679700589bab936a3 (diff) | |
download | linux-8a103df440afea30c91ebd42e61dc644e647f4bd.tar.xz |
Merge branch 'linus' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
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; |