CVE-2022-49412: bfq: Avoid merging queues with different parents

Published Feb 26, 2025
·
Updated

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

bfq: Avoid merging queues with different parents

It can happen that the parent of a bfqq changes between the moment we decide two queues are worth to merge (and set bic->stablemergebfqq) and the moment bfqsetupmerge() is called. This can happen e.g. because the process submitted IO for a different cgroup and thus bfqq got reparented. It can even happen that the bfqq we are merging with has parent cgroup that is already offline and going to be destroyed in which case the merge can lead to use-after-free issues such as:

BUG: KASAN: use-after-free in bfqdeactivateentity+0x9cb/0xa50 Read of size 8 at addr ffff88800693c0c0 by task runc:[2:INIT]/10544

CPU: 0 PID: 10544 Comm: runc:[2:INIT] Tainted: G E 5.15.2-0.g5fb85fd-default #1 openSUSE Tumbleweed (unreleased) f1f3b891c72369aebecd2e43e4641a6358867c70 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a-rebuilt.opensuse.org 04/01/2014 Call Trace: <IRQ> dumpstacklvl+0x46/0x5a printaddressdescription.constprop.0+0x1f/0x140 ? bfqdeactivateentity+0x9cb/0xa50 kasanreport.cold+0x7f/0x11b ? bfqdeactivateentity+0x9cb/0xa50 bfqdeactivateentity+0x9cb/0xa50 ? updatecurr+0x32f/0x5d0 bfqdeactivateentity+0xa0/0x1d0 bfqdelbfqqbusy+0x28a/0x420 ? reschedcurr+0x116/0x1d0 ? bfqrequeuebfqq+0x70/0x70 ? checkpreemptwakeup+0x52b/0xbc0 bfqbfqqexpire+0x1a2/0x270 bfqbfqqexpire+0xd16/0x2160 ? trytowakeup+0x4ee/0x1260 ? bfqendwrasyncqueues+0xe0/0xe0 ? rawwriteunlockbh+0x60/0x60 ? rawspinlockirq+0x81/0xe0 bfqidleslicetimer+0x109/0x280 ? bfqdispatchrequest+0x4870/0x4870 hrtimerrunqueues+0x37d/0x700 ? enqueuehrtimer+0x1b0/0x1b0 ? kvmclockgetcycles+0xd/0x10 ? ktimegetupdateoffsetsnow+0x6f/0x280 hrtimerinterrupt+0x2c8/0x740

Fix the problem by checking that the parent of the two bfqqs we are merging in bfqsetupmerge() is the same.

Affected Software

10 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel<5.4.198
Linux Linux kernel>=5.5<5.10.121
Linux Linux kernel>=5.13<5.15.46
Linux Linux kernel>=5.16<5.17.14
Linux Linux kernel>=5.18<5.18.3
debian/linux<5.18.5-1
5.18.5-1
debian/linux<5.18.5-1
5.18.5-1
debian/linux<5.18.5-1
5.18.5-1
debian/linux
5.18.5-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.18.5-1
  2. Compensating control

    In bfq_setup_merge(), check that the two bfqqs have the same parent before merging them.

Event History

Feb 26, 2025
CVE Published
via MITRE·02:12 AM
Data Sourced
via MITRE·02:12 AM
Description
Data Sourced
via Red Hat·03:15 AM
DescriptionSeverityAffected Software
Data Sourced
via NVD·07:01 AM
Description
Data Sourced
via OSV·07:01 AM
DescriptionSeverityAffected Software
Feb 27, 2025
Data Sourced
via NVD·07:15 PM
SeverityWeakness
Mar 24, 2025
Data Sourced
via NVD·07:52 PM
RemedyAffected Software
Jun 19, 2025
Updated
via NVD·01:15 PM
RemedyAffected Software
Aug 4, 2026
Data Sourced
via MITRE·09:05 AM
Severity

Frequently Asked Questions

1

What is the severity of CVE-2022-49412?

CVE-2022-49412 has a medium severity level due to potential issues with queue merging in the Linux kernel.

2

Which versions of the Linux kernel are affected by CVE-2022-49412?

CVE-2022-49412 affects Linux kernel versions from 5.5 up to, but not including, 5.4.198, as well as various other specific versions.

3

How do I fix CVE-2022-49412?

To fix CVE-2022-49412, update your Linux kernel to a version that is greater than 5.18.3.

4

What are the risks associated with CVE-2022-49412?

The risks associated with CVE-2022-49412 include potential system instability and increased vulnerability to attacks that exploit queue management flaws.

5

Is there a workaround for CVE-2022-49412?

There are no reliable workarounds for CVE-2022-49412; updating the kernel is recommended for mitigation.

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