* [PATCH v3] net: core: Prevent from dereferencing null pointer when releasing SKB
@ 2017-04-25 18:58 Myungho Jung
2017-04-26 18:47 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Myungho Jung @ 2017-04-25 18:58 UTC (permalink / raw)
To: davem; +Cc: netdev
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>
---
Changes in v2:
- Correct category in subject
Changes in v3:
- Fix typo in subject
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] net: core: Prevent from dereferencing null pointer when releasing SKB
2017-04-25 18:58 [PATCH v3] net: core: Prevent from dereferencing null pointer when releasing SKB Myungho Jung
@ 2017-04-26 18:47 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-04-26 18:47 UTC (permalink / raw)
To: mhjungk; +Cc: netdev
From: Myungho Jung <mhjungk@gmail.com>
Date: Tue, 25 Apr 2017 11:58:15 -0700
> 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>
Applied, thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-26 18:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-25 18:58 [PATCH v3] net: core: Prevent from dereferencing null pointer when releasing SKB Myungho Jung
2017-04-26 18:47 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.