mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yuya Kusakabe <yuya.kusakabe@gmail.com>
To: Andrea Mayer <andrea.mayer@uniroma2.it>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	stefano.salsano@uniroma2.it
Subject: Re: [PATCH net-next 1/2] seg6: skip the route refcount in seg6_lookup_any_nexthop()
Date: Fri,  9 Oct 2026 14:39:49 +0900	[thread overview]
Message-ID: <20261009053832.seg6-lookup-noref-v1-reply-dac23740@gmail.com> (raw)
In-Reply-To: <20261009024341.687e7226cd6abca80e779fda@uniroma2.it>

On Fri, Oct 09, 2026 at 02:43:41AM +0200, Andrea Mayer wrote:
> One possibility would be to split it into two functions, conceptually
> similar to ip6_route_output_flags() and ip6_route_output_flags_noref(): a
> noref primitive for the callers in the seg6local input path, and a
> refcounted wrapper around the primitive, which bpf_push_seg6_encap() would
> call. The split would put the contract in the name and fix the
> use-after-free above.

Thanks for reproducing it with KASAN.  I agree, and v2 will do that
split: seg6_lookup_nexthop() will still attach a refcounted dst to the
skb for filter.c, and only the seg6local input actions will use the
noref variant.  The lifetime of the dst from the exported helper then
does not change, so its declarations need no update.  The commit
message of patch 1/2 will also drop the claim that every caller runs
in the receive path.

pw-bot: cr

  reply	other threads:[~2026-10-09  5:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05  5:31 [PATCH net-next 0/2] seg6: skip route refcounts in seg6local lookups Yuya Kusakabe
2026-10-05  5:31 ` [PATCH net-next 1/2] seg6: skip the route refcount in seg6_lookup_any_nexthop() Yuya Kusakabe
2026-10-08  5:32   ` netdev-bot+sashiko
2026-10-09  0:43   ` Andrea Mayer
2026-10-09  5:39     ` Yuya Kusakabe [this message]
2026-10-05  5:31 ` [PATCH net-next 2/2] seg6: skip the route refcount in seg6local IPv4 lookups Yuya Kusakabe

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=20261009053832.seg6-lookup-noref-v1-reply-dac23740@gmail.com \
    --to=yuya.kusakabe@gmail.com \
    --cc=andrea.mayer@uniroma2.it \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stefano.salsano@uniroma2.it \
    /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

all inboxes | Powered by JetHome®