From: Florian Westphal <fw@strlen.de>
To: Ziyang Xuan <william.xuanziyang@huawei.com>
Cc: pablo@netfilter.org, kadlec@netfilter.org, fw@strlen.de,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft v2] netfilter: nf_tables: Fix pertential data-race in __nft_flowtable_type_get()
Date: Wed, 3 Apr 2024 10:01:44 +0200 [thread overview]
Message-ID: <20240403080144.GC26310@breakpoint.cc> (raw)
In-Reply-To: <20240403072204.2139712-1-william.xuanziyang@huawei.com>
Ziyang Xuan <william.xuanziyang@huawei.com> wrote:
> nft_unregister_flowtable_type() within nf_flow_inet_module_exit() can
> concurrent with __nft_flowtable_type_get() within nf_tables_newflowtable().
> And thhere is not any protection when iterate over nf_tables_flowtables
> list in __nft_flowtable_type_get(). Therefore, there is pertential
> data-race of nf_tables_flowtables list entry.
>
> Use list_for_each_entry_rcu() to iterate over nf_tables_flowtables list
> in __nft_flowtable_type_get(), and use rcu_read_lock() in the caller
> nft_flowtable_type_get() to protect the entire type query process.
Reviewed-by: Florian Westphal <fw@strlen.de>
Would you be so kind to send followup patches for the other two types
Pablo pointed out?
static LIST_HEAD(nf_tables_expressions);
static LIST_HEAD(nf_tables_objects);
It looks like they have same issue.
Thanks!
next prev parent reply other threads:[~2024-04-03 8:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-03 7:22 [PATCH nft v2] netfilter: nf_tables: Fix pertential data-race in __nft_flowtable_type_get() Ziyang Xuan
2024-04-03 8:01 ` Florian Westphal [this message]
2024-04-03 8:30 ` Ziyang Xuan (William)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240403080144.GC26310@breakpoint.cc \
--to=fw@strlen.de \
--cc=kadlec@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=william.xuanziyang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.