]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: md5: fix IPv4-mapped support
authorEric Dumazet <edumazet@google.com>
Tue, 26 Jul 2022 11:57:43 +0000 (11:57 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 27 Jul 2022 17:18:21 +0000 (10:18 -0700)
commitfc97929e06c4b676468950a32a7786cf53ae783d
tree1f814c250ba21d175b77c33f04156427a2ef22d1
parent0a055e40237d50df321aaac0ac21df0bb1775ee1
tcp: md5: fix IPv4-mapped support

After the blamed commit, IPv4 SYN packets handled
by a dual stack IPv6 socket are dropped, even if
perfectly valid.

$ nstat | grep MD5
TcpExtTCPMD5Failure             5                  0.0

For a dual stack listener, an incoming IPv4 SYN packet
would call tcp_inbound_md5_hash() with @family == AF_INET,
while tp->af_specific is pointing to tcp_sock_ipv6_specific.

Only later when an IPv4-mapped child is created, tp->af_specific
is changed to tcp_sock_ipv6_mapped_specific.

Fixes: fa64e214abdb ("net/tcp: Merge TCP-MD5 inbound callbacks")
Reported-by: Brian Vazquez <brianvv@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Reviewed-by: Dmitry Safonov <dima@arista.com>
Tested-by: Leonard Crestez <cdleonard@gmail.com>
Link: https://lore.kernel.org/r/20220726115743.2759832-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp.c