mm/huge_memory: fix NULL pointer deference when splitting folio
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.12.616.17.116.18In the Linux kernel, the following vulnerability has been resolved:
mm/huge_memory: fix NULL pointer deference when splitting folio
Commit c010d47f107f ("mm: thp: split huge page to any lower order pages") introduced an early check on the folio's order via mapping->flags before proceeding with the split work.
This check introduced a bug: for shmem folios in the swap cache and truncated folios, the mapping pointer can be NULL. Accessing mapping->flags in this state leads directly to a NULL pointer dereference.
This commit fixes the issue by moving the check for mapping != NULL before any attempt to access mapping->flags.
From the CVE record · Linux
The Linux kernel can dereference a NULL mapping pointer while splitting a shmem folio in the swap cache or a truncated folio. This can cause a kernel fault; the input does not specify an attacker path, required privileges, or user interaction.
Engineers running Linux kernels that include the affected huge-page splitting code should check their kernel version against the vendor advisory; affected versions are not specified.