diff options
author | Hoang Le <hoang.h.le@dektech.com.au> | 2019-02-11 05:18:28 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-05 17:35:12 +0300 |
commit | 0b42feca0dcaadaafb2a425ea76efa3422687c91 (patch) | |
tree | 556406efbc29218b620a6ad9a92418a705876c63 | |
parent | 959dbcf5c3fe3ee2ca7bc4eb60ce71774a63fa02 (diff) | |
download | linux-0b42feca0dcaadaafb2a425ea76efa3422687c91.tar.xz |
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: Ying Xue <ying.xue@windriver.com>
Acked-by: Jon Maloy <maloy@donjonn.com>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | net/tipc/link.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index 4e8647aef01c..c7406c1fdc14 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -1063,7 +1063,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; }; } |