]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: don't revoke uninstantiated key in request_key_auth_new()
authorEric Biggers <ebiggers@google.com>
Thu, 21 Sep 2017 20:57:41 +0000 (13:57 -0700)
committerDavid Howells <dhowells@redhat.com>
Mon, 25 Sep 2017 14:19:56 +0000 (15:19 +0100)
commit9e43412299d754f0b4537047391fbbd0e0ceb560
tree49f1c5c64627568698ea5313c40ad193d84db664
parent17a4c1d066f6c92a32a6b20ba20500d4ab235b8c
KEYS: don't revoke uninstantiated key in request_key_auth_new()

If key_instantiate_and_link() were to fail (which fortunately isn't
possible currently), the call to key_revoke(authkey) would crash with a
NULL pointer dereference in request_key_auth_revoke() because the key
has not yet been instantiated.

Fix this by removing the call to key_revoke().  key_put() is sufficient,
as it's not possible for an uninstantiated authkey to have been used for
anything yet.

Fixes: 9f3eba511d41 ("[PATCH] keys: Permit running process to instantiate keys")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
security/keys/request_key_auth.c