Re: [PATCH 0/4] Prevent UDP tunnels from operating on garbage socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tom Herbert <tom@xxxxxxxxxxxxxxx>
Date: Mon, 6 Apr 2015 06:59:21 -0700

> On Sun, Apr 5, 2015 at 7:18 PM, David Miller <davem@xxxxxxxxxxxxx> wrote:
>>
>> So this should do the rest of the work such that when we encapsulate
>> into a UDP tunnel, the output path works on the UDP tunnel's socket
>> rather than skb->sk.
>>
> Doesn't this contradict "udp: Do not require sock in
> udp_tunnel_xmit_skb" patch?  How is the skbuf getting set with a
> garbage socket?

It's not a garbage socket, but it could be a socket for a completely
different address family than ipv4/ipv6.  The canonical example is
AF_PACKET transmitting over an encapsulating device.

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

You must retain the original skb->sk of the application so that socket
memory accounting does not break.  You can't just rewrite skb->sk
during tunnel encapsulation.

That's the whole point these changes.

If an AF_PACKET socket transmits over a UDP encapsulating tunnel device
we want skb->sk to be the AF_PACKET socket for socket memory accounting
purposes, and pass down explicitly the UDP tunnel socket through the
output path starting at the point of UDP encapsulation.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux