Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1626453

[PATCH 2/3] KEYS: Change the name of the dead type to ".dead" to prevent user access

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject [PATCH 2/3] KEYS: Change the name of the dead type to ".dead" to prevent user access
Date 2017-04-19 18:20 +0200
Message-ID <ty0uL-5Cb-49@gated-at.bofh.it> (permalink)
References <ty0uJ-5Cb-9@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


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 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/security/keys/gc.c b/security/keys/gc.c
index addf060399e0..9cb4fe4478a1 100644
--- a/security/keys/gc.c
+++ b/security/keys/gc.c
@@ -46,7 +46,7 @@ static unsigned long key_gc_flags;
  * immediately unlinked.
  */
 struct key_type key_type_dead = {
-	.name = "dead",
+	.name = ".dead",
 };
 
 /*

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/3] KEYS: Fixes David Howells <dhowells@redhat.com> - 2017-04-19 18:20 +0200
  [PATCH 3/3] KEYS: fix keyctl_set_reqkey_keyring() to not leak  thread keyrings David Howells <dhowells@redhat.com> - 2017-04-19 18:20 +0200
  [PATCH 2/3] KEYS: Change the name of the dead type to ".dead" to  prevent user access David Howells <dhowells@redhat.com> - 2017-04-19 18:20 +0200

csiph-web