Re: [PATCH net 2/2] tcp: accecn: initialize AccECN fields in syncookie path
From: Thaison Phan
Date: Sun Nov 15 2026 - 21:32:18 EST
On Sun, Nov 15, 2026 at 09:13:02AM +0100, Eric Dumazet wrote:
> This is a different bug than the uninitialized fields above, with
> a different impact. I would prefer two patches, one per bug, but
> since both Fixes: commits landed in the same release I will not
> insist.
Makes sense. I'll make sure to split independent fixes into separate patches
in the future.
> Same remark as for the LOOPBACK4_IPV6 patch: KASAN does not catch
> uninitialized bitfields. Please say how the failure was observed
> (KMSAN, tcpi_accecn_fail_mode in TCP_INFO on the child, ...).
This was spotted by code inspection (with AI assistance) comparing
tcp_openreq_init() and cookie_tcp_reqsk_init() while investigating the
LOOPBACK4_IPV6 bug. We then verified it on a kernel with SLUB_RCU_DEBUG=y and
slub_debug=P (preventing reuse of the warm request_sock from the initial SYN),
observing bogus tcpi_accecn_fail_mode and tcpi_accecn_opt_seen values in
TCP_INFO on the accepted child socket (as well as tcpi_accecn_fail_mode=0x2
when the listener sends ECT(0) on the SYN-ACK).
I'll update the v2 changelog with these details.
> I think syn_ect_snt is always overwritten in cookie_{v4,v6}_check()
> before being read, this line is not needed?
Agreed, cookie_{v4,v6}_check() always overwrite syn_ect_snt before
tcp_get_cookie_sock() reads it. I'll drop that line in v2.