KEYS: Change the name of the dead type to ".dead" to prevent user access
authorDavid Howells <dhowells@redhat.com>
Wed, 19 Apr 2017 16:08:20 +0000 (17:08 +0100)
committerDanny Wood <danwood76@gmail.com>
Fri, 11 Jan 2019 07:53:57 +0000 (07:53 +0000)
commit904cdea824d519fecfae11805c4efca123f78a9c
tree0781f8ee7625f4c3a238b6edad00efe4cdc6de58
parent88ed18f3f632796b5336b0f962b44806cbd3b4a8
KEYS: Change the name of the dead type to ".dead" to prevent user access

This fixes CVE-2017-6951.

Userspace should not be able to do things with the "dead" key type as it
doesn't have some of the helper functions set upon it that the kernel
needs.  Attempting to use it may cause the kernel to crash.

Fix this by changing the name of the type to ".dead" so that it's rejected
up front on userspace syscalls by key_get_type_from_user().

Though this doesn't seem to affect recent kernels, it does affect older
ones, certainly those prior to:

commit c06cfb08b88dfbe13be44a69ae2fdc3a7c902d81
Author: David Howells <dhowells@redhat.com>
Date:   Tue Sep 16 17:36:06 2014 +0100
KEYS: Remove key_type::match in favour of overriding default by match_preparse

which went in before 3.18-rc1.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: stable@vger.kernel.org
security/keys/gc.c