[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1491863998-15131-1-git-send-email-mhjungk@gmail.com>
Date: Mon, 10 Apr 2017 15:39:58 -0700
From: Myungho Jung <mhjungk@...il.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, chunkeey@...glemail.com,
Myungho Jung <mhjungk@...il.com>
Subject: [PATCH] p54: Prevent from dereferencing null pointer when releasing SKB
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@...il.com>
---
net/core/dev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/core/dev.c b/net/core/dev.c
index 7869ae3..22be2a6 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2450,6 +2450,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.7.4
Powered by blists - more mailing lists