Article View: linux.kernel.netdev
Article #7742Re: [PATCH net v2 1/1] tcp: check congestion control restriction first
From: Eric Dumazet
Date: Tue, 27 Oct 2026 05:31
Date: Tue, 27 Oct 2026 05:31
31 lines
10244 bytes
10244 bytes
Le mar. 27 oct. 2026 ร 06:00, Kuniyuki Iwashima <kuniyu@google.com> a รฉcrit :
>
> On Tue, 27 Oct 2026 12:46:49 +0800, Zhiling Zou wrote:
> > tcp_set_default_congestion_control() takes a reference to an algorithm
> > before checking whether a non-init network namespace may select it. A
> > rejected request returns -EPERM without dropping the reference.
> >
> > This affects module-backed algorithms too; BPF is not required. For
> > example, after root loads tcp_bbr, a user with CAP_NET_ADMIN in a
> > non-init network namespace can repeatedly request it as the default
> > although it is not in tcp_allowed_congestion_control. Each rejected
> > write leaks a module reference. Since module->refcnt is an atomic_t,
> > 2^31 such writes can make it negative; later module_put() calls warn,
> > and rmmod can hit the BUG_ON() in try_release_module_ref().
> >
> > Check the namespace restriction before acquiring the reference, as
> > tcp_set_congestion_control() already does.
> >
> > Fixes: 8d432592f30f ("net: Only allow init netns to set default tcp cong to a restricted algo")
> > Cc: stable@vger.kernel.org
> > Reported-by: Vega <vega@nebusec.ai>
> > Suggested-by: Eric Dumazet <edumazet@kernel.org>
> > Assisted-by: LLM
> > Signed-off-by: Zhiling Zou <zhilinz@nebusec.ai>
>
> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Technical Details
Message-ID:
<CAL4Wiiqu2Az-B1dZnVRJefW-F52ouzLQ5VQ56L3FxSaeXcXGvA@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352225-linux-kernel-netdev=dewy.ruReferences:
<71c142b2d45af6a2fe7fc6cd4a5ca52c53afbe23.1793075984.git.zhilinz@nebusec.ai> <auAv3AoY0FkcXIEr@google.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-352225-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v2 1/1] tcp: check congestion control restriction first
Date: Tue, 27 Oct 2026 06:31:30 +0100
Organization: Usenet Network
Message-ID: <CAL4Wiiqu2Az-B1dZnVRJefW-F52ouzLQ5VQ56L3FxSaeXcXGvA@mail.gmail.com>
References: <71c142b2d45af6a2fe7fc6cd4a5ca52c53afbe23.1793075984.git.zhilinz@nebusec.ai>
<auAv3AoY0FkcXIEr@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="1471023"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:RT8n1h4gjwLq/00AvrgA9o1CKtY= sha256:gh8iwMKuIRTRYClkHLqg6cCeTd8sOs3mhkMNwy2pYvQ=
sha1:m3Sk2ZYpZheFvYLtH8HLmpjSW6s= sha256:5iuNb1rZiNEQiv36HVfQYMw/BmEOFkS7yECpjITRhrA=
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 3FDF7125BDC; Tue, 27 Oct 2026 08:35:59 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.739
X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, 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 qJJL_n233ZuE;
Tue, 27 Oct 2026 08:35:56 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-352225-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id BB9EE125BDA; Tue, 27 Oct 2026 08:35:46 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 470F42BAE1; Tue, 27 Oct 2026 05:31:46 +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=1793079103;
b=fBG7Fw01ebgzYadszmKEisPiSgrFygbDbMjG1o5ksaMZFwL5dbAHJDW485J4LV8XMVFv
lCIDM9ovzj+X0L0DbsRY1kD96SIq9PZOXgNsyFWTUGzHwixt0mBcLtrtKgi83xT+MP6Pg
pVi0szk2lyiGC8QWmuW4RgUuioLFcZL2JV3NdnyYeHZcmd9GheHw6CmJdEgH2HFSSh2rE
pm4A30zOdCRhe/LdHCpVeZHgxpKT5y1RSA+9jMPprJtweU/xEMVzkh2ojxm0wgPbUa/pR
I2wirS1p16XN2dqOf+rygbVbMj4Lkeklf8SkJp0Xryhp+KDKSE8WZ348i+KVObi/+jA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793079103;
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=Vdr4C3PkcbVZsQqqGDmD8tEhG/m1kQL4TeacGRf3vdo=;
b=AfclyuTCYd9/xv+RHT0708jrfBm1WeOfEhwyCrNQmKXtGpsFKix7es9Y1LKMjAnDFS16
jCOHr22XrwWj3gGBfaRFkbJAohrIYuO1vN8pISJxueav7e8AYS514WN0E4ydnKzFhdaf1
bNYHn8L+FouzjeFa8XK2NIBmSQo3mejPz21IYgvjTh2qxVQByrld0pB0PN01VURbJ6yJP
ONeWvzM4mtEx3Miz+fjW/m9pYrrSKDYwYkno1bKiRxdNMg/Chn6g3q4pMFUq/e7RkeU9G
GrMzBrTSKG7igluVrFAeTAAHj50q17sQY7DnTaLeXnHLcG99RCuJQrR1VIw8DpRua3A==
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=kyO1L8zA;
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 56584606A327;
Tue, 27 Oct 2026 05:31:43 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kyO1L8zA
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=1793079102;
b=5RKsmWB5dftYmLwW5t7AVWRwOMWVD/KWhLqmqaRvI7nkhIJ6u8L1gSni2XVkI5OXlOrV
MI5Bo6N3F36okUTJmjaXF01Gte37xfaE2zS81srRPG9TSIEDycJz0Bn8uGVnvO/A+dcK3
oQwXU/OcxrSEDUPDvpP/Qpj2vyAOjRC1I0tN3mKGC7EWh2HF93kCcSBFegD9i9suS2HiF
fbcg/sLugKlcW4dO+Qb/G+A7IEGeJeXjZGNhuSLxnsbm2Dsn0QG8nl3aQDev4LZFA/pow
gRfXXoBi91gmZkVoiTbdPkviweOX0d3cjxWvSJpojgkS7f2Fuja3Nz17wWV/M9qfHYg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1793079102;
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=Vdr4C3PkcbVZsQqqGDmD8tEhG/m1kQL4TeacGRf3vdo=;
b=SwlO+64rD6/CZZnOELHJtT714m4uCBZHFTF2P8JzNQ4kmjuk0S6ZHNOlpuqG5PQ2R6ca
Iezv9UQ/nx+qrDgKfPGaJpWaINRDT/qd+pWYKsclMuNp2FiwuRkwpklJ6g4LTq9MPXGBy
rzboNg6zk4UDwYMxdKbTUCncU8eW3BRyJ5H1SwH9woAxKKYDWSYUSHq6vaDbtyZeL6S5E
QSmik5AxGQBd4Ra05UDXWrabscSeBnEw0CjVXiM6IPWTFcbWazJKaux2y4Nwn5bifkWCI
wATUayopoigLizubYj5k4eif6QsBdDSDTJkFZO6Xq+R4Ep7uOKGEsQjBoUVcIABI6zA==
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=kyO1L8zA;
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 33FFA606A31E
for <netdev@vger.kernel.org>; Tue, 27 Oct 2026 05:31:41 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id C26EF1F031E3
for <netdev@vger.kernel.org>; Tue, 27 Oct 2026 05:31:41 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
s=k20260515; t=1793079101;
bh=Vdr4C3PkcbVZsQqqGDmD8tEhG/m1kQL4TeacGRf3vdo=;
h=References:In-Reply-To:From:Date:Subject:To:Cc;
b=kyO1L8zAQpWi9xUkQbRxPY6Jss1nVwpRvCFjx05ldBQvcEb/zrIuYt4szVNe89Qg6
zmtRPChFJtOxHgQHxO0VrMSGeuSJGPZYSR+HWAIHDYpTeI8GDqOaSpH+Qd9q1Ycg+/
8IHawtMy6hfe0KIhBcFIO+/2URBo27mByOov2euanpvGGSrLp49MuY/009gBHToflQ
L35MgGMwd8bCFhVZyFeSoECY2g58JK3/XvqnmLdJ1SXOHTFNuEhHQ/s2UdiNR1ja0v
oW5sF54BYPB1cUIAnhxbCb6CZcWBJz2OHIpZH2WXGBEn9QAuU8eKThiRFeeorV0SHg
FNGbFIYk9Wxhg==
X-Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-49429181ce9so2099784fac.0
for <netdev@vger.kernel.org>; Mon, 26 Oct 2026 22:31:41 -0700 (PDT)
X-Forwarded-Encrypted: i=1; AKwUvByhiTk1HcR8LNpOWiFHYue//OPmw7hnvwY9efpbT2k2dEjtdQWl9OJgE3jf4moQAcoRDUcAJcY=@vger.kernel.org
X-Gm-Message-State: AFq9FYJa1p3ue9aiTrRE194M+zFRWdqrBXTrhyfTkq7ZaRdSyeilNkO/
Mj3c0foolVABDAw4YsiP0o0rscV5WP0XB/MG+PSwuiA5ayEzMR30FIT4Vds2stz3AXcKi1WV8jk
VCdVwJyX7SMwgvLJSE2uj3uXWzelQV8o=
X-Received: by 2002:a05:6870:82a2:b0:45e:25a9:5455 with SMTP id
586e51a60fabf-4a83f1cb4e4mr5508785fac.2.1793079101053; Mon, 26 Oct 2026
22:31:41 -0700 (PDT)
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: <auAv3AoY0FkcXIEr@google.com>
X-Gmail-Original-Message-ID: <CAL4Wiiqu2Az-B1dZnVRJefW-F52ouzLQ5VQ56L3FxSaeXcXGvA@mail.gmail.com>
X-Gm-Features: AclHuK-fAzYz3D12aaK1VJX8HEDAnoy13ILnQawpMb1g_qhckuAXvvyZa-sKNj4
X-Cc: Zhiling Zou <zhilinz@nebusec.ai>, netdev@vger.kernel.org, bpf@vger.kernel.org,
ncardwell@google.com, davem@davemloft.net, pabeni@redhat.com,
horms@kernel.org, jonathon.reinhart@gmail.com, vega@nebusec.ai