Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C1944E77FF; Thu, 17 Sep 2026 18:17:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789669043; cv=none; b=kbGnpPy785fJLxfAsMmnZTIv1MSAsdBzklStpUVvCKn89RQJuGvL9Qnrki6oNuvB9EcLpazMI+O1BjDEYAGUwBy/8j7mWBKkl+pv1uAI7ZpsmHfi58J2VkP9OqsOlJw/YweHerrW9lRb5bJUMsBc3C9zqxKuEY0yKlm5qWynubU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789669043; c=relaxed/simple; bh=Eagk8jKS6YGGxD9BQ1NJj20iW8y3TsqaNmEzeEU/gTw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DYoOmhF+m/3eLSagbs1bBPM912njDQ1NUyiumVmwr4mIBVw+GnSEvDizv7naroM8Cc3+XA0+NBgKS4PGHQ41MLs9y+SY7FziCXQ9eLCQt7Nr69cEK/NkH8q5A4omgUx7c/IcjmYa3w3TVHFIRftEkeIyErWSI6NV71O+xvGN9IM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KFd/gg0L; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="KFd/gg0L" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78F7E1F00893; Thu, 17 Sep 2026 18:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789669042; bh=A7vuCsFkoMeEfctO5/M7SvGQjRA18YD+gXtXNTstK0I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KFd/gg0LJgtnZ6bx7xrOMKaDcmc1vgot3EqsYJptRbVp2yI0u2sd6zNL4Dp5xGrzK Fxd69wmwFO1A7fgPIwZ1VtSUgI0q3rHvD44/Pb1wBFKfTUE4fUUbKfLsA2lPwe3Ye/ kueLh6U4P8BTzhX7Kq85QAFC3h/J4kbsmGymuRP0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kyle Zeng , Julian Anastasov , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 6.12 0624/1102] ipvs: fix reversed sequence option serialization Date: Thu, 17 Sep 2026 16:09:27 +0100 Message-ID: <20260917151555.749621236@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151539.408551884@linuxfoundation.org> References: <20260917151539.408551884@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kyle Zeng [ Upstream commit b04578b74f2d3755548fe9e829e3b2a6c6f966a1 ] hton_seq() expects the host-order source first and the unaligned network-order destination second. The version 1 sync sender passes these arguments in reverse for both sequence blocks. This leaves 24 bytes of the kmalloc-backed message unwritten. It may disclose stale heap data and replace the live connection sequence state with values read from the buffer. Pass the connection sequence state as the source and the message payload as the destination for both blocks. Fixes: 986a07579533 ("IPVS: Backup, Change sending to Version 1 format") Assisted-by: Codex:gpt-5.6-sol Signed-off-by: Kyle Zeng Acked-by: Julian Anastasov Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/ipvs/ip_vs_sync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c index 4c6e253985365..ca25bb2dd3bde 100644 --- a/net/netfilter/ipvs/ip_vs_sync.c +++ b/net/netfilter/ipvs/ip_vs_sync.c @@ -748,9 +748,9 @@ void ip_vs_sync_conn(struct netns_ipvs *ipvs, struct ip_vs_conn *cp, int pkts) if (cp->flags & IP_VS_CONN_F_SEQ_MASK) { *(p++) = IPVS_OPT_SEQ_DATA; *(p++) = sizeof(struct ip_vs_sync_conn_options); - hton_seq((struct ip_vs_seq *)p, &cp->in_seq); + hton_seq(&cp->in_seq, (struct ip_vs_seq *)p); p += sizeof(struct ip_vs_seq); - hton_seq((struct ip_vs_seq *)p, &cp->out_seq); + hton_seq(&cp->out_seq, (struct ip_vs_seq *)p); p += sizeof(struct ip_vs_seq); } /* Handle pe data */ -- 2.53.0