From: Hoang Le Date: Mon, 11 Feb 2019 02:18:28 +0000 (+0700) Subject: tipc: fix skb may be leaky in tipc_link_input X-Git-Tag: android-x86-9.0-r1~4^2~67^2~90 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=66bccc6afb826bb3835aae9a7f28aed22fe8165e;p=android-x86%2Fkernel.git tipc: fix skb may be leaky in tipc_link_input [ Upstream commit 7384b538d3aed2ed49d3575483d17aeee790fb06 ] When we free skb at tipc_data_input, we return a 'false' boolean. Then, skb passed to subcalling tipc_link_input in tipc_link_rcv, 1303 int tipc_link_rcv: ... 1354 if (!tipc_data_input(l, skb, l->inputq)) 1355 rc |= tipc_link_input(l, skb, l->inputq); Fix it by simple changing to a 'true' boolean when skb is being free-ed. Then, tipc_link_rcv will bypassed to subcalling tipc_link_input as above condition. Acked-by: Ying Xue Acked-by: Jon Maloy Signed-off-by: Hoang Le Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/net/tipc/link.c b/net/tipc/link.c index 6344aca4487b..0fbf8ea18ce0 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -1114,7 +1114,7 @@ static bool tipc_data_input(struct tipc_link *l, struct sk_buff *skb, default: pr_warn("Dropping received illegal msg type\n"); kfree_skb(skb); - return false; + return true; }; }