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]