netfilter: nf_tables: use correct lock to protect gc_list
Subsystems (2)
Pablo Neira Ayuso
maintainerPATCH 1/1 netfilter: nf_tables: use correct lock to protect gc_list
Use nf_tables_gc_list_lock spinlock, not nf_tables_destroy_list_lock to protect the destroy list.
Fixes 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- net/netfilter/nf_tables_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nf_tables_api.c +2 -2
@@ -9456,9 +9456,9 @@ static void nft_trans_gc_work(struct work_struct *work)struct nft_trans_gc *trans, *next;LIST_HEAD (trans_gc_list); -spin_lock (&nf_tables_destroy_list_lock); +spin_lock (&nf_tables_gc_list_lock);list_splice_init (&nf_tables_gc_list, &trans_gc_list); -spin_unlock (&nf_tables_destroy_list_lock); +spin_unlock (&nf_tables_gc_list_lock);list_for_each_entry_safe (trans, next, &trans_gc_list, list) {list_del (&trans->list);
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerQuoted 2 lines · Pablo Neira Ayuso
Use
nf_tables_gc_list_lockspinlock, notnf_tables_destroy_list_lockto protect the destroy list.
For the record, this text should be instead:
... to protect the gc_list.
Quoted 25 lines
Fixes 5f68718b34a5 ("netfilter: nf_tables: GC transaction API to avoid race with control plane")Signed-off-by Pablo Neira Ayuso <[email protected]>--- net/netfilter/nf_tables_api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)net/netfilter/nf_tables_api.c +2
-2@@ -9456,9 +9456,9 @@ static void nft_trans_gc_work(struct work_struct *work)struct nft_trans_gc *trans, *next;LIST_HEAD (trans_gc_list); -spin_lock (&nf_tables_destroy_list_lock); +spin_lock (&nf_tables_gc_list_lock);list_splice_init (&nf_tables_gc_list, &trans_gc_list); -spin_unlock (&nf_tables_destroy_list_lock); +spin_unlock (&nf_tables_gc_list_lock);list_for_each_entry_safe (trans, next, &trans_gc_list, list) {list_del (&trans->list);Signature · 1 line
2.30.2