Skip to content

Commit

Permalink
KEYS: Change the name of the dead type to ".dead" to prevent user access
Browse files Browse the repository at this point in the history
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 c06cfb0
	Author: David Howells <[email protected]>
	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 <[email protected]>
cc: [email protected]
  • Loading branch information
dhowells committed Apr 18, 2017
1 parent ee8f844 commit c1644fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion security/keys/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static unsigned long key_gc_flags;
* immediately unlinked.
*/
struct key_type key_type_dead = {
.name = "dead",
.name = ".dead",
};

/*
Expand Down

0 comments on commit c1644fe

Please sign in to comment.