From: Jozsef Kadlecsik <kadlec@netfilter.org>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, Lion Ackermann <nnamrec@gmail.com>
Subject: Re: [PATCH 1/1] netfilter: ipset: Fix race between namespace cleanup and gc in the list:set type
Date: Thu, 6 Jun 2024 08:44:05 +0200 (CEST) [thread overview]
Message-ID: <e35a8727-aea9-0f16-c344-74b301728482@netfilter.org> (raw)
In-Reply-To: <ZmDlqGtGv_LdMj6k@calendula>
Hi Pablo,
On Thu, 6 Jun 2024, Pablo Neira Ayuso wrote:
> On Tue, Jun 04, 2024 at 03:58:03PM +0200, Jozsef Kadlecsik wrote:
> [...]
> > @@ -424,14 +428,8 @@ static void
> > list_set_destroy(struct ip_set *set)
> > {
> > struct list_set *map = set->data;
> > - struct set_elem *e, *n;
> >
> > - list_for_each_entry_safe(e, n, &map->members, list) {
> > - list_del(&e->list);
> > - ip_set_put_byindex(map->net, e->id);
> > - ip_set_ext_destroy(set, e);
> > - kfree(e);
> > - }
> > + BUG_ON(!list_empty(&map->members));
>
> It would probably be better to turn this is WARN_ON_ONCE, such as:
>
> WARN_ON_ONCE(!list_empty(&map->members);
>
> BUG_ON is only allowed to be used in very particular cases these days.
>
> I can update this patch if you are fine with it.
Yes, please update the patch. Thanks for noticing it!
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
next prev parent reply other threads:[~2024-06-06 6:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 13:58 [PATCH 0/1] ipset patch for nf tree Jozsef Kadlecsik
2024-06-04 13:58 ` [PATCH 1/1] netfilter: ipset: Fix race between namespace cleanup and gc in the list:set type Jozsef Kadlecsik
2024-06-05 22:24 ` Pablo Neira Ayuso
2024-06-06 6:44 ` Jozsef Kadlecsik [this message]
2024-06-11 16:45 ` Pablo Neira Ayuso
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=e35a8727-aea9-0f16-c344-74b301728482@netfilter.org \
--to=kadlec@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=nnamrec@gmail.com \
--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).