From: Florian Westphal <fw@strlen.de>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: netfilter-devel@vger.kernel.org, Seesee <cjc000013@gmail.com>
Subject: Re: [PATCH nf] netfilter: nft_set_pipapo: don't leak bad clone into future transaction
Date: Wed, 17 Jun 2026 10:02:26 +0200 [thread overview]
Message-ID: <ajJUklUUmvafRVi9@strlen.de> (raw)
In-Reply-To: <20260617075123.7a62e22c@elisabeth>
Stefano Brivio <sbrivio@redhat.com> wrote:
> On Tue, 16 Jun 2026 21:19:34 +0200
> Florian Westphal <fw@strlen.de> wrote:
>
> > On memory allocation failure the cloned nft_pipapo_match can enter a bad
> > state:
> > - some fields can have their lookup tables resized while others did
> > not
> > - bits might have been toggled
> > - scratch map can be undersized which also means m->bsize_max can be
> > lower than what is required
>
> If I understand it correctly, this is about pipapo_realloc_scratch()
> failing to allocate memory for per-CPU scratch maps but
> pipapo_maybe_clone() succeeding, right?
Yes.
> I don't see anything wrong with this approach, but I guess there might
> be a more obvious alternative, even though I didn't really think this
> through: undo what we did in nft_pipapo_insert() up to that point
> (perhaps calling nft_pipapo_delete() with a particular argument).
Yes, that is the laternative, return the cloned copy to a state where it
is identical to the state it had at function start.
> I can try to get to this in the next few days (I would have some ideas
> about testing, see below), but I suppose we want a fix quickly if that's
> really the case so I'm actually fine with this, with one nit, also
> reported below.
I don't mind, this can wait if you prefer to undo the state.
prev parent reply other threads:[~2026-06-17 8:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 19:19 [PATCH nf] netfilter: nft_set_pipapo: don't leak bad clone into future transaction Florian Westphal
2026-06-17 5:51 ` Stefano Brivio
2026-06-17 8:02 ` Florian Westphal [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=ajJUklUUmvafRVi9@strlen.de \
--to=fw@strlen.de \
--cc=cjc000013@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=sbrivio@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox