Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66bccc6a authored by Hoang Le's avatar Hoang Le Committed by Greg Kroah-Hartman
Browse files

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,

<snip>
1303 int tipc_link_rcv:
...
1354    if (!tipc_data_input(l, skb, l->inputq))
1355        rc |= tipc_link_input(l, skb, l->inputq);
</snip>

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: default avatarYing Xue <ying.xue@windriver.com>
Acked-by: default avatarJon Maloy <maloy@donjonn.com>
Signed-off-by: default avatarHoang Le <hoang.h.le@dektech.com.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5c29e33a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
	};
}