Article View: linux.kernel.netdev
Article #25184[PATCH net] ipvs: adjust non-SYNC hashing after late destination binding
From: zhuorao yang
Date: Tue, 01 Dec 2026 11:00
Date: Tue, 01 Dec 2026 11:00
78 lines
13631 bytes
13631 bytes
ip_vs_try_bind_dest() can bind a destination to an already hashed
connection without IP_VS_CONN_F_SYNC. The non-SYNC branch of
ip_vs_bind_dest() changes the forwarding method directly instead of
calling ip_vs_conn_change_fwd_mask().
A change between MASQ and non-MASQ changes whether hn1 is linked.
The resulting stale or missing hash node can be accessed by connection
lookup, resizing, or expiration after ip_vs_conn has been freed.
Move the hashed-connection update outside the SYNC-only branch so both
late-binding paths use the existing helper.
Fixes: f20c73b0460d ("ipvs: use more keys for connection hashing")
Signed-off-by: zhuorao yang <alex000young@gmail.com>
---
Vulnerability report
Affected versions: Linux 7.4-rc5 and 7.4-rc4; vulnerable generations are
kernels with IPVS double hashing introduced by f20c73b0460d
(v7.1-rc1).
Trigger conditions: IPVS backup synchronization must be enabled,
ip_vs_ftp must be loaded, and a TCP:21 service must have a DR/TUN real
server. An unauthenticated sync datagram and FTP PASV flow can create
and then late-bind a hashed non-SYNC connection with dest == NULL.
Configuring IPVS and the service requires CAP_NET_ADMIN; injecting the
remote sync datagram itself does not. Related work: 712d2993bea5 added
ip_vs_conn_change_fwd_mask() for the SYNC late-binding branch; this
patch covers the remaining non-SYNC branch.
Reproducer status: Same-version Linux 7.4-rc5 KASAN QEMU: unpatched
kernel produced 15 slab-use-after-free reports (13 reads and 2 writes)
in conn_resize_work_handler/ip_vs_conn_hashkey_conn. With this patch,
bind removed hn1, expiration and forced resize completed without
KASAN, and the kernel powered down normally. The test harness drives
real IPVS connection and destination-binding code; the final network-
only FTP/sync injection chain has not yet been demonstrated end to
end.
Reproducer material is intentionally withheld from this public message.
AI assistance: DeepSeek identified the issue and drafted the patch.
The submitter reviewed the code and certified the Developer Certificate
of Origin.
net/netfilter/ipvs/ip_vs_conn.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 83d8a9153a34..ad3671288b3b 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -1134,17 +1134,16 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest)
/* connections inherit forwarding method from dest */
flags &= ~(IP_VS_CONN_F_FWD_MASK | IP_VS_CONN_F_NOOUTPUT);
flags |= conn_flags;
- /* Changing forwarding method for hashed conn can
- * happen only under locks
- */
- if (cp->flags & IP_VS_CONN_F_HASHED)
- ip_vs_conn_change_fwd_mask(cp, flags);
- else
- cp->flags = flags;
} else {
flags |= conn_flags;
- cp->flags = flags;
}
+ /* Changing forwarding method for hashed conn can
+ * happen only under locks.
+ */
+ if (cp->flags & IP_VS_CONN_F_HASHED)
+ ip_vs_conn_change_fwd_mask(cp, flags);
+ else
+ cp->flags = flags;
cp->dest = dest;
IP_VS_DBG_BUF(7, "Bind-dest %s c:%s:%d v:%s:%d "
--
2.56.0
Technical Details
Message-ID:
<20261201110012.77694-1-alex000young@gmail.com>Path:
mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.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-374965-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lon.pugleaf.net!srl.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-374965-linux-kernel-netdev=dewy.ru
From: alex000young@gmail.com (zhuorao yang)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net] ipvs: adjust non-SYNC hashing after late destination binding
Date: Tue, 1 Dec 2026 19:00:12 +0800
Organization: Usenet Network
Message-ID: <20261201110012.77694-1-alex000young@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="1692372"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:DnL0XKIg1uaRNhzKa+M7bxURd3E= sha256:/HuUMo6Pff781yBKAFAeRn9+yEyX66zFj7wJ9z1ibC4=
sha1:LPel1I7zq/4GLse5PGGyOuHVMNw= sha256:o9V9Q41r3TUN8+BcbEmNzo1OTA3nq0+jgCw0OXmA/Bs=
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 647EF117340; Tue, 1 Dec 2026 14:05:47 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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.249,
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 Wcah60ftjg2e;
Tue, 1 Dec 2026 14:05:43 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-374965-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 0901711716E; Tue, 1 Dec 2026 14:05:30 +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 E219E23BC5; Tue, 1 Dec 2026 11:05:27 +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=1796123127;
b=bnjTLPr67ObnNgUuBkNCxjJMhJfG0hm/L4T55tOp22P4vfafePRRsGl9JuRdKqnZqruZ
7EMM2oGj2N8gFEx4LVMh2ufo5HDOJI1U9mlpLGKwT/EVi82U4ANLThAYA/FOwFoIWpfcu
VREFSoVlE62XbaGXenzueqTHrbnQ8Jokg5X84d4p2ZKR2jlMZtRljWv7VZTGX8sv5BdNg
C6rf8Qlm64sd51GQ/bgna4RdFJj7JmbBDdXx7ZzpHQHiWGEmvDTyHh17mkbWroSyeCvTb
Y01MO+FYO11Hpg7uX9V1kD8m2WMWaJH09CYFoxwDwtMUwONLkc2qfZiEKw7MWPoUYAg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796123127;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature: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=MBlrnzGq1MMTWxnnq/7lY8yf1KLqphiyTxQFvM0kWYA=;
b=48ZLpoG30gFGwenz1MxfEFUPEoDC97yI+G3bedheAtR5fcN1jb0HYQ9KKWqhEq+6HJx/
NcUJEptTdlGUP4Hgo5MF6frZMrGB4wBUoVNzeksldwTzhdyJD84DPvnUCQWW4itRyw0jp
F8ZUB8tfgv8mlnCcVGonoHisVZYarpAJoVtyyTlYww+kobOqTZ/smD0/OeYKrFMDo/Lid
Qt4c1aUtWQR9fLne5VXSK8WCi7IRNaceFiBWmYH6D1gH0t6eO6jHmpF55+x/0/QEUQ13x
IXlD/338FDCuL68/yCQYCRuAXzs61dL3UrZCC1MQYm4d3+udVYn+wODJipQP6bjJbwA==
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=roq04QLs;
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 6CCCC606A327;
Tue, 1 Dec 2026 11:05:27 +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=roq04QLs
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.181
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796123126;
b=4mCayB29CfqgV5SCdnC+6s4uX+VWNzdjQNtKUdX4IdWFaOKmDxBoynBPe2xeg5KPGBYv
KOnMbZNG1R8fNkcRwRdgOWQZXLSHWOb2fc4bo65f/1/2bDIJWCvWPJQPEB3Li6T94is13
gdku8DgJLR2nMjbJXR2PHAdPbmJ1tWg3C1g6dXrQPXnFQY9R7ZF1gMQxf4LXABKP+D01W
a4aDeBcXQUjnygFeGmvWPZFpWWrwWaKYKyCGcrYSfXpF8EDMCv3SVW4pqkLa7zmSCJyx1
fy6UpmRibwlSfYwpz/f+J08Mbgo4230w4QArM6BHf+qr4o1Z6xGg/J/VadMOBCnpe1w==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796123126;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
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=MBlrnzGq1MMTWxnnq/7lY8yf1KLqphiyTxQFvM0kWYA=;
b=vD/P7cGLfhfiCwziELKSINUKfhj9Qu9PixH3YSiTsK88NNWZNK1fl2gyQmms4ogp19bI
jXmCgImg2hfHiQbu0l5YfJa3F/XvBClS3tiOkaAEUCp0ErSetZpIUcMaFz5doJ/PwaqJh
1nOGNe4yJvOaLveaa7jjlT58cRrQy9p/6FczsOpac4vJshyC+UiyAqB4MYpKcJSrPdT//
IO4apEyW2+vtuDAywOLUtZmteCcyW7T694MtrNpOrOrfGfDT74M+dimuJWu8ih73G2s4u
5mrfSYyQUneMhZi49d6AY3/i0EnSLDVdIt5O22FHWqm2yalZ7QNSojLko6foVohREGQ==
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=roq04QLs;
arc=none smtp.remote-ip=209.85.214.181
X-Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181])
(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 9BFB8606A320
for <netdev@vger.kernel.org>; Tue, 1 Dec 2026 11:05:25 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9BFB8606A320
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-f181.google.com with SMTP id d9443c01a7336-2f0621eec70so83827625ad.2
for <netdev@vger.kernel.org>; Tue, 01 Dec 2026 03:05:25 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1796123125; x=1796727925; 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=MBlrnzGq1MMTWxnnq/7lY8yf1KLqphiyTxQFvM0kWYA=;
b=roq04QLsqOIlrGD230T9FyKFGyjHMRueOKDE8Gfbq05wVy90tJakoipmGpi2AiEJ5w
5CsZJp29OwDwHOSKKv9LMyEQiUNCxgyF4L2wov9MwTgMRN3ozOIh3esr3Ta5+2mt3aH7
IFCAw8k+qiZFXtMO7kuaiDCVJ91Sp2oJUgDXty95ERj3sLsS1pF72xoXLjboxfB69se9
8u8NYTOLLfhTWaanjYguepJvA8YpEM2tDT7hSuFZnrqM1YDU83/M3mT5LhfLvFMxbuec
M5jQxWcC8YX81fNVC95b1Zi3W32Mm4/Gmd20uZ2tbdtsQOJ1Q3eFcxcb6In/hRARW5nc
AHQg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796123125; x=1796727925;
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=MBlrnzGq1MMTWxnnq/7lY8yf1KLqphiyTxQFvM0kWYA=;
b=ENhRJ4gNtmXDht8iQGlNiRJJTEYgGC14PUb4eSvt1/YPjJ8MTu42tBBUiQmb/Tm2qV
J/1SKAa3tgSenVkw06AWnUgRprQFVCB51vK9o0joyJKaUX/SstewqPn/B59dU8tm/E/m
EIPVxy8hMhlLrpOjU6Ay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443c01a7336-2f0d9767d6amr210757785ad.14.1796123124311;
Tue, 01 Dec 2026 03:05:24 -0800 (PST)
X-Received: from [127.0.0.1] ([43.132.141.21])
by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f16e685d36sm2925465ad.48.2026.12.01.03.05.20
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Tue, 01 Dec 2026 03:05:23 -0800 (PST)
X-Cc: netdev@vger.kernel.org,
lvs-devel@vger.kernel.org,
netfilter-devel@vger.kernel.org,
coreteam@netfilter.org
X-Mailer: git-send-email 2.56.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