diff options
| author | Phil Sutter <phil@nwl.cc> | 2024-09-12 14:21:33 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-10-17 15:21:14 +0200 |
| commit | 8ae12602d99d46ca5e3ed3d5a180ba277db04340 (patch) | |
| tree | d8dacacb14ef7a3d89f06313fd009373cfbcf873 /net/netfilter | |
| parent | b600ccc041853f871c333b021d6f2aae88750fb0 (diff) | |
| download | linux-8ae12602d99d46ca5e3ed3d5a180ba277db04340.tar.gz linux-8ae12602d99d46ca5e3ed3d5a180ba277db04340.tar.bz2 linux-8ae12602d99d46ca5e3ed3d5a180ba277db04340.zip | |
netfilter: nf_tables: Keep deleted flowtable hooks until after RCU
[ Upstream commit 642c89c475419b4d0c0d90e29d9c1a0e4351f379 ]
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: 3f0465a9ef02 ("netfilter: nf_tables: dynamically allocate hooks per net_device in flowtables")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/netfilter')
| -rw-r--r-- | net/netfilter/nf_tables_api.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index a68b2193393c..ed09b1fdda16 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -8619,7 +8619,7 @@ static void nf_tables_flowtable_destroy(struct nft_flowtable *flowtable) flowtable->data.type->setup(&flowtable->data, hook->ops.dev, FLOW_BLOCK_UNBIND); list_del_rcu(&hook->list); - kfree(hook); + kfree_rcu(hook, rcu); } kfree(flowtable->name); module_put(flowtable->data.type->owner); |
