From: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: Myungho Jung <mhjungk@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
"Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Subject: [PATCH review for 3.18 18/30] net: core: Prevent from dereferencing null pointer when releasing SKB
Date: Wed, 20 Sep 2017 04:45:54 +0000 [thread overview]
Message-ID: <20170920044542.7571-18-alexander.levin@verizon.com> (raw)
In-Reply-To: <20170920044542.7571-1-alexander.levin@verizon.com>
From: Myungho Jung <mhjungk@gmail.com>
[ Upstream commit 9899886d5e8ec5b343b1efe44f185a0e68dc6454 ]
Added NULL check to make __dev_kfree_skb_irq consistent with kfree
family of functions.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=195289
Signed-off-by: Myungho Jung <mhjungk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
net/core/dev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index 22ad4e433b3a..21b0bd976699 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2225,6 +2225,9 @@ void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason)
{
unsigned long flags;
+ if (unlikely(!skb))
+ return;
+
if (likely(atomic_read(&skb->users) == 1)) {
smp_rmb();
atomic_set(&skb->users, 0);
--
2.11.0
next prev parent reply other threads:[~2017-09-20 4:47 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-20 4:45 [PATCH review for 3.18 01/30] drm: bridge: add DT bindings for TI ths8135 Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 02/30] RDS: RDMA: Fix the composite message user notification Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 03/30] MIPS: Ensure bss section ends on a long-aligned address Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 04/30] MIPS: kexec: Do not reserve invalid crashkernel memory on boot Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 07/30] hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 06/30] clk: wm831x: fix usleep_range with bad range Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 05/30] sh_eth: use correct name for ECMR_MPDE bit Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 10/30] IB/ipoib: Fix deadlock over vlan_mutex Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 11/30] IB/ipoib: rtnl_unlock can not come after free_netdev Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 09/30] tty: goldfish: Fix a parameter of a call to free_irq Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 08/30] ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 12/30] IB/ipoib: Replace list_del of the neigh->list with list_del_init Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 13/30] USB: serial: mos7720: fix control-message error handling Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 15/30] pinctrl: mvebu: Use seq_puts() in mvebu_pinconf_group_dbg_show() Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 14/30] USB: serial: mos7840: fix control-message error handling Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 16/30] partitions/efi: Fix integer overflow in GPT size calculation Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 20/30] team: fix memory leaks Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` Levin, Alexander (Sasha Levin) [this message]
2017-09-20 4:45 ` [PATCH review for 3.18 17/30] audit: log 32-bit socketcalls Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 19/30] net/packet: check length in getsockopt() called with PACKET_HDRLEN Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 22/30] mmc: sdio: fix alignment issue in struct sdio_func Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 23/30] netfilter: invoke synchronize_rcu after set the _hook_ to NULL Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 21/30] usb: plusb: Add support for PL-27A1 Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 24/30] [media] exynos-gsc: Do not swap cb/cr for semi planar formats Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 28/30] md/raid10: submit bio directly to replacement disk Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 25/30] netfilter: nfnl_cthelper: fix incorrect helper->expect_class_max Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 26/30] parisc: perf: Fix potential NULL pointer dereference Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 27/30] rds: ib: add error handle Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 30/30] libata: transport: Remove circular dependency at free time Levin, Alexander (Sasha Levin)
2017-09-20 4:45 ` [PATCH review for 3.18 29/30] xfs: remove kmem_zalloc_greedy Levin, Alexander (Sasha Levin)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170920044542.7571-18-alexander.levin@verizon.com \
--to=alexander.levin@verizon.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mhjungk@gmail.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®