Skip to content

Commit 4ffcf5c

Browse files
committed
netfilter: nf_tables: use rcu chain hook list iterator from netlink dump 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 <phil@nwl.cc> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent e1f1ee0 commit 4ffcf5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,7 @@ static int nft_dump_basechain_hook(struct sk_buff *skb, int family,
18491849
if (!hook_list)
18501850
hook_list = &basechain->hook_list;
18511851

1852-
list_for_each_entry(hook, hook_list, list) {
1852+
list_for_each_entry_rcu(hook, hook_list, list) {
18531853
if (!first)
18541854
first = hook;
18551855

0 commit comments

Comments
 (0)