From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Rapoport Subject: Re: [PATCH 1/3] userfaultfd/sysctl: introduce unprivileged_userfaultfd Date: Tue, 12 Mar 2019 15:53:17 +0200 Message-ID: <20190312135316.GA22990@rapoport-lnx> References: <20190311093701.15734-1-peterx@redhat.com> <20190311093701.15734-2-peterx@redhat.com> <20190312065830.GB9497@rapoport-lnx> <20190312122633.GE14108@xz-x1> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-kernel@vger.kernel.org, Paolo Bonzini , Hugh Dickins , Luis Chamberlain , Maxime Coquelin , kvm@vger.kernel.org, Jerome Glisse , Pavel Emelyanov , Johannes Weiner , Martin Cracauer , Denis Plotnikov , linux-mm@kvack.org, Marty McFadden , Maya Gokhale , Mike Kravetz , Andrea Arcangeli , Mike Rapoport , Kees Cook , Mel Gorman , "Kirill A . Shutemov" , linux-fsdevel@vger.kernel.org, To: Peter Xu Return-path: Content-Disposition: inline In-Reply-To: <20190312122633.GE14108@xz-x1> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Tue, Mar 12, 2019 at 08:26:33PM +0800, Peter Xu wrote: > On Tue, Mar 12, 2019 at 08:58:30AM +0200, Mike Rapoport wrote: > > [...] > > > > +config USERFAULTFD_UNPRIVILEGED_DEFAULT > > > + string "Default behavior for unprivileged userfault syscalls" > > > + depends on USERFAULTFD > > > + default "disabled" > > > + help > > > + Set this to "enabled" to allow userfaultfd syscalls from > > > + unprivileged users. Set this to "disabled" to forbid > > > + userfaultfd syscalls from unprivileged users. Set this to > > > + "kvm" to forbid unpriviledged users but still allow users > > > + who had enough permission to open /dev/kvm. > > > > I'd phrase it a bit differently: > > > > This option controls privilege level required to execute userfaultfd > ^ > +---- add " the default"? > > > system call. > > > > Set this to "enabled" to allow userfaultfd system call from unprivileged > > users. > > Set this to "disabled" to allow userfaultfd system call only for users who > > have ptrace capability. > > Set this to "kvm" to restrict userfaultfd system call usage to users with > ^ > add " who have ptrace capability, or" -------+ > > > permissions to open "/dev/kvm". > > I think your version is better than mine, but I'd like to confirm > about above two extra changes before I squash them into the patch. :) I like your changes. > Thanks! > > -- > Peter Xu > -- Sincerely yours, Mike.