lkml.org 
[lkml]   [2022]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v4 0/5] userfaultfd: add /dev/userfaultfd for fine grained access control
Date
On Aug 1, 2022, at 3:50 PM, Axel Rasmussen <axelrasmussen@google.com> wrote:

> ⚠ External Email
>
> On Mon, Aug 1, 2022 at 12:53 PM Nadav Amit <namit@vmware.com> wrote:
>> On Aug 1, 2022, at 10:13 AM, Axel Rasmussen <axelrasmussen@google.com> wrote:
>
> Ah, that I think is more or less what my series already proposes, if I
> understand you correctly.
>
> The usage is:
>
> fd = open(/dev/userfaultfd) /* This FD is only useful for creating new
> userfaultfds */
> uffd = ioctl(fd, USERFAULTFD_IOC_NEW) /* Now you get a real uffd */
> close(fd); /* No longer needed now that we have a real uffd */
>
> /* Use uffd to register, COPY, CONTINUE, whatever */
>
> One thing we could do now or in the future is extend
> USERFAULTFD_IOC_NEW to take a pid as an argument, to support creating
> uffds for remote processes.
>
>
>
> And then we get the benefit of permissions for /dev nodes working very
> naturally - they default to root, but can be configured by the
> sysadmin via chown/chmod, or udev rules, or whatever.

Oh. Stupid me. Then yes, using the /dev/userfaultfd is in line with other
usage models, such as KVM. And reading from each file descriptor is indeed
providing different output.

\
 
 \ /
  Last update: 2022-08-02 01:21    [W:0.052 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site