Skip to main content

CVE-2024-57878: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-57878cvecve-2024-57878
Published: Sat Jan 11 2025 (01/11/2025, 14:49:04 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: arm64: ptrace: fix partial SETREGSET for NT_ARM_FPMR Currently fpmr_set() doesn't initialize the temporary 'fpmr' 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.uw.fpmr, 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 FPMR will be retained. Before this patch: | # ./fpmr-test | Attempting to write NT_ARM_FPMR::fpmr = 0x900d900d900d900d | SETREGSET(nt=0x40e, len=8) wrote 8 bytes | | Attempting to read NT_ARM_FPMR::fpmr | GETREGSET(nt=0x40e, len=8) read 8 bytes | Read NT_ARM_FPMR::fpmr = 0x900d900d900d900d | | Attempting to write NT_ARM_FPMR (zero length) | SETREGSET(nt=0x40e, len=0) wrote 0 bytes | | Attempting to read NT_ARM_FPMR::fpmr | GETREGSET(nt=0x40e, len=8) read 8 bytes | Read NT_ARM_FPMR::fpmr = 0xffff800083963d50 After this patch: | # ./fpmr-test | Attempting to write NT_ARM_FPMR::fpmr = 0x900d900d900d900d | SETREGSET(nt=0x40e, len=8) wrote 8 bytes | | Attempting to read NT_ARM_FPMR::fpmr | GETREGSET(nt=0x40e, len=8) read 8 bytes | Read NT_ARM_FPMR::fpmr = 0x900d900d900d900d | | Attempting to write NT_ARM_FPMR (zero length) | SETREGSET(nt=0x40e, len=0) wrote 0 bytes | | Attempting to read NT_ARM_FPMR::fpmr | GETREGSET(nt=0x40e, len=8) read 8 bytes | Read NT_ARM_FPMR::fpmr = 0x900d900d900d900d

AI-Powered Analysis

AILast updated: 06/28/2025, 08:26:26 UTC

Technical Analysis

CVE-2024-57878 is a vulnerability identified in the Linux kernel specifically affecting the ARM64 architecture's ptrace subsystem. The flaw arises from improper initialization of a temporary variable 'fpmr' within the fpmr_set() function, which handles the SETREGSET operation for the NT_ARM_FPMR register set. When a SETREGSET call is made with a zero-length write, the 'fpmr' variable remains uninitialized, causing the kernel to write an arbitrary value back to the target thread's floating-point status register (fpmr). This results in a potential information leak of up to 64 bits from the kernel stack memory. The vulnerability does not provide a mechanism for arbitrary writes or code execution but allows an attacker to read sensitive kernel stack data unintentionally exposed through this flaw. The patch resolves the issue by initializing the temporary 'fpmr' variable before copying data from userspace, ensuring that zero-length writes retain the existing register contents rather than leaking uninitialized memory. This vulnerability is limited to ARM64 Linux systems that support ptrace and the NT_ARM_FPMR register set, and exploitation requires the ability to invoke ptrace operations on a target process, which typically demands elevated privileges or debugging capabilities. No known exploits are currently reported in the wild, and the issue was publicly disclosed in January 2025.

Potential Impact

For European organizations, the primary impact of CVE-2024-57878 is the potential leakage of sensitive kernel stack data on ARM64-based Linux systems. While the vulnerability does not allow direct code execution or privilege escalation, the information leak could be leveraged as part of a larger attack chain, such as bypassing kernel address space layout randomization (KASLR) or gathering sensitive kernel memory contents that aid in further exploitation. Organizations using ARM64 Linux servers, embedded devices, or cloud infrastructure with ARM64 nodes could be at risk. This includes sectors with high ARM64 adoption such as telecommunications, automotive, and IoT device manufacturers prevalent in Europe. Confidentiality of kernel memory is compromised, which may expose sensitive data or internal kernel state. However, the requirement for ptrace access limits the attack surface to users or processes with debugging or elevated permissions, reducing the risk for general users. The vulnerability's impact on system integrity and availability is minimal as it does not enable arbitrary code execution or denial of service. Nevertheless, the leak of kernel memory can undermine trust in system security and may facilitate more sophisticated attacks if combined with other vulnerabilities.

Mitigation Recommendations

To mitigate CVE-2024-57878, European organizations should: 1) Apply the official Linux kernel patches that initialize the 'fpmr' variable correctly, ensuring that zero-length SETREGSET calls do not leak kernel stack memory. 2) Restrict ptrace usage strictly by enforcing the Linux YAMA security module or equivalent ptrace scope restrictions, limiting ptrace operations to trusted users and processes only. 3) Employ mandatory access controls (e.g., SELinux, AppArmor) to constrain debugging capabilities and prevent unauthorized ptrace calls. 4) Monitor and audit ptrace usage and kernel debug interfaces to detect anomalous or unauthorized attempts to access process registers. 5) For ARM64-based systems, especially in production or sensitive environments, consider disabling unnecessary ptrace functionality if debugging is not required. 6) Maintain up-to-date kernel versions and subscribe to security advisories for timely patching. 7) In cloud or containerized environments, ensure that container runtimes and orchestration platforms do not grant excessive ptrace capabilities to untrusted workloads. These targeted mitigations go beyond generic patching by focusing on minimizing the attack surface related to ptrace and debugging interfaces.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-01-11T14:45:42.023Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9822c4522896dcbde935

Added to database: 5/21/2025, 9:08:50 AM

Last enriched: 6/28/2025, 8:26:26 AM

Last updated: 8/14/2025, 4:42:35 PM

Views: 9

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats