Skip to content

Commit

Permalink
netfilter: nf_tables: use rcu chain hook list iterator from netlink d…
Browse files Browse the repository at this point in the history
…ump path

Lockless iteration over hook list is possible from netlink dump path,
use rcu variant to iterate over the hook list as is done with flowtable
hooks.

Fixes: b9703ed ("netfilter: nf_tables: support for adding new devices to an existing netdev chain")
Reported-by: Phil Sutter <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
  • Loading branch information
ummakynes committed Sep 26, 2024
1 parent e1f1ee0 commit 4ffcf5c
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 @@ -1849,7 +1849,7 @@ static int nft_dump_basechain_hook(struct sk_buff *skb, int family,
if (!hook_list)
hook_list = &basechain->hook_list;

list_for_each_entry(hook, hook_list, list) {
list_for_each_entry_rcu(hook, hook_list, list) {
if (!first)
first = hook;

Expand Down

0 comments on commit 4ffcf5c

Please sign in to comment.