netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: David Ahern <dsahern@kernel.org>
Cc: netdev@vger.kernel.org, bluca@debian.org, Robin <imer@imer.cc>
Subject: Re: [PATCH iproute2] iptunnel: detect protocol mismatch on tunnel change
Date: Tue, 11 Apr 2023 09:49:29 -0700	[thread overview]
Message-ID: <20230411094929.5d80ef23@hermes.local> (raw)
In-Reply-To: <ac05b04d-a7ad-3804-39fd-2267904e9f23@kernel.org>

On Tue, 11 Apr 2023 09:55:25 -0600
David Ahern <dsahern@kernel.org> wrote:

> That addresses the stack smashing, but ....
> 
> >  
> >  				if (tnl_get_ioctl(*argv, &old_p))
> >  					return -1;
> > -				*p = old_p;
> > +
> > +				if (old_p.ip_tnl.iph.version != 4 ||
> > +				    old_p.ip_tnl.iph.ihl != 5)  
> 
> this field overlays laddr in ip6_tnl_parm2 which means there is a
> collision in valid addresses.

That is why the commit message said this is best effort.
What happens when there is a collision with a valid address is that
the call will fail later as a bogus change to an IP6 tunnel.

 # ip tunnel add gre1 mode ip6gre local 4545:db8::1 remote 2001:db8::2 ttl 255
 # ip tunnel change gre1 mode gre local 192.168.0.0 remote 192.168.0.1 ttl 255
ttl != 0 and nopmtudisc are incompatible

This is off in the non-standard IPv6 address range so not a likely
to bother anyone.

  reply	other threads:[~2023-04-11 16:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10 23:35 [PATCH iproute2] iptunnel: detect protocol mismatch on tunnel change Stephen Hemminger
2023-04-11 10:09 ` Luca Boccassi
2023-04-11 15:55 ` David Ahern
2023-04-11 16:49   ` Stephen Hemminger [this message]
2023-04-14 20:10 ` patchwork-bot+netdevbpf

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=20230411094929.5d80ef23@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=bluca@debian.org \
    --cc=dsahern@kernel.org \
    --cc=imer@imer.cc \
    --cc=netdev@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;
as well as URLs for NNTP newsgroup(s).