Article View: linux.kernel.netdev
Article #27209Re: [PATCH bpf v2 0/3] tcp, bpf: fix CA state on open and the TCP_CONGESTION name check
From: "Alexei Starovoitov"
Date: Sat, 05 Dec 2026 02:36
Date: Sat, 05 Dec 2026 02:36
35 lines
12858 bytes
12858 bytes
On Fri, Dec 04, 2026 at 06:22 PM Paul Moses <p@1g4.org> wrote:
> Yes, the refcount bug is independent. My concern is that patch 2 clears CA state
> already initialized by the hook.
>
> unpatched (#14): init=1 release=1
> all patches without [2]: init=2 release=1
> all patches with [2]: init=1 release=1
>
> Without [2], the child's CA is initialized twice without a release in between.
Yes. ->init() runs twice. It's harmless.
The second ->init() starts from zeroed icsk_ca_priv, like the first one.
Rows 1 and 2 have a real bug. They leak a reference on ca_count.
The lsm prog takes one. tcp_ca_openreq_child() takes one more, because
icsk_ca_setsockopt == 1. close() puts one.
So this prog needs [2] with and without patch 2.
> I can move the reset before the hook instead and drop the backport prereq note,
> but I feel like we're making this more complicated than it needs to be.
Pls don't move it. Without [2] the moved reset misses this case:
inet_csk_clone_lock()
reset
lsm prog: bpf_setsockopt("vegas") tcp_vegas_init()
icsk_ca_initialized = 1
tcp_ca_openreq_child() route has "congctl cdg"
icsk_ca_ops = cdg
tcp_init_transfer() skips tcp_cdg_init()
cdg sees ca->gradients == 0x7fffffff7fffffff again.
The reset in tcp_ca_openreq_child() covers it with and without [2].
Keep patch 2 as-is. Drop the note only.
Technical Details
Message-ID:
<DNCG6W97X6S5.20HJGVQ84C2FW@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-377792-linux-kernel-netdev=dewy.ruReferences:
<cover.1796374535.git.p@1g4.org> <DNC9500T7CFW.33DZ9BCBYWA12@gmail.com> <0qI4bliEJoe1Gzuxoccq94xz28S015yDsjw2nfkjEAyABbd6OQ3d8MEGJ5WX6zuDQhbfOH2IxT36YERbqvYrlYwHeaRGXNsWeurXQahMGH0=@1g4.org> <DNCEWOBJTPJF.3VGK5DRAMAV1N@gmail.com> <t7fsk0hbV-A2qnzjQnX34xQbAvJd3Yj8p5kbhA0zOCrIdWSfCSYkkVn-qQWagoYh8yDYUYvi7yvXHkkS7Cg0hdxW3phTyboXYEK1jo-W384=@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-377792-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: Sat, 05 Dec 2026 02:36:31 +0000
Organization: Usenet Network
Message-ID: <DNCG6W97X6S5.20HJGVQ84C2FW@gmail.com>
References: <cover.1796374535.git.p@1g4.org> <DNC9500T7CFW.33DZ9BCBYWA12@gmail.com> <0qI4bliEJoe1Gzuxoccq94xz28S015yDsjw2nfkjEAyABbd6OQ3d8MEGJ5WX6zuDQhbfOH2IxT36YERbqvYrlYwHeaRGXNsWeurXQahMGH0=@1g4.org> <DNCEWOBJTPJF.3VGK5DRAMAV1N@gmail.com> <t7fsk0hbV-A2qnzjQnX34xQbAvJd3Yj8p5kbhA0zOCrIdWSfCSYkkVn-qQWagoYh8yDYUYvi7yvXHkkS7Cg0hdxW3phTyboXYEK1jo-W384=@1g4.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="2936071"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:6gd0F341HENbUY0bbeQ3w0I5RWE= sha256:2T0ejhRtVwa2ykfVLM7m/0ZSB67pcryf85qjGZGPW+w=
sha1:otdDm+qacAEDhF0cKSQyi3ByshA= sha256:U7qW2zxuKTR6DPfBxUjyYPfLmn7dkarpo0MJMvDfED0=
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 13B51117D46; Sat, 5 Dec 2026 05:36:47 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.397
X-Spam-Status: No, score=-3.397 tagged_above=-9999 required=6.31
tests=[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 iIkp_bHYPmUn;
Sat, 5 Dec 2026 05:36:44 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-377792-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id C2372117A32; Sat, 5 Dec 2026 05:36:36 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sto.lore.kernel.org (Postfix) with ESMTP id 916DA60642A; Sat, 5 Dec 2026 02:36:35 +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=1796438195;
b=WEIjHPTEt3Ts2559D6DTaf/XsbI4EYltXH7bNMfsgjApx7ujHHHx0K2Rtc9ouyYULXaa
zFF+MSHy/RoWoNyK6ZgPwgU+unmVc90o5RB/aLYwKmvA1tPj/upUQtppj648r9TOthWqL
ayHhhkPuVe7zB761gbbom9K5zJ5aOFbHKvdZLhl1bFUI2NK1AUxkjUaYWR24oi9P96xzg
FW0AMR9MeX179GEYvO6gkxFRrqEweaTDUR0iQzyBpDR6KgBWpDFlcF1LAM2A7I1bOQo3+
pbENSPWjk37wuejirsrJvo48zMIUCzf7fA+bdI/AAHbZjgNlNzF+te2g8U4WPdcHOSA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796438195;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted: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=ctkpT32JinMDytizxIwGQ6fVOJc1WI8oohL+lvcaesI=;
b=EhOerNKDgGNBoY6WMhfkv2To7V5X6psq1r511ZwbfXprpBxshBsrKOXFHQLXuEI2B9KN
tfJnJQET1B0NyyIQEKxCYm5wsi8UT+NtEl/RN4eq1bLpEfN0PVg/tHveJOKHGa+Klh++V
8U6+lEZDa8HGvvqASJiEu57noe0eWJxmsauc2IaLCX4U1CBVuUepfq5cGeFmNhOg7yXaK
cUBpQmfKp5SVVJpjr+5NiKvRyqCxAj/AO1KGcqyignLh5ZtwTItnrjdhhE3/8+3uFsAgp
u6pIexezXrCTkT6XZZvplYx7iOpztBkBrofhHH7cooqcO3G93rP+PCHZpPU3v3icSww==
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=B3swnB9K;
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 F31D4606A322;
Sat, 5 Dec 2026 02:36:34 +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=B3swnB9K
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.178
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796438194;
b=afoTxH6zuZu05B0cwgowjHus+EZsAbcfrTD4hKXP06Z7NqBTg4nAORfSKYoPHq3dcFW8
5WMm4iPP+QVjx4CIUHSrYECcxsE80qYJ52tmhWB8goA0io1EBFRmEAzjyC01i5N4Qq755
uNS9sTbMwH55bMJ4vjIzw49A/zyh8Cwtve+24ktVhf5IXUINPrLqL47wXBnGOPMXIbgAI
i4YUCYbI+Hir7TCQ/3D4x10/XdQiUcfwhMp8QU1nQa4LQYQJbwSjTvajHm/GVXq0t2Imz
dxNTcKA85b5lUEp5vZRUAnU83IYwkc92n1nV3TwBqpmoeCbEiqHP2iLxJ/PPJPdYKIQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796438194;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted: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=ctkpT32JinMDytizxIwGQ6fVOJc1WI8oohL+lvcaesI=;
b=xz7EvWvPy+rLDrWK3JKwvVUOTwmV7AsRipd3NkrMIE6ghUgMeAyOPgiM/0yw6VIO614d
BtOxfH0WYC+MCWyR0TT3vuXFUi5xc9q6ddiM3dnXzJUxP/QcwmKfcbmFgAxZw9fHW42uG
wJGnBUgD6aK2QUJIhxqwMrhpgSPLPKVB3OvRZgXoqm6sD+z3gnxhMCTD69IjcjbWDRmKN
OULkFEHVg25fNLARzYZE6lqp4yXyzn2QKKTaH0+igjbs2sad1E3jRw8K+mbgAdujt7gmm
DkTbKfir9bPOnkWZ4gbTprT4j2Mb3oJzWvQQDLOlF/eh9kLb55cpc0eGFqhxggcMQbw==
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=B3swnB9K;
arc=none smtp.remote-ip=209.85.214.178
X-Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178])
(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 CA73A606A32C
for <netdev@vger.kernel.org>; Sat, 5 Dec 2026 02:36:33 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CA73A606A32C
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-pl1-f178.google.com with SMTP id d9443c01a7336-2f04fab527eso15477555ad.0
for <netdev@vger.kernel.org>; Fri, 04 Dec 2026 18:36:33 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1796438193; x=1797042993; 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=ctkpT32JinMDytizxIwGQ6fVOJc1WI8oohL+lvcaesI=;
b=B3swnB9Ku8MnsUUxsY+gCRnO3+JTfBPwLnQD1NpQpCYZCB6Pl7drCJmmHyJGQVe06o
E3vU39rxUOHWt32Jp0YQbOUyvprIAP347GG1YNuaOxGeFJK/Qpi5iPCEkUuvZoCDWqmz
dKS8xKho/DjpfzX4D2VWHr8V0FmaYfefXZd2HDTCmKzHeS5sginf9hO8h4MMPag4Hint
qx4I1P9h147pS13zSxVmGy4kOEtOzSOkFH7Kt/5ST9ooOHIyzey/BL0UphRvDQH4bkOb
lEfBhpxyYnOcR2OSlVxUmrHZERpVfvemeReLW+RqWYc5TEPOROT1vBWJ991EZXLE9AGR
jp8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796438193; x=1797042993;
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=ctkpT32JinMDytizxIwGQ6fVOJc1WI8oohL+lvcaesI=;
b=qnbYXTjPZkj8/eTGKPxY/BtXifTU0oYNEtZ+hClW8Qbxtb6YjFJpIEAtWns/sd/3H4
4A9JEM5lWn88QrF9dMjkAjDR/ttQkB12EoT/FhnzO98feR8ZQjCfmFs6EUpvAGCuhsB6
fNpBS/dhq8OJNsyUhgIW1iVXS3vfAywp6TYddf6XgMDtcgzVChYJUgHnOfv3ZZrSZuaf
3GrW+IjArNDIF85qYCmYfiJB12G92F+y5RaVEk5+ppvFfdUsou460v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:b0:2ef:f3df:7d7d with SMTP id d9443c01a7336-2f1ba21daebmr36948675ad.51.1796438192791;
Fri, 04 Dec 2026 18:36:32 -0800 (PST)
X-Received: from localhost ([153.61.198.246])
by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f1b791c0f1sm21197905ad.30.2026.12.04.18.36.32
(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
Fri, 04 Dec 2026 18:36:32 -0800 (PST)
X-Cc: <bpf@vger.kernel.org>, <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: <t7fsk0hbV-A2qnzjQnX34xQbAvJd3Yj8p5kbhA0zOCrIdWSfCSYkkVn-qQWagoYh8yDYUYvi7yvXHkkS7Cg0hdxW3phTyboXYEK1jo-W384=@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