mm/huge_memory: fix truncate racing with PMD zapping
NIST has received this entry but not started reviewing it.
In the Linux kernel, the following vulnerability has been resolved: mm/huge_memory: fix truncate racing with PMD zapping zap_huge_pmd_folio() removes the rmap before calling folio_mark_dirty(). If this was the last mapping, truncation can skip unmapping the folio and proceed without waiting for the PMD lock, racing with dirtying. ifs_set_range_dirty() can oops if MADV_DONTNEED races with ftruncate() on XFS, when we get the folio set dirty after it was found to not be mapped anymore. Move folio_mark_dirty() and folio_mark_accessed() before rmap removal, matching the PTE zap path. This keeps the folio mapped while updating its state, so truncation must wait for the page table lock. Fix generated by an LLM and sent by Chris Mason in private. [ david: simplify comment and description ]
New to this? Read how to keep your software updated.
The products and versions NIST lists as vulnerable, 2 products in all. If what you run is not listed it is probably not affected, but ask your provider if you are unsure.
| Product | Type | Vulnerable versions | Fixed in |
|---|---|---|---|
| Linux Linux | Software | from 79d8c89baa10612c1675972a632c65cdbe0936f6, before 37a32c760eb709440bb9cd6cd6852022850a542b; from 13f4910d81b62a214cdb28b47237198fa96078a2, before 664d37982d094623f5c3ac0373d3751401b10020; from 7a4c3f7b47ba34b021a7747081f330bfb76a4271, before b72f49d669840a87d0a811b3f16e14fe597fc3ce; from 6e904f9e8cb0e39f60e1cdbea679f89346a563c2, before df588ea0cf5dce9ee7cc1689e40a6940dc25429a; from fd720d3906877b3d2118cd480027e4bc6648f0c5, before e80c3d6e1dc80bae76471ea5b10bf625168f14c6; from effe3cc6d4fdd407457eb30f7b0ef094393f0d64, before d08f371175e5ad3bea97983ef446e416e4fb32e2; and 10 more | 37a32c760eb709440bb9cd6cd6852022850a542b; 664d37982d094623f5c3ac0373d3751401b10020; b72f49d669840a87d0a811b3f16e14fe597fc3ce; df588ea0cf5dce9ee7cc1689e40a6940dc25429a |
| Linux Linux | Software | 7.3 | not recorded |
The 7.8 severity score (high) from the company that reported it, broken into what it means in practice. Red means it makes the flaw easier or worse.
| How it is reached | On the machine | The attacker needs access to the computer itself, for example a login or a file they can get you to open. |
| How hard it is | Low | Easy to carry out. No special conditions have to line up. |
| Login needed | Low | The attacker needs an ordinary user account. |
| Someone has to act | None | Nobody has to click or open anything. It can happen on its own. |
| Reaches beyond the program | Unchanged | The damage stays inside the vulnerable program. |
| Data exposed | High | Total loss of confidentiality: the attacker can read all the data the program can reach. |
| Data changed | High | The attacker can change or delete anything the program can reach. |
| Service disrupted | High | The attacker can take the service down completely. |
| Ease of attack | 1.8 | A score for how easy it is to use the flaw. Higher is easier. |
| Damage | 5.9 | A score for how bad the harm is if it works. Higher is worse. |
NIST lists 8 sources for this flaw, none tagged as a vendor patch.