From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:43173 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753867AbcA0GhK (ORCPT ); Wed, 27 Jan 2016 01:37:10 -0500 Subject: Patch "net: pktgen: fix null ptr deref in skb allocation" has been added to the 4.4-stable tree To: john.fastabend@gmail.com, davem@davemloft.net, gregkh@linuxfoundation.org, john.r.fastabend@intel.com Cc: , From: Date: Tue, 26 Jan 2016 22:30:17 -0800 Message-ID: <145387621760195@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 net: pktgen: fix null ptr deref in skb allocation 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-pktgen-fix-null-ptr-deref-in-skb-allocation.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 know about it. >>From foo@baz Tue Jan 26 21:31:27 PST 2016 From: John Fastabend Date: Sun, 10 Jan 2016 21:38:44 -0800 Subject: net: pktgen: fix null ptr deref in skb allocation From: John Fastabend [ Upstream commit 3de03596dfeee48bc803c1d1a6daf60a459929f3 ] Fix possible null pointer dereference that may occur when calling skb_reserve() on a null skb. Fixes: 879c7220e82 ("net: pktgen: Observe needed_headroom of the device") Signed-off-by: John Fastabend Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/pktgen.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -2787,7 +2787,9 @@ static struct sk_buff *pktgen_alloc_skb( } else { skb = __netdev_alloc_skb(dev, size, GFP_NOWAIT); } - skb_reserve(skb, LL_RESERVED_SPACE(dev)); + + if (likely(skb)) + skb_reserve(skb, LL_RESERVED_SPACE(dev)); return skb; } Patches currently in stable-queue which might be from john.fastabend@gmail.com are queue-4.4/net-pktgen-fix-null-ptr-deref-in-skb-allocation.patch