CVE-2021-46984: kyber: fix out of bounds access when preempted
In the Linux kernel, the following vulnerability has been resolved:
kyber: fix out of bounds access when preempted
__blk_mq_sched_bio_merge() gets the ctx and hctx for the current CPU and
passes the hctx to ->bio_merge(). kyber_bio_merge() then gets the ctx
for the current CPU again and uses that to get the corresponding Kyber
context in the passed hctx. However, the thread may be preempted between
the two calls to blk_mq_get_ctx(), and the ctx returned the second time
may no longer correspond to the passed hctx. This "works" accidentally
most of the time, but it can cause us to read garbage if the second ctx
came from an hctx with more ctx's than the first one (i.e., if
ctx->index_hw[hctx->type] > hctx->nr_ctx).
This manifested as this UBSAN array index out of bounds error reported
by Jakub:
UBSAN: array-index-out-of-bounds in ../kernel/locking/qspinlock.c:130:9
index 13106 is out of range for type 'long unsigned int [128]'
Call Trace:
dump_stack+0xa4/0xe5
ubsan_epilogue+0x5/0x40
__ubsan_handle_out_of_bounds.cold.13+0x2a/0x34
queued_spin_lock_slowpath+0x476/0x480
do_raw_spin_lock+0x1c2/0x1d0
kyber_bio_merge+0x112/0x180
blk_mq_submit_bio+0x1f5/0x1100
submit_bio_noacct+0x7b0/0x870
submit_bio+0xc2/0x3a0
btrfs_map_bio+0x4f0/0x9d0
btrfs_submit_data_bio+0x24e/0x310
submit_one_bio+0x7f/0xb0
submit_extent_page+0xc4/0x440
__extent_writepage_io+0x2b8/0x5e0
__extent_writepage+0x28d/0x6e0
extent_write_cache_pages+0x4d7/0x7a0
extent_writepages+0xa2/0x110
do_writepages+0x8f/0x180
__writeback_single_inode+0x99/0x7f0
writeback_sb_inodes+0x34e/0x790
__writeback_inodes_wb+0x9e/0x120
wb_writeback+0x4d2/0x660
wb_workfn+0x64d/0xa10
process_one_work+0x53a/0xa80
worker_thread+0x69/0x5b0
kthread+0x20b/0x240
ret_from_fork+0x1f/0x30
Only Kyber uses the hctx, so fix it by passing the request_queue to
->bio_merge() instead. BFQ and mq-deadline just use that, and Kyber can
map the queues itself to avoid the mismatch.
Security readout for executives and security teams
Plain-English summary
This is a Linux kernel storage scheduler bug in Kyber. Under a timing race during CPU preemption, the kernel could use mismatched queue context and read outside expected memory bounds. The public bundle shows a kernel fix but no CVSS score, no KEV listing, and no cited active exploitation.
Executive priority
Treat as a normal kernel maintenance priority unless local risk is elevated by Kyber usage or sensitive multi-tenant workloads. There is no source-backed evidence of active exploitation, but kernel memory safety bugs should not remain unpatched indefinitely.
Technical view
__blk_mq_sched_bio_merge() passed an hctx derived from one CPU context, while kyber_bio_merge() recomputed ctx later. If preempted between those operations, ctx could map to a different hctx, causing an out-of-bounds array access. The fix changes bio_merge handling so Kyber maps queues consistently from the request_queue.
Likely exposure
Exposure is limited to Linux systems running affected kernel versions with the Kyber I/O scheduler path reachable. The bundle identifies Linux as affected and references stable kernel fixes, but distro-specific package mappings are not provided.
Exploitation context
No active exploitation is supported by the supplied sources, and the CVE is not marked KEV. Evidence describes a kernel UBSAN out-of-bounds report during filesystem writeback, not a public exploit or reliable remote attack path.
Researcher notes
The key condition is preemption between two ctx lookups, producing hctx/ctx mismatch. The bundle does not provide CVSS, CWE, exploitability analysis, or distro advisories. Validate impact against exact kernel backports rather than upstream version numbers alone.
Mitigation direction
Apply vendor kernel updates containing the referenced stable fixes.
Check Linux distribution advisories for exact fixed package versions.
Prioritize systems using Kyber or affected block multiqueue scheduler paths.
If patch timing is constrained, review vendor guidance for scheduler workarounds.
Validation and detection
Inventory Linux kernel versions across servers and appliances.
Determine whether Kyber is configured or selectable on exposed systems.
Map installed distro kernel packages to vendor fixed versions.
Review kernel logs for UBSAN or Kyber-related out-of-bounds reports.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2021-46984 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.