Skip to content
Snippets Groups Projects
  • Jiri Bohac's avatar
    xfrm: fix MTU regression · 4952faa7
    Jiri Bohac authored
    
    commit 6596a0229541270fb8d38d989f91b78838e5e9da upstream.
    
    Commit 749439bf ("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 b515d263 ("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: default avatarJiri Bohac <jbohac@suse.cz>
    Fixes: 749439bf ("ipv6: fix udpv6 sendmsg crash caused by too small MTU")
    Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    4952faa7
Code owners
Assign users and groups as approvers for specific file changes. Learn more.