lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200220163112.11409-2-peterx@redhat.com>
Date:   Thu, 20 Feb 2020 11:30:54 -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 01/19] userfaultfd: wp: add helper for writeprotect check

From: Shaohua Li <shli@...com>

add helper for writeprotect check. Will use it later.

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/linux/userfaultfd_k.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/linux/userfaultfd_k.h b/include/linux/userfaultfd_k.h
index ac9d71e24b81..5dc247af0f2e 100644
--- a/include/linux/userfaultfd_k.h
+++ b/include/linux/userfaultfd_k.h
@@ -52,6 +52,11 @@ static inline bool userfaultfd_missing(struct vm_area_struct *vma)
 	return vma->vm_flags & VM_UFFD_MISSING;
 }
 
+static inline bool userfaultfd_wp(struct vm_area_struct *vma)
+{
+	return vma->vm_flags & VM_UFFD_WP;
+}
+
 static inline bool userfaultfd_armed(struct vm_area_struct *vma)
 {
 	return vma->vm_flags & (VM_UFFD_MISSING | VM_UFFD_WP);
@@ -96,6 +101,11 @@ static inline bool userfaultfd_missing(struct vm_area_struct *vma)
 	return false;
 }
 
+static inline bool userfaultfd_wp(struct vm_area_struct *vma)
+{
+	return false;
+}
+
 static inline bool userfaultfd_armed(struct vm_area_struct *vma)
 {
 	return false;
-- 
2.24.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ