drivers/base/memory: set mem->altmap after successful device registration
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 1a8c64e110435e44e71bcd50a75663174b575f22 · < a2b8d7827f48ee54a686cb80e4a1d0ff954ec42a| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
drivers/base/memory: set mem->altmap after successful device registration
If __add_memory_block() fails at xa_store() (under memory pressure for example), device_unregister() is called, which eventually triggers memory_block_release() with mem->altmap still set, causing a WARN_ON(mem->altmap). This was triggered by modifying virtio-mem driver.
Fix this by delaying the assignment of mem->altmap until after __add_memory_block() has succeeded.
From the CVE record · Linux
The Linux kernel can trigger a WARN_ON during memory block cleanup if registration fails while mem->altmap is set, for example under memory pressure. The issue was triggered by modifying the virtio-mem driver; the input does not establish a network attack path or authentication requirement.
Engineers running Linux kernels with memory block registration, particularly those using virtio-mem, should check whether their kernel is affected; affected versions are not specified.