dax/kmem: account for partial discontiguous resource upon removal
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 60e93dc097f7f13a16a7e4b75b8803eb2adbb721 · < 30ea97affbcce236c57287c82dc6ef7a29c63b76| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
dax/kmem: account for partial discontiguous resource upon removal
When dev_dax_kmem_probe() partially succeeds (at least one range is mapped) but a subsequent range fails request_mem_region() or add_memory_driver_managed(), the probe silently continues, ultimately returning success, but with the corresponding range resource NULL'ed out.
dev_dax_kmem_remove() iterates over all dax_device ranges regardless of if the underlying resource exists. When remove_memory() is called later, it returns 0 because the memory was never added which causes dev_dax_kmem_remove() to incorrectly assume the (nonexistent) resource can be removed and attempts cleanup on a NULL pointer.
Fix this by skipping these ranges altogether, noting that these cases are considered success, such that the cleanup is still reached when all actually-added ranges are successfully removed.
From the CVE record · Linux
The Linux kernel’s dax/kmem removal path can attempt cleanup on a NULL resource after a probe partially succeeds and a later range fails to be added. This can occur when the device is removed; the input does not establish an attacker capability, authentication requirement, or user-interaction requirement.
Engineers running Linux kernels with dax/kmem should check their versions against the vendor advisory; affected versions are not specified.