[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200220163112.11409-15-peterx@redhat.com>
Date: Thu, 20 Feb 2020 11:31:07 -0500
From: Peter Xu <peterx@...hat.com>
To: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Cc: Brian Geffon <bgeffon@...gle.com>,
Pavel Emelyanov <xemul@...tuozzo.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
David Hildenbrand <david@...hat.com>, peterx@...hat.com,
Martin Cracauer <cracauer@...s.org>,
Andrea Arcangeli <aarcange@...hat.com>,
Mel Gorman <mgorman@...e.de>,
Bobby Powers <bobbypowers@...il.com>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>,
"Kirill A . Shutemov" <kirill@...temov.name>,
Maya Gokhale <gokhale2@...l.gov>,
Johannes Weiner <hannes@...xchg.org>,
Marty McFadden <mcfadden8@...l.gov>,
Denis Plotnikov <dplotnikov@...tuozzo.com>,
Hugh Dickins <hughd@...gle.com>,
"Dr . David Alan Gilbert" <dgilbert@...hat.com>,
Jerome Glisse <jglisse@...hat.com>, Shaohua Li <shli@...com>,
Pavel Emelyanov <xemul@...allels.com>,
Rik van Riel <riel@...hat.com>
Subject: [PATCH v6 14/19] userfaultfd: wp: enabled write protection in userfaultfd API
From: Shaohua Li <shli@...com>
Now it's safe to enable write protection in userfaultfd API
Cc: Andrea Arcangeli <aarcange@...hat.com>
Cc: Pavel Emelyanov <xemul@...allels.com>
Cc: Rik van Riel <riel@...hat.com>
Cc: Kirill A. Shutemov <kirill@...temov.name>
Cc: Mel Gorman <mgorman@...e.de>
Cc: Hugh Dickins <hughd@...gle.com>
Cc: Johannes Weiner <hannes@...xchg.org>
Signed-off-by: Shaohua Li <shli@...com>
Signed-off-by: Andrea Arcangeli <aarcange@...hat.com>
Reviewed-by: Jerome Glisse <jglisse@...hat.com>
Reviewed-by: Mike Rapoport <rppt@...ux.vnet.ibm.com>
Signed-off-by: Peter Xu <peterx@...hat.com>
---
include/uapi/linux/userfaultfd.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/uapi/linux/userfaultfd.h b/include/uapi/linux/userfaultfd.h
index 95c4a160e5f8..e7e98bde221f 100644
--- a/include/uapi/linux/userfaultfd.h
+++ b/include/uapi/linux/userfaultfd.h
@@ -19,7 +19,8 @@
* means the userland is reading).
*/
#define UFFD_API ((__u64)0xAA)
-#define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK | \
+#define UFFD_API_FEATURES (UFFD_FEATURE_PAGEFAULT_FLAG_WP | \
+ UFFD_FEATURE_EVENT_FORK | \
UFFD_FEATURE_EVENT_REMAP | \
UFFD_FEATURE_EVENT_REMOVE | \
UFFD_FEATURE_EVENT_UNMAP | \
@@ -34,7 +35,8 @@
#define UFFD_API_RANGE_IOCTLS \
((__u64)1 << _UFFDIO_WAKE | \
(__u64)1 << _UFFDIO_COPY | \
- (__u64)1 << _UFFDIO_ZEROPAGE)
+ (__u64)1 << _UFFDIO_ZEROPAGE | \
+ (__u64)1 << _UFFDIO_WRITEPROTECT)
#define UFFD_API_RANGE_IOCTLS_BASIC \
((__u64)1 << _UFFDIO_WAKE | \
(__u64)1 << _UFFDIO_COPY)
--
2.24.1
Powered by blists - more mailing lists