CVE-2026-12234: TOCTOU double-fetch in `zsock_sendmsg`/`recvmsg` userspace verifiers allows kernel-heap out-of-bounds write
The userspace syscall verifiers zvrfyzsocksendmsg() and zvrfyzsockrecvmsg() in subsys/net/lib/sockets/sockets.c snapshot the caller-supplied struct netmsghdr into a kernel-side copy with kusermodefromcopy(), but then re-read the still-live user struct for subsequent decisions. The kernel iovec shadow buffer is sized from one read of msg->msgiovlen, while the population loop is bounded by a second, live read of the same field.
Because msg points into ordinary user memory, a cooperating second thread in the same memory domain can inflate msg->msgiovlen in the window between the sizing read and the loop test (a classic double-fetch / TOCTOU). The population loop then iterates past the number of netiovec slots actually allocated, writing attacker-influenced iovbase/iovlen values beyond the end of the kernel-heap shadow buffer. The recvmsg verifier has the same defect on both its inbound and result write-back loops.
The code is reachable from an unprivileged user thread whenever CONFIGUSERSPACE is enabled and the zsocksendmsg/zsockrecvmsg syscalls are available. A successful race corrupts kernel-managed heap memory across the user-to-kernel privilege boundary, yielding a local privilege-escalation primitive or, at minimum, a kernel-fault denial of service. The fix copies the header once and derives every size, bound, and gate from the snapshot, copying each iovec entry atomically so its base and length can no longer be raced apart.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-12234?
The severity of CVE-2026-12234 is high, with a score of 7.8.
How can CVE-2026-12234 be mitigated?
Mitigation for CVE-2026-12234 involves updating to the latest Linux Kernel version that addresses the vulnerability.
What type of vulnerability is CVE-2026-12234?
CVE-2026-12234 is a TOCTOU double-fetch vulnerability that allows for a kernel-heap out-of-bounds write.
What software is affected by CVE-2026-12234?
CVE-2026-12234 affects the Linux Kernel.
What are the impacts of exploiting CVE-2026-12234?
Exploiting CVE-2026-12234 may lead to potential privilege escalation or arbitrary code execution in the kernel.