Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by zhuorao yang
Tue, 01 Dec 2026 11:00
[PATCH net] ipvs: adjust non-SYNC hashing after late destination binding
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads