Re: [PATCH v2 net] net/tcp-ao: fix reset key lookup for IPv4 segments on IPv6 listeners
From: Eric Dumazet
Date: Mon Nov 23 2026 - 04:35:42 EST
Le lun. 23 nov. 2026 à 04:41, Hungyu Lin <dennylin0707@xxxxxxxxx> a écrit :
>
> tcp_ao_prepare_reset() looks up the key for a reset that is sent on
> behalf of a listener by the address of the peer. It takes that address
> from the IPv6 header whenever the listener is an AF_INET6 socket, also
> when the segment is an IPv4 one that arrived on a dual-stack listener.
> The address is then read from the middle of the IPv4 header, the key of
> the peer is not found and the reset is not sent.
>
> The v4-mapped check that follows does not help: it looks at
> sk->sk_v6_daddr, which is the unspecified address for a listener, and
> it runs after the address has been picked.
>
> Take the family and the address from the protocol of the segment
> instead of the family of the socket.
>
> Fixes: 06b22ef29591 ("net/tcp: Wire TCP-AO to request sockets")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
> ---
> v2:
> - Take the family from skb->protocol only, do not read sk->sk_family
> (Kuniyuki).
> v1: https://lore.kernel.org/all/20261117215554.68071-1-dennylin0707@xxxxxxxxx/
>
Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>
Please reply to the netdev-bot question: how was this found, and did
you trigger it at runtime or is it from code inspection only?
A follow-up for net-next adding a v4-mapped peer on a dual-stack
listener case to tools/testing/selftests/net/tcp_ao/rst.c would be
nice.
Thanks.