🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27131

Re: [PATCH bpf v2 0/3] tcp, bpf: fix CA state on open and the TCP_CONGESTION name check

#27131
From: "Alexei Starovoitov"
Date: Fri, 04 Dec 2026 21:04
38 lines
12327 bytes
On Fri, Dec 04, 2026 at 01:01 AM Paul Moses <p@1g4.org> wrote:
> Patches 1 and 2 fix the cases Alexei reported [1]: stale CA state
> when a route changes the algorithm or a child inherits the listener's
> private state. Patch 3 uses the same name for the CDG check and lookup.

tcp fixes go via net tree.
Patch 1 fixes a tcp bug. bpf is not needed to hit it.
Use setsockopt("vegas") instead of bpf_cc in the sequence from [1].
tcp_vegas_init() sets minRTT and baseRTT to 0x7fffffff.
They are at offsets 16 and 20 of icsk_ca_priv.
cdg keeps ca->gradients there.
tcp_init_transfer() skips tcp_cdg_init(), so tcp_cdg_grad() and
tcp_cdg_release() see ca->gradients == 0x7fffffff7fffffff.

> Patch 2 needs Jiayuan's fix [2] so the clone hook runs after the
> child's CA state is cleared.

It doesn't.
Without [2] the lsm prog can init a cc on the child before
tcp_ca_openreq_child() runs.
The reset drops that state without ->release().
cdg is the only in-tree cc with ->release(), and bpf_setsockopt()
refuses cdg. So there is nothing to free.
A bpf cc gets ->init() twice. That's all.
Patches 1 and 2 don't depend on [2]. The backports don't either.

> I left the callback issue [3] out after reading more historical context.

In [3] you asked whether bpf_setsockopt(TCP_CONGESTION) can be limited
to .init.
No. It doesn't help.
.init of a bpf cc can write icsk_ca_priv after bpf_setsockopt() returns.

Pls resend patches 1 and 2 as [PATCH net].
Pls resend patch 3 alone as [PATCH bpf v3]. It doesn't depend on them.

pw-bot: cr
Technical Details
Message-ID: <DNC9500T7CFW.33DZ9BCBYWA12@gmail.com>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377628-linux-kernel-netdev=dewy.ru
References: <cover.1796374535.git.p@1g4.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377628-linux-kernel-netdev=dewy.ru
From: alexei.starovoitov@gmail.com ("Alexei Starovoitov")
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH bpf v2 0/3] tcp, bpf: fix CA state on open and the
 TCP_CONGESTION name check
Date: Fri, 04 Dec 2026 21:04:55 +0000
Organization: Usenet Network
Message-ID: <DNC9500T7CFW.33DZ9BCBYWA12@gmail.com>
References: <cover.1796374535.git.p@1g4.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2866297"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:fCce145FdoZm7RLXa4Iw9D66Owg= sha256:osS6BAZ7f/8/HdESVPawZSRRLgsJbSum2VCQLeSW0B8=
	sha1:9E0IFZvIhZFNrwTXmpo/NMPDa5U= sha256:MGR5f0FlhYTozFeHA4ZlZ3bppNgVhFGloLRxztN/V3A=
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 28094117CE2; Sat,  5 Dec 2026 00:05:24 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.297
X-Spam-Status: No, score=-3.297 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
	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=gmail.com
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 Y6ihno_Zj-vc;
	Sat,  5 Dec 2026 00:05:17 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-377628-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id EEE26117C8E; Sat,  5 Dec 2026 00:05:06 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 6AECA2FECA; Fri,  4 Dec 2026 21:05:01 +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=1796418298;
	b=l2rw3e2XTvvnaKXdjYzH72C/GiFiRInh50hsd5dhO2A8dXUzNZpqlHJLZI+ZiEodD5wc
	 obnQTuIrJuBGQMMOqbIHlIlbMJ1ulThqwPbbZJw/7brpqviX9x6YbpBHg3dw36Tf9qLSA
	 58M7GADZGT2oFOpWF2CYqvKk70HV5pqLOCYKFM2lmClhZIdxAzSvS+3dFeLAgTEmp/0Gr
	 xRgdv9HsSJ/gEanAlog4LzZgPH97BlmSgZCLuv8FcWezH2aPzLz3eN3r19JEsazV20QgE
	 eNLrDvGD/lK7odSv+7NEpjv9tgbazY+Mk2ByOKwRFEiae5UR42eArOJrPoaGc3IYgOw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796418298;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:Content-Type:Date:Message-Id:Cc:Subject:From:To:In-Reply-To:
	 References:Content-Transfer-Encoding:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version;
	bh=WX2T7InjrSW7Ibwrtae9AEohU+dA4LMlZ8VwDM5eEKg=;
	b=oDURkYx/jA6R+nNCJGzH38kphB1+u+Mz6+SMncafIpR+JpZ6wanDBI7H2+mkQgFRVo32
	 dTYWCO58RYC9QrzQtt3s0S07RfuJhmQYkBNQnQw/Ve+vt7xbBj5HDa5OdHhOqS/dHIbln
	 CLXpD+rfhtugHpVf/YbTlZLaZXpKTnw5NfbAaF8+loEcpULOh0Yi5c4fLFKK0LFKddBAO
	 mUP+U7JYMVNk/mc765Nq2GwZqXpKAGAANK0ZpHJx7euzwC/BA+TIfW4O3G013fDqNAFJg
	 6LwS0qom69/IjJc2S36QIqXbN38TBck5E4nyHYqU/y3C+3QjbWtkVFqMLp4K0BurxLQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=oCnMx6ni;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	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 7EE82606A322;
	Fri,  4 Dec 2026 21:04:58 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=oCnMx6ni
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.179
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796418297;
	b=D9qvP9CfLckBJiuY1EahQiDi4uTVJfaI+ab/w9VlCbKSKcFAg/Y9HrZJJo8zbDjbQMBW
	 FRu8CDXYJ0sFc0RexyDin+0o9J5VmemaYsEqWcsjwjUmDZAB/8ZvKRC55EDSOQ09gKRhv
	 wrlxihowl0Ihipnyy2Bnq/2HjKZhs1pyYgNwvv424zeqhIQ48SLeNsIXFl0q21aSl6TxQ
	 0xH0ZJfFJl12J92xqn6yCL9aFc0SsNtkwtGsWQYPrwkgBJFND2+bx5/+XZAarbqqiOdhD
	 qIVJC5RoRxlPsKQNt2mYrTmHD8WYMW2jIeF/fay8gZCPZ66dRQ/S8K82F+mjgVYexTw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796418297;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Content-Type:Date:
	 Message-Id:Cc:Subject:From:To:In-Reply-To:References:
	 Content-Transfer-Encoding:MIME-Version;
	bh=WX2T7InjrSW7Ibwrtae9AEohU+dA4LMlZ8VwDM5eEKg=;
	b=wIhkZ2SgriO/nMPzxKrNfT2DXTEy6Y3/gfMoU/1n8vIJYfjyfyqpUXFeTp8TIeGhSKOi
	 UGu3H65vgj+yzLQ0WFiehP33+Kn0EZeIUxv8ILW9g25FPY3gnIiq8dRr2jz4PP+jH7y88
	 D0ZmexrJ2hl0iSPxLmtY/H1u/BELF3yR7y7pWtuqLfdKQoi3eXD2F18eSKv/i3Pk7JVWr
	 myTupHRckWesiETpJVqgRGCXI6OPjf5V85ebHnbi/xvf8VAVJSWdrnm4RAjmkRaHhMKTD
	 Cq7tWcZRJsa3Pvb7903VeZBJWCm/PWTMV91h7mrlveTcx1AqD7NwBvQzNa7HlaXX0+Q==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=oCnMx6ni;
	arc=none smtp.remote-ip=209.85.215.179
X-Received: from mail-pg1-f179.google.com (mail-pg1-f179.google.com [209.85.215.179])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56A47606A32C
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 21:04:57 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 56A47606A32C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-pg1-f179.google.com with SMTP id 41be03b00d2f7-ce12ecc2af9so242860a12.1
        for <netdev@vger.kernel.org>; Fri, 04 Dec 2026 13:04:57 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796418296; x=1797023096; darn=vger.kernel.org;
        h=mime-version:content-transfer-encoding:references:in-reply-to:to
         :from:subject:cc:message-id:date:content-type:from:to:cc:subject
         :date:message-id:reply-to:content-type;
        bh=WX2T7InjrSW7Ibwrtae9AEohU+dA4LMlZ8VwDM5eEKg=;
        b=oCnMx6nivH9paVLU23TCV0MS0N2eohfAw48jVg9GDZkxlZKK9dzyICuW3zAUziEkqe
         8FTaB0pW9tCNfVwsMFYNcMGsyB5xXIqUvpChouSi2XIhmNrghrZNhJq+WFEv+wfFQBxv
         VTQkDRmIfywMaEm4M7QacUSg0BsSUgWvB/ttNx/sYh9Acb4rlCh2ZPfQbKEqBhXBJhK4
         TrH6P2lfwm3ZTILNZA3kZ/mDTpHxYyw8HIdFaVXEu33MXkKY8q4KelRFi6ZwdhQQLsN8
         rGbT+LivybMD+J1dXGTjj1g11GIkghmMZY3e4UbeCcMWptwjcf/5Jl1mqC/iX8ygQUmS
         3jiw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796418296; x=1797023096;
        h=mime-version:content-transfer-encoding:references:in-reply-to:to
         :from:subject:cc:message-id:date:content-type:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=WX2T7InjrSW7Ibwrtae9AEohU+dA4LMlZ8VwDM5eEKg=;
        b=LdUh2uKOGS8OFIu5f1v5fKve78QoVhOKsCWJGI0Qpqf51IY7CunOuWgXkxLt9Lb0oF
         +rJui+PVTNSEARxoZx0x36ZqcDMnUvEMbqhttNIWNAnvFWcfOjfn13Hg1/gGIhQ319Aw
         68kL6DOqt1BJFSmjp6lzMJl42YxLboUrHE0rNeZyL1UM5JMnFLbHJQwiFmmkQVyzwoNm
         /ldwMIc95eMHiPokz0Q8YaVnfbCyfMrCz1eDIZ+mgfA7XOqP85zBHF1bbSypgY6XyPfK
         sjMIJ/aTGkL75V9VpMpKuHmMB91fwrrwhSb9vdxOgdnnEEtpS5KysG4HSoqm4+wYZn+G
         fzuw==
X-Gm-Message-State: AB4q+uEOPERzRyYKuvGMjox2U4TkrO9O5XSsjr2KfNaNAxbS+UnfMdm9
	89wB4Ay44MLaU1djJchUpArRiMdObD8T+RUxGOtK9AmDnVS8WhR7nUqc
X-Gm-Gg: AZFdTZdsqoTaQc/SXIlfUPLgcDBZBdadhbZftT2Za3RQcmqGSn/W2uQqFLMYtN4d5vA
	TOh/vUfm0qvhdZgb0zmR8LPTrdOfH7DsquyyoTFFSmb0mR/Bhlm+lVU1hE/lSwd3VHQ956pIDwe
	sLTAl5zuAemPtLv3S9OjYFFoezDO2FHYj8lz6QVsSUmTFQ5L8dv/wov/cuGHv1ho1GD9jgoPMub
	5DxCTaS3JwcR9byYQBC+q9C0TUPT3K1vNK86qUXUptAVgfN5Up/oVZiYUmxJyY9jfTrw1v/Vs2b
	dmoZSJOrKedXXkPlrnVEb901hOG/1dLmKAKEPF30fEwWMbUFji+ODZCe8ITe5r7UICfGjvbQpRi
	SIuurfXgH3VEKYyOQ94ankRtogZEXEXMt1kci49UHi86XH9BswxPiH7PCb8h/DHGEIZh98yiix/
	Vv48FGi7F0sSjZDWxDiHhXnatIzRdX0PHPkXOTolKQlxqxGIEcggpF2WI1SVFPh8F2IguHf5Ma/
	Ou1VsHmBiFRwAwzVQWZjWs1IbfxM5mNkzOpRH9D8hDWdvJFH6AkFCksS/9xLtpqhzV7+gqa2uHQ
	E+3gTafJOi/2+c19oq7lltW0U3xWW3ZkDsid/Ap+EbiBAiiyur/UCanFvzKeVpE1SWsbKTamMW2
	8krORchuPxZHwfRMSdz7j8t83jLVlnK9Seg==
X-Received: by 2002:a17:90b:4c02:b0:3b5:32db:130 with SMTP id 98e67ed59e1d1-3b5e0619bd3mr1763928a91.13.1796418296281;
        Fri, 04 Dec 2026 13:04:56 -0800 (PST)
X-Received: from localhost ([153.61.198.241])
        by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b5c7d65000sm11003014a91.11.2026.12.04.13.04.55
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Fri, 04 Dec 2026 13:04:55 -0800 (PST)
X-Cc: <netdev@vger.kernel.org>, <daniel@iogearbox.net>,
 <martin.lau@linux.dev>, <edumazet@kernel.org>, <ncardwell@google.com>,
 <kuniyu@google.com>, <jiayuan.chen@linux.dev>
X-In-Reply-To: <cover.1796374535.git.p@1g4.org>
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