[Devel] [PATCH RH7 3/3] netfilter: nf_tables: use list_entry_rcu in nft_do_chain

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Wed Nov 1 13:46:55 MSK 2023


We already use list_for_each_entry_continue_rcu two lines below, it is
thus logical to also use list_entry_rcu there.

https://virtuozzo.atlassian.net/browse/PSBM-150147
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 net/netfilter/nf_tables_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_tables_core.c b/net/netfilter/nf_tables_core.c
index 81ccbca32fa8..2fc814445af1 100644
--- a/net/netfilter/nf_tables_core.c
+++ b/net/netfilter/nf_tables_core.c
@@ -141,7 +141,7 @@ nft_do_chain(struct nft_pktinfo *pkt, const struct nf_hook_ops *ops)
 		nft_trace_init(&info, pkt, &regs.verdict, basechain);
 do_chain:
 	rulenum = 0;
-	rule = list_entry(&chain->rules, struct nft_rule, list);
+	rule = list_entry_rcu(&chain->rules, struct nft_rule, list);
 next_rule:
 	regs.verdict.code = NFT_CONTINUE;
 	list_for_each_entry_continue_rcu(rule, &chain->rules, list) {
-- 
2.41.0



More information about the Devel mailing list