CVE-2022-49412

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49412
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49412.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49412
Downstream
Related
Published
2025-02-26T02:12:34Z
Modified
2025-10-15T21:35:24.830474Z
Severity
  • 7.8 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
bfq: Avoid merging queues with different parents
Details

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 _bfqdeactivate_entity+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 hrtimer_interrupt+0x2c8/0x740

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

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
430a67f9d6169a7b3e328bceb2ef9542e4153c7c
Fixed
5ee21edaed09e6b25f2c007b3f326752bc89bacf
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
430a67f9d6169a7b3e328bceb2ef9542e4153c7c
Fixed
a16c65cca7d2c7ff965fdd3adc8df2156529caf1
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
430a67f9d6169a7b3e328bceb2ef9542e4153c7c
Fixed
8abc8763b11c35e03cc91d59fd0cd28d39f88ca9
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
430a67f9d6169a7b3e328bceb2ef9542e4153c7c
Fixed
c1cee4ab36acef271be9101590756ed0c0c374d9

Affected versions

v5.*

v5.12
v5.12-rc5
v5.12-rc6
v5.12-rc7
v5.12-rc8
v5.13
v5.13-rc1
v5.13-rc2
v5.13-rc3
v5.13-rc4
v5.13-rc5
v5.13-rc6
v5.13-rc7
v5.14
v5.14-rc1
v5.14-rc2
v5.14-rc3
v5.14-rc4
v5.14-rc5
v5.14-rc6
v5.14-rc7
v5.15
v5.15-rc1
v5.15-rc2
v5.15-rc3
v5.15-rc4
v5.15-rc5
v5.15-rc6
v5.15-rc7
v5.15.1
v5.15.10
v5.15.11
v5.15.12
v5.15.13
v5.15.14
v5.15.15
v5.15.16
v5.15.17
v5.15.18
v5.15.19
v5.15.2
v5.15.20
v5.15.21
v5.15.22
v5.15.23
v5.15.24
v5.15.25
v5.15.26
v5.15.27
v5.15.28
v5.15.29
v5.15.3
v5.15.30
v5.15.31
v5.15.32
v5.15.33
v5.15.34
v5.15.35
v5.15.36
v5.15.37
v5.15.38
v5.15.39
v5.15.4
v5.15.40
v5.15.41
v5.15.42
v5.15.43
v5.15.44
v5.15.45
v5.15.5
v5.15.6
v5.15.7
v5.15.8
v5.15.9
v5.16
v5.16-rc1
v5.16-rc2
v5.16-rc3
v5.16-rc4
v5.16-rc5
v5.16-rc6
v5.16-rc7
v5.16-rc8
v5.17
v5.17-rc1
v5.17-rc2
v5.17-rc3
v5.17-rc4
v5.17-rc5
v5.17-rc6
v5.17-rc7
v5.17-rc8
v5.17.1
v5.17.10
v5.17.11
v5.17.12
v5.17.13
v5.17.2
v5.17.3
v5.17.4
v5.17.5
v5.17.6
v5.17.7
v5.17.8
v5.17.9
v5.18
v5.18-rc1
v5.18-rc2
v5.18-rc3
v5.18-rc4
v5.18-rc5
v5.18-rc6
v5.18-rc7
v5.18.1
v5.18.2

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.13.0
Fixed
5.15.46
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.17.14
Type
ECOSYSTEM
Events
Introduced
5.18.0
Fixed
5.18.3