From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A88E0ECAAA2 for ; Sun, 28 Aug 2022 21:03:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229632AbiH1VDY (ORCPT ); Sun, 28 Aug 2022 17:03:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbiH1VDX (ORCPT ); Sun, 28 Aug 2022 17:03:23 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0DDCD11C; Sun, 28 Aug 2022 14:03:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5C536B80B9E; Sun, 28 Aug 2022 21:03:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DF595C433C1; Sun, 28 Aug 2022 21:03:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1661720600; bh=dABCCI1Lg4ndH+KRci7XsgukDtn3oVIINBZAolRsXd0=; h=Date:To:From:Subject:From; b=SAl1BFfON2MlI8dQ5vM1H9NvzPPSdbkbzF/AKz/GRUwI5drB2eh+D3tv/ppFWoYE8 v8KBOfEH8S5bwoz15eefAl4D1cG5JiBnyfW/O2ZAiM9kvx2rqyw4EtzQuB+ZEWdF9k e6eGGsZFauurfsFNa3jVW2fqiU/6WGjCpJ48pKKQ= Date: Sun, 28 Aug 2022 14:03:19 -0700 To: mm-commits@vger.kernel.org, stable@vger.kernel.org, peterx@redhat.com, mike.kravetz@oracle.com, axelrasmussen@google.com, linmiaohe@huawei.com, akpm@linux-foundation.org From: Andrew Morton Subject: [merged mm-stable] mm-hugetlb-avoid-corrupting-page-mapping-in-hugetlb_mcopy_atomic_pte.patch removed from -mm tree Message-Id: <20220828210319.DF595C433C1@smtp.kernel.org> Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The quilt patch titled Subject: mm/hugetlb: avoid corrupting page->mapping in hugetlb_mcopy_atomic_pte has been removed from the -mm tree. Its filename was mm-hugetlb-avoid-corrupting-page-mapping-in-hugetlb_mcopy_atomic_pte.patch This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm ------------------------------------------------------ From: Miaohe Lin Subject: mm/hugetlb: avoid corrupting page->mapping in hugetlb_mcopy_atomic_pte Date: Tue, 12 Jul 2022 21:05:42 +0800 In MCOPY_ATOMIC_CONTINUE case with a non-shared VMA, pages in the page cache are installed in the ptes. But hugepage_add_new_anon_rmap is called for them mistakenly because they're not vm_shared. This will corrupt the page->mapping used by page cache code. Link: https://lkml.kernel.org/r/20220712130542.18836-1-linmiaohe@huawei.com Fixes: f619147104c8 ("userfaultfd: add UFFDIO_CONTINUE ioctl") Signed-off-by: Miaohe Lin Reviewed-by: Mike Kravetz Cc: Axel Rasmussen Cc: Peter Xu Cc: Signed-off-by: Andrew Morton --- mm/hugetlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/hugetlb.c~mm-hugetlb-avoid-corrupting-page-mapping-in-hugetlb_mcopy_atomic_pte +++ a/mm/hugetlb.c @@ -6041,7 +6041,7 @@ int hugetlb_mcopy_atomic_pte(struct mm_s if (!huge_pte_none_mostly(huge_ptep_get(dst_pte))) goto out_release_unlock; - if (vm_shared) { + if (page_in_pagecache) { page_dup_file_rmap(page, true); } else { ClearHPageRestoreReserve(page); _ Patches currently in -mm which might be from linmiaohe@huawei.com are mm-page_alloc-minor-clean-up-for-memmap_init_compound.patch hugetlb_cgroup-remove-unneeded-nr_pages-0-check.patch hugetlb_cgroup-hugetlbfs-use-helper-macro-sz_1kmg.patch hugetlb_cgroup-remove-unneeded-return-value.patch hugetlb_cgroup-use-helper-macro-numa_no_node.patch hugetlb_cgroup-use-helper-for_each_hstate-and-hstate_index.patch mm-hugetlb-fix-incorrect-update-of-max_huge_pages.patch mm-hugetlb-fix-warn_onkobj-in-sysfs_create_group.patch mm-hugetlb-fix-missing-call-to-restore_reserve_on_error.patch mm-hugetlb-fix-missing-call-to-restore_reserve_on_error-v2.patch mm-hugetlb_vmemmap-add-missing-smp_wmb-before-set_pte_at.patch mm-hugetlb-fix-sysfs-group-leak-in-hugetlb_unregister_node.patch mm-hugetlb-make-detecting-shared-pte-more-reliable.patch mm-hwpoison-fix-page-refcnt-leaking-in-try_memory_failure_hugetlb.patch mm-hwpoison-fix-page-refcnt-leaking-in-unpoison_memory.patch mm-hwpoison-fix-extra-put_page-in-soft_offline_page.patch mm-hwpoison-fix-possible-use-after-free-in-mf_dax_kill_procs-v2.patch mm-hwpoison-kill-procs-if-unmap-fails.patch mm-hwpoison-kill-procs-if-unmap-fails-v2.patch mm-hwpoison-avoid-trying-to-unpoison-reserved-page.patch