CVE-2021-46984: kyber: fix out of bounds access when preempted

Published Feb 28, 2024
·
Updated

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

kyber: fix out of bounds access when preempted

blkmqschedbiomerge() gets the ctx and hctx for the current CPU and passes the hctx to ->biomerge(). kyberbiomerge() 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 blkmqgetctx(), 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->indexhw[hctx->type] > hctx->nrctx).

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: dumpstack+0xa4/0xe5 ubsanepilogue+0x5/0x40 ubsanhandleoutofbounds.cold.13+0x2a/0x34 queuedspinlockslowpath+0x476/0x480 dorawspinlock+0x1c2/0x1d0 kyberbiomerge+0x112/0x180 blkmqsubmitbio+0x1f5/0x1100 submitbionoacct+0x7b0/0x870 submitbio+0xc2/0x3a0 btrfsmapbio+0x4f0/0x9d0 btrfssubmitdatabio+0x24e/0x310 submitonebio+0x7f/0xb0 submitextentpage+0xc4/0x440 extentwritepageio+0x2b8/0x5e0 extentwritepage+0x28d/0x6e0 extentwritecachepages+0x4d7/0x7a0 extentwritepages+0xa2/0x110 dowritepages+0x8f/0x180 writebacksingleinode+0x99/0x7f0 writebacksbinodes+0x34e/0x790 writebackinodeswb+0x9e/0x120 wbwriteback+0x4d2/0x660 wbworkfn+0x64d/0xa10 processonework+0x53a/0xa80 workerthread+0x69/0x5b0 kthread+0x20b/0x240 retfromfork+0x1f/0x30

Only Kyber uses the hctx, so fix it by passing the requestqueue to ->biomerge() instead. BFQ and mq-deadline just use that, and Kyber can map the queues itself to avoid the mismatch.

Other sources

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

kyber: fix out of bounds access when preempted

The Linux kernel CVE team has assigned CVE-2021-46984 to this issue.

Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024022824-CVE-2021-46984-e55e@gregkh/T/#u

Red Hat

Linux Kernel could allow a local attacker to obtain sensitive information, caused by an out-of-bounds read flaw when preempted. By sending a specially crafted request, an attacker could exploit this vulnerability to obtain sensitive information or cause a denial of service condition.

IBM

Affected Software

14 affected componentsFixes available
redhat/kernel<5.4.120
5.4.120
redhat/kernel<5.10.38
5.10.38
redhat/kernel<5.11.22
5.11.22
redhat/kernel<5.12.5
5.12.5
redhat/kernel<5.13
5.13
Linux Linux kernel>=4.18<5.4.120
Linux Linux kernel>=5.5<5.10.38
Linux Linux kernel>=5.11<5.11.22
Linux Linux kernel>=5.12<5.12.5
Linux Linux kernel=5.13-rc1
IBM Security Verify Governance<=ISVG 10.0.2
IBM Security Verify Governance, Identity Manager Software Stack<=ISVG 10.0.2
IBM Security Verify Governance, Identity Manager Virtual Appliance<=ISVG 10.0.2
IBM Security Verify Governance Identity Manager Container<=ISVG 10.0.2

Event History

Feb 28, 2024
CVE Published
via MITRE·08:13 AM
Data Sourced
via MITRE·08:13 AM
Description
Data Sourced
via Red Hat·09:41 PM
DescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2021-46984?

CVE-2021-46984 has a moderate severity rating due to the potential for out of bounds access in the Linux kernel.

2

How do I fix CVE-2021-46984?

To fix CVE-2021-46984, you should upgrade to kernel versions 5.4.120, 5.10.38, 5.11.22, 5.12.5, or 5.13.

3

Which versions of the Linux kernel are affected by CVE-2021-46984?

CVE-2021-46984 affects Linux kernel versions prior to 5.4.120, 5.10.38, 5.11.22, 5.12.5, and 5.13.

4

What type of vulnerability is CVE-2021-46984?

CVE-2021-46984 is an out of bounds access vulnerability that can occur when the kyber scheduler is preempted.

5

Is it safe to continue using versions of the Linux kernel affected by CVE-2021-46984?

Continuing to use affected versions of the Linux kernel poses security risks, and it is recommended to apply the patches as soon as possible.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203