netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: tom@herbertland.com
Cc: netdev@vger.kernel.org, netfilter-devel@vger.kernel.org,
	pablo@netfilter.org, hannes@stressinduktion.org,
	jiri@resnulli.us
Subject: Re: [PATCH 0/4] Prevent UDP tunnels from operating on garbage socket
Date: Mon, 06 Apr 2015 13:17:00 -0400 (EDT)	[thread overview]
Message-ID: <20150406.131700.185460014498109286.davem@davemloft.net> (raw)
In-Reply-To: <20150406.124114.924455461962119301.davem@davemloft.net>

From: David Miller <davem@davemloft.net>
Date: Mon, 06 Apr 2015 12:41:14 -0400 (EDT)

> Tom if you are saying that skb->sk should be reset to the tunnel
> socket, that doesn't work and is completely broken.

Thinking some more, I think what you are missing is that deeper in the
ipv4/ipv6 transmit call chain we do things like sk_mc_loop() etc. on
the socket and we cannot just do it on skb->sk.

To make that work correctly we must pass the tunnel socket down
through the ipv4/ipv6 packet output paths, via netfilter hooks
if necessary.

I am also really disappointed with the call signature of the udp
tunnel send paths.  You have to be honest with yourself and agree
that something with 11 arguments is not a well designed interface.

Now that hopefully you can see that the socket is actually required,
can possibly use that to trim the function signature down for
udp_tunnel{,6}_xmit_skb()?

Worst case, make a "struct udp_tunnel_state" just like I made a "struct
nf_hook_state" for the netfilter hooks.

Thanks.

  reply	other threads:[~2015-04-06 17:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-06  2:18 [PATCH 0/4] Prevent UDP tunnels from operating on garbage socket David Miller
2015-04-06 13:59 ` Tom Herbert
2015-04-06 16:41   ` David Miller
2015-04-06 17:17     ` David Miller [this message]
     [not found]       ` <CALx6S34CvOZN3dZjXr6_1afCbUDu2718cCGPk2Sm1Nkq8wCGKA@mail.gmail.com>
2015-04-06 19:38         ` David Miller
2015-04-07  2:43       ` Tom Herbert
2015-04-07  3:51         ` David Miller
2015-04-07  4:45           ` Tom Herbert
2015-04-07  5:03             ` Eric Dumazet
2015-04-07  8:20               ` Wilco Baan Hofman
2015-04-07  5:29             ` David Miller
2015-04-07 11:27             ` Hannes Frederic Sowa
2015-04-08 20:03               ` 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=20150406.131700.185460014498109286.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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).