summaryrefslogtreecommitdiff
path: root/net/tipc
diff options
context:
space:
mode:
authorHoang Le <hoang.h.le@dektech.com.au>2021-05-14 08:23:03 +0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-03 08:22:07 +0200
commit3917fe8933b3abfcd9f40bc354ec6dbfcdf61c1c (patch)
tree46c1f902b732c1705652b860b1a3f79f149966c7 /net/tipc
parent7d8d3059bbbaf3506445fe1df3ffe4ddc93993e2 (diff)
Revert "net:tipc: Fix a double free in tipc_sk_mcast_rcv"
commit 75016891357a628d2b8acc09e2b9b2576c18d318 upstream. This reverts commit 6bf24dc0cc0cc43b29ba344b66d78590e687e046. Above fix is not correct and caused memory leak issue. Fixes: 6bf24dc0cc0c ("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>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/socket.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index 0e5bb03c6425..3ad9158ecf30 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -763,7 +763,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);