diff options
| author | Eric Biggers <ebiggers@google.com> | 2017-04-18 15:31:09 +0100 |
|---|---|---|
| committer | Michael Bestas <mkbestas@lineageos.org> | 2017-05-14 10:00:20 +0000 |
| commit | d2f129e6cd92f6a448084048e77329244524c79d (patch) | |
| tree | eb916c0cb1eadcbdbef91ccf55270c03f124d8a8 /net/lapb/lapb_subr.c | |
| parent | 1d0aad6f772a4000549ce63b7e51b59eac2f1668 (diff) | |
KEYS: fix keyctl_set_reqkey_keyring() to not leak thread keyrings
commit c9f838d104fed6f2f61d68164712e3204bf5271b upstream.
This fixes CVE-2017-7472.
Running the following program as an unprivileged user exhausts kernel
memory by leaking thread keyrings:
#include <keyutils.h>
int main()
{
for (;;)
keyctl_set_reqkey_keyring(KEY_REQKEY_DEFL_THREAD_KEYRING);
}
Fix it by only creating a new thread keyring if there wasn't one before.
To make things more consistent, make install_thread_keyring_to_cred()
and install_process_keyring_to_cred() both return 0 if the corresponding
keyring is already present.
Fixes: d84f4f992cbd ("CRED: Inaugurate COW credentials")
Change-Id: I6c2b3b811deb18ce1e0305d0e4b947d26e6a75fd
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions
