Patch "netfilter: nf_tables: mark newset as dead on transaction abort" has been added to the 5.10-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: mark newset as dead on transaction abort

to the 5.10-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-mark-newset-as-dead-on-transacti.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 4a96a0394b23a2eb8a200d12541f581352c82b6c
Author: Florian Westphal <fw@xxxxxxxxx>
Date:   Mon Nov 27 11:00:37 2023 +0100

    netfilter: nf_tables: mark newset as dead on transaction abort
    
    [ Upstream commit 08e4c8c5919fd405a4d709b4ba43d836894a26eb ]
    
    If a transaction is aborted, we should mark the to-be-released NEWSET dead,
    just like commit path does for DEL and DESTROYSET commands.
    
    In both cases all remaining elements will be released via
    set->ops->destroy().
    
    The existing abort code does NOT post the actual release to the work queue.
    Also the entire __nf_tables_abort() function is wrapped in gc_seq
    begin/end pair.
    
    Therefore, async gc worker will never try to release the pending set
    elements, as gc sequence is always stale.
    
    It might be possible to speed up transaction aborts via work queue too,
    this would result in a race and a possible use-after-free.
    
    So fix this before it becomes an issue.
    
    Fixes: 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
    Signed-off-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_tables_api.c b/net/netfilter/nf_tables_api.c
index 4d1a009dab45..6e91c743a4d4 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -8840,6 +8840,7 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)
 				nft_trans_destroy(trans);
 				break;
 			}
+			nft_trans_set(trans)->dead = 1;
 			list_del_rcu(&nft_trans_set(trans)->list);
 			break;
 		case NFT_MSG_DELSET:




[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