CVE-2026-87039

I2S configure syscall handler passes an unvalidated user-supplied kernel object pointer to drivers

Published Nov 4, 2026 CVSS 3.1 · 7.8 High EPSS < 1% KEV · Not listed
Description
The user-mode syscall verifier z_vrfy_i2s_configure() in drivers/i2s/i2s_handlers.c copies the caller's struct i2s_config in from user memory and then, when cfg->frame_clk_freq is 0 (the API's "unconfigure the stream" request), jumps straight to z_impl_i2s_configure() without performing the K_SYSCALL_OBJ(config.mem_slab, K_OBJ_MEM_SLAB) ownership/type check or the block_size sanity check. The mem_slab field is a struct k_mem_slab *, so on that path a completely unvalidated, user-chosen pointer reaches driver code that is entitled to trust it as a real kernel object.

Any thread running under CONFIG_USERSPACE that has access to an I2S device object can trigger this with a single i2s_configure() call. Most in-tree drivers special-case frame_clk_freq == 0 and never store the caller's structure, but drivers/i2s/i2s_litex.c does not: i2s_litex_configure() only logs a warning for a mismatched frame clock, then memcpy()s the caller's config into stream->cfg and marks the stream I2S_STATE_READY. A subsequent i2s_trigger() with I2S_TRIGGER_START enables the FIFO interrupt, and the interrupt handlers i2s_litex_isr_rx() / i2s_litex_isr_tx() then call k_mem_slab_alloc() and k_mem_slab_free() on the attacker-supplied pointer in supervisor context.

The result is an arbitrary-pointer read/write primitive executed by the kernel on behalf of an unprivileged thread — k_mem_slab_alloc() takes a spinlock at slab->lock and reads and writes slab->free_list and the link word inside the returned "block" — which defeats the CONFIG_USERSPACE isolation boundary entirely. The same missing validation is a hazard for out-of-tree I2S drivers that retain the configuration on the unconfigure path. Builds without CONFIG_USERSPACE are unaffected, since the verifier is not used.

The fix zeroes config.mem_slab and config.block_size on the unconfigure path so the driver can never receive an unvalidated pointer, while still allowing a stream to be unconfigured by a caller that does not own a memory slab, as the API documents.

Analysis

AI-generated

Technical impact

The Zephyr I2S configure syscall verifier copies the caller’s struct i2s_config into kernel space but, on an unconfigure request indicated by frame_clk_freq equal to zero, it bypasses the ownership check on the config.mem_slab field and the block size sanity test. The mem_slab pointer is a struct k_mem_slab * and therefore, on that code path, a fully user‑supplied kernel object pointer is passed directly to driver code. In drivers such as i2s_litex, this pointer is used by the interrupt handlers in supervisor context when allocating and freeing memory slabs. Because k_mem_slab_alloc and k_mem_slab_free acquire a spinlock and manipulate the slab’s internal free list, an attacker can read and write arbitrary kernel memory, effectively breaking the userspace isolation boundary and enabling privilege escalation.

Affected Systems

This flaw is present in all Zephyr Project builds that enable CONFIG_USERSPACE and include an I2S device driver. Any user thread that has permission to access an I2S object can trigger the vulnerability by issuing a single i2s_configure() call to unconfigure the stream. The issue does not affect builds without CONFIG_USERSPACE because the syscall verifier is not exercised.

Risk and Exploitability

The CVSS score of 7.8 indicates moderate to high severity. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog, but the exploit is straightforward to trigger where user access to I2S devices exists. An attacker only needs the ability to call the public I2S configuration API; no additional privileges are required. Once triggered, the kernel performs arbitrary read/write, giving the attacker full control of memory and the ability to execute arbitrary code at kernel privilege level.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update Zephyr to a version that includes the commit that zeroes config.mem_slab and config.block_size on the unconfigure path and thereby restores proper ownership validation.
  • If an upgrade is not immediately possible, restrict or remove userspace access to I2S devices or disable CONFIG_USERSPACE for the affected application to prevent the vulnerable code from running.
  • Review any custom or out-of-tree I2S drivers for missing configuration sanitization and apply the same zeroing approach or patch them to prevent unvalidated pointers from being used on unconfigure.

Generated by OpenCVE AI on November 4, 2026 at 10:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Zephyrproject
Zephyrproject zephyr
Vendors & Products Zephyrproject
Zephyrproject zephyr
Type Values Removed Values Added
Description The user-mode syscall verifier z_vrfy_i2s_configure() in drivers/i2s/i2s_handlers.c copies the caller's struct i2s_config in from user memory and then, when cfg->frame_clk_freq is 0 (the API's "unconfigure the stream" request), jumps straight to z_impl_i2s_configure() without performing the K_SYSCALL_OBJ(config.mem_slab, K_OBJ_MEM_SLAB) ownership/type check or the block_size sanity check. The mem_slab field is a struct k_mem_slab *, so on that path a completely unvalidated, user-chosen pointer reaches driver code that is entitled to trust it as a real kernel object. Any thread running under CONFIG_USERSPACE that has access to an I2S device object can trigger this with a single i2s_configure() call. Most in-tree drivers special-case frame_clk_freq == 0 and never store the caller's structure, but drivers/i2s/i2s_litex.c does not: i2s_litex_configure() only logs a warning for a mismatched frame clock, then memcpy()s the caller's config into stream->cfg and marks the stream I2S_STATE_READY. A subsequent i2s_trigger() with I2S_TRIGGER_START enables the FIFO interrupt, and the interrupt handlers i2s_litex_isr_rx() / i2s_litex_isr_tx() then call k_mem_slab_alloc() and k_mem_slab_free() on the attacker-supplied pointer in supervisor context. The result is an arbitrary-pointer read/write primitive executed by the kernel on behalf of an unprivileged thread — k_mem_slab_alloc() takes a spinlock at slab->lock and reads and writes slab->free_list and the link word inside the returned "block" — which defeats the CONFIG_USERSPACE isolation boundary entirely. The same missing validation is a hazard for out-of-tree I2S drivers that retain the configuration on the unconfigure path. Builds without CONFIG_USERSPACE are unaffected, since the verifier is not used. The fix zeroes config.mem_slab and config.block_size on the unconfigure path so the driver can never receive an unvalidated pointer, while still allowing a stream to be unconfigured by a caller that does not own a memory slab, as the API documents.
Title I2S configure syscall handler passes an unvalidated user-supplied kernel object pointer to drivers
Weaknesses CWE-787
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
zephyr
Published
Updated
Nov 9, 2026, 9:25 PM
Reserved
Sep 8, 2026, 6:40 PM
Status
Awaiting Analysis
Published
Nov 4, 2026, 6:17 AM
Modified
Nov 9, 2026, 10:18 PM