CVE-2026-10635: Xtensa Memory Domain Use-After-Free in Zephyr RTOS
CVE-2026-10635 is a use-after-free vulnerability in Zephyr's Xtensa memory domain handling. When a memory domain is destroyed on Xtensa systems with MMU support, the kernel fails to cleanly remove the domain from an internal tracking list, leaving a dangling pointer. If the freed memory is later reused or accessed, kernel code can dereference corrupted data structures, potentially compromising memory isolation between privileged and unprivileged code. The vulnerability requires privileged kernel access to trigger and cannot be exploited directly from user space or remotely.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 6.3 MEDIUM · CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:L/I:H/A:H
- Weaknesses (CWE)
- CWE-416
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-16 / 2026-07-14
NVD description (verbatim)
On Xtensa targets with CONFIG_USERSPACE and CONFIG_XTENSA_MMU, the page-table code (arch/xtensa/core/ptables.c) maintains a global list, xtensa_domain_list, of active memory domains using a list node embedded inside the caller-owned struct k_mem_domain. When a domain is destroyed via k_mem_domain_deinit() -> arch_mem_domain_deinit(), the page tables are torn down and domain->arch.ptables is set to NULL, but the domain's node was not removed from xtensa_domain_list. The freed/deinitialized domain therefore remained linked into the global list as a dangling pointer into caller-owned storage that may then be freed or reused. Any subsequent arch_mem_map()/arch_mem_unmap() operation (widely invoked by kernel memory-mapping and demand-paging code) traverses the stale node and dereferences domain->ptables: at minimum a NULL pointer dereference causing a fatal MMU exception (denial of service), and if the k_mem_domain storage has been freed or reused, a use-after-free in which a stale/controlled ptables value is dereferenced and written through during the page-table walk (l2_page_table_map writes l1_table[...] and l2_table[...], and xtensa_mmu_compute_domain_regs writes into the domain struct and the L1 table), yielding page-table memory corruption that can undermine userspace isolation. The vulnerable path is reachable only from privileged kernel/supervisor code (k_mem_domain_deinit is not a syscall), not directly from unprivileged user threads or remotely. Affected: Zephyr v4.4.0 (the Xtensa memory-domain de-initialization feature was introduced in commit 3032b58f52d and first shipped in v4.4.0); fixed on main by adding sys_slist_find_and_remove() in arch_mem_domain_deinit(). The Xtensa MPU path is unaffected.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The Xtensa page-table code (arch/xtensa/core/ptables.c) maintains a global linked list, xtensa_domain_list, containing active memory domains via list nodes embedded in caller-owned k_mem_domain structures. When k_mem_domain_deinit() is called, the function tears down page tables and nulls domain->arch.ptables but omits removal of the domain's node from xtensa_domain_list. The deinitialized domain becomes a dangling pointer within the global list. Subsequent arch_mem_map() or arch_mem_unmap() operations traverse this stale node and dereference domain->ptables. If that memory has been freed or reused, the l2_page_table_map and xtensa_mmu_compute_domain_regs functions write to arbitrary kernel memory locations (L1 and L2 page tables, domain structure fields), corrupting page-table metadata and potentially breaking userspace isolation. The fix adds explicit list removal via sys_slist_find_and_remove() during domain deinitialization.
Business impact
For deployments using Zephyr on Xtensa targets with MMU and CONFIG_USERSPACE enabled, this vulnerability creates a window for kernel-level memory corruption following domain teardown. If memory domains are created and destroyed as part of normal operation (e.g., dynamic task lifecycle, privilege isolation features), the freed k_mem_domain storage can be reallocated or overwritten, allowing subsequent memory-mapping operations to corrupt page tables. This undermines the integrity of user/kernel isolation boundaries and can lead to privilege escalation or data corruption. Organizations relying on Zephyr's userspace protection for security-sensitive embedded systems face a medium-severity exposure.
Affected systems
Zephyr v4.4.0 and later versions prior to the fix on the main branch are affected. The vulnerability is specific to Xtensa architecture targets configured with CONFIG_USERSPACE and CONFIG_XTENSA_MMU enabled. The Xtensa MPU (memory protection unit) variant is not affected. Systems using other architectures (ARM, RISC-V, etc.) or Xtensa systems without MMU support are unaffected.
Exploitability
Exploitation requires privileged kernel code to call k_mem_domain_deinit() followed by a memory-mapping operation that traverses the stale list node. The vulnerability cannot be triggered directly by unprivileged user-space code or remote attackers. However, any kernel driver, thread, or subsystem that performs domain deinitialization and subsequent memory remapping within the same system lifecycle creates exposure. If an attacker has already achieved kernel-level code execution, this vulnerability can be leveraged to corrupt page tables and further elevate privileges or disable isolation. In typical embedded deployments, kernel code is trusted, reducing the threat model; however, systems with untrusted kernel-loaded modules or firmware updates face elevated risk.
Remediation
Apply the main-branch fix: add sys_slist_find_and_remove() to arch_mem_domain_deinit() to explicitly remove the domain's node from xtensa_domain_list before page-table teardown completes. This ensures the domain is no longer reachable via list traversal after deinitialization. Verify the patch version against the official Zephyr advisory to confirm the exact commit or release tag. For systems unable to upgrade immediately, restrict domain creation/destruction to initialization phases or implement a graceful shutdown procedure that drains all pending memory-mapping operations before tearing down domains.
Patch guidance
The official fix is available on the Zephyr main branch (verify exact commit hash and release version against the vendor advisory). Users should update to the patched version once released in a stable branch (e.g., v4.5.0 or later). Before upgrading, verify compatibility with your Xtensa toolchain, CONFIG_USERSPACE/CONFIG_XTENSA_MMU settings, and any out-of-tree drivers. Test the patched kernel thoroughly in a staging environment, especially any code paths that exercise k_mem_domain lifecycle operations. If an immediate patch is unavailable for your release series, contact the Zephyr security team for guidance on backports or workarounds.
Detection guidance
Monitor kernel logs for MMU exceptions, faults, or memory access violations correlated with k_mem_domain operations. On Xtensa targets, watch for CPU exceptions during arch_mem_map() or arch_mem_unmap() calls. Memory corruption signatures (e.g., unexpected page-table entries, corrupted domain structures) may appear in crash dumps or kernel memory inspections. Static code analysis tools can flag use-after-free patterns in list management; audit calls to k_mem_domain_deinit() to confirm list removal occurs. Dynamic debugging with kernel assertions enabled can catch dangling-pointer dereferences at runtime. If you control the system build, enable CONFIG_DEBUG_OBJECTS and related Kconfig options to catch memory-domain lifecycle issues earlier.
Why prioritize this
Although the CVSS score is 6.3 (medium), the actual risk depends on deployment architecture. Systems using Xtensa with MMU and CONFIG_USERSPACE for security-critical userspace isolation (e.g., trusted execution environments, multi-tenant embedded systems) should prioritize this patch. Systems where kernel and userspace are not strictly separated, or where Xtensa targets do not have MMU enabled, face lower risk. The requirement for privileged kernel code to trigger the vulnerability limits remote-attack surface, but post-compromise escalation and privilege-boundary violations warrant prompt remediation in security-sensitive deployments.
Risk score, explained
CVSS 6.3 (Medium) reflects moderate severity with constraints: a high-privilege actor (PR:H) on a local system (AV:L) with no user interaction (UI:N) can corrupt memory (I:H), cause denial of service (A:H), and partially compromise confidentiality (C:L). The score does not fully capture the context-dependent risk: in systems where CONFIG_USERSPACE isolation is critical to threat model, the impact rating would be higher; in systems without strict userspace isolation, the risk is lower. The vulnerability requires existing kernel-level compromise or trusted-code misuse to manifest; it is not independently exploitable from user space.
Frequently asked questions
Can this vulnerability be exploited remotely or from user-space code?
No. k_mem_domain_deinit() is a kernel-only function not exposed as a syscall. Exploitation requires privileged kernel code execution. Unprivileged user threads cannot trigger the vulnerable path directly.
What Xtensa configurations are at risk?
Only Xtensa targets with both CONFIG_XTENSA_MMU=y and CONFIG_USERSPACE=y enabled. Xtensa systems using the MPU (CONFIG_XTENSA_MPU) are unaffected. Other architectures are not affected.
If my Zephyr kernel uses memory domains, what should I do now?
Verify your kernel config and Zephyr version. If you target Xtensa with MMU and userspace, prioritize updating to the patched version. Until then, review kernel code that calls k_mem_domain_deinit() and ensure no concurrent memory-mapping operations occur. Test your application thoroughly after patching.
Does this vulnerability affect deployed firmware, or only development systems?
Both. Any Zephyr v4.4.0+ firmware running on an affected Xtensa configuration with CONFIG_USERSPACE+CONFIG_XTENSA_MMU can be vulnerable if domain deinitialization occurs during the device lifetime. Deployed firmware should be updated via OTA or manual reflash if patches are available.
This analysis is provided for informational purposes only and reflects ground-truth data as of the publication date. Readers must verify all technical details, affected versions, and patch availability against official vendor advisories and security bulletins from the Zephyr project before making remediation decisions. SEC.co makes no warranty regarding the completeness or accuracy of this analysis. Patch version numbers, release timelines, and compatibility information are subject to change. Organizations should conduct their own risk assessment, testing, and validation in their specific environments. This vulnerability requires privileged kernel access and is not independently remotely exploitable; however, post-compromise privilege escalation scenarios should be evaluated based on your threat model and deployment architecture. Source: NVD (public-domain), retrieved 2026-07-23. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-10634MEDIUMZephyr TCP Stack Use-After-Free Race Condition
- CVE-2026-10637MEDIUMZephyr IPv6 MLD Use-After-Free Denial of Service
- CVE-2026-10638MEDIUMZephyr ICMPv6 Use-After-Free Denial of Service
- CVE-2026-10639MEDIUMZephyr IPv4 Use-After-Free in ICMP Echo Reply Statistics
- CVE-2026-10640MEDIUMZephyr IPv6 Neighbor Discovery Use-After-Free Vulnerability
- CVE-2026-10636LOWUse-After-Free in Zephyr IPv4 IGMP Implementation
- CVE-2025-55644MEDIUMHeap Use-After-Free in GPAC MP4Box v2.4 DoS Vulnerability
- CVE-2025-55650MEDIUMHeap Use-After-Free in GPAC MP4Box v2.4 DoS Vulnerability