Netdev Archive on lore.kernel.org
 help / Atom feed
* [net] tipc: fix skb may be leaky in tipc_link_input
@ 2019-02-11  2:18 Hoang Le
  2019-02-12  2:36 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Hoang Le @ 2019-02-11  2:18 UTC (permalink / raw)
  To: tipc-discussion, jon.maloy, maloy, ying.xue, netdev

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>
---
 net/tipc/link.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/link.c b/net/tipc/link.c
index ac306d17f8ad..d31f83a9a2c5 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -1145,7 +1145,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;
 	};
 }
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [net] tipc: fix skb may be leaky in tipc_link_input
  2019-02-11  2:18 [net] tipc: fix skb may be leaky in tipc_link_input Hoang Le
@ 2019-02-12  2:36 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-02-12  2:36 UTC (permalink / raw)
  To: hoang.h.le; +Cc: tipc-discussion, jon.maloy, maloy, ying.xue, netdev

From: Hoang Le <hoang.h.le@dektech.com.au>
Date: Mon, 11 Feb 2019 09:18:28 +0700

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-11  2:18 [net] tipc: fix skb may be leaky in tipc_link_input Hoang Le
2019-02-12  2:36 ` David Miller

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org netdev@archiver.kernel.org
	public-inbox-index netdev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox