CVE-2026-99681: blk-mq: fix out-of-bounds read in blk_mq_free_rqs
In the Linux kernel, the following vulnerability has been resolved:
blk-mq: fix out-of-bounds read in blkmqfreerqs
A KASAN slab-out-of-bounds read can occur in blkmqfreerqs() when there is a mismatch between the number of hardware queues allocated for the IO scheduler (et->nrhwqueues) and the number of hardware queues in the block tag set (set->nrhwqueues).
This mismatch can happen if blkmqupdatenrhwqueues() fails halfway through (e.g., due to memory pressure during blkmqprealloctagsettags()). In this error path, the elevator is restored with a larger number of hardware queues than the block tag set actually has.
When the elevator is later freed, blkmqfreeschedtags() iterates up to the new et->nrhwqueues and calls blkmqfreerqs(). In blkmqfreerqs(), it attempts to access set->tags[hctxidx] to get the driver tags. Because set->nrhwqueues was not updated due to the earlier failure, set->tags still has the old (smaller) size, leading to an out-of-bounds read.
BUG: KASAN: slab-out-of-bounds in blkmqfreerqs+0xde/0x680 Read of size 8 at addr ffff88818d67fc28 by task syz-executor117/5839 Call Trace: blkmqfreerqs+0xde/0x680 blkmqfreemapandrqs+0x40/0xf0 blkmqfreeschedtags blkmqfreeschedres+0xeb/0x280 elevatorchangedone+0x1d2/0x5c0 elevatorchange+0x34f/0x480 elvioschedstore+0x504/0x630 queueattrstore+0x207/0x2b0
To fix this, explicitly check if hctxidx < set->nrhwqueues before accessing set->tags[hctxidx]. If hctxidx >= set->nrhwqueues, the hardware queue doesn't exist in the tag set, meaning there are no driver tags to clear mappings from. In this case, safely set drvtags to NULL. The subsequent call to blkmqclearrqmapping() already handles a NULL drvtags pointer and will safely return.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.17 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.64 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.5 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.192-2Fixed in 6.12.107-1Fixed in 6.12.117-1Fixed in 7.3.5-1
Event History
Frequently Asked Questions
What conditions are required to trigger the out-of-bounds read?
A hardware-queue-count update must fail partway through, such as when memory pressure causes blk_mq_prealloc_tag_set_tags() to fail. This can leave the I/O scheduler with more hardware queues than the block tag set, and the read occurs later when the elevator is freed.
Which systems are realistically exposed?
Exposure is limited to Linux kernel systems that reach the failed blk_mq_update_nr_hw_queues() error path and subsequently free the affected I/O scheduler. The issue depends on a mismatch between the scheduler's hardware-queue count and the block tag set's hardware-queue count.
How can administrators identify a possible occurrence?
The reported symptom is a KASAN slab-out-of-bounds read in blk_mq_free_rqs(). The supplied example reports a read of size 8 and includes blk_mq_free_rqs and blk_mq_free_map_and_rqs in the call trace.