CVE-2026-139120 PUBLISHED

blk-mq: set up a queue under tag_list_lock

Assigner: Linux
Reserved: 30.11.2026 Published: 30.11.2026 Updated: 01.12.2026

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

blk-mq: set up a queue under tag_list_lock

blk_mq_init_allocated_queue() 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. An update clearing the maps at that time makes the new queue free tags that all the other queues share. An NVMe controller reset during a namespace scan does exactly that.

Take the lock before the first look at the set. An update can be part of error handling, so the allocations under the lock must not wait for IO: memalloc_noio_save(), as in add_disk_fwnode().

Metrics

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 9.8

AV:N - On an nvme-tcp host, a hostile or on-path target sends a Namespace-Changed AEN and Identify data, driving nvme_scan_work→nvme_scan_ns_async→nvme_alloc_ns→blk_mq_alloc_disk→blk_mq_init_allocated_queue(). It also sends a Persistent-Internal-Error AEN and a Set Features Number-of-Queues result, driving nvme_reset_ctrl→nvme_tcp_configure_io_queues→blk_mq_update_nr_hw_queues on the same ctrl->tagset over routable TCP. AC:L - The target controls both sides: it times the scan's Identify completions against the I/O-queue Connect completions of the immediate reset. nvme_stop_ctrl() never flushes scan_work, and nr_maps=2 makes every update clear mq_map. The target can also change the queue and namespace counts to widen the window, and missed attempts are harmless and repeatable. PR:N - The attacker is the NVMe/TCP target or an on-path spoofer and needs no account or capability on the host. AENs, Identify data and Set Features results are accepted on the established fabrics session, and TLS/DH-HMAC-CHAP are optional. The root-only local triggers (reset_controller, NVME_IOCTL_RESET) are not needed. UI:N - scan_work, the reset_work reconnect and the parallel nvme_scan_ns_async namespace allocation all run from nvme_wq/nvme_reset_wq kernel workers in response to target-sent AEN completions. No host user action is needed once the fabrics controller is connected. S:U - The freed blk_mq_tags and request pages, and the out-of-bounds hctx pointer, are all host kernel heap memory in the block layer. No VM, IOMMU or other security-authority boundary is crossed. C:H - With the map cleared, the new queue's blk_mq_map_swqueue() calls __blk_mq_free_map_and_rqs() on set->tags[i] that other namespaces' hctx->tags still use. Their later I/O reads the freed sbitmap, static_rqs and request pages, a sprayable UAF read. The grow case also reads queue_hw_ctx[] past its kcalloc'd end. I:H - blk_mq_get_tag() and blk_mq_rq_ctx_init() then write into freed blk_mq_tags and request pages. With a grown queue count, queue_hctx() returns an out-of-bounds pointer that blk_mq_map_swqueue() writes through (cpumask_set_cpu, hctx->ctxs[nr_ctx++]=ctx). This memory corruption is usable for control-flow hijack. A:H - Even without exploitation, I/O on a stale hctx->tags or through the wild hctx pointer oopses the host in blk_mq_get_tag or blk_mq_map_swqueue. That takes down every namespace sharing the controller's tag set, and the target can repeat the AEN and reset cycle at will.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 868f2f0b72068a097508b6e8870a8950fd8eb7ef to e7e089b61901be0f4bac6b1d8c8f8e25cf178280 (excl.)
  • affected from 868f2f0b72068a097508b6e8870a8950fd8eb7ef to 515e211124113b4faecf3b0cb20087965286ee0c (excl.)
  • affected from 868f2f0b72068a097508b6e8870a8950fd8eb7ef to 4fcc499ea9bc31b02393904a1903e794d146f5f7 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 4.6 is affected
  • unaffected from 0 to 4.6 (excl.)
  • unaffected from 6.18.65 to 6.18.* (incl.)
  • unaffected from 7.3.6 to 7.3.* (incl.)
  • unaffected from 7.4-rc1 to * (incl.)

References