Skip to content

Commit

Permalink
Revert "net:tipc: Fix a double free in tipc_sk_mcast_rcv"
Browse files Browse the repository at this point in the history
commit 7501689 upstream.

This reverts commit 6bf24dc.
Above fix is not correct and caused memory leak issue.

Fixes: 6bf24dc ("net:tipc: Fix a double free in tipc_sk_mcast_rcv")
Acked-by: Jon Maloy <jmaloy@redhat.com>
Acked-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
Signed-off-by: Hoang Le <hoang.h.le@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Hoang Le authored and gregkh committed Jun 3, 2021
1 parent 2f2ab04 commit 5875860
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/tipc/socket.c
Expand Up @@ -1265,7 +1265,10 @@ void tipc_sk_mcast_rcv(struct net *net, struct sk_buff_head *arrvq,
spin_lock_bh(&inputq->lock);
if (skb_peek(arrvq) == skb) {
skb_queue_splice_tail_init(&tmpq, inputq);
__skb_dequeue(arrvq);
/* Decrease the skb's refcnt as increasing in the
* function tipc_skb_peek
*/
kfree_skb(__skb_dequeue(arrvq));
}
spin_unlock_bh(&inputq->lock);
__skb_queue_purge(&tmpq);
Expand Down

0 comments on commit 5875860

Please sign in to comment.