All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>
To: <netdev-bot+sashiko@kernel.org>
Cc: <netdev@vger.kernel.org>, <bpf@vger.kernel.org>,
	<daniel@iogearbox.net>, <andrii@kernel.org>, <eddyz87@gmail.com>,
	<memxor@gmail.com>, <josef@toxicpanda.com>, <mason@kernel.org>,
	<steffen.klassert@secunet.com>, <herbert@gondor.apana.org.au>,
	<kuba@kernel.org>
Subject: Re: [PATCH net] net: free the policies if a socket's clone fails late
Date: Sun, 18 Oct 2026 15:31:13 +0000	[thread overview]
Message-ID: <DM82LW742MNX.XRJ64BXF8A8A@gmail.com> (raw)
In-Reply-To: <179228971515.3135.11305942271655228187@kernel.org>

On Sat, Oct 17, 2026 at 07:15 PM netdev-bot+sashiko@kernel.org <netdev-bot+sashiko@kernel.org> wrote:
> [Severity: High]
> Can the same policy leak still happen through the branch just above this,
> when xfrm_sk_clone_policy() itself fails partway?

yeah. It's an old bug, not from this patch. It needs both policies on
the listener and an allocation failure on the second clone.

> Would it be safe to call xfrm_sk_free_policy(newsk) in that sub-case, for
> example in an else branch of the !is_charged check? Alternatively,
> __xfrm_sk_clone_policy() could roll back the already cloned policy on
> partial failure.

Yes.
Somebody would need to send a followup.

      reply	other threads:[~2026-10-18 15:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17  1:39 [PATCH net] net: free the policies if a socket's clone fails late Alexei Starovoitov
2026-10-17  1:44 ` netdev-bot+sinfo
2026-10-17  4:04 ` kuniyu
2026-10-18  1:39 ` sashiko-bot
2026-10-18  2:15 ` netdev-bot+sashiko
2026-10-18 15:31   ` Alexei Starovoitov [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=DM82LW742MNX.XRJ64BXF8A8A@gmail.com \
    --to=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=josef@toxicpanda.com \
    --cc=kuba@kernel.org \
    --cc=mason@kernel.org \
    --cc=memxor@gmail.com \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.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.