mm/huge_memory: drop beyond-EOF folios with the right number of refs
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.216.13.96.14In the Linux kernel, the following vulnerability has been resolved:
mm/huge_memory: drop beyond-EOF folios with the right number of refs
When an after-split folio is large and needs to be dropped due to EOF, folio_put_refs(folio, folio_nr_pages(folio)) should be used to drop all page cache refs. Otherwise, the folio will not be freed, causing memory leak.
This leak would happen on a filesystem with blocksize > page_size and a truncate is performed, where the blocksize makes folios split to >0 order ones, causing truncated folios not being freed.
From the CVE record · Linux
The Linux kernel can leak memory when a file is truncated on a filesystem whose block size exceeds the page size. In this case, split folios beyond the end of the file may not be freed because not all page-cache references are dropped. The input does not specify attacker access requirements or user interaction.
Engineers running Linux kernels on filesystems with a block size greater than the page size should check their deployments; affected versions are not specified.