summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2017-10-19 03:28:38 +0200
committerJames Morris <james.l.morris@oracle.com>2017-10-19 03:28:38 +0200
commit494b9ae7abb84e6d88d7587906aff29dd26cf9d0 (patch)
treeaeb24854a715777aaa9d433d57f5e45d05017f73 /lib
parentMerge tag 'xfs-4.14-fixes-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux (diff)
parentpkcs7: Prevent NULL pointer dereference, since sinfo is not always set. (diff)
downloadlinux-494b9ae7abb84e6d88d7587906aff29dd26cf9d0.tar.xz
linux-494b9ae7abb84e6d88d7587906aff29dd26cf9d0.zip
Merge commit 'tags/keys-fixes-20171018' into fixes-v4.14-rc5
Diffstat (limited to 'lib')
-rw-r--r--lib/digsig.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/digsig.c b/lib/digsig.c
index 03d7c63837ae..6ba6fcd92dd1 100644
--- a/lib/digsig.c
+++ b/lib/digsig.c
@@ -87,6 +87,12 @@ static int digsig_verify_rsa(struct key *key,
down_read(&key->sem);
ukp = user_key_payload_locked(key);
+ if (!ukp) {
+ /* key was revoked before we acquired its semaphore */
+ err = -EKEYREVOKED;
+ goto err1;
+ }
+
if (ukp->datalen < sizeof(*pkh))
goto err1;