From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6B6AB192B8F for ; Sat, 11 Jan 2025 14:31:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736605904; cv=none; b=u/vOvpMZ/A5zoABD1UvK4lPknqIstTrET/BuV/mu67GcBGYfCpQUaUz/KieBoSXR4zFXAwrC+B4nw2eHrKc9LoeXHazVDACYyNhobiT26wFnlkYxn1Z92DUHYL05rlTG5J8hFHxg7Jd/6HetNemgyxdYDRDLX13FpNsadLfbiVU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736605904; c=relaxed/simple; bh=LP8U2TMCL0qK271ft+HO4ligCJwcw6vEalcvOFKAJSc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=T41oexta9L+QyM9YW0eqa+nhZ0derYH7Ctn1AVvVhjXi2I+jRldpfOXbiE1t4nD95CdeTxlRACe96tPsTz82yMjO5rzvXOTS2cS0K6mWIdJYbfjByfNEnyHTqEqkkIeGZLIYEQWP+KVRrM1O0R4FfQncT5MzP3xbEU2t0ODxr80= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=zSFRxIux; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="zSFRxIux" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F75DC4CED2; Sat, 11 Jan 2025 14:31:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1736605904; bh=LP8U2TMCL0qK271ft+HO4ligCJwcw6vEalcvOFKAJSc=; h=From:To:Cc:Subject:Date:Reply-to:From; b=zSFRxIuxDkWkwfHHV1S2tGByu2cDyO6+7DKQkaOb/k7vUHPUANoTCi06rDZY5THos zhgP+TYX77c2sMvX3Zmii+rZ2jcAjEm6xgNYN+1WRXayZYK8xeOgsSx249EEM5UfRY DPH+hhiAHC4rUkdVbYdsMWu7qORoZtdPXHbsAXlU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-23126: arm64: ptrace: fix partial SETREGSET for NT_ARM_POE Date: Sat, 11 Jan 2025 15:31:09 +0100 Message-ID: <2025011105-CVE-2025-23126-4c4f@gregkh> X-Mailer: git-send-email 2.48.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3449; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=LP8U2TMCL0qK271ft+HO4ligCJwcw6vEalcvOFKAJSc=; b=owGbwMvMwCRo6H6F97bub03G02pJDOlNDSs3uuXl3Z707pmcXJCseKmb7Krwley1IpGZy5QmW lSHrfHriGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIm0xzPMj5m2x++6edbDZLfI +0mqz+zXprxdxLBgU1799KmnpmxzEuQ5nBv/sfJHNt89AA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: arm64: ptrace: fix partial SETREGSET for NT_ARM_POE Currently poe_set() doesn't initialize the temporary 'ctrl' variable, and a SETREGSET call with a length of zero will leave this uninitialized. Consequently an arbitrary value will be written back to target->thread.por_el0, potentially leaking up to 64 bits of memory from the kernel stack. The read is limited to a specific slot on the stack, and the issue does not provide a write mechanism. Fix this by initializing the temporary value before copying the regset from userspace, as for other regsets (e.g. NT_PRSTATUS, NT_PRFPREG, NT_ARM_SYSTEM_CALL). In the case of a zero-length write, the existing contents of POR_EL1 will be retained. Before this patch: | # ./poe-test | Attempting to write NT_ARM_POE::por_el0 = 0x900d900d900d900d | SETREGSET(nt=0x40f, len=8) wrote 8 bytes | | Attempting to read NT_ARM_POE::por_el0 | GETREGSET(nt=0x40f, len=8) read 8 bytes | Read NT_ARM_POE::por_el0 = 0x900d900d900d900d | | Attempting to write NT_ARM_POE (zero length) | SETREGSET(nt=0x40f, len=0) wrote 0 bytes | | Attempting to read NT_ARM_POE::por_el0 | GETREGSET(nt=0x40f, len=8) read 8 bytes | Read NT_ARM_POE::por_el0 = 0xffff8000839c3d50 After this patch: | # ./poe-test | Attempting to write NT_ARM_POE::por_el0 = 0x900d900d900d900d | SETREGSET(nt=0x40f, len=8) wrote 8 bytes | | Attempting to read NT_ARM_POE::por_el0 | GETREGSET(nt=0x40f, len=8) read 8 bytes | Read NT_ARM_POE::por_el0 = 0x900d900d900d900d | | Attempting to write NT_ARM_POE (zero length) | SETREGSET(nt=0x40f, len=0) wrote 0 bytes | | Attempting to read NT_ARM_POE::por_el0 | GETREGSET(nt=0x40f, len=8) read 8 bytes | Read NT_ARM_POE::por_el0 = 0x900d900d900d900d The Linux kernel CVE team has assigned CVE-2025-23126 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit 17519819926211e6b2834e00e4554bec0daf22ac and fixed in 6.12.5 with commit 4105dd76bc8ad6529d47157ef0565cb84ca6676c Issue introduced in 6.12 with commit 17519819926211e6b2834e00e4554bec0daf22ac and fixed in 6.13-rc2 with commit 594bfc4947c4fcabba1318d8384c61a29a6b89fb Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-23126 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: arch/arm64/kernel/ptrace.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/4105dd76bc8ad6529d47157ef0565cb84ca6676c https://git.kernel.org/stable/c/594bfc4947c4fcabba1318d8384c61a29a6b89fb