KVM: guest_memfd: Gracefully handle xarray errors when binding a memslot
No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 0%. Fixed in Kernel e6ecb88711d93b9e014532f17d3d29b57e80932c, Kernel 1706461eb1af814366b6d0ab413edd0876bd8033, Kernel 2cfc1ccf67ffe96811c816d27d44128c5d5833ec and 4 more.
In the Linux kernel, the following vulnerability has been resolved: KVM: guest_memfd: Gracefully handle xarray errors when binding a memslot If inserting a memslot into a guest_memfd's bindings xarray fails, propagate the error back to the caller, i.e. fail memslot creation as well. Signalling success and continuing on with memslot creation results in use-after-free, as the guest_memfd instance will remain reachable via the memslot after the file is freed (kvm_gmem_release() won't nullify the file pointer due to lack of a valid binding). Opportunistically WARN and reject binding if KVM_MEMSLOT_GMEM_ONLY is already set, partly to guard against goofs elsewhere, but mostly so that KVM doesn't need to worry about clobbering flags when unwinding on failure. Regarding the unwind, the slot must be fully prepared before inserting it into the bindings, at which point the slot becomes reachable. I.e. waiting to update the slot in order to avoid the ugly unwind isn't an option. And as part of the unwind, explicitly nullify the relevant bindings, as xarray can store a subset of entries when populating a range.
Affected
Vendors, products and packages with version ranges
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| Linux | Kernel | >=a7800aa80ea4d5356b8474c2302812e9d4926fa6 <e6ecb88711d93b9e014532f17d3d29b57e80932c, >=a7800aa80ea4d5356b8474c2302812e9d4926fa6 <1706461eb1af814366b6d0ab413edd0876bd8033, >=a7800aa80ea4d5356b8474c2302812e9d4926fa6 <2cfc1ccf67ffe96811c816d27d44128c5d5833ec, >=a7800aa80ea4d5356b8474c2302812e9d4926fa6 <2fa83c615f8dbb240b262265e788b120b6384e7b, =6.8 | e6ecb88711d93b9e014532f17d3d29b57e80932c, 1706461eb1af814366b6d0ab413edd0876bd8033, 2cfc1ccf67ffe96811c816d27d44128c5d5833ec, 2fa83c615f8dbb240b262265e788b120b6384e7b |
| linux-kernel: Kernel | >=6.19.0 <7.3.2, >=6.8.0 <6.12.117, >=6.13.0 <6.18.63 | 7.3.2, 6.12.117, 6.18.63 |
Timeline
Every event on this vulnerability
Related
Other vulnerabilities in Kernel, strongest first
Embed
A live severity badge for an advisory, README or ticket