CVE-2022-49265: PM: domains: Fix sleep-in-atomic bug caused by genpd_debug_remove()

Published Feb 26, 2025
·
Updated

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

PM: domains: Fix sleep-in-atomic bug caused by genpddebugremove()

When a genpd with GENPDFLAGIRQSAFE gets removed, the following sleep-in-atomic bug will be seen, as genpddebugremove() will be called with a spinlock being held.

[ 0.029183] BUG: sleeping function called from invalid context at kernel/locking/rwsem.c:1460 [ 0.029204] inatomic(): 1, irqsdisabled(): 128, nonblock: 0, pid: 1, name: swapper/0 [ 0.029219] preemptcount: 1, expected: 0 [ 0.029230] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.17.0-rc4+ #489 [ 0.029245] Hardware name: Thundercomm TurboX CM2290 (DT) [ 0.029256] Call trace: [ 0.029265] dumpbacktrace.part.0+0xbc/0xd0 [ 0.029285] showstack+0x3c/0xa0 [ 0.029298] dumpstacklvl+0x7c/0xa0 [ 0.029311] dumpstack+0x18/0x34 [ 0.029323] mightresched+0x10c/0x13c [ 0.029338] mightsleep+0x4c/0x80 [ 0.029351] downread+0x24/0xd0 [ 0.029363] lookuponelenunlocked+0x9c/0xcc [ 0.029379] lookuppositiveunlocked+0x10/0x50 [ 0.029392] debugfslookup+0x68/0xac [ 0.029406] genpdremove.part.0+0x12c/0x1b4 [ 0.029419] ofgenpdremovelast+0xa8/0xd4 [ 0.029434] pscicpuidledomainprobe+0x174/0x53c [ 0.029449] platformprobe+0x68/0xe0 [ 0.029462] reallyprobe+0x190/0x430 [ 0.029473] driverprobedevice+0x90/0x18c [ 0.029485] driverprobedevice+0x40/0xe0 [ 0.029497] driverattach+0xf4/0x1d0 [ 0.029508] busforeachdev+0x70/0xd0 [ 0.029523] driverattach+0x24/0x30 [ 0.029534] busadddriver+0x164/0x22c [ 0.029545] driverregister+0x78/0x130 [ 0.029556] platformdriverregister+0x28/0x34 [ 0.029569] psciidleinitdomains+0x1c/0x28 [ 0.029583] dooneinitcall+0x50/0x1b0 [ 0.029595] kernelinitfreeable+0x214/0x280 [ 0.029609] kernelinit+0x2c/0x13c [ 0.029622] retfromfork+0x10/0x20

It doesn't seem necessary to call genpddebugremove() with the lock, so move it out from locking to fix the problem.

Affected Software

8 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=5.11<5.15.33
Linux Linux kernel>=5.16<5.16.19
Linux Linux kernel>=5.17<5.17.2
debian/linux<5.17.3-1
5.17.3-1
debian/linux<5.17.3-1
5.17.3-1
debian/linux<5.17.3-1
5.17.3-1
debian/linux
6.1.176-16.1.192-26.12.107-16.12.117-17.3.4-17.3.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.17.3-1
  2. Upgrade

    Upgrade debian/linux to 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.4-1Fixed in 7.3.5-1
  3. Compensating control

    Move the genpd_debug_remove() call outside the spinlock-held locking section so it is not called while a spinlock is held, preventing the sleep-in-atomic bug for genpds with GENPD_FLAG_IRQ_SAFE.

Event History

Feb 26, 2025
CVE Published
via MITRE·01:56 AM
Data Sourced
via MITRE·01:56 AM
Description
Data Sourced
via Red Hat·03:17 AM
DescriptionSeverityAffected Software
Data Sourced
via NVD·07:01 AM
RemedyDescriptionSeverityAffected Software
Data Sourced
via OSV·07:01 AM
DescriptionAffected Software

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