netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Paolo Abeni <pabeni@redhat.com>, Andrea Mayer <andrea.mayer@uniroma2.it>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	David Lebrun <david.lebrun@uclouvain.be>,
	Paolo Lungaroni <paolo.lungaroni@uniroma2.it>,
	David Ahern <dsahern@kernel.org>,
	netdev@vger.kernel.org, stefano.salsano@uniroma2.it
Subject: Re: [PATCH net] seg6: fix route leak for encap routes
Date: Thu, 18 Dec 2025 15:28:42 +0100	[thread overview]
Message-ID: <364fe528-87a1-4bc3-bcff-7fa73eb9eb44@6wind.com> (raw)
In-Reply-To: <3394763c-c546-4c80-8157-98467c8e8698@redhat.com>

Le 18/12/2025 à 11:35, Paolo Abeni a écrit :
> On 12/14/25 2:39 PM, Andrea Mayer wrote:
>> On Wed, 10 Dec 2025 18:00:39 +0100
>> Nicolas Dichtel <nicolas.dichtel@6wind.com> wrote:
>>> Le 10/12/2025 à 11:37, Andrea Mayer a écrit :
>>>> I've got your point. However, I'm still concerned about the implications of
>>>> using the *dev* field in the root lookup. This field has been ignored for this
>>>> purpose so far, so some existing configurations/scripts may need to be adapted
>>>> to work again. The adjustments made to the self-tests below show what might
>>>> happen.
>>> Yes, I was wondering how users use this *dev* arg. Maybe adding a new attribute,
>>> something like SEG6_IPTUNNEL_USE_NH_DEV will avoid any regressions.
>>>
>>
>> IMHO using a new attribute seems to be a safer approach.
I agree.

> 
> Given the functional implication I suggest using a new attribute. Given
> that I also suggest targeting net-next for the next revision of this patch.
I see this as a bug. A route such as
cafe::1  encap seg6 mode encap segs 1 [ fc00:21:100::6046 ] dev veth0
with veth0 completely ignored but mandatory is buggy.

> 
>>>>> diff --git a/net/ipv6/seg6_iptunnel.c b/net/ipv6/seg6_iptunnel.c
>>>>> index 3e1b9991131a..9535aea28357 100644
>>>>> --- a/net/ipv6/seg6_iptunnel.c
>>>>> +++ b/net/ipv6/seg6_iptunnel.c
>>>>> @@ -484,6 +484,12 @@ static int seg6_input_core(struct net *net, struct sock *sk,
>>>>>  	 * now and use it later as a comparison.
>>>>>  	 */
>>>>>  	lwtst = orig_dst->lwtstate;
>>>>> +	if (orig_dst->dev) {
> 
> Here you should probably use dst_dev_rcu(), under the rcu lock, avoiding
> touching dev twice.
Ok.

Thanks,
Nicolas

  reply	other threads:[~2025-12-18 14:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-08 10:24 [PATCH net] seg6: fix route leak for encap routes Nicolas Dichtel
2025-12-10 10:37 ` Andrea Mayer
2025-12-10 17:00   ` Nicolas Dichtel
2025-12-14 13:39     ` Andrea Mayer
2025-12-18 10:35       ` Paolo Abeni
2025-12-18 14:28         ` Nicolas Dichtel [this message]
2025-12-18 14:24       ` Nicolas Dichtel

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=364fe528-87a1-4bc3-bcff-7fa73eb9eb44@6wind.com \
    --to=nicolas.dichtel@6wind.com \
    --cc=andrea.mayer@uniroma2.it \
    --cc=davem@davemloft.net \
    --cc=david.lebrun@uclouvain.be \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=paolo.lungaroni@uniroma2.it \
    --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;
as well as URLs for NNTP newsgroup(s).