stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for 4.9 01/39] net: core: Prevent from dereferencing null pointer when releasing SKB
@ 2017-09-18  0:19 Levin, Alexander (Sasha Levin)
  2017-09-18  0:19 ` [PATCH for 4.9 02/39] net/packet: check length in getsockopt() called with PACKET_HDRLEN Levin, Alexander (Sasha Levin)
                   ` (16 more replies)
  0 siblings, 17 replies; 20+ messages in thread
From: Levin, Alexander (Sasha Levin) @ 2017-09-18  0:19 UTC (permalink / raw)
  To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
  Cc: Myungho Jung, David S . Miller, Levin, Alexander (Sasha Levin)

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 1d0a7369d5a2..8d5db08f79f3 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2355,6 +2355,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

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2017-09-18 14:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-18  0:19 [PATCH for 4.9 01/39] net: core: Prevent from dereferencing null pointer when releasing SKB Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 02/39] net/packet: check length in getsockopt() called with PACKET_HDRLEN Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 04/39] usb: plusb: Add support for PL-27A1 Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 03/39] team: fix memory leaks Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 08/39] mmc: sdio: fix alignment issue in struct sdio_func Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 05/39] udp: disable inner UDP checksum offloads in IPsec case Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 07/39] qed: Fix possible system hang in the dcbnl-getdcbx() path Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 09/39] bridge: netlink: register netdevice before executing changelink Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 06/39] net: dsa: b53: Include IMP/CPU port in dumb forwarding mode Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 12/39] sata_via: Enable hotplug only on VT6421 Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 11/39] Btrfs: fix potential use-after-free for cloned bio Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 10/39] Btrfs: fix segmentation fault when doing dio read Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 16/39] netfilter: invoke synchronize_rcu after set the _hook_ to NULL Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 14/39] kasan: do not sanitize kexec purgatory Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 13/39] hugetlbfs: initialize shared policy as part of inode allocation Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 15/39] drivers/rapidio/devices/tsi721.c: make module parameter variable name unique Levin, Alexander (Sasha Levin)
2017-09-18  0:19 ` [PATCH for 4.9 17/39] MIPS: IRQ Stack: Unwind IRQ stack onto task stack Levin, Alexander (Sasha Levin)
2017-09-18  6:41 ` [PATCH for 4.9 01/39] net: core: Prevent from dereferencing null pointer when releasing SKB Greg KH
2017-09-18 14:13   ` Levin, Alexander (Sasha Levin)
2017-09-18 14:31     ` Levin, Alexander (Sasha Levin)

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).