Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-09-19 Thread Nick Kralevich
On Fri, Sep 4, 2020 at 5:36 PM Lokesh Gidra wrote: > > On Thu, Sep 3, 2020 at 8:34 PM Andrea Arcangeli wrote: > > > > 1) why don't you enforce the block of kernel initiated faults with > >seccomp-bpf instead of adding a sysctl value 2? Is the sysctl just > >an optimization to remove a

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-09-04 Thread Lokesh Gidra
On Thu, Sep 3, 2020 at 8:34 PM Andrea Arcangeli wrote: > > Hello, > > On Mon, Aug 17, 2020 at 03:11:16PM -0700, Lokesh Gidra wrote: > > There has been an emphasis that Android is probably the only user for > > the restriction of userfaults from kernel-space and that it wouldn’t > > be useful

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-09-03 Thread Andrea Arcangeli
Hello, On Mon, Aug 17, 2020 at 03:11:16PM -0700, Lokesh Gidra wrote: > There has been an emphasis that Android is probably the only user for > the restriction of userfaults from kernel-space and that it wouldn’t > be useful anywhere else. I humbly disagree! There are various areas > where the

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-08-17 Thread Lokesh Gidra
On Wed, Aug 5, 2020 at 10:44 PM Michael S. Tsirkin wrote: > > On Wed, Aug 05, 2020 at 05:43:02PM -0700, Nick Kralevich wrote: > > On Fri, Jul 24, 2020 at 6:40 AM Michael S. Tsirkin wrote: > > > > > > On Thu, Jul 23, 2020 at 05:13:28PM -0700, Nick Kralevich wrote: > > > > On Thu, Jul 23, 2020 at

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-08-05 Thread Michael S. Tsirkin
On Wed, Aug 05, 2020 at 05:43:02PM -0700, Nick Kralevich wrote: > On Fri, Jul 24, 2020 at 6:40 AM Michael S. Tsirkin wrote: > > > > On Thu, Jul 23, 2020 at 05:13:28PM -0700, Nick Kralevich wrote: > > > On Thu, Jul 23, 2020 at 10:30 AM Lokesh Gidra > > > wrote: > > > > From the discussion so far

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-08-05 Thread Nick Kralevich
On Fri, Jul 24, 2020 at 6:40 AM Michael S. Tsirkin wrote: > > On Thu, Jul 23, 2020 at 05:13:28PM -0700, Nick Kralevich wrote: > > On Thu, Jul 23, 2020 at 10:30 AM Lokesh Gidra > > wrote: > > > From the discussion so far it seems that there is a consensus that > > > patch 1/2 in this series

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-07-24 Thread Michael S. Tsirkin
On Thu, Jul 23, 2020 at 05:13:28PM -0700, Nick Kralevich wrote: > On Thu, Jul 23, 2020 at 10:30 AM Lokesh Gidra wrote: > > From the discussion so far it seems that there is a consensus that > > patch 1/2 in this series should be upstreamed in any case. Is there > > anything that is pending on

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-07-23 Thread Nick Kralevich
On Thu, Jul 23, 2020 at 10:30 AM Lokesh Gidra wrote: > From the discussion so far it seems that there is a consensus that > patch 1/2 in this series should be upstreamed in any case. Is there > anything that is pending on that patch? That's my reading of this thread too. > > > Unless I'm

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-07-23 Thread Lokesh Gidra
Daniel, the original contributor of this patchset, has moved to another company. Adding his personal email, in case he still wants to be involved. >From the discussion so far it seems that there is a consensus that patch 1/2 in this series should be upstreamed in any case. Is there anything that

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-07-17 Thread Jeffrey Vander Stoep
On Wed, May 20, 2020 at 11:17 PM Andrea Arcangeli wrote: > > On Wed, May 20, 2020 at 01:17:20PM -0700, Lokesh Gidra wrote: > > Adding the Android kernel team in the discussion. > > Unless I'm mistaken that you can already enforce bit 1 of the second > parameter of the userfaultfd syscall to be

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-20 Thread Andrea Arcangeli
On Wed, May 20, 2020 at 01:17:20PM -0700, Lokesh Gidra wrote: > Adding the Android kernel team in the discussion. Unless I'm mistaken that you can already enforce bit 1 of the second parameter of the userfaultfd syscall to be set with seccomp-bpf, this would be more a question to the Android

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-20 Thread Lokesh Gidra
Adding the Android kernel team in the discussion. On Wed, May 20, 2020 at 12:51 PM Andrea Arcangeli wrote: > > On Wed, May 20, 2020 at 03:48:04PM -0400, Andrea Arcangeli wrote: > > The sysctl /proc/sys/kernel/unprivileged_bpf_disabled is already there > > Oops I picked the wrong unprivileged_*

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-20 Thread Andrea Arcangeli
On Wed, May 20, 2020 at 03:48:04PM -0400, Andrea Arcangeli wrote: > The sysctl /proc/sys/kernel/unprivileged_bpf_disabled is already there Oops I picked the wrong unprivileged_* :) of course I meant: /proc/sys/vm/unprivileged_userfaultfd

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-20 Thread Andrea Arcangeli
Hello Kees, On Wed, May 20, 2020 at 11:03:39AM -0700, Kees Cook wrote: > Err, did I miss a separate 6-patch series? I can't find anything on lore. Daniel included the link of the previous series I referred to is the cover letter 0/2:

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-20 Thread Kees Cook
On Wed, May 20, 2020 at 12:59:38AM -0400, Andrea Arcangeli wrote: > Hello everyone, > > On Fri, May 08, 2020 at 12:54:03PM -0400, Michael S. Tsirkin wrote: > > On Fri, May 08, 2020 at 12:52:34PM -0400, Michael S. Tsirkin wrote: > > > On Wed, Apr 22, 2020 at 05:26:32PM -0700, Daniel Colascione

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-19 Thread Andrea Arcangeli
Hello everyone, On Fri, May 08, 2020 at 12:54:03PM -0400, Michael S. Tsirkin wrote: > On Fri, May 08, 2020 at 12:52:34PM -0400, Michael S. Tsirkin wrote: > > On Wed, Apr 22, 2020 at 05:26:32PM -0700, Daniel Colascione wrote: > > > This sysctl can be set to either zero or one. When zero (the

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-19 Thread Andrea Arcangeli
Hello Jonathan and everyone, On Thu, May 07, 2020 at 01:15:03PM -0600, Jonathan Corbet wrote: > On Wed, 6 May 2020 15:38:16 -0400 > Peter Xu wrote: > > > If this is going to be added... I am thinking whether it should be easier to > > add another value for unprivileged_userfaultfd, rather than

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-08 Thread Michael S. Tsirkin
On Fri, May 08, 2020 at 12:52:34PM -0400, Michael S. Tsirkin wrote: > On Wed, Apr 22, 2020 at 05:26:32PM -0700, Daniel Colascione wrote: > > This sysctl can be set to either zero or one. When zero (the default) > > the system lets all users call userfaultfd with or without > > UFFD_USER_MODE_ONLY,

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-08 Thread Michael S. Tsirkin
On Wed, Apr 22, 2020 at 05:26:32PM -0700, Daniel Colascione wrote: > This sysctl can be set to either zero or one. When zero (the default) > the system lets all users call userfaultfd with or without > UFFD_USER_MODE_ONLY, modulo other access controls. When >

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-07 Thread Jonathan Corbet
On Wed, 6 May 2020 15:38:16 -0400 Peter Xu wrote: > If this is going to be added... I am thinking whether it should be easier to > add another value for unprivileged_userfaultfd, rather than a new sysctl. > E.g.: > > "0": unprivileged userfaultfd forbidden > "1": unprivileged userfaultfd

Re: [PATCH 2/2] Add a new sysctl knob: unprivileged_userfaultfd_user_mode_only

2020-05-06 Thread Peter Xu
On Wed, Apr 22, 2020 at 05:26:32PM -0700, Daniel Colascione wrote: > +unprivileged_userfaultfd_user_mode_only > + > + > +This flag controls whether unprivileged users can use the userfaultfd > +system calls to handle page faults in kernel mode. If set to