5.5medium
lib/test_hmm.c: handle src_pfns and dst_pfns allocation failure
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.31% (higher than 16% of CVEs)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: lib/test_hmm.c: handle src_pfns and dst_pfns allocation failure The kcalloc() in dmirror_device_evict_chunk() will return null if the physical memory has run out. As a result, if src_pfns or dst_pfns is dereferenced, the null pointer dereference bug will happen. Moreover, the device is going away. If the kcalloc() fails, the pages mapping a chunk could not be evicted. So add a __GFP_NOFAIL flag in kcalloc(). Finally, as there is no need to have physically contiguous memory, Switch kcalloc() to kvcalloc() in order to avoid failing allocations.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from b2ef9f5a5cb37643ca5def3516c546457074b882 before 1a21fdeea502658e315bd939409b755974f4fb64, from b2ef9f5a5cb37643ca5def3516c546457074b882 before 65e528a69cb3ed4a286c45b4afba57461c8b5b33, from b2ef9f5a5cb37643ca5def3516c546457074b882 before ce47e8ead9a72834cc68431d53f8092ce69bebb7, from b2ef9f5a5cb37643ca5def3516c546457074b882 before 3b20d18f475bd17309db640dbe7d7c7ebb5bc2bc, from b2ef9f5a5cb37643ca5def3516c546457074b882 before c2af060d1c18beaec56351cf9c9bcbbc5af341a3, 5.8 Not affected: before 5.8, from 6.1.93 up to 6.1.*, from 6.6.33 up to 6.6.*, from 6.8.12 up to 6.8.*, from 6.9.3 up to 6.9.*, from 6.10 up to * | CVE List |
| linux linux_kernel | from 5.8 before 6.1.93, from 6.2 before 6.6.33, from 6.7 before 6.8.12, from 6.9 before 6.9.3 | NVD |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: lib/test_hmm.c: handle src_pfns and dst_pfns allocation failure The kcalloc() in dmirror_device_evict_chunk() will return null if the physical memory has run out. As a result, if src_pfns or dst_pfns is dereferenced, the null pointer dereference bug will happen. Moreover, the device is going away. If the kcalloc() fails, the pages mapping a chunk could not be evicted. So add a __GFP_NOFAIL flag in kcalloc(). Finally, as there is no need to have physically contiguous memory, Switch kcalloc() to kvcalloc() in order to avoid failing allocations.
NVD (es)
En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: lib/test_hmm.c: maneja el error de asignación de src_pfns y dst_pfns El kcalloc() en dmirror_device_evict_chunk() devolverá nulo si la memoria física se ha agotado. Como resultado, si se desreferencia src_pfns o dst_pfns, se producirá el error de desreferencia del puntero nulo. Además, el dispositivo va a desaparecer. Si kcalloc() falla, las páginas que asignan un fragmento no podrán ser desalojadas. Entonces agregue una bandera __GFP_NOFAIL en kcalloc(). Finalmente, como no es necesario tener memoria físicamente contigua, cambie kcalloc() a kvcalloc() para evitar asignaciones fallidas.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-38543 changed 2026-05-11 | CVE Terms of Use |
| NVD | CVE-2024-38543 changed 2026-06-17 | Public domain |