Commit 0fa76f2
mm/hugetlb: fix two comments related to huge_pmd_unshare()
jira VULN-46930
cve-bf CVE-2024-57883
commit-author David Hildenbrand (Red Hat) <david@kernel.org>
commit 3937027
upstream-diff Resolved conflicts due to the
4e1f5f6 backport incorporating a typo
'refernece', which was fixed upstream (and expected by this patch) in
b6c4660, but it didn't make it to
ciqlts9_4. Could not have been picked as prerequisite due to multiple
conflicts
Ever since we stopped using the page count to detect shared PMD page
tables, these comments are outdated.
The only reason we have to flush the TLB early is because once we drop the
i_mmap_rwsem, the previously shared page table could get freed (to then
get reallocated and used for other purpose). So we really have to flush
the TLB before that could happen.
So let's simplify the comments a bit.
The "If we unshared PMDs, the TLB flush was not recorded in mmu_gather."
part introduced as in commit a4a118f ("hugetlbfs: flush TLBs
correctly after huge_pmd_unshare") was confusing: sure it is recorded in
the mmu_gather, otherwise tlb_flush_mmu_tlbonly() wouldn't do anything.
So let's drop that comment while at it as well.
We'll centralize these comments in a single helper as we rework the code
next.
Link: https://lkml.kernel.org/r/20251223214037.580860-3-david@kernel.org
Fixes: 59d9094 ("mm: hugetlb: independent PMD page table shared count")
Signed-off-by: David Hildenbrand (Red Hat) <david@kernel.org>
Reviewed-by: Rik van Riel <riel@surriel.com>
Tested-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: Oscar Salvador <osalvador@suse.de>
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Cc: Liu Shixin <liushixin2@huawei.com>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: "Uschakow, Stanislav" <suschako@amazon.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
(cherry picked from commit 3937027)
Signed-off-by: Marcin Wcisło <marcin.wcislo@conclusive.pl>1 parent 018658b commit 0fa76f2
1 file changed
Lines changed: 8 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5360 | 5360 | | |
5361 | 5361 | | |
5362 | 5362 | | |
5363 | | - | |
5364 | | - | |
5365 | | - | |
5366 | | - | |
5367 | | - | |
5368 | | - | |
5369 | | - | |
5370 | | - | |
5371 | | - | |
5372 | | - | |
5373 | | - | |
| 5363 | + | |
| 5364 | + | |
| 5365 | + | |
| 5366 | + | |
5374 | 5367 | | |
5375 | 5368 | | |
5376 | 5369 | | |
| |||
6756 | 6749 | | |
6757 | 6750 | | |
6758 | 6751 | | |
6759 | | - | |
6760 | | - | |
6761 | | - | |
6762 | | - | |
6763 | | - | |
| 6752 | + | |
| 6753 | + | |
| 6754 | + | |
| 6755 | + | |
6764 | 6756 | | |
6765 | 6757 | | |
6766 | 6758 | | |
| |||
0 commit comments