Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: sd@queasysnail.net
Cc: netdev@vger.kernel.org, nordmark@arista.com, gilligan@arista.com,
	hannes@stressinduktion.org, sbrivio@redhat.com
Subject: Re: [PATCH net] ipv6: make DAD fail with enhanced DAD when nonce length differs
Date: Mon, 16 Jul 2018 13:45:38 -0700 (PDT)	[thread overview]
Message-ID: <20180716.134538.2203677879700944715.davem@davemloft.net> (raw)
In-Reply-To: <d477c52e54bcfc32f41df33ce48251543033d468.1531494812.git.sd@queasysnail.net>

From: Sabrina Dubroca <sd@queasysnail.net>
Date: Fri, 13 Jul 2018 17:21:42 +0200

> Commit adc176c54722 ("ipv6 addrconf: Implemented enhanced DAD (RFC7527)")
> added enhanced DAD with a nonce length of 6 bytes. However, RFC7527
> doesn't specify the length of the nonce, other than being 6 + 8*k bytes,
> with integer k >= 0 (RFC3971 5.3.2). The current implementation simply
> assumes that the nonce will always be 6 bytes, but others systems are
> free to choose different sizes.
> 
> If another system sends a nonce of different length but with the same 6
> bytes prefix, it shouldn't be considered as the same nonce. Thus, check
> that the length of the received nonce is the same as the length we sent.
> 
> Ugly scapy test script running on veth0:
> 
> def loop():
>     pkt=sniff(iface="veth0", filter="icmp6", count=1)
>     pkt = pkt[0]
>     b = bytearray(pkt[Raw].load)
>     b[1] += 1
>     b += b'\xde\xad\xbe\xef\xde\xad\xbe\xef'
>     pkt[Raw].load = bytes(b)
>     pkt[IPv6].plen += 8
>     # fixup checksum after modifying the payload
>     pkt[IPv6].payload.cksum -= 0x3b44
>     if pkt[IPv6].payload.cksum < 0:
>         pkt[IPv6].payload.cksum += 0xffff
>     sendp(pkt, iface="veth0")
> 
> This should result in DAD failure for any address added to veth0's peer,
> but is currently ignored.
> 
> Fixes: adc176c54722 ("ipv6 addrconf: Implemented enhanced DAD (RFC7527)")
> Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
> Reviewed-by: Stefano Brivio <sbrivio@redhat.com>

Applied and queued up for -stable, thank you!

      reply	other threads:[~2018-07-16 21:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13 15:21 [PATCH net] ipv6: make DAD fail with enhanced DAD when nonce length differs Sabrina Dubroca
2018-07-16 20:45 ` David Miller [this message]

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=20180716.134538.2203677879700944715.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=gilligan@arista.com \
    --cc=hannes@stressinduktion.org \
    --cc=netdev@vger.kernel.org \
    --cc=nordmark@arista.com \
    --cc=sbrivio@redhat.com \
    --cc=sd@queasysnail.net \
    /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