{"id":65231,"date":"2025-06-28T12:32:20","date_gmt":"2025-06-28T09:02:20","guid":{"rendered":"https:\/\/afaghhosting.net\/blog\/cve-2025-38084-linux-kernel-hugetlb-racy-protection-vulnerability\/"},"modified":"2025-06-28T12:32:20","modified_gmt":"2025-06-28T09:02:20","slug":"cve-2025-38084-linux-kernel-hugetlb-racy-protection-vulnerability","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/cve-2025-38084-linux-kernel-hugetlb-racy-protection-vulnerability\/","title":{"rendered":"CVE-2025-38084 &#8211; Linux Kernel Hugetlb Racy Protection Vulnerability"},"content":{"rendered":"<p><strong>CVE ID : <\/strong>CVE-2025-38084<br \/>\n<br \/>\n<strong>Published : <\/strong> June 28, 2025, 8:15 a.m. | 44\u00a0minutes ago<br \/>\n<br \/>\n<strong>Description : <\/strong>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>mm\/hugetlb: unshare page tables during VMA split, not before<\/p>\n<p>Currently, __split_vma() triggers hugetlb page table unsharing through<br \/>\nvm_ops-&gt;may_split().  This happens before the VMA lock and rmap locks are<br \/>\ntaken &#8211; which is too early, it allows racing VMA-locked page faults in our<br \/>\nprocess and racing rmap walks from other processes to cause page tables to<br \/>\nbe shared again before we actually perform the split.<\/p>\n<p>Fix it by explicitly calling into the hugetlb unshare logic from<br \/>\n__split_vma() in the same place where THP splitting also happens.  At that<br \/>\npoint, both the VMA and the rmap(s) are write-locked.<\/p>\n<p>An annoying detail is that we can now call into the helper<br \/>\nhugetlb_unshare_pmds() from two different locking contexts:<\/p>\n<p>1. from hugetlb_split(), holding:<br \/>\n    &#8211; mmap lock (exclusively)<br \/>\n    &#8211; VMA lock<br \/>\n    &#8211; file rmap lock (exclusively)<br \/>\n2. hugetlb_unshare_all_pmds(), which I think is designed to be able to<br \/>\n   call us with only the mmap lock held (in shared mode), but currently<br \/>\n   only runs while holding mmap lock (exclusively) and VMA lock<\/p>\n<p>Backporting note:<br \/>\nThis commit fixes a racy protection that was introduced in commit<br \/>\nb30c14cd6102 (&#8220;hugetlb: unshare some PMDs when splitting VMAs&#8221;); that<br \/>\ncommit claimed to fix an issue introduced in 5.13, but it should actually<br \/>\nalso go all the way back.<\/p>\n[jannh@google.com: v2]\n<br \/>\n<strong>Severity:<\/strong> 0.0 | NA<br \/>\n<br \/>\nVisit the link for more details, such as CVSS details, affected products, timeline, and more&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CVE ID : CVE-2025-38084 Published : June 28, 2025, 8:15 a.m. | 44\u00a0minutes ago Description : In the Linux kernel, the following vulnerability has been resolved: mm\/hugetlb: unshare page tables during VMA split, not before Currently, __split_vma() triggers hugetlb page table unsharing through vm_ops-&gt;may_split(). This happens before the VMA lock and rmap locks are taken &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-65231","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/65231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=65231"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/65231\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=65231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=65231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=65231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}