[linux] 01/01: 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 16:45:38 UTC 2017


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

carnil pushed a commit to branch jessie-security
in repository linux.

commit 7ef49ff5d94ce11fde7691b1513f9c8f78f4a4e4
Author: Salvatore Bonaccorso <carnil at debian.org>
Date:   Tue Mar 7 17:43:33 2017 +0100

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

diff --git a/debian/changelog b/debian/changelog
index cb0bf5a..d0b4cf4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ linux (3.16.39-1+deb8u2) UNRELEASED; urgency=medium
   * sctp: deny peeloff operation on asocs with threads sleeping on it
     (CVE-2017-6353)
   * tcp: avoid infinite loop in tcp_splice_read() (CVE-2017-6214)
+  * net/llc: avoid BUG_ON() in skb_orphan() (CVE-2017-6345)
 
  -- Salvatore Bonaccorso <carnil at debian.org>  Tue, 07 Mar 2017 17:10:30 +0100
 
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..090fc50
--- /dev/null
+++ b/debian/patches/bugfix/all/net-llc-avoid-BUG_ON-in-skb_orphan.patch
@@ -0,0 +1,59 @@
+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>
+---
+ net/llc/llc_conn.c | 3 +++
+ net/llc/llc_sap.c  | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/net/llc/llc_conn.c b/net/llc/llc_conn.c
+index 3e821da..8bc5a1b 100644
+--- a/net/llc/llc_conn.c
++++ b/net/llc/llc_conn.c
+@@ -821,7 +821,10 @@ void llc_conn_handler(struct llc_sap *sap, struct sk_buff *skb)
+ 		 * 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);
+diff --git a/net/llc/llc_sap.c b/net/llc/llc_sap.c
+index d0e1e80..5404d0d 100644
+--- a/net/llc/llc_sap.c
++++ b/net/llc/llc_sap.c
+@@ -290,7 +290,10 @@ static void llc_sap_rcv(struct llc_sap *sap, struct sk_buff *skb,
+ 
+ 	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);
+ }
+ 
+-- 
+2.1.4
+
diff --git a/debian/patches/series b/debian/patches/series
index 5c15abe..2b7ec57 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -697,6 +697,7 @@ 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/sctp-deny-peeloff-operation-on-asocs-with-threads-sl.patch
 bugfix/all/tcp-avoid-infinite-loop-in-tcp_splice_read.patch
+bugfix/all/net-llc-avoid-BUG_ON-in-skb_orphan.patch
 
 # Fix ABI changes
 debian/of-fix-abi-changes.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