[igt-dev] [PATCH i-g-t] lib/core_auth: mount namespace magic to make the test work everywhere

Chris Wilson chris at chris-wilson.co.uk
Thu Feb 14 12:26:22 UTC 2019


Quoting Daniel Vetter (2019-02-13 18:33:09)
> +       /* create a card node matching master which (only) we can access as
> +        * non-root */
> +       do_or_die(fstat(master, &statbuf));
> +       do_or_die(unshare(CLONE_NEWNS));
> +       igt_system("mount --make-rprivate /");
> +       igt_system("mount -t tmpfs none /dev/dri");

man mount(2)? I'm optimistic that translates to MS_PRIVATE.

Changing the propagation type of an existing mount

       If mountflags includes one of MS_SHARED, MS_PRIVATE, MS_SLAVE, or
       MS_UNBINDABLE (all available since Linux 2.6.15), then the
       propagation type of an existing mount is changed.  If more than one
       of these flags is specified, an error results.

       The only flags that can be used with changing the propagation type
       are MS_REC and MS_SILENT.

Seems like it should be just that :)
-Chris


More information about the igt-dev mailing list