Patch "netfilter: ctnetlink: fix possible refcount leak in ctnetlink_create_conntrack()" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    netfilter: ctnetlink: fix possible refcount leak in ctnetlink_create_conntrack()

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     netfilter-ctnetlink-fix-possible-refcount-leak-in-ct.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 1f55fe0ea27502e358baa4fcd7525f1f92b66d38
Author: Hangyu Hua <hbh25y@xxxxxxxxx>
Date:   Fri Feb 10 15:17:30 2023 +0800

    netfilter: ctnetlink: fix possible refcount leak in ctnetlink_create_conntrack()
    
    [ Upstream commit ac4893980bbe79ce383daf9a0885666a30fe4c83 ]
    
    nf_ct_put() needs to be called to put the refcount got by
    nf_conntrack_find_get() to avoid refcount leak when
    nf_conntrack_hash_check_insert() fails.
    
    Fixes: 7d367e06688d ("netfilter: ctnetlink: fix soft lockup when netlink adds new entries (v2)")
    Signed-off-by: Hangyu Hua <hbh25y@xxxxxxxxx>
    Acked-by: Florian Westphal <fw@xxxxxxxxx>
    Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index bc6f0c8874f81..4747daf901e71 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -2086,12 +2086,15 @@ ctnetlink_create_conntrack(struct net *net,
 
 	err = nf_conntrack_hash_check_insert(ct);
 	if (err < 0)
-		goto err2;
+		goto err3;
 
 	rcu_read_unlock();
 
 	return ct;
 
+err3:
+	if (ct->master)
+		nf_ct_put(ct->master);
 err2:
 	rcu_read_unlock();
 err1:



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux