CVE-2026-139120: Linux kernel block layer sets up a new request queue without the tag-set lock, so a controller reset during a namespace scan frees tags that every other queue shares

ByLinuxtastic

December 3, 2026 #CVE, #Linux Kernel

The multiqueue block layer gives every device a request queue built from a shared tag set: the set says how many hardware queues there are, owns the tags and the CPU-to-queue maps, and blk_mq_init_allocated_queue() builds a new queue from it. The kernel CNA record says that function “only takes tag_list_lock at the end, when it adds the queue to the set. Before that it sizes the queue by set->nr_hw_queues, hands out set->tags[], maps by set->map[], and blk_mq_map_swqueue() frees tags of the set.” If the set is being updated at that moment, “the new queue free[s] tags that all the other queues share”, and the record names the ordinary event that does it: “An NVMe controller reset during a namespace scan does exactly that.” The kernel CNA scores it 9.8 as a network flaw; Red Hat rates it Critical and says why in the box below. On hosts whose block devices can be reset while they are being scanned, above all NVMe over Fabrics hosts, upgrade to 6.18.65, 7.3.6 or later and reboot; for the older stable series no backport is listed yet, so watch the record.

CVE-2026-139120 at a glance.

ComponentLinux kernel, the multiqueue block layer (block/blk-mq.c): blk_mq_init_allocated_queue() and its use of the tag set before tag_list_lock is held
Affected versionsmainline 4.6 up to 7.4-rc1 (from commit 868f2f0b, “blk-mq: dynamic h/w context count”); 6.18.x below 6.18.65, 7.3.x below 7.3.6. The record lists no fix for 5.10, 5.15, 6.1, 6.6 or 6.12, which it marks affected by default
Fixed inmainline 7.4-rc1 (commit 4fcc499e, the one Debian cites) and stable 6.18.65 (e7e089b6), 7.3.6 (515e2111). The fix takes tag_list_lock “before the first look at the set” and, because an update can be part of error handling, allocates under the lock with memalloc_noio_save() “as in add_disk_fwnode()”; block/blk-mq.c +18/−3
SeverityKernel CNA CVSS 3.1 9.8 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H), which NVD shows as its only metric; Red Hat Critical, 9.8 on the same vector, CWE-413 (improper resource locking); Ubuntu Medium, no score. A race between queue setup and a tag-set update that ends in tags shared by live queues being freed
Exploited in the wildNot on the CISA KEV catalogue (2026.11.30). EPSS: no score yet on 2 December 2026
Who is exposedHosts where a block device can be reset or reconfigured while a new queue is being created for it. Red Hat’s statement puts the network vector on “hosts configured to connect to remote NVMe over TCP fabrics, where malformed asynchronous event notifications can exploit race conditions during namespace discovery”, so that “an unauthenticated remote attacker managing a networked storage endpoint, or an attacker performing on-path spoofing” can “trigger kernel memory corruption that may result in arbitrary code execution or a complete host crash”; it adds that “local unprivileged users have limited opportunity to initiate controller reconfigurations”. A host with only local NVMe or SCSI disks meets the race only through its own resets
PublishedCVE record 30 November 2026 (kernel CNA, updated 1 December); this page built 2 December 2026, last updated 2 December 2026

What it is

A tag set is the thing a driver registers once per controller: it says how many hardware queues the controller has (nr_hw_queues), it owns the per-queue tag pools (set->tags[]) and it owns the maps from CPUs to queues (set->map[]). Every request queue made from the set, one per namespace for NVMe, is sized and wired by reading those three things, and the set can change under a running system: blk_mq_update_nr_hw_queues() is what a controller reset calls when it comes back with a different queue count, and it tears the maps down and rebuilds them for every queue on the set. The list of queues on a set is protected by tag_list_lock, which is why the update can walk it safely, and why a queue being created was supposed to be invisible to the update until it was added to the list.

The record describes the gap. The new queue was added to the list, under the lock, only at the end of blk_mq_init_allocated_queue(); everything before that read the set without the lock. If an update cleared the maps while the new queue was still reading them, blk_mq_map_swqueue(), which frees the tags of hardware queues that no CPU maps to any more, freed tags that belonged to the set and were in use by every other queue. NVMe reaches this without any attacker: a controller reset while a namespace scan is adding queues is the example the record gives, and controller resets are what the NVMe host driver does on any error it cannot handle in place, including, for a fabrics host, a bad message from the target.

The fix, by Josef Bacik and committed by Jens Axboe as patch 39 of a 28 October block series, moves the lock to the top: the set is not looked at until tag_list_lock is held, so an update either finishes before the new queue starts or waits until the queue is on the list and will be updated like the others. Holding the lock changes what the allocations inside may do, since an update can be running as part of error handling and must not wait for I/O that the same device will never complete, so the fix wraps them in memalloc_noio_save(), the pattern add_disk_fwnode() already uses. The record explains the 9.8 only by its vector; Red Hat’s statement, quoted in the box, is where the network path is spelled out. git.kernel.org refuses automated readers, so the mainline commit and the 6.18 backport (with Sasha Levin’s sign-off) were read on GitHub.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 2 December 2026; the link in the row is the tracker page, which will be newer than this one. The affected code dates from 4.6, so every supported distribution kernel has it; the filter is whether the host’s block devices can be reset while queues are being built.

DistributionStatusFixed package
AlpineNot consulted for this page: the Alpine tracker refused the automated reader on 2 December 2026—
Debianbookworm (6.1.176-1, security 6.1.192-3) vulnerable; trixie (6.12.117-1, security 6.12.118-1) vulnerable; fixed in forky and sid (7.3.6-1); no DSAunstable 7.3.6-1; nothing for trixie or bookworm on 2 December 2026
UbuntuMedium, no Ubuntu CVSS yet; linux needs evaluation in every supported release from 14.04 to 26.10 (no version named); no USNnothing released on 2 December 2026
RHEL, Rocky, Alma, CentOS StreamCritical, 9.8 on the CNA vector, CWE-413; the portal page carried no affected-packages table on 2 December 2026 and the hydra JSON refused the reader three times, so per-release states are not known to this page; the statement is quoted in the box abovenothing released on 2 December 2026
openSUSE/SLENot consulted: suse.com refused the automated reader on 2 December 2026 (client error)—
Fedora, Arch; self-built kernelsNot consulted; upstream stable versions apply6.18.65 / 7.3.6 or later; nothing listed for 5.10, 5.15, 6.1, 6.6 or 6.12

How to check

Three questions, in order: which kernel is running, does the host attach block devices over a fabric where a remote target can provoke a reset, and are resets and rescans happening. The second is where Red Hat put the Critical rating; a host with only local disks meets the race through its own resets.

# 1. the running kernel (6.18.65 / 7.3.6 or later carries the fix; older series have no backport listed)
uname -r

# 2. is there an NVMe over Fabrics host here, and which transport
for c in /sys/class/nvme/nvme*; do printf '%s %s %s\n' "$(basename $c)" "$(cat $c/transport)" "$(cat $c/address 2>/dev/null)"; done
lsmod | grep -E '^nvme_(tcp|rdma|fc)'
nvme list-subsys 2>/dev/null

# 3. the precondition: controller resets racing namespace scans
journalctl -k | grep -E 'nvme[0-9]+: (resetting controller|rescanning|new ctrl|reconnect)' | tail -n 20
journalctl -k | grep -E 'blk_mq|tag_list|queue_hw_ctx' | tail -n 20

A kernel at or above the fixed version for its series is done. A host whose transport files all say pcie has no remote party in the picture; the race still exists but needs a reset on a local controller to coincide with a scan, which is a rare event rather than something an attacker on the network schedules. A host with tcp, rdma or fc controllers is the case Red Hat describes, and the question becomes whether the targets are trusted and the path to them is one an on-path attacker could spoof. The log signature is the ordinary reset and rescan messages close together, followed by a crash in the block layer: a use after free in the tag pool shows up as an oops with blk_mq functions in the trace, and under KASAN as a slab-use-after-free on a tags object.

How to fix it

Install the fixed kernel and reboot; every queue is rebuilt from the set at boot. Debian forky and sid had 7.3.6-1 out on 2 December; Debian trixie and bookworm, Ubuntu and Red Hat had nothing released, and the record lists no backport for the stable series those distributions build from, so their fixes will carry the patch themselves when they come. The record lists no mitigation.

# Debian forky / sid (trixie and bookworm once a security update names this CVE)
apt update && apt install linux-image-amd64 && systemctl reboot       # or linux-image-arm64
# Ubuntu, RHEL family, SUSE: when the pending builds land
apt update && apt full-upgrade && systemctl reboot
dnf update kernel && systemctl reboot
zypper patch && systemctl reboot
uname -r
# Until then, on NVMe over Fabrics hosts: keep the window small rather than closed
# do not connect to targets you do not control, and do not run a manual reset while a scan is in flight
nvme disconnect-all                                   # only if the host can do without its fabric storage
echo 1 > /sys/class/nvme/nvme0/reset_controller       # the manual reset: avoid it during discovery

There is no setting that removes the race on a vulnerable kernel: the reset is the driver’s response to an error and the scan is what follows a reconnect, so the two will coincide again. What not to do: do not read “network” in the CNA vector as meaning every host with a network card; the record’s own trigger is a storage controller reset, and the remote party is a storage target or someone able to spoof one. And do not disconnect fabric storage as a reflex on a host that boots from it; the mitigation is to keep untrusted targets off the host, and the fix is the kernel.

Sources

  • CVE-2026-139120 at CVE.org — the kernel CNA record: the commit message with the “only takes tag_list_lock at the end” and “An NVMe controller reset during a namespace scan does exactly that” sentences, the git and version ranges, block/blk-mq.c (30 November 2026, updated 1 December)
  • Fix commits on git.kernel.org: 4fcc499e (mainline, 7.4-rc1) and the backports e7e089b6 (6.18.65), 515e2111 (7.3.6); git.kernel.org refuses automated readers, so the mainline commit was read on GitHub: Josef Bacik, committed by Jens Axboe, patch 39 of the 28 October series, Fixes: 868f2f0b, blk-mq.c +18/−3, no stable Cc; the 6.18 backport on GitHub adds Sasha Levin’s sign-off
  • NVD entry — Received on 30 November 2026, modified 1 December; shows the CNA’s 9.8 as a secondary metric, no NVD score, CWE or CPE on 2 December
  • Distribution trackers: Debian (bookworm and trixie vulnerable, forky and sid fixed in 7.3.6-1) · Ubuntu (Medium; needs evaluation in every release) · Red Hat (Critical 9.8, CWE-413, statement quoted above; no package table on the portal page, hydra JSON not reachable on 2 December) · SUSE (not reachable on 2 December)
  • CISA KEV catalogue 2026.11.30, not listed · EPSS no score on 2 December 2026

Related reading

This advisory page was assembled from the primary sources listed above on 2 December 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.