linux-stable/net/ipv4
Evan Nimmo 9ab1265d52 xfrm: Use actual socket sk instead of skb socket for xfrm_output_resume
A situation can occur where the interface bound to the sk is different
to the interface bound to the sk attached to the skb. The interface
bound to the sk is the correct one however this information is lost inside
xfrm_output2 and instead the sk on the skb is used in xfrm_output_resume
instead. This assumes that the sk bound interface and the bound interface
attached to the sk within the skb are the same which can lead to lookup
failures inside ip_route_me_harder resulting in the packet being dropped.

We have an l2tp v3 tunnel with ipsec protection. The tunnel is in the
global VRF however we have an encapsulated dot1q tunnel interface that
is within a different VRF. We also have a mangle rule that marks the
packets causing them to be processed inside ip_route_me_harder.

Prior to commit 31c70d5956 ("l2tp: keep original skb ownership") this
worked fine as the sk attached to the skb was changed from the dot1q
encapsulated interface to the sk for the tunnel which meant the interface
bound to the sk and the interface bound to the skb were identical.
Commit 46d6c5ae95 ("netfilter: use actual socket sk rather than skb sk
when routing harder") fixed some of these issues however a similar
problem existed in the xfrm code.

Fixes: 31c70d5956 ("l2tp: keep original skb ownership")
Signed-off-by: Evan Nimmo <evan.nimmo@alliedtelesis.co.nz>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
2021-03-03 09:32:52 +01:00
..
bpfilter
netfilter netfilter: nftables: add nft_parse_register_load() and use it 2021-01-27 22:53:29 +01:00
Kconfig
Makefile
af_inet.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-02-16 13:14:06 -08:00
ah4.c xfrm: Use actual socket sk instead of skb socket for xfrm_output_resume 2021-03-03 09:32:52 +01:00
arp.c
bpf_tcp_ca.c
cipso_ipv4.c
datagram.c
devinet.c
esp4.c xfrm: Use actual socket sk instead of skb socket for xfrm_output_resume 2021-03-03 09:32:52 +01:00
esp4_offload.c net: Simplify the calculation of variables 2021-01-27 11:49:55 +01:00
fib_frontend.c ipv4: Ignore ECN bits for fib lookups in fib_compute_spec_dst() 2020-12-28 14:44:32 -08:00
fib_lookup.h IPv4: Add "offload failed" indication to routes 2021-02-08 16:47:03 -08:00
fib_notifier.c
fib_rules.c
fib_semantics.c IPv4: Add "offload failed" indication to routes 2021-02-08 16:47:03 -08:00
fib_trie.c IPv4: Extend 'fib_notify_on_flag_change' sysctl 2021-02-08 16:47:03 -08:00
fou.c
gre_demux.c erspan: fix version 1 check in gre_parse_header() 2020-12-28 15:00:00 -08:00
gre_offload.c ip_gre: add csum offload support for gre header 2021-01-29 20:39:14 -08:00
icmp.c
igmp.c
inet_connection_sock.c tcp: fix TCP_USER_TIMEOUT with zero window 2021-01-18 19:59:17 -08:00
inet_diag.c
inet_fragment.c inet: frags: batch fqdir destroy works 2020-12-12 15:08:54 -08:00
inet_hashtables.c tcp: add some entropy in __inet_hash_connect() 2021-02-11 13:13:05 -08:00
inet_timewait_sock.c
inetpeer.c
ip_forward.c
ip_fragment.c
ip_gre.c
ip_input.c net: use indirect call helpers for dst_input 2021-02-03 14:51:39 -08:00
ip_options.c
ip_output.c net: use indirect call helpers for dst_output 2021-02-03 14:51:39 -08:00
ip_sockglue.c
ip_tunnel.c net: ip_tunnel: fix mtu calculation 2021-02-01 19:58:23 -08:00
ip_tunnel_core.c net: ip_tunnel: clean up endianness conversions 2021-01-08 19:25:35 -08:00
ip_vti.c vti: fix ipv4 pmtu check to honor ip header df 2021-03-03 07:36:02 +01:00
ipcomp.c
ipconfig.c net: ipconfig: avoid use-after-free in ic_close_devs 2021-02-11 14:31:39 -08:00
ipip.c
ipmr.c
ipmr_base.c
metrics.c
netfilter.c
netlink.c
nexthop.c nexthop: Extract a helper for validation of get/del RTNL requests 2021-01-28 20:49:54 -08:00
ping.c
proc.c net: proc: speedup /proc/net/netstat 2021-01-29 20:59:53 -08:00
protocol.c
raw.c
raw_diag.c
route.c IPv4: Add "offload failed" indication to routes 2021-02-08 16:47:03 -08:00
syncookies.c selinux/stable-5.11 PR 20201214 2020-12-16 11:01:04 -08:00
sysctl_net_ipv4.c IPv4: Extend 'fib_notify_on_flag_change' sysctl 2021-02-08 16:47:03 -08:00
tcp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-02-16 13:14:06 -08:00
tcp_bbr.c
tcp_bic.c
tcp_bpf.c
tcp_cdg.c
tcp_cong.c
tcp_cubic.c tcp_cubic: use memset and offsetof init 2021-01-15 20:22:16 -08:00
tcp_dctcp.c
tcp_dctcp.h
tcp_diag.c
tcp_fastopen.c
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c tcp: tcp_data_ready() must look at SOCK_DONE 2021-02-15 13:20:36 -08:00
tcp_ipv4.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-02-16 13:14:06 -08:00
tcp_lp.c
tcp_metrics.c fixes-v5.11 2020-12-14 16:40:27 -08:00
tcp_minisocks.c tcp: parse mptcp options contained in reset packets 2020-12-14 17:30:06 -08:00
tcp_nv.c
tcp_offload.c
tcp_output.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-01-28 17:09:31 -08:00
tcp_rate.c
tcp_recovery.c tcp: fix TLP timer not set when CA_STATE changes from DISORDER to OPEN 2021-01-23 21:33:01 -08:00
tcp_scalable.c
tcp_timer.c tcp: make TCP_USER_TIMEOUT accurate for zero window probes 2021-01-23 19:32:51 -08:00
tcp_ulp.c
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tunnel4.c
udp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-02-16 13:14:06 -08:00
udp_bpf.c
udp_diag.c
udp_impl.h
udp_offload.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-02-02 14:21:31 -08:00
udp_tunnel_core.c udp_tunnel: reshuffle NETIF_F_RX_UDP_TUNNEL_PORT checks 2021-01-07 12:53:29 -08:00
udp_tunnel_nic.c
udp_tunnel_stub.c
udplite.c
xfrm4_input.c
xfrm4_output.c
xfrm4_policy.c
xfrm4_protocol.c
xfrm4_state.c
xfrm4_tunnel.c