FAILED: patch "[PATCH] netfilter: nf_tables: adapt set backend to use GC transaction" failed to apply to 5.10-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x f6c383b8c31a93752a52697f8430a71dcbc46adf
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023081214-unsteady-tablet-4621@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^..
Possible dependencies:
f6c383b8c31a ("netfilter: nf_tables: adapt set backend to use GC transaction API") f718863aca46 ("netfilter: nft_set_rbtree: fix overlap expiration walk")212ed75dc5fb ("netfilter: nf_tables: integrate pipapo into commit protocol") 61ae320a29b0 ("netfilter: nft_set_rbtree: fix null deref on element insertion") 5d235d6ce75c ("netfilter: nft_set_rbtree: skip elements in transaction from garbage collection") c9e6978e2725 ("netfilter: nft_set_rbtree: Switch to node list walk for overlap detection") babc3dc9524f ("netfilter: nft_set_rbtree: overlap detection with element re-addition after deletion") 6fb721cf7818 ("netfilter: nf_tables: honor NLM_F_CREATE and NLM_F_EXCL in event notification") e189ae161dd7 ("netfilter: nf_tables: add position handle in event notification") ad9f151e560b ("netfilter: nf_tables: initialize set before expression setup") aaa31047a6d2 ("netfilter: nftables: add catch-all set element support")97c976d662fb ("netfilter: nftables: add helper function to validate set element data") e6ba7cb63b8a ("netfilter: nftables: add helper function to flush set elements") f8bb7889af58 ("netfilter: nftables: rename set element data activation/deactivation functions") 7dab8ee3b6e7 ("netfilter: nfnetlink: pass struct nfnl_info to batch callbacks") 797d49805ddc ("netfilter: nfnetlink: pass struct nfnl_info to rcu callbacks") a65553657174 ("netfilter: nfnetlink: add struct nfnl_info and pass it to callbacks") d59d2f82f984 ("netfilter: nftables: add nft_pernet() helper function")0854db2aaef3 ("netfilter: nf_tables: use net_generic infra for transaction data") ebfbe67568a7 ("netfilter: cttimeout: use net_generic infra")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f6c383b8c31a93752a52697f8430a71dcbc46adf Mon Sep 17 00:00:00 2001
From: Pablo Neira Ayuso <[email protected]>
Date: Wed, 9 Aug 2023 14:54:23 +0200
Subject: [PATCH] netfilter: nf_tables: adapt set backend to use GC transaction
API
Use the GC transaction API to replace the old and buggy gc API and the busy mark approach.
No set elements are removed from async garbage collection anymore, instead the _DEAD bit is set on so the set element is not visible from lookup path anymore. Async GC enqueues transaction work that might be aborted and retried later.
rbtree and pipapo set backends does not set on the _DEAD bit from the sync GC path since this runs in control plane path where mutex is held. In this case, set elements are deactivated, removed and then released via RCU callback, sync GC never fails.
net/netfilter/nf_tables_api.c +2 -5
@@ -6380,7 +6380,6 @@ static void nft_setelem_activate(struct net *net, struct nft_set *set,if (nft_setelem_is_catchall (set, elem)) {nft_set_elem_change_active (net, set, ext); -nft_set_elem_clear_busy (ext); }else { set->ops->activate (net, set, elem); }
@@ -6395,8 +6394,7 @@ static int nft_setelem_catchall_deactivate(const struct net *net,list_for_each_entry (catchall, &set->catchall_list, list) { ext =nft_set_elem_ext (set, catchall->elem); -if (!nft_is_active (net, ext) || -nft_set_elem_mark_busy (ext)) +if (!nft_is_active (net, ext))continue ;kfree (elem->priv);
@@ -7109,8 +7107,7 @@ static int nft_set_catchall_flush(const struct nft_ctx *ctx,list_for_each_entry_rcu (catchall, &set->catchall_list, list) { ext =nft_set_elem_ext (set, catchall->elem); -if (!nft_set_elem_active (ext, genmask) || -nft_set_elem_mark_busy (ext)) +if (!nft_set_elem_active (ext, genmask))continue ; elem.priv = catchall->elem;
net/netfilter/nft_set_hash.c +48 -29
140 lines not on this page · raw message
net/netfilter/nft_set_pipapo.c +37 -13
84 lines not on this page · raw message
net/netfilter/nft_set_rbtree.c +87 -57
232 lines not on this page · raw message