netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Lebrun <david.lebrun@uclouvain.be>
To: Tom Herbert <tom@herbertland.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v4 3/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels
Date: Sun, 6 Nov 2016 15:02:07 +0100	[thread overview]
Message-ID: <581F37DF.4060509@uclouvain.be> (raw)
In-Reply-To: <CALx6S35TVxfmB-Rc=0HpSkLP9-FKHLcsHf97Y=ro_Q_-G5P1XA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2266 bytes --]

On 11/04/2016 05:26 PM, Tom Herbert wrote:
>> +
>> +int seg6_output(struct net *net, struct sock *sk, struct sk_buff *skb)
>> +{
>> +       struct dst_entry *orig_dst = skb_dst(skb);
>> +       struct dst_entry *dst = NULL;
>> +       struct seg6_lwt *slwt;
>> +       int err = -EINVAL;
>> +
>> +       err = seg6_do_srh(skb);
> 
> Technically we're not allowed by the standard to insert extension
> headers when forwarding, only the source host can place EH in packets.
> There was a _long_ discussion about this in 6man WG and it appears
> that for RFC2460bis the plan is to make this point clear. The
> rationale is that inserting extension headers in the middle of the
> network break PMTUD, IPsec AH, amongst other things.
> 
> I think people are going to do this anyway (especially for something
> like SR) so I don't think we should abandon this patch. But, we
> probably need a big disclaimer documented that if someone does this
> they may see problems in the network (in other words they should only
> use this if they know what they are doing).
> 

Agreed that directly inserting an EH breaks a lot of things. Note that
this concerns only seg6_do_srh_inline(). The other function,
seg6_do_srh_encap(), uses an outer IPv6 header to carry the SRH which is
RFC compliant. Also agreed that people are going to use direct insertion
regardless of RFC.

Where do you think the disclaimer should be ? Documentation/ file ?
Perhaps I can create a specific option CONFIG_IPV6_SEG6_INLINE to enable
or disable direct insertion.


>> +
>> +       memcpy(&slwt->tuninfo, tuninfo, tuninfo_len);
>> +
> Thomas pointed out to me that we are just blindly copying the SR
> option from userspace. We really should validate that it is well
> formed and acceptable to send. Minimally, we should check that
> addresses are valid, the TLVs are well formed, and we need to decide
> on rather to allow arbitrary TLVs that are unknown to the kernel. Same
> thing should be true for socket options or other interfaces to program
> SR.
> 

Yep, I overlooked that part of the patch and this indeed also applies to
the setsockopt() interface. I will respin a patch series with this issue
fixed.

Thanks for the feedback

David


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 163 bytes --]

  reply	other threads:[~2016-11-06 14:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-04 10:29 [PATCH net-next v4 0/9] net: add support for IPv6 Segment Routing David Lebrun
2016-11-04 10:29 ` [PATCH net-next v4 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header) David Lebrun
2016-11-04 10:29 ` [PATCH net-next v4 2/9] ipv6: sr: add code base for control plane support of SR-IPv6 David Lebrun
2016-11-04 10:29 ` [PATCH net-next v4 3/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels David Lebrun
2016-11-04 14:21   ` Thomas Graf
2016-11-04 16:26   ` Tom Herbert
2016-11-06 14:02     ` David Lebrun [this message]
2016-11-07  2:42   ` [lkp] [ipv6] 3e1ad8cb8a: kmsg.IPv6:Attempt_to_unregister_permanent_protocol kernel test robot
2016-11-04 10:29 ` [PATCH net-next v4 4/9] ipv6: sr: add core files for SR HMAC support David Lebrun
2016-11-04 10:32 ` [PATCH net-next v4 5/9] ipv6: sr: implement API to control SR HMAC structure David Lebrun
2016-11-04 10:32 ` [PATCH net-next v4 6/9] ipv6: sr: add calls to verify and insert HMAC signatures David Lebrun
2016-11-04 10:32 ` [PATCH net-next v4 7/9] ipv6: add source address argument for ipv6_push_nfrag_opts David Lebrun
2016-11-04 10:32 ` [PATCH net-next v4 8/9] ipv6: sr: add support for SRH injection through setsockopt David Lebrun
2016-11-04 10:32 ` [PATCH net-next v4 9/9] ipv6: sr: add documentation file for per-interface sysctls David Lebrun

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=581F37DF.4060509@uclouvain.be \
    --to=david.lebrun@uclouvain.be \
    --cc=netdev@vger.kernel.org \
    --cc=tom@herbertland.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 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).