All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@nvidia.com>
To: Xia Yan <yanxia@cmss.chinamobile.com>
Cc: netdev@vger.kernel.org, dsahern@kernel.org, davem@davemloft.net,
	edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
	horms@kernel.org, linux-kernel@vger.kernel.org,
	kuniyu@google.com, xeb@mail.ru, yana06070@163.com,
	netdev-bot+sashiko@kernel.org
Subject: Re: [PATCH net-next v4] ip6_gre: fix changelink conflict checks for L2 tunnels
Date: Sun, 22 Nov 2026 14:35:55 +0200	[thread overview]
Message-ID: <20261122123555.GA2812544@shredder> (raw)
In-Reply-To: <179491056935.741041.1816208847037703396.ip6gre-v4@cmss.chinamobile.com>

On Tue, Nov 17, 2026 at 06:16:09PM +0800, Xia Yan wrote:
> ip6gre_changelink_common() calls ip6gre_tunnel_locate(), which only looks
> for ARPHRD_IP6GRE devices. This lets an ip6gretap or ip6erspan update
> create a duplicate L2 tunnel, or rejects a valid update because an
> unrelated L3 tunnel has the requested parameters. A duplicate can receive
> traffic intended for the original tunnel.
> 
> When the addresses, input key or link change, check for a conflict using
> dev->type, including updates to metadata devices.
> 
> A metadata device can be created with the same receive parameters as an
> existing ordinary device. Allow updates that leave those parameters
> unchanged, and keep the hash entry in place. Otherwise a TTL update can
> either fail because another entry matches first, or move the updated
> device to the head and change which device receives packets. Do this for
> both GRE and ERSPAN changelink.
> 
> Check conflicts and unregistering before applying encapsulation
> parameters. Leave the shared find helper, newlink, legacy ioctls and
> receive lookup unchanged.
> 
> Found during code review of the newlink and changelink duplicate checks.
> Reproduced under UML with an IPv6 underlay named under:
> 
>   ip link add tap1 type ip6gretap local fd26:106::1 \
>       remote fd26:106::2 key 100 dev under
>   ip link add tap2 type ip6gretap local fd26:106::1 \
>       remote fd26:106::2 key 200 dev under
>   ip link set tap1 up
>   ip link set tap2 up
>   ip link set tap2 type ip6gretap key 100
> 
> Before the fix, the last command succeeds and received frames move from
> tap1 to tap2. With the fix, it fails with EEXIST and tap2 is unchanged.
> Custom UML tests covered conflicting and valid updates, metadata
> overlaps, and receive interfaces for GRE, GRE TAP and ERSPAN. TTL,
> fwmark and output-key updates kept the same receive interface. Kernel
> selftests were not run.
> 
> Signed-off-by: Xia Yan <yanxia@cmss.chinamobile.com>
> ---
> 
> Notes (ip6gre-v4-mail):
>     Changes in v4:
>     - Check changed receive parameters for metadata devices too.
>     - Skip the duplicate lookup when receive parameters are unchanged.
>     - Keep unchanged receive parameters in place in the hash table for both
>       GRE and ERSPAN, so an update does not change receive priority.
>     - Rebase onto current net-next; keep the shared find helper unchanged.
>     
>     v3: https://lore.kernel.org/netdev/179455350258.84965.17518172977020586093.ip6gre-v3@cmss.chinamobile.com/
>     Review: https://lore.kernel.org/netdev/179489968486.3136.18372818760197436344@kernel.org/
>     
>     Tested on net-next 6ff4c5942a301675eb12e5b49d53a81e604624a1 with
>     W=1 UML builds. The main checks passed 194/194 assertions; eight
>     additional cases passed 92/92. Packet checks verified the receive
>     interface and payload before and after updates.
> 
>  net/ipv6/ip6_gre.c | 64 +++++++++++++++++++++++++++++-----------------
>  1 file changed, 40 insertions(+), 24 deletions(-)

No.

The patch is trying to "fix" an extremely uninteresting "problem" that
was most likely flagged by LLM. No report from a single user in over 14
years. I was OK with v1 because it made IPv6 consistent with IPv4 and
was small:

 1 file changed, 1 insertion(+), 1 deletion(-)

Then, it grew and grew for the sole reason of pleasing some LLM that
flagged even less interesting "problems" that IPv4 already "suffers"
from.

Two options:

1. Go back to v1.
2. Don't apply anything.

  reply	other threads:[~2026-11-22 12:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 10:16 [PATCH net-next v4] ip6_gre: fix changelink conflict checks for L2 tunnels Xia Yan
2026-11-22 12:35 ` Ido Schimmel [this message]
2026-11-22 13:46   ` Xia Yan

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=20261122123555.GA2812544@shredder \
    --to=idosch@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xeb@mail.ru \
    --cc=yana06070@163.com \
    --cc=yanxia@cmss.chinamobile.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.