[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1357671093-9605-3-git-send-email-dborkman@redhat.com>
Date: Tue, 8 Jan 2013 19:51:33 +0100
From: Daniel Borkmann <dborkman@...hat.com>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org, Daniel Borkmann <dborkman@...hat.com>,
Changli Gao <xiaosuo@...il.com>,
Eric Dumazet <eric.dumazet@...il.com>
Subject: [PATCH net 2/2] net: dev_queue_xmit_nit: fix potential NULL ptr dereference
Commit 71d9dec24dce548bf699815c976cf063ad9257e2 (``net: increase
skb->users instead of skb_clone()'') introduced a skb_clone in
dev_queue_xmit_nit that, when NULL, leaves the loop, but can still
be injected into pt_prev->func().
Cc: Changli Gao <xiaosuo@...il.com>
Cc: Eric Dumazet <eric.dumazet@...il.com>
Signed-off-by: Daniel Borkmann <dborkman@...hat.com>
---
net/core/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/dev.c b/net/core/dev.c
index 723dcd0..6c35c33 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1827,7 +1827,7 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
pt_prev = ptype;
}
}
- if (pt_prev)
+ if (skb2 && pt_prev)
pt_prev->func(skb2, skb->dev, pt_prev, skb->dev);
rcu_read_unlock();
}
--
1.7.11.7
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists