Article View: linux.kernel.netdev
Article #6689[PATCH net v2 0/2] inet: fix established lookup races
From: Hyunwoo Kim
Date: Fri, 23 Oct 2026 05:24
Date: Fri, 23 Oct 2026 05:24
33 lines
11896 bytes
11896 bytes
Fix two issues in lockless established socket lookups. Reject unhashed
sockets after taking a reference, and restore the acquire/release
ordering around refcount publication and acquisition.
Changes in v2:
- 1/2: split the unhashed checks and __reqsk_free() to reqsk_put()
conversions from the ordering changes, set the Fixes tag to commit
079096f103fa ("tcp/dccp: install syn_recv requests into ehash table"),
mention the TIME_WAIT hashdance and request replacement cases, clarify
request reference ownership, and drop the full socket race discussion
(Eric)
- 2/2: new, split out the acquire/release changes, set the Fixes tag to
commit fb041bb7c0a9 ("locking/refcount: Consolidate implementations of
refcount_t"), cover sk_clone(), and leave the already ordered TIME_WAIT
path unchanged (Eric)
- v1: https://lore.kernel.org/r/ath58Egc-oI6p3Jl@v4bel
Hyunwoo Kim (2):
inet: reject unhashed sockets during established lookups
inet: restore refcount ordering for established lookups
net/core/sock.c | 3 +--
net/ipv4/inet_connection_sock.c | 16 ++++++++++------
net/ipv4/inet_hashtables.c | 7 ++++---
net/ipv4/syncookies.c | 4 +++-
net/ipv4/tcp_fastopen.c | 3 +--
net/ipv4/tcp_input.c | 4 +++-
net/ipv6/inet6_hashtables.c | 6 ++++--
7 files changed, 26 insertions(+), 17 deletions(-)
--
2.43.0
Technical Details
Message-ID:
<20261023052542.3505250-1-imv4bel@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-350918-linux-kernel-netdev=dewy.ruShow 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-350918-linux-kernel-netdev=dewy.ru
From: imv4bel@gmail.com (Hyunwoo Kim)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2 0/2] inet: fix established lookup races
Date: Fri, 23 Oct 2026 14:24:34 +0900
Organization: Usenet Network
Message-ID: <20261023052542.3505250-1-imv4bel@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="418654"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:dAUpLOhjsHWjgHg1b2+z1WcDh18= sha256:Hqooei6XxjqwY3BLQQ9rmFau6r5Vc8GU1ZzpcZxk3DQ=
sha1:HhugW61OqVivGECXQU+b4Vm7hpc= sha256:HW54TAlQ8iHtWkZYM1dEe/apckIGTfmiOgnGwHDmja4=
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 AC5AF1113F2; Fri, 23 Oct 2026 08:26:49 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.148
X-Spam-Status: No, score=-3.148 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.25, 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 cFnn8cDHyxEb;
Fri, 23 Oct 2026 08:26:42 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-350918-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 4670E1113EF; Fri, 23 Oct 2026 08:26:31 +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 067E1608B96; Fri, 23 Oct 2026 05:26:30 +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=1792733188;
b=3XCJsQo6lP2uqLESlr8bpoGS3BEQODNqtHOm/8ltwbNdKOjRikfjhBCvxh49yCd2977+
DquQV1MFQKO6050NZhnss2sx1mS1OK1ur3dMVULrdmHU58VtymCbCP3z+y8WK+nqFIHBM
Jr40uP3QuNGWAO01DO0X9CqbBTPztKhzMkemnO4qWXH9U25VHpXzMlKr1OANP6w3N4lrJ
NiJesIwgxKIuytWTlY12CFKU8Pi7I9bR+sZysxM2v8WgNa3WI461/fZaaWoHWrnmyvwWU
h3pqrVeo8VxKqwt25qp6x4KpAUlDhvGxlscPjr0lIjkdXKulHQsvUQPxWo0t96lJBuQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792733188;
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:From:To:Cc:Subject:Date:Message-ID:
X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:
Content-Transfer-Encoding;
bh=qlBNnkEDkPHB8dgWswxWdVSqPFXZ5/t64+eH3GFcJTM=;
b=WfCyzAXTTzcwsyfa0JWIvI3WVZSB2oSb9c0JXR1xzwygGiMdBw2xc+vdslnSyz0GeY+b
UBU8knrgosiBOw6RNpmRHSZpu/JRWVaz+JxVhNZCeiytj7Ffz9oGs37qMiTKVRm2bcycZ
QB1W5a812Jb28lJ45O/7U8CegRsAxTTJrdXd1LnxhrdKtLIClMKgNRrdgvkX7bjKLcYVy
WR2m7BABxTVh6m0RN/r8EfPazgmzRMe3rrqFy3T020dTr0tIaNvE8Hb/Tl2ohc7UGoTea
pYC65uEaWibD/EFKPGFBmJ5gZHPW88B6zQOjRS/gP1/nm9HtjfGbpuw0rO7732G3hYw==
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=20251104 header.b=l3592cdj;
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 43F09606A322;
Fri, 23 Oct 2026 05:26:28 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=l3592cdj
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.216.51
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1792733187;
b=TaOfo5LjTiqrXsJu2XU5WKWW2LjLV6g9Qkhu2TiK+ca/56U57Jo9Z7uoGaernB6xRIHv
2X/soA32AmALxkRdSrhaDTQ+dfgr+TAjM2l0KlgVLFCCftrMD97c8IcXrM60cKCQGSMs4
SOYlRrT/KnzHjfes06MKguD6OftYP7h6Vq0U/994t53aKLsZbqzZupcxWLn3Ae7COnbaB
89cnym2KBUht8TReHlsfS5rK1Y334FxjfC9TE8Bv0mtDk27VMv72q+4H9L4wOiFFm5go+
7GpxFPrFD8I5aRvNNLOGnv2KChBeLkecAWz2dlrJvznDfo0Fkv2DeuUK0oLMnc/QXfA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1792733187;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version:
Content-Transfer-Encoding;
bh=qlBNnkEDkPHB8dgWswxWdVSqPFXZ5/t64+eH3GFcJTM=;
b=O/sRJCR7sojb2EBveHr/E3ykWFvuaVgPdsIKPTeHxBzEpIYVv9gVr0uaDV7q/mDGTfIR
H2A5+GlcNrwiQHN13aze86Lfa3Z8SnEGuO3sFjDD+HWfh8iWN9ckIT4hhtLKCShNxbhV3
H/ZYKD/ABc75pONYqp8ilPcJ+rlZXUXxcHyqt7wp51aq9wKeADaQkjfONL8LCfSXF4m//
I3pbv4aO0mzQ3vNEYFObQI0m2tu5GVThV3EvYWu6StPmekQaTiyPu/bCcYld9a+p8DHc9
UbGgo8J0zALczTKgZuwszTiStFpqCHYoUEUsGpREV7Lp7vxwJlB3u+SydI7o4Xs9+Uw==
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=20251104 header.b=l3592cdj;
arc=none smtp.remote-ip=209.85.216.51
X-Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51])
(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 15B91606A31A
for <netdev@vger.kernel.org>; Fri, 23 Oct 2026 05:26:26 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 15B91606A31A
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-pj1-f51.google.com with SMTP id 98e67ed59e1d1-3ab2cb8d577so371059a91.1
for <netdev@vger.kernel.org>; Thu, 22 Oct 2026 22:26:26 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1792733186; x=1793337986; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=qlBNnkEDkPHB8dgWswxWdVSqPFXZ5/t64+eH3GFcJTM=;
b=l3592cdjG1936JuIGRQc0PPIVLGtQBCJu7eIiK5WEf5QtJ5IRGI+IfkjRMYfsk6BSJ
RUkzntpaSplD6lG0jflA4cYJ28u0/GTA91FNV5QldVRQocJ9dqT4tzJvthM+XJAK8QzH
54KzgDzpdaiX2e+FjmkMOzr+kTIxaO0Nl3lYyidGC4w0qm56KxKT23gokonhjkuo/FA/
soDE2ZFzJSHmcIQCwsuwNZ7VxWlNj1e6+L0evJN/VdxYk78EcTg9BfP7PSSc+XELPC6b
zk6L4bVybDsQ2sZDIcfV9cZYY4Svpmr6fLJJiKkytdPto8v70AFbprCyxZLgj/XMLOBK
HJrA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1792733186; x=1793337986;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=qlBNnkEDkPHB8dgWswxWdVSqPFXZ5/t64+eH3GFcJTM=;
b=lmFqXW+A3NWl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88nFX70vxBECDHfpzHqXuBXv9+P
6pFpm9mwR4iys1RP46NjjvDi3Q5JHRD9pQuCK2sz6ty5+C96OzDfGc5sYW4943SFUCZmNIsH/JD
buKTvZCCzUekIp5yNk0OugM=
X-Received: by 2002:a17:90b:4b84:b0:3ab:884b:65b4 with SMTP id 98e67ed59e1d1-3adce154993mr920199a91.59.1792733186301;
Thu, 22 Oct 2026 22:26:26 -0700 (PDT)
X-Received: from v4bel.. ([58.123.110.97])
by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3ada4890c56sm7379785a91.2.2026.10.22.22.26.22
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Thu, 22 Oct 2026 22:26:25 -0700 (PDT)
X-Cc: Hyunwoo Kim <imv4bel@gmail.com>,
martin.lau@linux.dev,
john.fastabend@gmail.com,
weiwan@google.com,
sd@queasysnail.net,
jiayuan.chen@linux.dev,
netdev@vger.kernel.org
X-Mailer: git-send-email 2.43.0
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