Re: [PATCH STAGING v2 07/16] fchroot04: test fchroot() into failfs as root

Cyril Hrubis <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi!
> +/*\
> + * Test :manpage:`fchroot(2)` with the ``FD_FAILFS_ROOT`` sentinel as a
> + * privileged process.
> + *
> + * :manpage:`fchroot(2)` was introduced in Linux v7.3 together with failfs,
> + * a kernel internal filesystem where every operation fails with
> + * ``EOPNOTSUPP``. The ``FD_FAILFS_ROOT`` sentinel moves the process root
> + * there without needing a file descriptor: it is the ``fs_struct`` equivalent
> + * of ``RESOLVE_BENEATH``.
> + *
> + * The test verifies that entering failfs succeeds with ``CAP_SYS_CHROOT`` and
> + * that every absolute path lookup then fails with ``EOPNOTSUPP``. The working
> + * directory, left behind in the real filesystem, is consequently reported
> + * as unreachable by :manpage:`getcwd(2)`.
> + *
> + * The syscall runs in a forked child because leaving failfs requires a
> + * mount namespace file descriptor and the parent needs its root for the
> + * test framework cleanup.

Here as well no need for the fork().

-- 
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.