]> git.dujemihanovic.xyz Git - linux.git/commit
vxlan: Pull inner IP header in vxlan_rcv().
authorGuillaume Nault <gnault@redhat.com>
Tue, 30 Apr 2024 16:50:13 +0000 (18:50 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 2 May 2024 02:07:11 +0000 (19:07 -0700)
commitf7789419137b18e3847d0cc41afd788c3c00663d
tree91ad772c8602faf412c387ecada4100f6e88a66e
parent97bf6f81b29a8efaf5d0983251a7450e5794370d
vxlan: Pull inner IP header in vxlan_rcv().

Ensure the inner IP header is part of skb's linear data before reading
its ECN bits. Otherwise we might read garbage.
One symptom is the system erroneously logging errors like
"vxlan: non-ECT from xxx.xxx.xxx.xxx with TOS=xxxx".

Similar bugs have been fixed in geneve, ip_tunnel and ip6_tunnel (see
commit 1ca1ba465e55 ("geneve: make sure to pull inner header in
geneve_rx()") for example). So let's reuse the same code structure for
consistency. Maybe we'll can add a common helper in the future.

Fixes: d342894c5d2f ("vxlan: virtual extensible lan")
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://lore.kernel.org/r/1239c8db54efec341dd6455c77e0380f58923a3c.1714495737.git.gnault@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/vxlan/vxlan_core.c