All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next] tipc: add NULL pointer check
@ 2019-04-03  6:05 Hoang Le
  2019-04-03 12:52 ` Jon Maloy
  2019-04-05  0:34 ` David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Hoang Le @ 2019-04-03  6:05 UTC (permalink / raw)
  To: jon.maloy, maloy, ying.xue, tipc-discussion, netdev

skb somehow dequeued out of inputq before processing, it causes to
NULL pointer and kernel crashed.

Add checking skb valid before using.

Fixes: c55c8edafa9 ("tipc: smooth change between replicast and broadcast")
Reported-by: Tuong Lien Tong <tuong.t.lien@dektech.com.au>
Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
---
 net/tipc/bcast.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 76e14dc08bb9..6c997d4a6218 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -769,6 +769,9 @@ void tipc_mcast_filter_msg(struct net *net, struct sk_buff_head *defq,
 	u32 node, port;
 
 	skb = skb_peek(inputq);
+	if (!skb)
+		return;
+
 	hdr = buf_msg(skb);
 
 	if (likely(!msg_is_syn(hdr) && skb_queue_empty(defq)))
-- 
2.17.1


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

end of thread, other threads:[~2019-04-05  0:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-03  6:05 [net-next] tipc: add NULL pointer check Hoang Le
2019-04-03 12:52 ` Jon Maloy
2019-04-03 13:09   ` Bo YU
2019-04-03 14:27     ` Jon Maloy
2019-04-04  0:35       ` Bo YU
2019-04-05  0:34 ` 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.