Skip to content

Commit

Permalink
netfilter: nf_tables: skip set commit for deleted/destroyed sets
Browse files Browse the repository at this point in the history
commit 7315dc1 upstream.

NFT_MSG_DELSET deactivates all elements in the set, skip
set->ops->commit() to avoid the unnecessary clone (for the pipapo case)
as well as the sync GC cycle, which could deactivate again expired
elements in such set.

Fixes: 5f68718 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
Reported-by: Kevin Rich <kevinrich1337@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
ummakynes authored and gregkh committed Jan 5, 2024
1 parent e904e81 commit b7f1c01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -9849,7 +9849,7 @@ static void nft_set_commit_update(struct list_head *set_update_list)
list_for_each_entry_safe(set, next, set_update_list, pending_update) {
list_del_init(&set->pending_update);

if (!set->ops->commit)
if (!set->ops->commit || set->dead)
continue;

set->ops->commit(set);
Expand Down

0 comments on commit b7f1c01

Please sign in to comment.