[linux] 04/07: net/llc: avoid BUG_ON() in skb_orphan() (CVE-2017-6345)

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Tue Mar 7 02:36:44 UTC 2017


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch wheezy-security
in repository linux.

commit 1cdc95238ead6eab107c802c7b90be00ce3ca85b
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Tue Mar 7 02:15:16 2017 +0000

    net/llc: avoid BUG_ON() in skb_orphan() (CVE-2017-6345)
---
 debian/changelog                                   |  1 +
 .../all/net-llc-avoid-bug_on-in-skb_orphan.patch   | 53 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 55 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index e3c2274..29a5adc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -79,6 +79,7 @@ linux (3.2.86-1) UNRELEASED; urgency=medium
   [ Ben Hutchings ]
   * ipc/shm: Fix shmat mmap nil-page protection (CVE-2017-5669)
   * sctp: avoid BUG_ON on sctp_wait_for_sndbuf (CVE-2017-5986)
+  * net/llc: avoid BUG_ON() in skb_orphan() (CVE-2017-6345)
 
  -- Ben Hutchings <ben at decadent.org.uk>  Tue, 07 Mar 2017 01:47:48 +0000
 
diff --git a/debian/patches/bugfix/all/net-llc-avoid-bug_on-in-skb_orphan.patch b/debian/patches/bugfix/all/net-llc-avoid-bug_on-in-skb_orphan.patch
new file mode 100644
index 0000000..0e7ac74
--- /dev/null
+++ b/debian/patches/bugfix/all/net-llc-avoid-bug_on-in-skb_orphan.patch
@@ -0,0 +1,53 @@
+From: Eric Dumazet <edumazet at google.com>
+Date: Sun, 12 Feb 2017 14:03:52 -0800
+Subject: net/llc: avoid BUG_ON() in skb_orphan()
+Origin: https://git.kernel.org/linus/8b74d439e1697110c5e5c600643e823eb1dd0762
+Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-6345
+
+It seems nobody used LLC since linux-3.12.
+
+Fortunately fuzzers like syzkaller still know how to run this code,
+otherwise it would be no fun.
+
+Setting skb->sk without skb->destructor leads to all kinds of
+bugs, we now prefer to be very strict about it.
+
+Ideally here we would use skb_set_owner() but this helper does not exist yet,
+only CAN seems to have a private helper for that.
+
+Fixes: 376c7311bdb6 ("net: add a temporary sanity check in skb_orphan()")
+Signed-off-by: Eric Dumazet <edumazet at google.com>
+Reported-by: Andrey Konovalov <andreyknvl at google.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
+---
+ net/llc/llc_conn.c | 3 +++
+ net/llc/llc_sap.c  | 3 +++
+ 2 files changed, 6 insertions(+)
+
+--- a/net/llc/llc_conn.c
++++ b/net/llc/llc_conn.c
+@@ -821,7 +821,10 @@ void llc_conn_handler(struct llc_sap *sa
+ 		 * another trick required to cope with how the PROCOM state
+ 		 * machine works. -acme
+ 		 */
++		skb_orphan(skb);
++		sock_hold(sk);
+ 		skb->sk = sk;
++		skb->destructor = sock_efree;
+ 	}
+ 	if (!sock_owned_by_user(sk))
+ 		llc_conn_rcv(sk, skb);
+--- a/net/llc/llc_sap.c
++++ b/net/llc/llc_sap.c
+@@ -294,7 +294,10 @@ static void llc_sap_rcv(struct llc_sap *
+ 
+ 	ev->type   = LLC_SAP_EV_TYPE_PDU;
+ 	ev->reason = 0;
++	skb_orphan(skb);
++	sock_hold(sk);
+ 	skb->sk = sk;
++	skb->destructor = sock_efree;
+ 	llc_sap_state_process(sap, skb);
+ }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index b5d3004..2f3eac8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1108,6 +1108,7 @@ bugfix/all/KEYS-Don-t-permit-request_key-to-construct-a-new-key.patch
 bugfix/all/ecryptfs-fix-handling-of-directory-opening.patch
 bugfix/all/ipc-shm-fix-shmat-mmap-nil-page-protection.patch
 bugfix/all/sctp-avoid-bug_on-on-sctp_wait_for_sndbuf.patch
+bugfix/all/net-llc-avoid-bug_on-in-skb_orphan.patch
 
 # ABI maintenance
 debian/perf-hide-abi-change-in-3.2.30.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git



More information about the Kernel-svn-changes mailing list