summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJames Morris <james.l.morris@oracle.com>2017-10-19 12:28:38 +1100
committerJames Morris <james.l.morris@oracle.com>2017-10-19 12:28:38 +1100
commit494b9ae7abb84e6d88d7587906aff29dd26cf9d0 (patch)
treeaeb24854a715777aaa9d433d57f5e45d05017f73 /lib
parent73d3393ada4f70fa3df5639c8d438f2f034c0ecb (diff)
parent68a1fdbbf8bd3378325e45c19e167a165f9ffc3a (diff)
downloadlinux-stable-494b9ae7abb84e6d88d7587906aff29dd26cf9d0.tar.gz
linux-stable-494b9ae7abb84e6d88d7587906aff29dd26cf9d0.tar.bz2
linux-stable-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;