CVE-2024-57917
Published: 19 January 2025
Summary
CVE-2024-57917 is a high-severity an unspecified weakness vulnerability in Linux Linux Kernel. Its CVSS base score is 7.8 (High).
Operationally, exploitation aligns with the MITRE ATT&CK technique Exploitation for Privilege Escalation (T1068); ranked at the 8.5th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog.
The strongest mitigations our analysis identified are NIST 800-53 RA-5 (Vulnerability Monitoring and Scanning) and SI-2 (Flaw Remediation).
Deeper analysis
CVE-2024-57917 is a vulnerability in the Linux kernel's topology subsystem, specifically affecting the handling of cpumasks during printing operations. The issue arises in the core_siblings_list_read function when using kvasprintf to format and print the core_cpumask via bitmap_print_to_buf and cpumap_print functions. During fuzz testing, a warning was triggered because the cpumask could be modified—such as by CPU hotplugging—between the initial length calculation in vsnprintf and the subsequent string formatting step, resulting in inconsistent return values and a failure in kvasprintf's consistency check.
A local attacker with low privileges (PR:L) can exploit this vulnerability with low complexity and no user interaction required (AV:L/AC:L/UI:N). Successful exploitation could lead to high impacts on confidentiality, integrity, and availability (C:H/I:H/A:H), as indicated by the CVSS v3.1 score of 7.8 in the unchanged security scope (S:U). The attack involves triggering a read on the core_siblings_list sysfs file concurrently with cpumask modifications, potentially causing memory handling issues in kvasprintf.
Mitigation is provided through kernel patches available in stable releases, as detailed in the referenced commits: 1c7818e2746e747838a3de1687e89eac7b947f08, 360596e7fe319a5db1b5fb34a3952862ae53c924, b02cf1d27e460ab2b3e1c8c9ce472d562cad2e8d, ca47e933a900492d89dcf5db18a99c28bd4a742d, and cbd399f78e23ad4492c174fc5e6b3676dba74a52. These patches cache the cpumask in a temporary variable before calling cpumap_print_list or cpumap_print_cpumask_to_buf, ensuring it remains unchanged during the entire printing process and preventing length inconsistencies. Security practitioners should update to a patched kernel version as soon as possible.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2024-53820
Vulnerability details
In the Linux kernel, the following vulnerability has been resolved: topology: Keep the cpumask unchanged when printing cpumap During fuzz testing, the following warning was discovered: different return values (15 and 11) from vsnprintf("%*pbl ", ...) test:keyward is WARNING in…
more
kvasprintf WARNING: CPU: 55 PID: 1168477 at lib/kasprintf.c:30 kvasprintf+0x121/0x130 Call Trace: kvasprintf+0x121/0x130 kasprintf+0xa6/0xe0 bitmap_print_to_buf+0x89/0x100 core_siblings_list_read+0x7e/0xb0 kernfs_file_read_iter+0x15b/0x270 new_sync_read+0x153/0x260 vfs_read+0x215/0x290 ksys_read+0xb9/0x160 do_syscall_64+0x56/0x100 entry_SYSCALL_64_after_hwframe+0x78/0xe2 The call trace shows that kvasprintf() reported this warning during the printing of core_siblings_list. kvasprintf() has several steps: (1) First, calculate the length of the resulting formatted string. (2) Allocate a buffer based on the returned length. (3) Then, perform the actual string formatting. (4) Check whether the lengths of the formatted strings returned in steps (1) and (2) are consistent. If the core_cpumask is modified between steps (1) and (3), the lengths obtained in these two steps may not match. Indeed our test includes cpu hotplugging, which should modify core_cpumask while printing. To fix this issue, cache the cpumask into a temporary variable before calling cpumap_print_{list, cpumask}_to_buf(), to keep it unchanged during the printing process.
- CWE(s)
Related Threats
MITRE ATT&CK Enterprise TechniquesAI
Why these techniques?
Local kernel memory handling flaw in sysfs cpumask printing enables privilege escalation via crafted concurrent reads and CPU state changes.
CVEs Like This One
Affected Assets
Mitigating Controls
Mitigating Controls (NIST 800-53 r5) AI
Directly requires timely remediation of kernel flaws like CVE-2024-57917 through patching to eliminate the cpumask race condition during sysfs printing.
Vulnerability scanning identifies unpatched Linux kernels affected by CVE-2024-57917, enabling proactive flaw remediation.
System monitoring detects kernel warnings from kvasprintf inconsistencies triggered by concurrent cpumask modifications and sysfs reads.