CVE-2022-49884

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-49884
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-49884.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-49884
Downstream
Published
2025-05-01T14:10:30Z
Modified
2025-10-16T01:19:30.076551Z
Summary
KVM: Initialize gfn_to_pfn_cache locks in dedicated helper
Details

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

KVM: Initialize gfntopfn_cache locks in dedicated helper

Move the gfntopfncache lock initialization to another helper and call the new helper during VM/vCPU creation. There are race conditions possible due to kvmgfntopfncacheinit()'s ability to re-initialize the cache's locks.

For example: a race between ioctl(KVMXENHVMEVTCHNSEND) and kvmgfntopfncache_init() leads to a corrupted shinfo gpc lock.

            (thread 1)                |           (thread 2)
                                      |

kvmxensetevtchnfast | readlockirqsave(&gpc->lock, ...) | | kvmgfntopfncacheinit | rwlockinit(&gpc->lock) readunlockirqrestore(&gpc->lock, ...) |

Rename "cacheinit" and "cachedestroy" to activate+deactivate to avoid implying that the cache really is destroyed/freed.

Note, there more races in the newly named kvmgpcactivate() that will be addressed separately.

[sean: call out that this is a bug fix]

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
982ed0de4753ed6e71dbd40f82a5a066baf133ed
Fixed
61242001d6c9c253df7645dab090842d8da08764
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
982ed0de4753ed6e71dbd40f82a5a066baf133ed
Fixed
52491a38b2c2411f3f0229dc6ad610349c704a41

Affected versions

v5.*

v5.16
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.18
v5.18-rc1
v5.18-rc2
v5.18-rc3
v5.18-rc4
v5.18-rc5
v5.18-rc6
v5.18-rc7
v5.19
v5.19-rc1
v5.19-rc2
v5.19-rc3
v5.19-rc4
v5.19-rc5
v5.19-rc6
v5.19-rc7
v5.19-rc8

v6.*

v6.0
v6.0-rc1
v6.0-rc2
v6.0-rc3
v6.0-rc4
v6.0-rc5
v6.0-rc6
v6.0-rc7
v6.0.1
v6.0.2
v6.0.3
v6.0.4
v6.0.5
v6.0.6
v6.0.7
v6.1-rc1

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.17.0
Fixed
6.0.8