CVE-2026-9771: Missing device-pointer validation in flash_copy() syscall allows userspace privilege escalation
The flashcopy() system call is verified by zvrfyflashcopy() in drivers/flash/flashutil.c. On builds with CONFIGUSERSPACE enabled, this handler is the kernel-side trust boundary for a user-mode caller. Prior to the fix it validated only the output buffer (KSYSCALLMEMORYWRITE) and passed the two struct device arguments, srcdev and dstdev, directly into the implementation without any object validation — unlike every sibling flash syscall, which guards its device pointer with KSYSCALLDRIVERFLASH.
A user-mode thread fully controls the values of srcdev/dstdev and the contents of its own address space. The implementation zimplflashcopy() dereferences these pointers and calls through their driver-API function tables (e.g. api->getparameters(dstdev), flashread(srcdev, ...), flashwrite(dstdev, ...)). By supplying a pointer to a forged struct device whose api table contains attacker-chosen function pointers, an unprivileged thread can cause the kernel to call arbitrary code in supervisor mode; passing any arbitrary or invalid address otherwise yields a kernel crash or out-of-bounds read.
The result is a local privilege escalation out of the userspace sandbox (with kernel denial-of-service and information disclosure as lesser outcomes). The fix adds KSYSCALLDRIVERFLASH(srcdev, read) and KSYSCALLDRIVERFLASH(dstdev, write) to zvrfyflashcopy(), which verify each device is a registered flash-driver kernel object the calling thread is permitted to use before any dereference, closing the path completely.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Configuration
Ensure CONFIG_USERSPACE is disabled if not required; otherwise apply the flash_copy() trust-boundary fix because user-mode callers rely on z_vrfy_flash_copy() for device-pointer validation when CONFIG_USERSPACE is enabled.
Kernel build configuration (CONFIG_USERSPACE) CONFIG_USERSPACE = enabled
Event History
Frequently Asked Questions
What is the severity of CVE-2026-9771?
CVE-2026-9771 has a severity score of 8.8, indicating a high level of risk.
What does CVE-2026-9771 exploit?
CVE-2026-9771 exploits a missing device-pointer validation in the flash_copy() syscall, allowing potential privilege escalation.
How do I mitigate the risks associated with CVE-2026-9771?
To mitigate the risks of CVE-2026-9771, ensure you are using an updated version of the Linux kernel that includes the necessary fixes.
Who is affected by CVE-2026-9771?
CVE-2026-9771 affects systems using the Linux flash_copy system call with CONFIG_USERSPACE enabled.
What actions should I take if I am impacted by CVE-2026-9771?
If impacted by CVE-2026-9771, you should update your Linux kernel and review your system's security configurations.