All of lore.kernel.org
 help / color / mirror / Atom feed
* [folded-merged] userfaultfd-add-minor-fault-registration-mode-fix.patch removed from -mm tree
@ 2021-05-05  0:55 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2021-05-05  0:55 UTC (permalink / raw)
  To: aarcange, axelrasmussen, mike.kravetz, mm-commits, peterx, rppt


The patch titled
     Subject: userfaultfd/hugetlbfs: fix minor fault page leak
has been removed from the -mm tree.  Its filename was
     userfaultfd-add-minor-fault-registration-mode-fix.patch

This patch was dropped because it was folded into userfaultfd-add-minor-fault-registration-mode.patch

------------------------------------------------------
From: Peter Xu <peterx@redhat.com>
Subject: userfaultfd/hugetlbfs: fix minor fault page leak

When uffd-minor enabled, we need to put the page cache before handling the
userfault in hugetlb_no_page(), otherwise the page refcount got leaked.

This can be reproduced by running userfaultfd selftest with hugetlb_shared
mode, then cat /proc/meminfo.

Link: https://lkml.kernel.org/r/20210322175132.36659-1-peterx@redhat.com
Fixes: f2bf15fb0969 ("userfaultfd: add minor fault registration mode")
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Axel Rasmussen <axelrasmussen@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/hugetlb.c |    1 +
 1 file changed, 1 insertion(+)

--- a/mm/hugetlb.c~userfaultfd-add-minor-fault-registration-mode-fix
+++ a/mm/hugetlb.c
@@ -4609,6 +4609,7 @@ retry:
 		/* Check for page in userfault range. */
 		if (userfaultfd_minor(vma)) {
 			unlock_page(page);
+			put_page(page);
 			ret = hugetlb_handle_userfault(vma, mapping, idx,
 						       flags, haddr,
 						       VM_UFFD_MINOR);
_

Patches currently in -mm which might be from peterx@redhat.com are

hugetlb-pass-vma-into-huge_pte_alloc-and-huge_pmd_share.patch
hugetlb-userfaultfd-forbid-huge-pmd-sharing-when-uffd-enabled.patch
mm-hugetlb-move-flush_hugetlb_tlb_range-into-hugetlbh.patch
hugetlb-userfaultfd-unshare-all-pmds-for-hugetlbfs-when-register-wp.patch
userfaultfd-add-minor-fault-registration-mode.patch
mm-hugetlb-fix-f_seal_future_write.patch
mm-hugetlb-fix-cow-where-page-writtable-in-child.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-05  0:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05  0:55 [folded-merged] userfaultfd-add-minor-fault-registration-mode-fix.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.