]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Dec 2017 12:10:09 +0000 (13:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Dec 2017 12:10:09 +0000 (13:10 +0100)
added patches:
don-t-leak-a-key-reference-if-request_key-tries-to-use-a-revoked-keyring.patch
keys-don-t-permit-request_key-to-construct-a-new-keyring.patch
mac80211-fix-addition-of-mesh-configuration-element.patch

queue-3.18/don-t-leak-a-key-reference-if-request_key-tries-to-use-a-revoked-keyring.patch [new file with mode: 0644]
queue-3.18/keys-don-t-permit-request_key-to-construct-a-new-keyring.patch [new file with mode: 0644]
queue-3.18/mac80211-fix-addition-of-mesh-configuration-element.patch [new file with mode: 0644]
queue-3.18/series

diff --git a/queue-3.18/don-t-leak-a-key-reference-if-request_key-tries-to-use-a-revoked-keyring.patch b/queue-3.18/don-t-leak-a-key-reference-if-request_key-tries-to-use-a-revoked-keyring.patch
new file mode 100644 (file)
index 0000000..dfd1d8b
--- /dev/null
@@ -0,0 +1,37 @@
+From d0709f1e66e8066c4ac6a54620ec116aa41937c0 Mon Sep 17 00:00:00 2001
+From: David Jeffery <djeffery@redhat.com>
+Date: Thu, 12 Feb 2015 16:45:31 +0000
+Subject: Don't leak a key reference if request_key() tries to use a revoked keyring
+
+From: David Jeffery <djeffery@redhat.com>
+
+commit d0709f1e66e8066c4ac6a54620ec116aa41937c0 upstream.
+
+If a request_key() call to allocate and fill out a key attempts to insert the
+key structure into a revoked keyring, the key will leak, using memory and part
+of the user's key quota until the system reboots. This is from a failure of
+construct_alloc_key() to decrement the key's reference count after the attempt
+to insert into the requested keyring is rejected.
+
+key_put() needs to be called in the link_prealloc_failed callpath to ensure
+the unused key is released.
+
+Signed-off-by: David Jeffery <djeffery@redhat.com>
+Signed-off-by: David Howells <dhowells@redhat.com>
+Signed-off-by: James Morris <james.l.morris@oracle.com>
+Signed-off-by: Eric Biggers <ebiggers@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ security/keys/request_key.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/security/keys/request_key.c
++++ b/security/keys/request_key.c
+@@ -437,6 +437,7 @@ link_check_failed:
+ link_prealloc_failed:
+       mutex_unlock(&user->cons_lock);
++      key_put(key);
+       kleave(" = %d [prelink]", ret);
+       return ret;
diff --git a/queue-3.18/keys-don-t-permit-request_key-to-construct-a-new-keyring.patch b/queue-3.18/keys-don-t-permit-request_key-to-construct-a-new-keyring.patch
new file mode 100644 (file)
index 0000000..594873e
--- /dev/null
@@ -0,0 +1,38 @@
+From 911b79cde95c7da0ec02f48105358a36636b7a71 Mon Sep 17 00:00:00 2001
+From: David Howells <dhowells@redhat.com>
+Date: Mon, 19 Oct 2015 11:20:28 +0100
+Subject: KEYS: Don't permit request_key() to construct a new keyring
+
+From: David Howells <dhowells@redhat.com>
+
+commit 911b79cde95c7da0ec02f48105358a36636b7a71 upstream.
+
+If request_key() is used to find a keyring, only do the search part - don't
+do the construction part if the keyring was not found by the search.  We
+don't really want keyrings in the negative instantiated state since the
+rejected/negative instantiation error value in the payload is unioned with
+keyring metadata.
+
+Now the kernel gives an error:
+
+       request_key("keyring", "#selinux,bdekeyring", "keyring", KEY_SPEC_USER_SESSION_KEYRING) = -1 EPERM (Operation not permitted)
+
+Signed-off-by: David Howells <dhowells@redhat.com>
+Signed-off-by: Eric Biggers <ebiggers@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ security/keys/request_key.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/security/keys/request_key.c
++++ b/security/keys/request_key.c
+@@ -467,6 +467,9 @@ static struct key *construct_key_and_lin
+       if (ret)
+               goto error;
++      if (ctx->index_key.type == &key_type_keyring)
++              return ERR_PTR(-EPERM);
++
+       user = key_user_lookup(current_fsuid());
+       if (!user) {
+               ret = -ENOMEM;
diff --git a/queue-3.18/mac80211-fix-addition-of-mesh-configuration-element.patch b/queue-3.18/mac80211-fix-addition-of-mesh-configuration-element.patch
new file mode 100644 (file)
index 0000000..f36abe5
--- /dev/null
@@ -0,0 +1,38 @@
+From 57629915d568c522ac1422df7bba4bee5b5c7a7c Mon Sep 17 00:00:00 2001
+From: Ilan peer <ilan.peer@intel.com>
+Date: Mon, 26 Dec 2016 18:17:36 +0200
+Subject: mac80211: Fix addition of mesh configuration element
+
+From: Ilan peer <ilan.peer@intel.com>
+
+commit 57629915d568c522ac1422df7bba4bee5b5c7a7c upstream.
+
+The code was setting the capabilities byte to zero,
+after it was already properly set previously. Fix it.
+
+The bug was found while debugging hwsim mesh tests failures
+that happened since the commit mentioned below.
+
+Fixes: 76f43b4c0a93 ("mac80211: Remove invalid flag operations in mesh TSF synchronization")
+Signed-off-by: Ilan Peer <ilan.peer@intel.com>
+Reviewed-by: Masashi Honma <masashi.honma@gmail.com>
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Cc: Richard Schütz <rschuetz@uni-koblenz.de>
+Cc: Mathias Kretschmer <mathias.kretschmer@fit.fraunhofer.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ net/mac80211/mesh.c |    2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/net/mac80211/mesh.c
++++ b/net/mac80211/mesh.c
+@@ -289,8 +289,6 @@ int mesh_add_meshconf_ie(struct ieee8021
+       /* Mesh PS mode. See IEEE802.11-2012 8.4.2.100.8 */
+       *pos |= ifmsh->ps_peers_deep_sleep ?
+                       IEEE80211_MESHCONF_CAPAB_POWER_SAVE_LEVEL : 0x00;
+-      *pos++ = 0x00;
+-
+       return 0;
+ }
index afdef71cf8a3c5b975790aba00ef1a8f0f591b63..2c07df85b2e760fec6819d8c8372354f7f91c376 100644 (file)
@@ -6,3 +6,6 @@ usb-core-prevent-malicious-bnuminterfaces-overflow.patch
 usbip-fix-stub_send_ret_submit-vulnerability-to-null-transfer_buffer.patch
 xhci-don-t-add-a-virt_dev-to-the-devs-array-before-it-s-fully-allocated.patch
 ext4-fix-crash-when-a-directory-s-i_size-is-too-small.patch
+don-t-leak-a-key-reference-if-request_key-tries-to-use-a-revoked-keyring.patch
+keys-don-t-permit-request_key-to-construct-a-new-keyring.patch
+mac80211-fix-addition-of-mesh-configuration-element.patch