* [PATCH net] net/tcp-ao: fix reset key lookup for IPv4 segments on IPv6 listeners
@ 2026-11-17 21:55 Hungyu Lin
2026-11-17 21:58 ` netdev-bot+sinfo
0 siblings, 1 reply; 2+ messages in thread
From: Hungyu Lin @ 2026-11-17 21:55 UTC (permalink / raw)
To: edumazet, ncardwell
Cc: kuniyu, davem, dsahern, kuba, pabeni, horms, 0x7f454c46, fruggeri,
noureddine, netdev, linux-kernel, dennylin0707
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.
Use the protocol of the segment to tell the family, like
tcp_v6_do_rcv() does.
Fixes: 06b22ef29591 ("net/tcp: Wire TCP-AO to request sockets")
Cc: stable@vger.kernel.org
Signed-off-by: Hungyu Lin <dennylin0707@gmail.com>
---
net/ipv4/tcp_ao.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/tcp_ao.c b/net/ipv4/tcp_ao.c
index bb7bbc20ba3f..656dbf805cfc 100644
--- a/net/ipv4/tcp_ao.c
+++ b/net/ipv4/tcp_ao.c
@@ -813,14 +813,12 @@ int tcp_ao_prepare_reset(const struct sock *sk, struct sk_buff *skb,
sisn = th->seq;
disn = 0;
}
+ if (skb->protocol == htons(ETH_P_IP))
+ family = AF_INET;
if (IS_ENABLED(CONFIG_IPV6) && family == AF_INET6)
addr = (union tcp_md5_addr *)&ipv6_hdr(skb)->saddr;
else
addr = (union tcp_md5_addr *)&ip_hdr(skb)->saddr;
-#if IS_ENABLED(CONFIG_IPV6)
- if (family == AF_INET6 && ipv6_addr_v4mapped(&sk->sk_v6_daddr))
- family = AF_INET;
-#endif
sk = sk_const_to_full_sk(sk);
ao_info = rcu_dereference(tcp_sk(sk)->ao_info);
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net] net/tcp-ao: fix reset key lookup for IPv4 segments on IPv6 listeners
2026-11-17 21:55 [PATCH net] net/tcp-ao: fix reset key lookup for IPv4 segments on IPv6 listeners Hungyu Lin
@ 2026-11-17 21:58 ` netdev-bot+sinfo
0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sinfo @ 2026-11-17 21:58 UTC (permalink / raw)
To: Hungyu Lin
Cc: edumazet, ncardwell, kuniyu, davem, dsahern, kuba, pabeni, horms,
0x7f454c46, fruggeri, noureddine, netdev, linux-kernel
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by LLM and not proven at runtime). If it was triggered
please include the symptoms, like the stack trace or kernel messages.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account.
*IMPORTANT*: If you do repost (for other reasons) - please include
the relevant info in the cover letter or commit messages.
--
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-17 21:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 21:55 [PATCH net] net/tcp-ao: fix reset key lookup for IPv4 segments on IPv6 listeners Hungyu Lin
2026-11-17 21:58 ` netdev-bot+sinfo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox