From: Greg Kroah-Hartman Date: Wed, 19 Aug 2020 13:52:47 +0000 (+0200) Subject: drop queue-5.8/khugepaged-khugepaged_test_exit-check-mmget_still_valid.patch X-Git-Tag: v4.14.194~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=274bfb18ac6a07908276a6b5aaf53c5c186f2e00;p=thirdparty%2Fkernel%2Fstable-queue.git drop queue-5.8/khugepaged-khugepaged_test_exit-check-mmget_still_valid.patch --- diff --git a/queue-5.8/khugepaged-khugepaged_test_exit-check-mmget_still_valid.patch b/queue-5.8/khugepaged-khugepaged_test_exit-check-mmget_still_valid.patch deleted file mode 100644 index 0829e5dbde5..00000000000 --- a/queue-5.8/khugepaged-khugepaged_test_exit-check-mmget_still_valid.patch +++ /dev/null @@ -1,56 +0,0 @@ -From bbe98f9cadff58cdd6a4acaeba0efa8565dabe65 Mon Sep 17 00:00:00 2001 -From: Hugh Dickins -Date: Thu, 6 Aug 2020 23:26:25 -0700 -Subject: khugepaged: khugepaged_test_exit() check mmget_still_valid() - -From: Hugh Dickins - -commit bbe98f9cadff58cdd6a4acaeba0efa8565dabe65 upstream. - -Move collapse_huge_page()'s mmget_still_valid() check into -khugepaged_test_exit() itself. collapse_huge_page() is used for anon THP -only, and earned its mmget_still_valid() check because it inserts a huge -pmd entry in place of the page table's pmd entry; whereas -collapse_file()'s retract_page_tables() or collapse_pte_mapped_thp() -merely clears the page table's pmd entry. But core dumping without mmap -lock must have been as open to mistaking a racily cleared pmd entry for a -page table at physical page 0, as exit_mmap() was. And we certainly have -no interest in mapping as a THP once dumping core. - -Fixes: 59ea6d06cfa9 ("coredump: fix race condition between collapse_huge_page() and core dumping") -Signed-off-by: Hugh Dickins -Signed-off-by: Andrew Morton -Cc: Andrea Arcangeli -Cc: Song Liu -Cc: Mike Kravetz -Cc: Kirill A. Shutemov -Cc: [4.8+] -Link: http://lkml.kernel.org/r/alpine.LSU.2.11.2008021217020.27773@eggly.anvils -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman - ---- - mm/khugepaged.c | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - ---- a/mm/khugepaged.c -+++ b/mm/khugepaged.c -@@ -431,7 +431,7 @@ static void insert_to_mm_slots_hash(stru - - static inline int khugepaged_test_exit(struct mm_struct *mm) - { -- return atomic_read(&mm->mm_users) == 0; -+ return atomic_read(&mm->mm_users) == 0 || !mmget_still_valid(mm); - } - - static bool hugepage_vma_check(struct vm_area_struct *vma, -@@ -1100,9 +1100,6 @@ static void collapse_huge_page(struct mm - * handled by the anon_vma lock + PG_lock. - */ - mmap_write_lock(mm); -- result = SCAN_ANY_PROCESS; -- if (!mmget_still_valid(mm)) -- goto out; - result = hugepage_vma_revalidate(mm, address, &vma); - if (result) - goto out; diff --git a/queue-5.8/series b/queue-5.8/series index 1b03564febb..b7d83747830 100644 --- a/queue-5.8/series +++ b/queue-5.8/series @@ -78,7 +78,6 @@ khugepaged-collapse_pte_mapped_thp-flush-the-right-range.patch mm-hugetlb-fix-calculation-of-adjust_range_if_pmd_sharing_possible.patch khugepaged-collapse_pte_mapped_thp-protect-the-pmd-lock.patch khugepaged-retract_page_tables-remember-to-test-exit.patch -khugepaged-khugepaged_test_exit-check-mmget_still_valid.patch hugetlbfs-remove-call-to-huge_pte_alloc-without-i_mmap_rwsem.patch mm-shuffle-don-t-move-pages-between-zones-and-don-t-read-garbage-memmaps.patch mm-fix-kthread_use_mm-vs-tlb-invalidate.patch