Linux Kernel
CVE-2024-38541
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain local low-privilege shell
-
DeliveryTrigger device tree modalias lookup with oversized compatible string
-
Exploitof_modalias() len wraps negative, str pointer escapes buffer
-
ExecutionOut-of-bounds kernel memory write
-
PersistCorrupt kernel control structures
-
ImpactEscalate privileges to root
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Buffer copy size validation
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires a local user account with at least low-privilege access (PR:L per CVSS). The vulnerable code path is in of_modalias(), which is invoked during Open Firmware / device tree-based module alias resolution - this code path is only active on kernels compiled with OF/device tree support (CONFIG_OF), which is standard on ARM, ARM64, PowerPC, RISC-V, and similar embedded/SoC architectures, but not the default code path on standard x86 bare-metal servers without device tree. An attacker must be able to trigger a modalias lookup against a device tree node whose compatible property string is long enough that even the first snprintf() into the caller-supplied buffer overflows it. Exploitation is further limited by the requirement for physical or remote shell access to the target system, and by kernel hardening features such as SMEP, SMAP, and stack canaries which raise the bar for converting a kernel heap/stack corruption into reliable code execution. |
| Impact | The CVSS 3.1 vector AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H yields a base score of 7.8 and reflects realistic exploitation conditions: local access with minimal privilege is sufficient, no user interaction is needed, and successful exploitation yields full kernel-level C/I/A impact. EPSS sits at 1.48% (71st percentile), meaning this CVE ranks in the upper third of all CVEs by exploitation probability but the absolute probability remains low, consistent with a kernel-internal code path that is not easily reachable from unprivileged userspace in typical configurations. The vulnerability is NOT in CISA KEV and no public exploit code has been identified, which meaningfully reduces near-term operational risk. The attack complexity (AC:L) may be slightly optimistic given that triggering the overflow requires either crafted device tree content or a kernel caller supplying an undersized buffer - conditions more common in embedded/IoT or hypervisor contexts than in standard server deployments. For general-purpose Linux servers running hardened distributions with SELinux/AppArmor and limited local user access, real-world exploitability is lower than the CVSS score suggests. Embedded and IoT systems using device tree hardware description (ARM, RISC-V, PowerPC platforms) carry higher practical risk because device tree content may be attacker-influenced. |
| Exploit ScenarioDerived | An attacker with a local low-privileged shell account on a Linux system using device tree hardware description (ARM, PowerPC, or RISC-V platform) triggers the of_modalias() function by initiating a module lookup against a device tree node whose compatible string is long enough to overflow a small caller-supplied buffer. The negative len value causes the str pointer to reference memory beyond the buffer, and subsequent snprintf() writes corrupt adjacent kernel heap or stack memory. With sufficient control over the overflow content, the attacker could overwrite kernel function pointers or security structures to escalate privileges to root. No public proof-of-concept has been identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv3 – Aug 04, 2026
Buffer overflow in the Linux kernel's of_modalias() function allows a local low-privileged attacker to potentially corrupt kernel memory, leading to privilege escalation or system crash. The flaw exists in the Open Firmware (OF) module subsystem: when the output buffer is undersized relative to the first snprintf() call, the len variable wraps to a negative value and the str pointer advances past the buffer boundary, enabling out-of-bounds writes in subsequent operations. No public exploit has been identified at time of analysis, though the CVSS score of 7.8 with local C:H/I:H/A:H impact signals serious post-exploitation potential on affected kernels.
Earlier versions of this analysis (2)
Buffer overflow in the Linux kernel's of_modalias() function (drivers/of/module.c) allows a local attacker with low privileges to write past an allocated kernel buffer boundary on Device Tree-enabled platforms. When of_modalias() is called with an undersized output buffer, the len variable goes negative after the first snprintf() returns a value exceeding the buffer size, causing the str pointer to advance beyond the buffer's end - enabling out-of-bounds kernel memory writes with potential for privilege escalation. No public exploit code or CISA KEV active-exploitation listing exists at time of analysis; EPSS sits at 1.48% (71st percentile), suggesting elevated but not immediate exploitation probability.
Buffer overflow in the Linux kernel's device tree module alias function of_modalias() allows a local low-privileged user to corrupt kernel memory, potentially achieving privilege escalation or arbitrary code execution. The flaw exists because when the output buffer is too small for the first snprintf() call, the remaining length variable len wraps to a negative value and the write pointer str advances past the buffer's end, enabling out-of-bounds kernel memory writes. No public exploit or CISA KEV listing has been identified at time of analysis, though the 71st-percentile EPSS ranking indicates elevated concern relative to most CVEs.
RemediationAI
Apply the vendor-released kernel patches available across multiple stable branches via the upstream stable tree; the primary patch references are https://git.kernel.org/stable/c/0b0d5701a8bf02f8fee037e81aacf6746558bfd6 and https://git.kernel.org/stable/c/cf7385cb26ac4f0ee6c7385960525ad534323252 among others. Debian LTS users should apply the updates announced at https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html. Exact fixed kernel release versions per stable branch are not confirmed from available data - verify against the upstream stable release tags tied to the listed commits before deploying. As a compensating control where patching is not immediately feasible, restricting local user accounts (minimizing PR:L attack surface) and enforcing mandatory access control policies (SELinux enforcing, AppArmor profiles) reduces the likelihood of exploitation by limiting which processes can trigger the of_modalias() code path. On systems where device tree-based hardware is not used (x86 bare metal without OF support), the code path may be unreachable, though this should be verified per kernel config. There are no known side effects from applying the patch.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability resides in of_modalias() within the Linux kernel's drivers/of/module.c, which constructs modalias strings from Open Firmware device tree nodes for automatic kernel module loading. The root cause is CWE-120 (Classic Buffer Copy without Checking Size of Input), specifically a missing bounds check after the first snprintf() invocation: if the formatted string already exceeds the buffer length, len becomes negative (signed integer underflow of the remaining-capacity variable) and the str pointer, if non-NULL, is advanced beyond the allocated buffer end. Any subsequent snprintf() or strlen() call on that corrupted pointer operates on out-of-bounds kernel memory. The fix adds an explicit overflow guard after the first snprintf() and corrects the post-strlen() check to account for the NUL terminator. Affected products span multiple Linux kernel stable branches per seven CPE entries (cpe:2.3:o:linux:linux_kernel:*) and eight distinct stable-tree patch commits, indicating broad version coverage across the 5.x and 6.x series.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Local access and low privilege required to trigger OF modalias path; kernel memory corruption yields full C/I/A impact with no scope change.
Primary rating from Vendor (416baaa9-dc9f-4396-8d5f-8c081fb06d67).
CVSS VectorVendor: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
Lifecycle Timeline
6DescriptionCVE.org
In the Linux kernel, the following vulnerability has been resolved:
of: module: add buffer overflow check in of_modalias()
In of_modalias(), if the buffer happens to be too small even for the 1st snprintf() call, the len parameter will become negative and str parameter (if not NULL initially) will point beyond the buffer's end. Add the buffer overflow check after the 1st snprintf() call and fix such check after the strlen() call (accounting for the terminating NUL char).
Executive ViewAI
CVE-2024-38541 is a buffer overflow in the Linux kernel's Open Firmware module that allows local low-privileged attackers to escalate privileges or crash systems. Any organization running vulnerable Linux kernels faces risk of unauthorized administrative access and service disruption; immediate patching is required to prevent privilege escalation attacks from compromise of any local user account.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
NVD
CVE.org
EPSS
GitHub PoC
Exploit-DB