Patch "netfilter: nf_tables: netlink notifier might race to release objects" has been added to the 6.0-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: nf_tables: netlink notifier might race to release objects

to the 6.0-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-nf_tables-netlink-notifier-might-race-to-r.patch
and it can be found in the queue-6.0 subdirectory.

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



commit 2e20e22894b9ca91f8e4f3b5302b98334da18649
Author: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
Date:   Wed Oct 26 09:52:36 2022 +0200

    netfilter: nf_tables: netlink notifier might race to release objects
    
    [ Upstream commit d4bc8271db21ea9f1c86a1ca4d64999f184d4aae ]
    
    commit release path is invoked via call_rcu and it runs lockless to
    release the objects after rcu grace period. The netlink notifier handler
    might win race to remove objects that the transaction context is still
    referencing from the commit release path.
    
    Call rcu_barrier() to ensure pending rcu callbacks run to completion
    if the list of transactions to be destroyed is not empty.
    
    Fixes: 6001a930ce03 ("netfilter: nftables: introduce table ownership")
    Reported-by: syzbot+8f747f62763bc6c32916@xxxxxxxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 5897afd12466..cc598504bc10 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -10030,6 +10030,8 @@ static int nft_rcv_nl_event(struct notifier_block *this, unsigned long event,
 	nft_net = nft_pernet(net);
 	deleted = 0;
 	mutex_lock(&nft_net->commit_mutex);
+	if (!list_empty(&nf_tables_destroy_list))
+		rcu_barrier();
 again:
 	list_for_each_entry(table, &nft_net->tables, list) {
 		if (nft_table_has_owner(table) &&



[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