Commit e1279ff7 authored by Hoang Le's avatar Hoang Le Committed by David S. Miller

tipc: add NULL pointer check

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

Add checking skb valid before using.

Fixes: c55c8eda ("tipc: smooth change between replicast and broadcast")
Reported-by: default avatarTuong Lien Tong <tuong.t.lien@dektech.com.au>
Acked-by: default avatarYing Xue <ying.xue@windriver.com>
Signed-off-by: default avatarHoang Le <hoang.h.le@dektech.com.au>
Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 95e27a4d
...@@ -769,6 +769,9 @@ void tipc_mcast_filter_msg(struct net *net, struct sk_buff_head *defq, ...@@ -769,6 +769,9 @@ void tipc_mcast_filter_msg(struct net *net, struct sk_buff_head *defq,
u32 node, port; u32 node, port;
skb = skb_peek(inputq); skb = skb_peek(inputq);
if (!skb)
return;
hdr = buf_msg(skb); hdr = buf_msg(skb);
if (likely(!msg_is_syn(hdr) && skb_queue_empty(defq))) if (likely(!msg_is_syn(hdr) && skb_queue_empty(defq)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment