CVE-2024-45022

Source
https://nvd.nist.gov/vuln/detail/CVE-2024-45022
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-45022.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2024-45022
Downstream
Related
Published
2024-09-11T16:15:07Z
Modified
2025-08-09T19:01:27Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
[none]
Details

In the Linux kernel, the following vulnerability has been resolved:

mm/vmalloc: fix page mapping if vmareaalloc_pages() with high order fallback to order 0

The _vmappagesrangenoflush() assumes its argument pages* contains pages with the same page shift. However, since commit e9c3cda4d86e ("mm, vmalloc: fix high order __GFP_NOFAIL allocations"), if gfp_flags includes __GFP_NOFAIL with high order in vm_area_alloc_pages() and page allocation failed for high order, the pages* may contain two different page shifts (high order and order-0). This could lead _vmappagesrangenoflush() to perform incorrect mappings, potentially resulting in memory corruption.

Users might encounter this as follows (vmapallowhuge = true, 2M is for PMD_SIZE):

kvmalloc(2M, _GFPNOFAIL|GFPX) _vmallocnoderangenoprof(vmflags=VMALLOWHUGEVMAP) vmareaallocpages(order=9) ---> order-9 allocation failed and fallback to order-0 vmappagesrange() vmappagesrangenoflush() _vmappagesrangenoflush(pageshift = 21) ----> wrong mapping happens

We can remove the fallback code because if a high-order allocation fails, _vmallocnoderangenoprof() will retry with order-0. Therefore, it is unnecessary to fallback to order-0 here. Therefore, fix this by removing the fallback code.

References

Affected packages