efi: fix potential NULL deref in efi_mem_reserve_persistent
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
b5961ecad7121fec138ebee7d9eba4863f9dc6e7| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
efi: fix potential NULL deref in efi_mem_reserve_persistent
When iterating on a linked list, a result of memremap is dereferenced without checking it for NULL.
This patch adds a check that falls back on allocating a new page in case memremap doesn't succeed.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
[ardb: return -ENOMEM instead of breaking out of the loop]
From the CVE record · Linux
The Linux kernel's efi_mem_reserve_persistent function can dereference a NULL pointer if memremap fails while it iterates over a linked list. The input does not describe how an attacker could trigger this condition or whether access or user interaction is required.
Anyone running the Linux kernel should check their version against the vendor advisory; affected versions are not specified in the input.