]> git.baikalelectronics.ru Git - kernel.git/commit
KEYS: put keyring if install_session_keyring_to_cred() fails
authorEric Biggers <ebiggers@google.com>
Thu, 8 Jun 2017 13:48:03 +0000 (14:48 +0100)
committerJames Morris <james.l.morris@oracle.com>
Fri, 9 Jun 2017 03:29:46 +0000 (13:29 +1000)
commit71f531962dd2aabfa060cf6eebfa93debd5531b9
treed2242b7934d34bd2e6779e5d2061a0ed5ce216cc
parent1d03ec94315cfe2375d56febee0f0b4715c8988f
KEYS: put keyring if install_session_keyring_to_cred() fails

In join_session_keyring(), if install_session_keyring_to_cred() were to
fail, we would leak the keyring reference, just like in the bug fixed by
commit 73f3c7f6c431 ("KEYS: Fix keyring ref leak in
join_session_keyring()").  Fortunately this cannot happen currently, but
we really should be more careful.  Do this by adding and using a new
error label at which the keyring reference is dropped.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
security/keys/process_keys.c