From: Jozsef Kadlecsik <kadlec@netfilter.org>
To: Pablo Neira Ayuso <pablo@netfilter.org>,
Alexander Maltsev <keltar.gw@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH] netfilter: ipset: Add list flush to cancel_gc
Date: Mon, 22 Apr 2024 10:32:23 +0200 (CEST) [thread overview]
Message-ID: <4b7724e0-f54e-ecc1-c992-e117b571b17b@netfilter.org> (raw)
In-Reply-To: <20240417135141.18288-1-keltar.gw@gmail.com>
On Wed, 17 Apr 2024, Alexander Maltsev wrote:
> Flushing list in cancel_gc drops references to other lists right away,
> without waiting for RCU to destroy list. Fixes race when referenced
> ipsets can't be destroyed while referring list is scheduled for destroy.
>
> Signed-off-by: Alexander Maltsev <keltar.gw@gmail.com>
> ---
> kernel/net/netfilter/ipset/ip_set_list_set.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/kernel/net/netfilter/ipset/ip_set_list_set.c b/kernel/net/netfilter/ipset/ip_set_list_set.c
> index cc2e5b9..0d15f4f 100644
> --- a/kernel/net/netfilter/ipset/ip_set_list_set.c
> +++ b/kernel/net/netfilter/ipset/ip_set_list_set.c
> @@ -552,6 +552,9 @@ list_set_cancel_gc(struct ip_set *set)
>
> if (SET_WITH_TIMEOUT(set))
> timer_shutdown_sync(&map->gc);
> +
> + /* Flush list to drop references to other ipsets */
> + list_set_flush(set);
> }
>
> static const struct ip_set_type_variant set_variant = {
Looks good, Pablo please apply to the nf-next tree. Thanks!
Acked-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Best regards,
Jozsef
--
E-mail : kadlec@blackhole.kfki.hu, kadlecsik.jozsef@wigner.hu
PGP key : https://wigner.hu/~kadlec/pgp_public_key.txt
Address : Wigner Research Centre for Physics
H-1525 Budapest 114, POB. 49, Hungary
prev parent reply other threads:[~2024-04-22 8:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 13:51 [PATCH] netfilter: ipset: Add list flush to cancel_gc Alexander Maltsev
2024-04-22 8:32 ` Jozsef Kadlecsik [this message]
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=4b7724e0-f54e-ecc1-c992-e117b571b17b@netfilter.org \
--to=kadlec@netfilter.org \
--cc=keltar.gw@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).