Skip to content

Commit 642c89c

Browse files
Phil Sutterummakynes
authored andcommitted
netfilter: nf_tables: Keep deleted flowtable hooks until after RCU
Documentation of list_del_rcu() warns callers to not immediately free the deleted list item. While it seems not necessary to use the RCU-variant of list_del() here in the first place, doing so seems to require calling kfree_rcu() on the deleted item as well. Fixes: 3f0465a ("netfilter: nf_tables: dynamically allocate hooks per net_device in flowtables") Signed-off-by: Phil Sutter <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent aa75876 commit 642c89c

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
@@ -9207,7 +9207,7 @@ static void nf_tables_flowtable_destroy(struct nft_flowtable *flowtable)
92079207
flowtable->data.type->setup(&flowtable->data, hook->ops.dev,
92089208
FLOW_BLOCK_UNBIND);
92099209
list_del_rcu(&hook->list);
9210-
kfree(hook);
9210+
kfree_rcu(hook, rcu);
92119211
}
92129212
kfree(flowtable->name);
92139213
module_put(flowtable->data.type->owner);

0 commit comments

Comments
 (0)