public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Natarajan KV <natarajankv91@gmail.com>
Cc: stable@vger.kernel.org, pablo@netfilter.org,
	kadlec@netfilter.org, fw@strlen.de
Subject: Re: [PATCH v2] netfilter: nft_set_pipapo: move clone allocation to insert/removal path
Date: Wed, 4 Mar 2026 16:12:45 +0100	[thread overview]
Message-ID: <2026030421-grunt-raft-15f0@gregkh> (raw)
In-Reply-To: <69a84adc.050a0220.1cea47.3011@mx.google.com>

On Wed, Mar 04, 2026 at 07:08:12AM -0800, Natarajan KV wrote:
> Move pipapo_clone() from the commit/abort callbacks to the
> insert and removal paths via pipapo_maybe_clone(), which creates
> the working copy on demand and can propagate allocation failures.
> 
> Previously, pipapo_clone() was called from nft_pipapo_commit() and
> nft_pipapo_abort() which return void, making it impossible to
> report allocation failures. When pipapo_clone() failed during abort,
> the stale clone persisted with dirty == true, causing subsequent
> commits to promote a clone containing freed element references --
> a use-after-free.
> 
> With this change:
>  - pipapo_maybe_clone() allocates the clone lazily on first insert,
>    deactivate, walk(UPDATE), or remove. Allocation failure returns
>    NULL and propagates -ENOMEM to the caller.
>  - nft_pipapo_commit() simply swaps clone to match and sets clone
>    to NULL. No allocation needed.
>  - nft_pipapo_abort() simply frees the clone and sets it to NULL.
>    No allocation needed.
>  - The dirty flag is removed; clone != NULL indicates pending changes.
>  - nft_pipapo_init() no longer pre-allocates a clone.
> 
> This is a backport adaptation of the mainline on-demand clone refactor
> series from commit a590f4760922 ("netfilter: nft_set_pipapo: move
> prove_locking helper around") through commit 532aec7e878b
> ("netfilter: nft_set_pipapo: remove dirty flag") to the 6.6.x
> stable tree, preserving the 6.6.x function signatures and API
> conventions.


I would prefer to take the backport of these 6 patches.  That's not many
at all, we've taken series much much larger than that in the past.  That
way we can properly track and document exactly what commits get
backported to where, to make fixes and bug tracking easier.

So can you send the full series and not just one patch?

thanks,

greg k-h

  reply	other threads:[~2026-03-04 15:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-04 13:38 [PATCH] netfilter: nft_set_pipapo: clear dirty flag on abort/commit clone failure Natarajan KV
2026-03-04 13:47 ` Greg KH
2026-03-04 13:50 ` Florian Westphal
2026-03-04 15:08 ` [PATCH v2] netfilter: nft_set_pipapo: move clone allocation to insert/removal path Natarajan KV
2026-03-04 15:12   ` Greg KH [this message]
2026-03-04 16:54     ` [PATCH v3 6.6.y 0/8] " Natarajan KV
2026-03-04 16:54       ` [PATCH v3 6.6.y 1/8] netfilter: nft_set_pipapo: move prove_locking helper around Natarajan KV
2026-03-04 16:54       ` [PATCH v3 6.6.y 2/8] netfilter: nft_set_pipapo: make pipapo_clone helper return NULL Natarajan KV
2026-03-04 16:55       ` [PATCH v3 6.6.y 3/8] netfilter: nft_set_pipapo: prepare destroy function for on-demand clone Natarajan KV
2026-03-04 16:55       ` [PATCH v3 6.6.y 4/8] netfilter: nft_set_pipapo: prepare walk " Natarajan KV
2026-03-04 16:55       ` [PATCH v3 6.6.y 5/8] netfilter: nft_set_pipapo: merge deactivate helper into caller Natarajan KV
2026-03-04 16:55       ` [PATCH v3 6.6.y 6/8] netfilter: nft_set_pipapo: prepare pipapo_get helper for on-demand clone Natarajan KV
2026-03-04 16:55       ` [PATCH v3 6.6.y 7/8] netfilter: nft_set_pipapo: move cloning of match info to insert/removal path Natarajan KV
2026-03-04 16:55       ` [PATCH v3 6.6.y 8/8] netfilter: nft_set_pipapo: remove dirty flag Natarajan KV
2026-03-04 21:30       ` [PATCH v3 6.6.y 0/8] netfilter: nft_set_pipapo: move clone allocation to insert/removal path 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=2026030421-grunt-raft-15f0@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=fw@strlen.de \
    --cc=kadlec@netfilter.org \
    --cc=natarajankv91@gmail.com \
    --cc=pablo@netfilter.org \
    --cc=stable@vger.kernel.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