From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:42414 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752630AbcA0GbI (ORCPT ); Wed, 27 Jan 2016 01:31:08 -0500 Subject: Patch "phonet: properly unshare skbs in phonet_rcv()" has been added to the 4.1-stable tree To: edumazet@google.com, courmisch@gmail.com, davem@davemloft.net, gregkh@linuxfoundation.org, ivo.g.dimitrov.75@gmail.com Cc: , From: Date: Tue, 26 Jan 2016 22:28:02 -0800 Message-ID: <145387608225171@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled phonet: properly unshare skbs in phonet_rcv() to the 4.1-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: phonet-properly-unshare-skbs-in-phonet_rcv.patch and it can be found in the queue-4.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Tue Jan 26 21:37:04 PST 2016 From: Eric Dumazet Date: Tue, 12 Jan 2016 08:58:00 -0800 Subject: phonet: properly unshare skbs in phonet_rcv() From: Eric Dumazet [ Upstream commit 7aaed57c5c2890634cfadf725173c7c68ea4cb4f ] Ivaylo Dimitrov reported a regression caused by commit 7866a621043f ("dev: add per net_device packet type chains"). skb->dev becomes NULL and we crash in __netif_receive_skb_core(). Before above commit, different kind of bugs or corruptions could happen without major crash. But the root cause is that phonet_rcv() can queue skb without checking if skb is shared or not. Many thanks to Ivaylo Dimitrov for his help, diagnosis and tests. Reported-by: Ivaylo Dimitrov Tested-by: Ivaylo Dimitrov Signed-off-by: Eric Dumazet Cc: Remi Denis-Courmont Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/phonet/af_phonet.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/net/phonet/af_phonet.c +++ b/net/phonet/af_phonet.c @@ -377,6 +377,10 @@ static int phonet_rcv(struct sk_buff *sk struct sockaddr_pn sa; u16 len; + skb = skb_share_check(skb, GFP_ATOMIC); + if (!skb) + return NET_RX_DROP; + /* check we have at least a full Phonet header */ if (!pskb_pull(skb, sizeof(struct phonethdr))) goto out; Patches currently in stable-queue which might be from edumazet@google.com are queue-4.1/net-sched-fix-missing-free-per-cpu-on-qstats.patch queue-4.1/ipv6-tcp-add-rcu-locking-in-tcp_v6_send_synack.patch queue-4.1/ipv6-update-skb-csum-when-ce-mark-is-propagated.patch queue-4.1/tcp-dccp-fix-old-style-declarations.patch queue-4.1/net-possible-use-after-free-in-dst_release.patch queue-4.1/phonet-properly-unshare-skbs-in-phonet_rcv.patch queue-4.1/tcp-dccp-fix-timewait-races-in-timer-handling.patch queue-4.1/tcp_yeah-don-t-set-ssthresh-below-2.patch