From fc9e81c1a18ab86e1ef58e09710560d1b4d230ce Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 13 Dec 2023 15:02:36 +0000 Subject: [PATCH] ANDROID: Fix up merge issues in 6.1.64 in net/netfilter/nf_tables_api.c When merging 6.1.64 into the 'android14-6.1-lts' branch, which contained a subset of the upstream changes in nf_tables_api.c, the merge got confused and did it "backwards", backing out some of the needed fixes. This happens when we cherry-pick a subset of the upstream fixes into the 'android14-6.1' branch and then merge the LTS changes. Fixes: f1bc13cb9d85 ("Merge 6.1.64 into android14-6.1-lts") Change-Id: I8f510160f4ca43a05be265173daccb962531b1b4 Signed-off-by: Greg Kroah-Hartman --- net/netfilter/nf_tables_api.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 9a39cff34f99..421211eba838 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -9274,12 +9274,11 @@ void nft_trans_gc_queue_sync_done(struct nft_trans_gc *trans) struct nft_trans_gc *nft_trans_gc_catchall_async(struct nft_trans_gc *gc, unsigned int gc_seq) { - struct nft_set_elem_catchall *catchall, *next; + struct nft_set_elem_catchall *catchall; const struct nft_set *set = gc->set; - struct nft_elem_priv *elem_priv; struct nft_set_ext *ext; - list_for_each_entry_safe(catchall, next, &set->catchall_list, list) { + list_for_each_entry_rcu(catchall, &set->catchall_list, list) { ext = nft_set_elem_ext(set, catchall->elem); if (!nft_set_elem_expired(ext)) @@ -9293,17 +9292,7 @@ dead_elem: if (!gc) return NULL; - elem_priv = catchall->elem; - if (sync) { - struct nft_set_elem elem = { - .priv = elem_priv, - }; - - nft_setelem_data_deactivate(gc->net, gc->set, &elem); - nft_setelem_catchall_destroy(catchall); - } - - nft_trans_gc_elem_add(gc, elem_priv); + nft_trans_gc_elem_add(gc, catchall->elem); } return gc;