[PATCH net v2 0/2] tcp: initialize missing request_sock fields in syncookie path
From: Thaison Phan
Date: Sun Nov 15 2026 - 21:37:23 EST
Initialize missing request_sock fields for TCP connections accepted via
SYN cookies, where cookie_tcp_reqsk_alloc() and
bpf_sk_assign_tcp_reqsk() allocate without __GFP_ZERO:
- Patch 1 initializes ireq->ir_rmt_addr and ireq->ir_loc_addr to
LOOPBACK4_IPV6 in cookie_v6_check(), matching tcp_v6_init_req().
- Patch 2 initializes saw_accecn_opt, accecn_fail_mode, and syn_ect_rcv
in cookie_tcp_reqsk_init() and sets syn_ect_snt in
cookie_{v4,v6}_check(), matching tcp_openreq_init() and
tcp_{v4,v6}_send_synack().
An AI coding assistant helped audit the request_sock initialization
paths, write the QEMU reproducer, and draft the changelogs.
v2:
- Patch 1: clarify how KASAN (via SLUB_RCU_DEBUG) exposed the bug,
explain how it was observed, and include the inet_sock_set_state
trace line (Eric Dumazet)
- Patch 2: drop redundant treq->syn_ect_snt = 0 in
cookie_tcp_reqsk_init() and clarify how the bug was found and
observed via TCP_INFO (Eric Dumazet)
- Add Eric Dumazet's Reviewed-by tags
v1: https://lore.kernel.org/netdev/20261114161248.3428695-1-thaisonphan@xxxxxxxxxx/
Thaison Phan (2):
tcp: initialize ir_rmt_addr and ir_loc_addr in cookie_v6_check()
tcp: accecn: initialize AccECN fields in syncookie path
net/ipv4/syncookies.c | 4 ++++
net/ipv6/syncookies.c | 4 ++++
2 files changed, 8 insertions(+)
base-commit: aa40afa831ebfe45e40a23721711059f2ac584d4
--
2.56.0.611.g1030f0b940-goog