From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382459; b=iKfw0y8KtFCm53QGJ90uhsr1pSWIMobBDIELdd7K9/2mzfyZ6KcxvWA6t83x8AcFZrF6 dXOVhpI8F2Df1EA/xFfLwRPq+345Kv7y3k8I11v92gEx41mXk62zabXr05tvOTIrhPMgE OqbTZTeKvrDInkVc+30L4H6BBIIACnbYe+drKhAPDjshxbklzY0Mik6Tf+KG8K0uFahO0 RKmiMBCIa6odULwu7EokjM09mqDnkVUja9KKUpJQzBoV7+1fECmML6lEVslIK21pV0Ol/ QA8it3rn2BylGKsFEd0T+BZGxGCNFypmxl2F8Odypl8k5CiLdZoQauPPQP11Uk0Lkkg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382459; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Xt3uLeYZlRoUjn/x5VdnFwZDpMNlTuKlsJmY+B+psvc=; b=HsaflOFuFnCBcBAaTUYaMg+tXitns25NLWeczN/B86SewNdENsD6z9m/9gsV+uIVC+Bh UQw1a6IrHnZl2sfHwN6HJrLrFoa75EeplMzRQxALHyDmXgcvIs4jwjSZY+ReZoRAYMdUj +2z5TQOch0Za+VeDErmQ0JZz00c3zoTw8ABqT513dFVI27YmDv6axCA2T1wrAwMLijLX6 h8JE2vNVtLFQSRNiVkyNIzKNavB2jO76u/uX0NBU4XCB7nF6RWEn4araZlR67z4V0o7ur MntD9EJ4IngEnIzJPInkVl3v9OvwayaqWo5h+Ibdgv8w975iDOdQcRtLMTNv1wfbXdw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=bX+L9bZF; arc=none smtp.remote-ip=100.103.45.18 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 7A946606A32D; Fri, 4 Dec 2026 11:07:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=bX+L9bZF Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADB3A1F000C2; Fri, 4 Dec 2026 11:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382459; bh=Xt3uLeYZlRoUjn/x5VdnFwZDpMNlTuKlsJmY+B+psvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=bX+L9bZFRmaaEV9TV183Ur7obCe/Y3V4jlLk3i0iPkBF17Og5dsfoin9621MvzIv6 hP6hZf8uMdySFoqwCd+i/hmuYDjdExUG2p2Y2Sco9k0JV3EjWYu2uPOeue6JGMpNJE WZiC8+6EtRNOEAHmd/3+7rnOE5/bzia041renZqA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Henry Martin , Ido Schimmel , Jakub Kicinski Subject: [PATCH 6.18 464/703] ip6mr: prevent info-leak in ip6mr_cache_report() Date: Fri, 4 Dec 2026 19:06:03 +0900 Message-ID: <20261204100640.125119722@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Henry Martin commit ea538b5790eed4f042ea787ea761cb1a695f8138 upstream. The non-WHOLEPKT branch copies the IPv6 header at offset 0 and then appends 40 bytes with skb_put(), but the mrt6msg is written at offset 0 after skb_reset_transport_header(), so the appended 40 bytes are never initialized. They hold stale heap contents. The report is queued to the mroute6 socket and copied into the IP6MRA_CREPORT_PKT netlink attribute, disclosing the stale bytes to user space. The stale bytes can contain kernel heap and image pointers, and the report is reachable from an unprivileged user namespace (MRT6_INIT in a new netns, plus the non-root RTNLGRP_IPV6_MROUTE_R group). Use skb_put_zero() instead, as the IPv4 code does since commit 4f34002e2e376 ("ipmr: prevent info-leak in pmr_cache_report()"). This issue was discovered by Tencent CodeBuddy Security. Fixes: 7bc570c8b4f75 ("[IPV6] MROUTE: Support multicast forwarding.") Cc: stable@vger.kernel.org Signed-off-by: Henry Martin Reviewed-by: Ido Schimmel Link: https://patch.msgid.link/20261112042415.617221-1-bsdhenrymartin@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ipv6/ip6mr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c @@ -1132,7 +1132,7 @@ static int ip6mr_cache_report(const stru /* * Add our header */ - skb_put(skb, sizeof(*msg)); + skb_put_zero(skb, sizeof(*msg)); skb_reset_transport_header(skb); msg = (struct mrt6msg *)skb_transport_header(skb);