>Subject: [PATCH net] tipc: Fix skb leak on multicast synchronization failure
>
>tipc_mcast_xmit() calls tipc_msg_reassemble() to prepare an skb for local
>delivery and queues it in localq. If the subsequent
>tipc_mcast_send_sync() fails, the function skips local delivery and purges only
>the original packet queue, leaking the skb in localq. Purge localq before exiting
>on synchronization failure.
>
>Fixes: dca4a17d24ee ("tipc: fix potential hanging after b/rcast changing")
>Signed-off-by: Haoxiang Li <haox…@163.com>
>---
> net/tipc/bcast.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c index
>10d1ec593084..086e2a953a13 100644
>--- a/net/tipc/bcast.c
>+++ b/net/tipc/bcast.c
>@@ -409,6 +409,7 @@ int tipc_mcast_xmit(struct net *net, struct
>sk_buff_head *pkts,
> if (unlikely(rc)) {
> pr_err("Unable to send SYN: method %d, rc
>%d\n",
> rcast, rc);
>+ __skb_queue_purge(&localq);
This fix is incomplete because we still have another leak if tipc_msg_reassemble() fails.
This issue was known and already in my to-do list.
I will post this complete fix and add you as Co-developer:
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 10d1ec593084..f6d43ee99713 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -426,6 +426,7 @@ int tipc_mcast_xmit(struct net *net, struct sk_buff_head *pkts,
exit:
/* This queue should normally be empty by now */
__skb_queue_purge(pkts);
+ __skb_queue_purge(&localq);
return rc;
}
---
pw-bot: rejected