KVM: Move kvm_io_bus_get_dev() locking responsibilities to callers
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8a39d00670f0792c1186e442e1dd28fe0326f2ee · < 7099e7148f81c605bbc319b16ce0131540341560| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
KVM: Move kvm_io_bus_get_dev() locking responsibilities to callers
kvm_io_bus_get_dev() returns a device that is only matched by the address, and nothing else. This can cause a lifetime issue if the matched device is not the expected type, as by the time the caller can introspect the object, it might be gone (the srcu lock having been dropped).
Given that there is only a single user of this helper, the simplest option is to move the locking responsibility to the caller, which can keep the srcu lock held for as long as it wants.
Note that this aligns with other kvm_io_bus*() helpers, which already require the srcu lock to be held by the callers.
From the CVE record · Linux
KVM's kvm_io_bus_get_dev() can return an address-matched device of an unexpected type that may be gone by the time the caller inspects it, after the SRCU lock is released. The input does not specify what an attacker could do or whether exploitation requires local or network access, authentication, or user interaction.
Engineers running Linux with KVM should check their kernel versions; affected versions are not specified.