🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #19051

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

#19051
From: Eric Dumazet
Date: Thu, 19 Nov 2026 08:48
57 lines
11504 bytes
Le mer. 18 nov. 2026 à 22:09, Thaison Phan <thaisonphan@google.com> a écrit :
>
> 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.
>

Reviewed-by: Eric Dumazet <edumazet@kernel.org>

> 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/20261117124710.1338951-1-thaisonphan@google.com/
>   - 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/20261116023709.132684-1-thaisonphan@google.com/
>   - 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@google.com/
>
> 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
> --
> 2.56.1.831.g720f3f5937-goog
>
Technical Details
Message-ID: <CAL4WiioV7HyfBS=RZhGLkeGVyZEHf85fTueKvXD4s+aO3fRTqQ@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366863-linux-kernel-netdev=dewy.ru
References: <20261118210933.2477423-1-thaisonphan@google.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366863-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v4 0/2] tcp: initialize missing request_sock fields in
 syncookie path
Date: Thu, 19 Nov 2026 09:48:15 +0100
Organization: Usenet Network
Message-ID: <CAL4WiioV7HyfBS=RZhGLkeGVyZEHf85fTueKvXD4s+aO3fRTqQ@mail.gmail.com>
References: <20261118210933.2477423-1-thaisonphan@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="2831826"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:PQYtVUIRy/qDJnPOq84FnEFRdCA= sha256:BTpcKXgzWWdOHDA3/XO+nRW4mPYGvTqQbbdljKSiqIM=
	sha1:bseQfyDjAuVbwxqTSQd31gqdHYE= sha256:ow2PfwFnA5eKDdd5V9IIr3C/elgbGMUXkSRBYbcupzs=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id B4887115525; Thu, 19 Nov 2026 11:48:50 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id Rikb5lLhsIkR;
	Thu, 19 Nov 2026 11:48:46 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366863-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id EF27F11556D; Thu, 19 Nov 2026 11:48:36 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 70EA32E4858; Thu, 19 Nov 2026 08:48:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795078114;
	b=ssHsSp7xMeyJgGLompaHYVhr972d7GikNXTJt/6sVcNBdsI7ev6wintEorgcJhKfwpwp
	 sx+46zgHpi1gCJwT6zMuJxyRO7ajCq688pttJUzW8rBDvCps9UJKUnDOPzQU73s3yqPYK
	 MJ4F1rhY/RHfdZMYJ8okCZn2Fc98698pGe5ASC90x5ewVXUJ9yeTxcg/eSlrp5pxmUjGA
	 fR0xMDKciZ7P0ZgD6evlId/NVz7+Wukc/ciO1fyjDy9rbAaBgFp1f6W3mcTVdg5EL4eeG
	 bsgJ20ui1JbAZAm1Ujp9SRG9piWPblJnsmZQGc8W75MShXvPYPdlaUzVaTFOSFGXAJQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795078114;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:References:In-Reply-To:From:Date:
	 X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
	 Content-Type:Content-Transfer-Encoding;
	bh=2DGfvM7qByzpKVDZ+ShBLfzRqMDlNgUiCoMSZg5a9wA=;
	b=wDWd2kLONwsO1UHtrBV+RiG4POB6FVfNmDyoOgHBZSt+IkZWfCNXfDXXUUmapO/1DnR5
	 5pbIW+xGlBfQD4SS1JsVvajOqdjONQvu/GoNMJkF6H+uq9e02UqFPkSxNlCEFC+zhN0PK
	 Fs6QZlTVWW9T+dqFVxlqZWTnixJr+iT7QQiMBaE7JxmWRji0tozdLFYNp6qfA3vkUPAx6
	 JLXTAD5OAFFwDS7xb+23EZmOpk/7tM7CjW2YdzxYef9AhEj1QEFzc3vDF4ySCslowQFJM
	 gkn8sTc/VGqfuyTIfgDYHHA4JunePoEvD87lswRInAEw0c2k9Y2YME2fg6B4SkizMuw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IbD7H8Ao;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 08148606A325;
	Thu, 19 Nov 2026 08:48:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IbD7H8Ao
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795078108;
	b=FUnmqo+6gh1rJBuILi/7G3qQ1udcFL8T8ro5RarN9xB0by5jQwxcBQMF9h/9DI58K1gK
	 +77HC6ksXRb9W3J/1lfQ1D677ihWraLXyD8+bVlcD0cSED4Kk+gcWTCKCxpNbryknlnvQ
	 laFQpQlBBDL18nuxwWo7/ug+PocRyoUjddM0GBjRAr6OZLDDc8vwHRKtfxooqkh1scPgz
	 BfMHJe4PcjKhSDLZ0ymfXJK1id8C3BjxAx09jrR002EcBVh9Ew9P5HlI8A90AIS//A99b
	 XbOfL1RgaLROfvgFb2PTxptJg6NqxTEQzx6IBmdTEgUX/2dwV6ARFoctvv9iCrf6sKQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795078108;
	h=Received:DKIM-Signature:Received:X-Forwarded-Encrypted:
	 X-Gm-Message-State:X-Received:MIME-Version:References:In-Reply-To:
	 From:Date:X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:
	 Subject:To:Cc:Content-Type:Content-Transfer-Encoding;
	bh=2DGfvM7qByzpKVDZ+ShBLfzRqMDlNgUiCoMSZg5a9wA=;
	b=bqTG7DqDyxOJdyXl1+xoGphQji+oZmlxCWdd/y5iJoXqgG2/XFHjrYU/m6VmIXjCZWoJ
	 4NHj2konr6NmiO6tFkm5QWj+1Rkk0zNkS57PofFHbLaZPGRZYRcMYi23v/YjA6t8f34EI
	 19lWLXPojKA9gbQMyl+d2nVhxK4UdLKii4KkagTfia0/1McdNZIpvTXCuwGzV2MyESeN9
	 yHpNSyxc9x86PpnigntTGCC1X9iHYAWv/7R1NNwkP4NE+Fx1VQDhBfZDgmj8jPR5SZH+K
	 x7iHtHXhTy5qScujIZEwscdT1SXg1u4BLZ8LhYK+inPHVTIktLlFKOtmWi3gxkv9cqQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=IbD7H8Ao;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 255DE606A320
	for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 08:48:27 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD9591F000C9
	for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 08:48:27 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795078107;
	bh=2DGfvM7qByzpKVDZ+ShBLfzRqMDlNgUiCoMSZg5a9wA=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc;
	b=IbD7H8AohXhp9T6d2YizYcw3IEOLuMrBuGlnMP/hbh+qaH2NZTdQK6XvcpIrE0oLt
	 eHc6ujjspld2m0TEYAwidrOC3LxGtGaKnw4GKCw8ySRfUzZ4Odhw3Gpj41mcpbEysU
	 KwSMhSVthY55rm2q0VPKvTXGkf+noW3G742+9RJoMlOIyViTw1hCrWNTwJv7U0tkil
	 8uVY2XkPsM75Vl1FPJKgGPdbQyXYJ8UmQbgKlEldPQz2sDdL3mA2P4bON2hz91Vz7F
	 VlN0ZtaXlIFoVa3CBZN0aBOWryWOPLyc8rrAp60KRrbeUiKwgNVJkS/t8S0ItsL7/x
	 L4AkRxbD9a77Q==
X-Received: by mail-oo1-f52.google.com with SMTP id 006d021491bc7-71b0d330acfso489425eaf.1
        for <netdev@vger.kernel.org>; Thu, 19 Nov 2026 00:48:27 -0800 (PST)
X-Forwarded-Encrypted: i=1; AL+hErHFrD4aHQb92VnamMcoYd+PeF4PZxH09z/8kDlZ9sHQ37QAI1EqYAOoHWtfUkmbG8mgkQudhYU=@vger.kernel.org
X-Gm-Message-State: APuU4Z9lpP++ClpnYT4rsSNYU8vN/xwtS3AeDfAoXYV7L4XJ/WFIErE7
	9WYWgoIXOfdzIR1LouvyL8aWbI5rxDkyxKX/4ST5Xn+ZeYQAlc550vHg3eN+a8gjDYFtyajubqK
	WpHPavvtqEmAsP4oULCiXUcqQ/CqNGZg=
X-Received: by 2002:a05:6820:340c:10b0:71a:d047:6555 with SMTP id
 006d021491bc7-71b325f3a96mr154013eaf.23.1795078107107; Thu, 19 Nov 2026
 00:48:27 -0800 (PST)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261118210933.2477423-1-thaisonphan@google.com>
X-Gmail-Original-Message-ID: <CAL4WiioV7HyfBS=RZhGLkeGVyZEHf85fTueKvXD4s+aO3fRTqQ@mail.gmail.com>
X-Gm-Features: AclHuK9F0ayhafrQxHgp6uPjGOaq2j-B5wMREskCAbT73MrvpLVLr_jmqjYYh6w
X-Cc: Neal Cardwell <ncardwell@google.com>, Kuniyuki Iwashima <kuniyu@google.com>, 
	"David S . Miller" <davem@davemloft.net>, David Ahern <dsahern@kernel.org>, 
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, 
	Matthieu Baerts <matttbe@kernel.org>, Simon Horman <horms@kernel.org>, Ilpo Järvinen <ij@kernel.org>, 
	Olivier Tilmans <olivier.tilmans@nokia.com>, 
	Chia-Yu Chang <chia-yu.chang@nokia-bell-labs.com>, Stan Iliev <stani@google.com>, 
	netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org