CVE-2022-49146

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49146
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49146.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49146
Downstream
Published
2025-02-26T01:55:14Z
Modified
2025-10-15T18:51:55.085304Z
Summary
virtio: use virtio_device_ready() in virtio_device_restore()
Details

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

virtio: use virtiodeviceready() in virtiodevicerestore()

After waking up a suspended VM, the kernel prints the following trace for virtio drivers which do not directly call virtiodeviceready() in the .restore:

PM: suspend exit
irq 22: nobody cared (try booting with the "irqpoll" option)
Call Trace:
 <IRQ>
 dump_stack_lvl+0x38/0x49
 dump_stack+0x10/0x12
 __report_bad_irq+0x3a/0xaf
 note_interrupt.cold+0xb/0x60
 handle_irq_event+0x71/0x80
 handle_fasteoi_irq+0x95/0x1e0
 __common_interrupt+0x6b/0x110
 common_interrupt+0x63/0xe0
 asm_common_interrupt+0x1e/0x40
 ? __do_softirq+0x75/0x2f3
 irq_exit_rcu+0x93/0xe0
 sysvec_apic_timer_interrupt+0xac/0xd0
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x12/0x20
 arch_cpu_idle+0x12/0x20
 default_idle_call+0x39/0xf0
 do_idle+0x1b5/0x210
 cpu_startup_entry+0x20/0x30
 start_secondary+0xf3/0x100
 secondary_startup_64_no_verify+0xc3/0xcb
 </TASK>
handlers:
[<000000008f9bac49>] vp_interrupt
[<000000008f9bac49>] vp_interrupt
Disabling IRQ #22

This happens because we don't invoke .enablecbs callback in virtiodevice_restore(). That callback is used by some transports (e.g. virtio-pci) to enable interrupts.

Let's fix it, by calling virtiodeviceready() as we do in virtiodevprobe(). This function calls .enablects callback and sets DRIVEROK status bit.

This fix also avoids setting DRIVEROK twice for those drivers that call virtiodevice_ready() in the .restore.

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
d50497eb4e554e1f0351e1836ee7241c059592e6
Fixed
94e9f5da39ee5f8ea31be1585de31c54f10dedce
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
d50497eb4e554e1f0351e1836ee7241c059592e6
Fixed
4ae431113179d72c668b61df320af0c06d1aa5c5
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
d50497eb4e554e1f0351e1836ee7241c059592e6
Fixed
8d65bc9a5be3f23c5e2ab36b6b8ef40095165b18

Affected versions

v5.*

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.16.1
v5.16.10
v5.16.11
v5.16.12
v5.16.13
v5.16.14
v5.16.15
v5.16.16
v5.16.17
v5.16.18
v5.16.2
v5.16.3
v5.16.4
v5.16.5
v5.16.6
v5.16.7
v5.16.8
v5.16.9
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

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
5.16.19
Type
ECOSYSTEM
Events
Introduced
5.17.0
Fixed
5.17.2