netfilter: Pass socket pointer down through okfn().
On the output paths in particular, we have to sometimes deal with two
socket contexts. First, and usually skb->sk, is the local socket that
generated the frame.
And second, is potentially the socket used to control a tunneling
socket, such as one the encapsulates using UDP.
We do not want to disassociate skb->sk when encapsulating in order
to fix this, because that would break socket memory accounting.
The most extreme case where this can cause huge problems is an
AF_PACKET socket transmitting over a vxlan device. We hit code
paths doing checks that assume they are dealing with an ipv4
socket, but are actually operating upon the AF_PACKET one.
Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- include/linux/netdevice.h 11 additions, 3 deletionsinclude/linux/netdevice.h
- include/linux/netfilter.h 34 additions, 28 deletionsinclude/linux/netfilter.h
- include/linux/netfilter_bridge.h 1 addition, 1 deletioninclude/linux/netfilter_bridge.h
- include/net/dn_neigh.h 3 additions, 3 deletionsinclude/net/dn_neigh.h
- include/net/ip.h 2 additions, 1 deletioninclude/net/ip.h
- include/net/ip6_route.h 2 additions, 1 deletioninclude/net/ip6_route.h
- include/net/ipv6.h 1 addition, 1 deletioninclude/net/ipv6.h
- include/net/xfrm.h 4 additions, 4 deletionsinclude/net/xfrm.h
- net/bridge/br_forward.c 8 additions, 5 deletionsnet/bridge/br_forward.c
- net/bridge/br_input.c 9 additions, 7 deletionsnet/bridge/br_input.c
- net/bridge/br_multicast.c 2 additions, 1 deletionnet/bridge/br_multicast.c
- net/bridge/br_netfilter.c 31 additions, 25 deletionsnet/bridge/br_netfilter.c
- net/bridge/br_private.h 3 additions, 3 deletionsnet/bridge/br_private.h
- net/bridge/br_stp_bpdu.c 3 additions, 2 deletionsnet/bridge/br_stp_bpdu.c
- net/core/dev.c 5 additions, 5 deletionsnet/core/dev.c
- net/decnet/dn_neigh.c 19 additions, 16 deletionsnet/decnet/dn_neigh.c
- net/decnet/dn_nsp_in.c 3 additions, 2 deletionsnet/decnet/dn_nsp_in.c
- net/decnet/dn_route.c 15 additions, 11 deletionsnet/decnet/dn_route.c
- net/ipv4/arp.c 6 additions, 4 deletionsnet/ipv4/arp.c
- net/ipv4/ip_forward.c 4 additions, 4 deletionsnet/ipv4/ip_forward.c
Loading
Please register or sign in to comment