All of lore.kernel.org
 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 23:51:18 -0400 (EDT)	[thread overview]
Message-ID: <20150406.235118.65925113152002205.davem@davemloft.net> (raw)
In-Reply-To: <CALx6S35bZ6t9d+cpHRXYS94N6rGuHhACMAt9Bj6UzCwBuomBSA@mail.gmail.com>

From: Tom Herbert <tom@herbertland.com>
Date: Mon, 6 Apr 2015 19:43:11 -0700

> To be honest, requiring an additional socket to transmit UDP
> encapsulation seems really convoluted to me, especially considering
> that this is just trying trying to solve AF_PACKET in nf which seems
> like a narrow use case.  Is there no way to test for AF_PACKET sockets
> and take action at a lower function?  Does every type encapsulation
> need its own UDP socket, or can you just have one which set from the
> udp_tunnel when family of skb->sk is AF_PACKET?

This has nothing to do with netfilter.

This has everything to do with being able to pass a socket down
through the complete ipv4/ipv6 output path.  That's the only
reason netfilter needed to be touched.

The ipv4/ipv6 output call paths have the NF hooks in the middle, and
the NF hooks determine what the call signature is for the rest of the
output path.  That's why it needed to be adjusted.

For ipv6 fragmentation, in particular, having the right ipv4/ipv6
socket is going to be important.

AF_PACKET is not an isolated case, just the most likely example.  It's
just as easy to trigger this problem for other protocol families too.
You can send appletalk packets over VXLAN.

I don't see what is convoluted about using the correct socket for
sending L3 protocol frames.  That's in fact how it's _supposed_ to
work.  And consistently having a proper matching socket available
makes it so that, long-term, we'll never have to deal with this issue
ever again.

  reply	other threads:[~2015-04-07  3:51 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
     [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 [this message]
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.235118.65925113152002205.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.