CVE-2026-89793 in Linuxinfo

Summary

by MITRE • 09/16/2026

In the Linux kernel, the following vulnerability has been resolved:

ublk: clear VM_MAYWRITE on read-only ublk char device mmap

ublk_ch_mmap() rejects mmap requests with VM_WRITE set, but never clears VM_MAYWRITE on the resulting read-only mapping. This allows a userspace daemon to mmap the per-queue command buffer PROT_READ, then upgrade it to PROT_WRITE via mprotect(), since VM_MAYWRITE was never cleared.

The command buffer holds struct ublksrv_io_desc entries that are kernel-written ABI; a writable mapping lets an unprivileged daemon process corrupt fields such as addr, op_flags, nr_sectors, and start_sector.

Same bug class as the drm/panthor and drm/vc4 VM_MAYWRITE fixes, and the 2026-08-13 ptp/vmclock fix (a5edadbae57e).

Verified via mprotect() PoC: before the fix, a PROT_READ mapping can be upgraded to PROT_READ|PROT_WRITE and a write into the command buffer corrupts io_desc fields (confirmed under KASAN). After the fix, mprotect() returns -EACCES.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 09/16/2026

The Linux kernel's ublk subsystem contains a critical memory protection flaw within its character device mmap implementation that allows unprivileged userspace processes to escalate write permissions on read-only mappings. The vulnerability resides in the ublk_ch_mmap function, which is responsible for setting up memory-mapped I/O regions for user-space daemons interacting with block devices via the ublk protocol. While the kernel correctly rejects initial mmap requests that explicitly request VM_WRITE permission, it fails to clear the VM_MAYWRITE flag on the resulting vm_area_struct when creating a read-only mapping. This oversight creates a significant security gap because the Linux memory management subsystem relies on VM_MAYWRITE to determine whether mprotect system calls can modify protection flags for an existing mapping. Since this flag remains set despite the initial PROT_READ restriction, any process with access to the device file descriptor retains the ability to alter its own memory protections at runtime.

This technical flaw enables a direct privilege escalation path through the use of the mprotect syscall. An attacker or malicious daemon can first map the per-queue command buffer using mmap with only read permissions. Subsequently, by invoking mprotect on that specific address range and requesting PROT_READ|PROT_WRITE, the kernel erroneously grants write access because VM_MAYWRITE is still asserted in the VMA structure. This behavior contradicts the principle of least privilege and effectively bypasses the intended read-only constraints enforced during the initial mapping phase. The issue mirrors similar vulnerabilities previously identified and patched in other subsystems such as drm/panthor, drm/vc4, and ptp/vmclock, all of which suffered from identical failures to clear VM_MAYWRITE on read-only mappings, highlighting a systemic pattern in how certain kernel drivers handle memory protection flags during initialization.

The operational impact of this vulnerability is severe due to the nature of the data structures involved. The command buffer mapped by ublk contains struct ublksrv_io_desc entries, which constitute part of the kernel-user ABI and are written to by the kernel as part of normal block device operations. These descriptors include critical fields such as addr, op_flags, nr_sectors, and start_sector that dictate how data is transferred between user space and the storage backend. By gaining write access through the mprotect exploit, an unprivileged process can corrupt these structures in memory. Such corruption allows for arbitrary kernel memory writes when the kernel subsequently processes the malformed descriptors, potentially leading to code execution, denial of service via system crash, or further privilege escalation depending on the specific values written and the current state of the kernel heap.

From a classification perspective, this vulnerability aligns with CWE-284 Improper Access Control, specifically regarding insufficient restrictions on memory protection flags. It also maps closely to MITRE ATT&CK technique T1055 Process Injection or more accurately T1068 Exploitation for Privilege Escalation via improper validation of access controls in kernel subsystems. The ability to modify read-only mappings is a classic vector for bypassing security boundaries, allowing low-privileged processes to interfere with high-integrity kernel operations. Verification through proof-of-concept exploits confirms that before the patch, mprotect successfully upgrades permissions and allows writes into the command buffer, which corrupt io_desc fields as confirmed under Kernel Address Sanitizer (KASAN). After applying the fix, attempts to upgrade protections correctly fail with an EACCES error code, restoring the intended security posture.

Mitigation for this vulnerability requires immediate application of the kernel patch that explicitly clears VM_MAYWRITE in ublk_ch_mmap when creating read-only mappings. System administrators should ensure their systems are updated to a version containing this fix. For environments where kernel updates cannot be applied immediately, restricting access to the /dev/ublk-control device node via strict file permissions or SELinux/AppArmor policies can limit exposure to trusted daemons only. Additionally, enabling KASAN in development and testing environments helps detect such memory corruption issues early by catching out-of-bounds writes and invalid pointer dereferences that result from exploiting this flaw. Long-term remediation involves auditing other kernel drivers for similar patterns where VM_MAYWRITE is not cleared on read-only mappings to prevent recurrence of this class of vulnerability across the Linux codebase.

Responsible

Linux

Reservation

09/11/2026

Disclosure

09/16/2026

Moderation

accepted

CPE

ready

EPSS

0.00209

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!