diff options
author | Hoang Le <hoang.h.le@dektech.com.au> | 2019-04-03 02:05:04 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-04 20:34:11 -0400 |
commit | e1279ff7aec19d7154da30bf5b83e797a13fbced (patch) | |
tree | 4973b70e2590391fcf1ecc12f5021081a60cbfd2 /net/tipc | |
parent | 95e27a4da6143ad8a0c908215a0f402031b9ebf3 (diff) |
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: 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>
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/bcast.c | 3 |
1 files changed, 3 insertions, 0 deletions
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, | |||
769 | u32 node, port; | 769 | u32 node, port; |
770 | 770 | ||
771 | skb = skb_peek(inputq); | 771 | skb = skb_peek(inputq); |
772 | if (!skb) | ||
773 | return; | ||
774 | |||
772 | hdr = buf_msg(skb); | 775 | hdr = buf_msg(skb); |
773 | 776 | ||
774 | if (likely(!msg_is_syn(hdr) && skb_queue_empty(defq))) | 777 | if (likely(!msg_is_syn(hdr) && skb_queue_empty(defq))) |