netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@redhat.com>
To: netdev@vger.kernel.org
Cc: Thomas Graf <tgraf@suug.ch>, Pravin Shelar <pshelar@nicira.com>,
	Tom Herbert <tom@herbertland.com>
Subject: [PATCH v2 net-next 3/4] fou: reject IPv6 config
Date: Fri, 28 Aug 2015 20:48:21 +0200	[thread overview]
Message-ID: <e43a28ab8a6c5d0f16476bc9102cb11478fa5eff.1440787601.git.jbenc@redhat.com> (raw)
In-Reply-To: <cover.1440787600.git.jbenc@redhat.com>

fou does not really support IPv6 encapsulation. After an UDP socket is
created in fou_create, the encap_rcv callback is set either to fou_udp_recv
or to gue_udp_recv. Both of those unconditionally assume that the received
packet has an IPv4 header and access the data at network_header as it was an
IPv4 header. This leads to IPv6 flow label being interpreted as IP packet
length, etc.

Disallow fou tunnel to be configured as IPv6 until real IPv6 support is
added to fou.

CC: Tom Herbert <tom@herbertland.com>
Signed-off-by: Jiri Benc <jbenc@redhat.com>
---
v2: no change
---
 net/ipv4/fou.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/fou.c b/net/ipv4/fou.c
index 2d1646cff057..e0fcbbbcfe54 100644
--- a/net/ipv4/fou.c
+++ b/net/ipv4/fou.c
@@ -566,7 +566,7 @@ static int parse_nl_config(struct genl_info *info,
 	if (info->attrs[FOU_ATTR_AF]) {
 		u8 family = nla_get_u8(info->attrs[FOU_ATTR_AF]);
 
-		if (family != AF_INET && family != AF_INET6)
+		if (family != AF_INET)
 			return -EINVAL;
 
 		cfg->udp_config.family = family;
-- 
1.8.3.1

  parent reply	other threads:[~2015-08-28 18:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-28 18:48 [PATCH v2 net-next 0/4] tunnels: fix incorrect IPv4/v6 headers interpretation Jiri Benc
2015-08-28 18:48 ` [PATCH v2 net-next 1/4] ip_tunnels: convert the mode field of ip_tunnel_info to flags Jiri Benc
2015-08-28 22:15   ` Thomas Graf
2015-08-28 22:55   ` Pravin Shelar
2015-08-28 18:48 ` [PATCH v2 net-next 2/4] ip_tunnels: record IP version in tunnel info Jiri Benc
2015-08-28 22:24   ` Thomas Graf
2015-08-29  8:43     ` Jiri Benc
2015-08-28 22:55   ` Pravin Shelar
2015-08-28 18:48 ` Jiri Benc [this message]
2015-08-28 18:48 ` [PATCH v2 net-next 4/4] vxlan: do not receive IPv4 packets on IPv6 socket Jiri Benc
2015-08-28 22:39   ` Thomas Graf
2015-08-29  8:55     ` Jiri Benc
2015-08-30  9:30       ` Thomas Graf
2015-08-29 20:08 ` [PATCH v2 net-next 0/4] tunnels: fix incorrect IPv4/v6 headers interpretation David Miller

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=e43a28ab8a6c5d0f16476bc9102cb11478fa5eff.1440787601.git.jbenc@redhat.com \
    --to=jbenc@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.com \
    --cc=tgraf@suug.ch \
    --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).