From: Lokesh Gidra <lokeshgidra@google.com>
To: linux-man@vger.kernel.org
Cc: Daniel Colascione <dancol@dancol.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Kalesh Singh <kaleshsingh@google.com>,
Calin Juravle <calin@google.com>,
Suren Baghdasaryan <surenb@google.com>,
Jeffrey Vander Stoep <jeffv@google.com>,
"Cc: Android Kernel" <kernel-team@android.com>,
Peter Xu <peterx@redhat.com>,
Andrea Arcangeli <aarcange@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
"open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>
Subject: Re: [PATCH v1] userfaultfd.2: Add UFFD_USER_MODE_ONLY flag
Date: Tue, 26 Jan 2021 09:50:08 -0800 [thread overview]
Message-ID: <CA+EESO5MafN2aa8+BC_KP+BfRNqw9ySpQJwymuuZd4BBxPn4fA@mail.gmail.com> (raw)
In-Reply-To: <20210126014450.1901335-1-lokeshgidra@google.com>
On Mon, Jan 25, 2021 at 5:44 PM Lokesh Gidra <lokeshgidra@google.com> wrote:
>
> Add description of UFFD_USER_MODE_ONLY flag to userfaultfd(2) manual
> page, which is required after [1]. Also updated the description of
> unprivileged_userfaultfd file in proc(5) as per [2].
>
> [1] https://lore.kernel.org/linux-mm/20201215031349.NXimL388W%25akpm@linux-foundation.org/
> [2] https://lore.kernel.org/linux-mm/20201215031354.gUsHJUpKo%25akpm@linux-foundation.org/
>
> Signed-off-by: Lokesh Gidra <lokeshgidra@google.com>
> ---
> man2/userfaultfd.2 | 5 +++++
> man5/proc.5 | 12 ++++++++++++
> 2 files changed, 17 insertions(+)
>
> diff --git a/man2/userfaultfd.2 b/man2/userfaultfd.2
> index e7dc9f813..792a49d52 100644
> --- a/man2/userfaultfd.2
> +++ b/man2/userfaultfd.2
> @@ -72,6 +72,11 @@ See the description of the
> .BR O_NONBLOCK
> flag in
> .BR open (2).
> +.TP
> +.BR UFFD_USER_MODE_ONLY " (Since Linux 5.11)"
> +Allow handling of user-mode page-faults only. See the description of the
> +unprivileged_userfaultfd file in
> +.BR proc (5).
> .PP
> When the last file descriptor referring to a userfaultfd object is closed,
> all memory ranges that were registered with the object are unregistered
> diff --git a/man5/proc.5 b/man5/proc.5
> index f16a29d6e..cb2350c0c 100644
> --- a/man5/proc.5
> +++ b/man5/proc.5
> @@ -5905,6 +5905,18 @@ If this file has the value 0, then only processes that have the
> capability may employ
> .BR userfaultfd (2).
> The default value in this file is 1.
> +.IP
> +Starting with Linux 5.11,
> +.BR userfaultfd (2)
> +can be used by all processes, however, if this file has the value 0, then
> +.BR UFFD_USER_MODE_ONLY
> +flag must be passed to it, which restricts page-fault handling to only
> +user-mode faults. This restriction is not applicable for processes with
> +.B CAP_SYS_PTRACE
> +capability, or if this file has the value 1. Furthermore, the default
> +value in this file is changed to 0. For further details see the
> +Linux kernel source file
> +.I Documentation/admin\-guide/sysctl/vm.rst.
> .TP
> .IR /proc/sysrq\-trigger " (since Linux 2.4.21)"
> Writing a character to this file triggers the same SysRq function as
> --
Adding the right linux-mm mailing list. Mistakenly used
linux-mm@kvack.kernel.org earlier.
> 2.30.0.280.ga3ce27912f-goog
>
parent reply other threads:[~2021-01-26 17:50 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20210126014450.1901335-1-lokeshgidra@google.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+EESO5MafN2aa8+BC_KP+BfRNqw9ySpQJwymuuZd4BBxPn4fA@mail.gmail.com \
--to=lokeshgidra@google.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=calin@google.com \
--cc=dancol@dancol.org \
--cc=jeffv@google.com \
--cc=kaleshsingh@google.com \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=peterx@redhat.com \
--cc=surenb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox