Files
linux/include/linux
Peter Xu 6dfeaff93b hugetlb/userfaultfd: unshare all pmds for hugetlbfs when register wp
Huge pmd sharing for hugetlbfs is racy with userfaultfd-wp because
userfaultfd-wp is always based on pgtable entries, so they cannot be
shared.

Walk the hugetlb range and unshare all such mappings if there is, right
before UFFDIO_REGISTER will succeed and return to userspace.

This will pair with want_pmd_share() in hugetlb code so that huge pmd
sharing is completely disabled for userfaultfd-wp registered range.

Link: https://lkml.kernel.org/r/20210218231206.15524-1-peterx@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Adam Ruprecht <ruprecht@google.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Cannon Matthews <cannonmatthews@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Chinwen Chang <chinwen.chang@mediatek.com>
Cc: David Rientjes <rientjes@google.com>
Cc: "Dr . David Alan Gilbert" <dgilbert@redhat.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jann Horn <jannh@google.com>
Cc: Jerome Glisse <jglisse@redhat.com>
Cc: Lokesh Gidra <lokeshgidra@google.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: "Michal Koutn" <mkoutny@suse.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Mina Almasry <almasrymina@google.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Oliver Upton <oupton@google.com>
Cc: Shaohua Li <shli@fb.com>
Cc: Shawn Anastasio <shawn@anastas.io>
Cc: Steven Price <steven.price@arm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-05-05 11:27:20 -07:00
..
2021-04-22 09:26:22 -07:00
2021-02-02 00:16:57 +01:00
2020-12-09 19:26:02 -06:00
2021-01-23 14:57:21 +01:00
2021-04-14 16:30:30 +03:00
2020-12-02 09:46:55 -07:00
2021-01-24 14:27:17 +01:00
2021-02-26 09:41:03 -08:00
2021-04-08 16:04:20 -07:00
2021-02-17 14:07:48 +01:00
2021-04-08 16:04:20 -07:00
2021-04-08 16:04:20 -07:00
2021-01-21 14:06:00 -07:00
2021-01-16 15:12:06 -05:00
2021-01-18 14:26:51 +01:00
2021-03-22 03:57:39 +01:00
2021-02-08 12:28:07 +01:00
2020-12-10 12:42:59 -06:00
2021-04-12 15:04:23 +02:00
2021-03-30 22:37:06 +02:00
2020-11-16 16:31:41 +01:00
2021-05-05 11:27:20 -07:00
2021-04-08 10:24:36 -06:00
2020-11-16 15:20:01 +01:00
2020-11-16 08:14:30 -07:00
2021-02-11 13:24:44 -08:00
2021-04-08 16:04:20 -07:00
2020-12-02 22:10:35 -08:00
2021-04-30 11:20:40 -07:00
2020-11-23 14:16:55 +00:00
2021-01-27 12:27:36 +01:00
2020-11-24 16:47:48 +01:00
2021-03-22 04:23:14 +01:00
2020-12-15 16:19:31 +01:00
2021-02-17 14:12:42 +01:00
2021-01-21 16:16:10 +00:00
2021-02-26 09:41:02 -08:00
2021-02-26 09:41:03 -08:00
2021-01-22 15:09:42 +01:00
2021-03-13 11:27:30 -08:00
2021-04-08 16:04:20 -07:00
2021-01-04 11:42:21 -05:00
2021-04-06 08:34:39 +02:00
2021-02-17 13:17:49 -08:00
2021-04-21 10:24:41 -05:00
2021-02-26 09:40:59 -08:00
2021-02-03 19:05:50 +01:00
2021-03-10 09:34:06 +01:00
2020-10-18 09:27:10 -07:00
2021-01-24 14:27:17 +01:00
2021-01-24 14:27:20 +01:00
2021-03-06 12:40:22 +01:00
2021-02-26 09:41:03 -08:00
2020-12-03 11:20:52 +01:00
2021-01-16 23:19:26 +01:00
2021-03-22 02:45:52 +01:00
2020-12-10 16:17:15 +01:00
2020-12-10 10:45:36 +01:00
2021-03-02 17:25:46 -07:00
2021-02-20 10:13:32 -05:00
2021-03-17 15:51:17 +01:00
2021-03-25 17:39:33 -07:00
2020-10-30 21:57:04 +01:00
2021-01-06 16:24:59 -08:00
2021-02-09 12:27:29 -05:00
2021-03-10 09:34:06 +01:00
2021-04-15 10:32:17 +02:00
2021-02-13 17:17:53 +01:00
2021-03-30 17:06:49 -07:00
2020-11-09 18:39:36 +01:00
2021-04-26 22:55:12 +01:00
2021-04-09 16:00:00 +02:00
2021-01-21 16:16:10 +00:00
2021-03-22 15:02:14 +01:00
2021-02-09 12:15:07 +01:00
2021-01-21 14:06:00 -07:00
2021-04-16 15:31:02 -07:00
2021-03-30 13:42:33 -04:00
2021-01-24 14:27:17 +01:00
2021-02-08 22:58:55 +01:00