CVE-2026-139121 PUBLISHED

blk-mq: exit the hctxs of 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: exit the hctxs of a queue under tag_list_lock

blk_mq_update_nr_hw_queues() exits and replaces the hctxs of every queue on set->tag_list under tag_list_lock. blk_mq_exit_queue() exits its hctxs without the lock and only then takes the queue off the list, so an update running at the same time exits them again and sets up new ones that nobody exits. del_gendisk() is kept away by update_nr_hwq_lock, disk_release() of a never added disk and blk_mq_destroy_queue() are not, and nvme_alloc_ns() drops such a disk when it finds the queues frozen by a reset.

Hold tag_list_lock for both steps.

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 - A hostile NVMe/TCP target sends a Namespace-Changed AEN and Identify data, so nvme_scan_work→nvme_alloc_ns allocates a queue on ctrl->tagset. It then sends a Persistent-Internal-Error AEN, so nvme_reset_ctrl→nvme_tcp_configure_io_queues runs blk_mq_update_nr_hw_queues. nvme_alloc_ns then sees NVME_CTRL_FROZEN or a failed Identify, and put_disk→disk_release calls blk_mq_exit_queue without tag_list_lock. AC:L - The target drives both sides. It times the Identify NS completion that makes nvme_alloc_ns drop the disk against the I/O-queue Connect completions that start the update. nvme_stop_ctrl never flushes scan_work, nr_maps=2 makes every reconnect reallocate each queue's hctxs, and the async scan gives many dying queues per reset. Missed attempts are harmless and repeatable. PR:N - The attacker is the NVMe/TCP target, or an on-path spoofer when TLS/DH-HMAC-CHAP are not configured, and needs no host account. The host accepts AEN and Identify completions on the established fabrics session. The local triggers (reset_controller sysfs, NVME_IOCTL_RESET/RESCAN) need root or CAP_SYS_ADMIN and are not used. UI:N - scan_work, nvme_scan_ns_async and the reset_work reconnect all run in nvme_wq/nvme_reset_wq kernel workers in response to AEN completions the target sends. No host user action is needed once the fabrics controller is connected. S:U - The double hctx exit and the stale hctxs corrupt host kernel heap in blk-mq and nvme-tcp request PDUs. No VM, IOMMU or other security-authority boundary is crossed. C:H - If the update reallocates the queue's hctxs before or during blk_mq_exit_hw_queues, its blk_mq_add_hw_queues_cpuhp re-registers hctxs that blk_mq_release then kfrees on mainline. On 6.6/6.12 it installs never-exited hctxs whose ->queue is the freed request_queue. Later cpuhp instance adds and blk_mq_hctx_notify_dead read freed memory, a sprayable UAF. I:H - Two concurrent blk_mq_exit_hctx() calls on one hctx run nvme_tcp_exit_request's page_frag_free(req->pdu) twice and queue fq->rcu_head to SRCU twice, double-kfreeing flush_rq and the flush queue. notify_dead also splices lists inside a freed ctx. This slab and page corruption is usable for control-flow hijack. A:H - In the simplest interleaving blk_mq_exit_hw_queues finishes first and the update's blk_mq_exit_hctx dereferences the NULLed hctx->fq. That oopses the reset worker while it holds tag_list_lock and update_nr_hwq_lock with every namespace frozen, so all I/O on the controller hangs. The target can repeat the AEN and reset cycle at will.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 630ef623ed26c18a457cdc070cf24014e50129c2 to a6f435cba9508e6ee9f81c1b32ebce9e90031023 (excl.)
  • affected from 630ef623ed26c18a457cdc070cf24014e50129c2 to f179c59bea9959901d6b9f0a7e45c170d6fbb2e3 (excl.)
  • affected from 630ef623ed26c18a457cdc070cf24014e50129c2 to 2aa679bff2e9a90f8a39e769ccb0b03d945a5c52 (excl.)
  • affected from 630ef623ed26c18a457cdc070cf24014e50129c2 to b11079315bcbe2bd947e5e819e5f5c03451afc61 (excl.)
  • affected from 630ef623ed26c18a457cdc070cf24014e50129c2 to 89a2381482d8ff8e4fe0b7d32797bb4f77503b89 (excl.)
  • Version 0b948f3c2149680b38757257d37406777338b0dc is affected
  • Version 00b5bc6421739f6eba45eede245846394e0dd279 is affected
  • Version 3c1db90ae0d0210c0695f63f77458124d83508b2 is affected
  • Version 3a96437f6bf85fa64e933cc100445f9278cee1ff is affected
  • Version 929778cfc8f31f3fa793a5fa5f10fe3cd30f63ff is affected
  • Version 5e9e6d114b536c654a7209c98a38f982a2de7009 is affected
  • affected from 4.14.233 to 4.15 (excl.)
  • affected from 4.19.191 to 4.20 (excl.)
  • affected from 5.4.120 to 5.5 (excl.)
  • affected from 5.10.38 to 5.11 (excl.)
  • affected from 5.11.22 to 5.12 (excl.)
  • affected from 5.12.5 to 5.13 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 5.13 is affected
  • unaffected from 0 to 5.13 (excl.)
  • unaffected from 6.6.163 to 6.6.* (incl.)
  • unaffected from 6.12.119 to 6.12.* (incl.)
  • 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