From: David Miller <davem@davemloft.net>
To: nicolas.dichtel@6wind.com
Cc: netdev@vger.kernel.org, willemb@google.com, maximmi@mellanox.com
Subject: Re: [PATCH net v2] af_packet: fix raw sockets over 6in4 tunnel
Date: Thu, 17 Jan 2019 15:55:27 -0800 (PST) [thread overview]
Message-ID: <20190117.155527.717258097202066512.davem@davemloft.net> (raw)
In-Reply-To: <20190117102722.14474-1-nicolas.dichtel@6wind.com>
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Date: Thu, 17 Jan 2019 11:27:22 +0100
> Since commit cb9f1b783850, scapy (which uses an AF_PACKET socket in
> SOCK_RAW mode) is unable to send a basic icmp packet over a sit tunnel:
>
> Here is a example of the setup:
> $ ip link set ntfp2 up
> $ ip addr add 10.125.0.1/24 dev ntfp2
> $ ip tunnel add tun1 mode sit ttl 64 local 10.125.0.1 remote 10.125.0.2 dev ntfp2
> $ ip addr add fd00:cafe:cafe::1/128 dev tun1
> $ ip link set dev tun1 up
> $ ip route add fd00:200::/64 dev tun1
> $ scapy
>>>> p = []
>>>> p += IPv6(src='fd00:100::1', dst='fd00:200::1')/ICMPv6EchoRequest()
>>>> send(p, count=1, inter=0.1)
>>>> quit()
> $ ip -s link ls dev tun1 | grep -A1 "TX.*errors"
> TX: bytes packets errors dropped carrier collsns
> 0 0 1 0 0 0
>
> The problem is that the network offset is set to the hard_header_len of the
> output device (tun1, ie 14 + 20) and in our case, because the packet is
> small (48 bytes) the pskb_inet_may_pull() fails (it tries to pull 40 bytes
> (ipv6 header) starting from the network offset).
>
> This problem is more generally related to device with variable hard header
> length. To avoid a too intrusive patch in the current release, a (ugly)
> workaround is proposed in this patch. It has to be cleaned up in net-next.
>
> Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=993675a3100b1
> Link: http://patchwork.ozlabs.org/patch/1024489/
> Fixes: cb9f1b783850 ("ip: validate header length on virtual device xmit")
> CC: Willem de Bruijn <willemb@google.com>
> CC: Maxim Mikityanskiy <maximmi@mellanox.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
> ---
>
> v1 -> v2:
> reset nh offset only for small packets sent on a variable hard hdr len device
Applied.
next prev parent reply other threads:[~2019-01-17 23:55 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 14:43 [PATCH net] af_packet: fix raw sockets over 6in4 tunnel Nicolas Dichtel
2019-01-11 21:29 ` Willem de Bruijn
2019-01-12 18:00 ` Willem de Bruijn
2019-01-14 14:51 ` Nicolas Dichtel
2019-01-14 15:15 ` Willem de Bruijn
2019-01-14 15:38 ` Willem de Bruijn
2019-01-15 9:49 ` Nicolas Dichtel
2019-01-15 16:20 ` Willem de Bruijn
2019-01-17 10:27 ` [PATCH net v2] " Nicolas Dichtel
2019-01-17 15:09 ` Willem de Bruijn
2019-01-17 23:55 ` David Miller [this message]
2019-02-18 15:57 ` Sasha Levin
2019-02-20 18:39 ` Willem de Bruijn
2019-02-20 19:33 ` David Miller
2019-02-22 19:50 ` David Miller
2019-02-22 23:53 ` Willem de Bruijn
2019-02-25 8:55 ` 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=20190117.155527.717258097202066512.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=maximmi@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=willemb@google.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).