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=1796383875; b=MLwrd1QlcORVXJ6rSnjFf5kRqOIUG57R8LBwmRr4REzh0/XGSBZaVpmfrvLRehnb+YtT KRH56bCbD6N0thXV5MVH+WiDnkY1sqCEkobVIvYck+UJy+9EfGvgirq+sEnF0wbYHWxj7 /63K9hItwpxVWTIcVFfXS2A5eB1jd1KBenY3AmwbqTRQ1eYcGQAVtAgn7Smo367X7hC9A juELStrEwx2lmq+pPm2Tc9qIfiJSDIdxIGHDMcVvuSB1T/fkhxH6bkfaZ86y9PiWrNtOW mgb5Ex557GVVafTlNSSHpvSg87rNTDWCdL/BCQS+bmt4qOgx4UD9c7tYBddL9zsCD1w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796383875; 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=m7Nl1QKXmolBexf86GZT5cna6J3GHjo86OvRTy2fawo=; b=MndV3gXSr+oO8INe93FEswbOjUAo0JPGxy8OSY5aJfOZxtvgwIkGiFgMI+FMUloKachI F5Wn2+t//Fd5nFejEyvjzpioXuZiYX7kz44ZYHY0yKxX7j5Rj6MJmnpgFyfXPmJ8cz43/ TkKArilkUzPEiMesosqHcM8zdlIZhk26tk7g2ImEVKqt2zbNr3/YoZd7hIJN2XctSESSw UA+L/NNw7+ZuA75J8/tRh4ca1p+7K3G1Vyv6wyrdKy4bRf1TX4te2XffGC+5eOEeUX9TZ cH9WiXyKBMHI6e8smENp5CGJ9YGvZxeS99Q4Zq2YbxGwmyq7G8C43pSDX3Cutb0yD/w== 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=W2AqKsk3; 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 BC5FE606A322; Fri, 4 Dec 2026 11:31:15 +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=W2AqKsk3 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 374101F000C2; Fri, 4 Dec 2026 11:31:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796383875; bh=m7Nl1QKXmolBexf86GZT5cna6J3GHjo86OvRTy2fawo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=W2AqKsk3uhrj8gqcxmoQmcDtGoITS9IU74D+peVZ+ixPa94JcAYBNTnmQi/lcO1a3 b5ZvEtedn+SFhjvq3Q0hNv98RpeOxYsIEbTuXhD/YLkK3Qa6eqi0VzmnLPV9lL9NJv 4coH3OacjYLtcaHkFLdD0xuGI+quEKwmpvxPVPI4= 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.12 404/555] ip6mr: prevent info-leak in ip6mr_cache_report() Date: Fri, 4 Dec 2026 19:07:27 +0900 Message-ID: <20261204100625.050989831@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@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.12-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 @@ -1124,7 +1124,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);