Skip to content

tcp: initialize missing request_sock fields in syncookie path

Thaison Phan bpf lkml netdev 4 versions – Applied

Status from this message: This series was applied to netdev/net.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 1 replyApplied 2/2
  2. v32 patches 2 repliesSuperseded
  3. v22 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v12 patches6 repliesSuperseded

Changes in v4 from the cover letter

- Patch 2: restore treq->syn_ect_snt = 0 in cookie_tcp_reqsk_init() and guard syn_ect_snt updates in cookie_{v4,v6}_check() with !req->syncookie for BPF custom syncookies; document in changelog (Sashiko, Eric Dumazet)
- Patch 2: add Reviewed-by tag from Matthieu Baerts
v3: https://lore.kernel.org/netdev/[email protected]/
- Patch 2: clarify syn_ect_snt / tcp_accecn_third_ack() description for AccECN connections and reference RFC 9768 Table 4
(Chia-Yu Chang)
v2: https://lore.kernel.org/netdev/[email protected]/
- 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/[email protected]/

Patches in v4 All 2 applied

#Subject and filesSizeRepliesApplied
1/2tcp: initialize ir_rmt_addr and ir_loc_addr in cookie_v6_check()net/ipv6/syncookies.c+3 -00 repliesApplied
2/2tcp: accecn: initialize AccECN fields in syncookie pathnet/ipv4/syncookies.c net/ipv6/syncookies.c+10 -00 repliesApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchEric DumazetMatthieu Baerts (NGI0)
SeriesR-b
1/2R-b
2/2R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH net v4 0/2] tcp: initialize missing request_sock fields in syncookie path

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 the AccECN request_sock fields in cookie_tcp_reqsk_init() and sets syn_ect_snt in cookie_{v4,v6}_check() for kernel-generated cookies (!req->syncookie), 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.

v4:
- Patch 2: restore treq->syn_ect_snt = 0 in cookie_tcp_reqsk_init() and guard syn_ect_snt updates in cookie_{v4,v6}_check() with !req->syncookie for BPF custom syncookies; document in changelog (Sashiko, Eric Dumazet)
- Patch 2: add Reviewed-by tag from Matthieu Baerts
v3: https://lore.kernel.org/netdev/[email protected]/
- Patch 2: clarify syn_ect_snt / tcp_accecn_third_ack() description for AccECN connections and reference RFC 9768 Table 4
(Chia-Yu Chang)
v2: https://lore.kernel.org/netdev/[email protected]/
- 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/[email protected]/

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 | 7 +++++++
 net/ipv6/syncookies.c | 6 ++++++
 2 files changed, 13 insertions(+)

base-commit: 2a324a58a084c5cfd7e5a2f55e0786bee170a4a5

Signature · 1 line
2.56.1.831.g720f3f5937-goog