Message ID | 146608853752.5715.2913110713238395465.stgit@warthog.procyon.org.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
David Howells <dhowells@redhat.com> wrote: > From: Dan Carpenter <dan.carpenter@oracle.com> > > If __key_link_begin() failed then "edit" would be uninitialized. I've > added a check to fix that. > > This allows a random user to crash the kernel, though it's quite difficult > to achieve. There are three ways it can be done as the user would have to > cause an error to occur in __key_link(): > > ... I forgot to mention, this fixes CVE-2016-4470. David -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/security/keys/key.c b/security/keys/key.c index bd5a272f28a6..346fbf201c22 100644 --- a/security/keys/key.c +++ b/security/keys/key.c @@ -597,7 +597,7 @@ int key_reject_and_link(struct key *key, mutex_unlock(&key_construction_mutex); - if (keyring) + if (keyring && link_ret == 0) __key_link_end(keyring, &key->index_key, edit); /* wake up anyone waiting for a key to be constructed */