From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Kravetz Subject: Re: [PATCH 0/3] userfaultfd: allow to forbid unprivileged users Date: Wed, 13 Mar 2019 13:01:40 -0700 Message-ID: References: <20190311093701.15734-1-peterx@redhat.com> <58e63635-fc1b-cb53-a4d1-237e6b8b7236@oracle.com> <20190313060023.GD2433@xz-x1> <3714d120-64e3-702e-6eef-4ef253bdb66d@redhat.com> <20190313185230.GH25147@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Peter Xu , linux-kernel@vger.kernel.org, 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 Rapoport , Kees Cook , Mel Gorman , "Kirill A . Shutemov" , linux-fsdevel@vger.kernel.org, "Dr . David Alan Gilbert" , Andrew Morton To: Andrea Arcangeli , Paolo Bonzini Return-path: In-Reply-To: <20190313185230.GH25147@redhat.com> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 3/13/19 11:52 AM, Andrea Arcangeli wrote: > > hugetlbfs is more complicated to detect, because even if you inherit > it from fork(), the services that mounts the fs may be in a different > container than the one that Oracle that uses userfaultfd later on down > the road from a different context. And I don't think it would be ok to > allow running userfaultfd just because you can open a file in an > hugetlbfs file system. With /dev/kvm it's a bit different, that's > chmod o-r by default.. no luser should be able to open it. > > Unless somebody suggests a consistent way to make hugetlbfs "just > work" (like we could achieve clean with CRIU and KVM), I think Oracle > will need a one liner change in the Oracle setup to echo into that > file in addition of running the hugetlbfs mount. I think you are suggesting the DB setup process enable uffd for all users. Correct? This may be too simple, and I don't really like group access, but how about just defining a uffd group? If you are in the group you can make uffd system calls. -- Mike Kravetz