]> exis.tech > repos - linux.git/commit
ip6_vti: fix incorrect tunnel matching in vti6_tnl_lookup()
authorEric Dumazet <edumazet@google.com>
Mon, 8 Jun 2026 16:46:13 +0000 (16:46 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 10 Jun 2026 15:16:07 +0000 (08:16 -0700)
commita5c0359f5cbc51a2e2b114d6041e0f3c73f903e9
treedf7e012789b2152c7b475522d48e3d05cc4fe710
parent627366c51145a07f675b1800fb5ea2ec960bd900
ip6_vti: fix incorrect tunnel matching in vti6_tnl_lookup()

In vti6_tnl_lookup(), when an exact match for a tunnel fails,
the code falls back to searching for wildcard tunnels:

- Tunnels matching the packet's local address, with any remote address
  wildcard remote).

- Tunnels matching the packet's remote address, with any local address
  (wildcard local).

However, vti6 stores all these different types of tunnels in the same
hash table (ip6n->tnls_r_l) prone to hash collisions.

The bug is that the fallback search loops in vti6_tnl_lookup() were
missing checks to ensure that the candidate tunnel actually has
a wildcard address.

Fixes: fbe68ee87522 ("vti6: Add a lookup method for tunnels with wildcard endpoints.")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Reviewed-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Link: https://patch.msgid.link/20260608164613.933023-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/ip6_vti.c