Regression for ip6-in-ip4 IPsec tunnel in 4.14.16

From: Yves-Alexis Perez
Date: Wed Feb 07 2018 - 11:38:23 EST


Hi Mike,

I noticed a regression in 4.14.16 stable kernel (I assume it's also
present in mainline).

I'm using an IPsec setup where I tunnel all my IP trafic to a gateway.
The tunnel can use either IPv6 or IPv4 (depending on what's available
locally) and will route both IPv4 and IPv6 (my gateway will assign both
family addresses).

The tunnel doesn't use ESP directly but rather encapsulates in UDP.

Starting with 4.14.16, IPv6 traffic is broken. When trying a simple ping
to an IPv6 address I get:

ping: sendmsg: Invalid argument

I bisected 4.14.15 to 4.14.16 and got the attached bisect log, which
ends with 8278804e05f6bcfe3fdfea4a404020752ead15a6 as the offending
commit. The -EINVAL is consistent with the âInvalid argumentâ return
from ping. I didn't try yet on a pure IPv6 setup (without IPsec
tunneling) but will followup when I have a chance to test it.

Reverting that commit on top of 4.14.17 fixes the problem.

If you need more info, please ask.

Regards,
--
Yves-Alexis# bad: [6c70076667f246dc200c7a3e9aeabd2f8f388416] Linux 4.14.16
# good: [a16134b082346b7e7c34f594a0763eafacdcea92] Linux 4.14.15
git bisect start 'v4.14.16' 'v4.14.15'
# bad: [72d4f3abd6d3521f5cd978b63f9301051f127812] r8169: fix memory corruption on retrieval of hardware statistics.
git bisect bad 72d4f3abd6d3521f5cd978b63f9301051f127812
# good: [295bcfbbcf5a741e9103605c3252276ed21433bb] ARM: net: bpf: correct stack layout documentation
git bisect good 295bcfbbcf5a741e9103605c3252276ed21433bb
# bad: [8278804e05f6bcfe3fdfea4a404020752ead15a6] ipv6: fix udpv6 sendmsg crash caused by too small MTU
git bisect bad 8278804e05f6bcfe3fdfea4a404020752ead15a6
# good: [9ad970c8a13595e38d3af98114bcbbec6d8a5be4] drm/vc4: Fix NULL pointer dereference in vc4_save_hang_state()
git bisect good 9ad970c8a13595e38d3af98114bcbbec6d8a5be4
# good: [42d68bf2a42381642ea5ae460c6a5d86a56213f0] ipv4: Make neigh lookup keys for loopback/point-to-point devices be INADDR_ANY
git bisect good 42d68bf2a42381642ea5ae460c6a5d86a56213f0
# good: [2295b3dd543f9a5a1834e4265d506a5bc0819983] ipv6: Fix getsockopt() for sockets with default IPV6_AUTOFLOWLABEL
git bisect good 2295b3dd543f9a5a1834e4265d506a5bc0819983
# first bad commit: [8278804e05f6bcfe3fdfea4a404020752ead15a6] ipv6: fix udpv6 sendmsg crash caused by too small MTU

Attachment: signature.asc
Description: This is a digitally signed message part