* Patch "net/llc: avoid BUG_ON() in skb_orphan()" has been added to the 4.4-stable tree
@ 2017-02-23 20:13 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-02-23 20:13 UTC (permalink / raw)
To: edumazet, andreyknvl, davem, gregkh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
net/llc: avoid BUG_ON() in skb_orphan()
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
net-llc-avoid-bug_on-in-skb_orphan.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From foo@baz Thu Feb 23 21:13:19 CET 2017
From: Eric Dumazet <edumazet@google.com>
Date: Sun, 12 Feb 2017 14:03:52 -0800
Subject: net/llc: avoid BUG_ON() in skb_orphan()
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit 8b74d439e1697110c5e5c600643e823eb1dd0762 ]
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@google.com>
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
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
@@ -290,7 +290,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);
}
Patches currently in stable-queue which might be from edumazet@google.com are
queue-4.4/dccp-fix-freeing-skb-too-early-for-ipv6_recvpktinfo.patch
queue-4.4/ip-fix-ip_checksum-handling.patch
queue-4.4/packet-fix-races-in-fanout_add.patch
queue-4.4/packet-do-not-call-fanout_release-from-atomic-contexts.patch
queue-4.4/net-llc-avoid-bug_on-in-skb_orphan.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-02-23 20:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-23 20:13 Patch "net/llc: avoid BUG_ON() in skb_orphan()" has been added to the 4.4-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).