android_kernel_motorola_sm6225/net/ipv6
Jiri Bohac 20fe64c544 xfrm: fix MTU regression
commit 6596a0229541270fb8d38d989f91b78838e5e9da upstream.

Commit 749439bfac ("ipv6: fix udpv6
sendmsg crash caused by too small MTU") breaks PMTU for xfrm.

A Packet Too Big ICMPv6 message received in response to an ESP
packet will prevent all further communication through the tunnel
if the reported MTU minus the ESP overhead is smaller than 1280.

E.g. in a case of a tunnel-mode ESP with sha256/aes the overhead
is 92 bytes. Receiving a PTB with MTU of 1371 or less will result
in all further packets in the tunnel dropped. A ping through the
tunnel fails with "ping: sendmsg: Invalid argument".

Apparently the MTU on the xfrm route is smaller than 1280 and
fails the check inside ip6_setup_cork() added by 749439bf.

We found this by debugging USGv6/ipv6ready failures. Failing
tests are: "Phase-2 Interoperability Test Scenario IPsec" /
5.3.11 and 5.4.11 (Tunnel Mode: Fragmentation).

Commit b515d2637276a3810d6595e10ab02c13bfd0b63a ("xfrm:
xfrm_state_mtu should return at least 1280 for ipv6") attempted
to fix this but caused another regression in TCP MSS calculations
and had to be reverted.

The patch below fixes the situation by dropping the MTU
check and instead checking for the underflows described in the
749439bf commit message.

Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Fixes: 749439bfac ("ipv6: fix udpv6 sendmsg crash caused by too small MTU")
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-08 19:04:07 +01:00
..
ila
netfilter netfilter: ip6_tables: zero-initialize fragment offset 2021-10-17 10:19:48 +02:00
addrconf.c gre/sit: Don't generate link-local addr if addr_gen_mode is IN6_ADDR_GEN_MODE_NONE 2021-11-26 11:36:07 +01:00
addrconf_core.c net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup 2020-04-29 16:31:17 +02:00
addrlabel.c ipv6: addrlabel: fix possible memory leak in ip6addrlbl_net_init 2020-12-08 10:18:51 +01:00
af_inet6.c net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup 2020-04-29 16:31:17 +02:00
ah6.c ah6: fix error return code in ah6_input() 2020-11-24 13:27:15 +01:00
anycast.c ipv6: fix memory leaks on IPV6_ADDRFORM path 2020-08-11 15:32:34 +02:00
calipso.c cipso,calipso: resolve a number of problems with the DOI refcounts 2021-03-17 16:43:44 +01:00
datagram.c net: ipv6: add net argument to ip6_dst_lookup_flow 2020-04-29 16:31:16 +02:00
esp6.c esp: avoid unneeded kmap_atomic call 2021-01-23 15:49:55 +01:00
esp6_offload.c esp6: get the right proto for transport mode in esp6_gso_encap 2020-06-03 08:19:48 +02:00
exthdrs.c ipv6: fix out-of-bound access in ip6_parse_tlv() 2021-07-20 16:15:52 +02:00
exthdrs_core.c
exthdrs_offload.c
fib6_notifier.c
fib6_rules.c
fou6.c
icmp.c net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-03-04 09:39:59 +01:00
inet6_connection_sock.c net: ipv6: add net argument to ip6_dst_lookup_flow 2020-04-29 16:31:16 +02:00
inet6_hashtables.c tcp/dccp: fix possible race __inet_lookup_established() 2020-01-04 19:13:41 +01:00
ip6_checksum.c
ip6_fib.c ipv6: annotate accesses to fn->fn_sernum 2022-02-08 18:23:09 +01:00
ip6_flowlabel.c
ip6_gre.c ipv6: remove extra dev_hold() for fallback tunnels 2021-05-22 10:59:50 +02:00
ip6_icmp.c net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending 2021-03-04 09:39:59 +01:00
ip6_input.c ipv6: weaken the v4mapped source check 2021-04-07 12:48:47 +02:00
ip6_offload.c gso: do not skip outer ip header in case of ipip and net_failover 2022-03-02 11:38:12 +01:00
ip6_offload.h
ip6_output.c xfrm: fix MTU regression 2022-03-08 19:04:07 +01:00
ip6_tunnel.c ipv6_tunnel: Rate limit warning messages 2022-02-08 18:23:07 +01:00
ip6_udp_tunnel.c
ip6_vti.c ip6_vti: initialize __ip6_tnl_parm struct in vti6_siocdevprivate 2022-01-11 13:58:50 +01:00
ip6mr.c ipmr,ip6mr: acquire RTNL before calling ip[6]mr_free_table() on failure path 2022-02-16 12:51:45 +01:00
ipcomp6.c
ipv6_sockglue.c ipv6: fix memory leaks on IPV6_ADDRFORM path 2020-08-11 15:32:34 +02:00
Kconfig net: ipv6: fix kconfig dependency warning for IPV6_SEG6_HMAC 2020-09-26 18:01:29 +02:00
Makefile
mcast.c mld: fix panic in mld_newpack() 2021-06-03 08:38:11 +02:00
mcast_snoop.c
mip6.c
ndisc.c
netfilter.c netfilter: use actual socket sk rather than skb sk when routing harder 2020-11-18 19:18:44 +01:00
output_core.c ipv6: use prandom_u32() for ID generation 2021-07-20 16:16:00 +02:00
ping.c
proc.c
protocol.c
raw.c net-ipv6: bugfix - raw & sctp - switch to ipv6_can_nonlocal_bind() 2021-04-14 08:22:33 +02:00
reassembly.c ipv6: record frag_max_size in atomic fragments in input path 2021-06-03 08:38:12 +02:00
route.c ipv6: annotate accesses to fn->fn_sernum 2022-02-08 18:23:09 +01:00
seg6.c
seg6_hmac.c
seg6_iptunnel.c seg6: fix the iif in the IPv6 socket control block 2021-12-14 10:18:05 +01:00
seg6_local.c ipv6: sr: remove SKB_GSO_IPXIP6 on End.D* actions 2020-01-29 16:43:14 +01:00
sit.c sit: do not call ipip6_dev_free() from sit_init_net() 2021-12-22 09:19:02 +01:00
syncookies.c net: Update window_clamp if SOCK_RCVBUF is set 2020-11-18 19:18:51 +01:00
sysctl_net_ipv6.c
tcp_ipv6.c ipv6: tcp: drop silly ICMPv6 packet too big messages 2021-07-28 11:13:45 +02:00
tcpv6_offload.c
tunnel6.c
udp.c udp: using datalen to cap ipv6 udp max gso segments 2022-01-05 12:34:58 +01:00
udp_impl.h
udp_offload.c
udplite.c
xfrm6_input.c
xfrm6_mode_beet.c
xfrm6_mode_ro.c
xfrm6_mode_transport.c
xfrm6_mode_tunnel.c
xfrm6_output.c net: ipv6: fix return value of ip6_skb_dst_mtu 2021-07-28 11:13:44 +02:00
xfrm6_policy.c net: add bool confirm_neigh parameter for dst_ops.update_pmtu 2020-01-04 19:13:37 +01:00
xfrm6_protocol.c
xfrm6_state.c
xfrm6_tunnel.c