Is it possible to exit the chroot(2) environment?

Kyle Evans kevans at freebsd.org
Sun Sep 27 19:56:28 UTC 2020


On Sun, Sep 27, 2020 at 2:47 PM Yuri <yuri at rawbw.com> wrote:
>
> On 2020-09-27 12:42, Kyle Evans wrote:
> > I think the original report needs a ktrace to narrow down what's
> > really going on...
>
>
> https://people.freebsd.org/~yuri/rpm-ktrace-dump-chroot-fails.txt
>

Yup, that's pretty definitive:

 69691 python3.7 CALL  chroot(0x8026e6ad2)
 69691 python3.7 NAMI  "."
 69691 python3.7 RET   chroot -1 errno 1 Operation not permitted

Note the explanation of EPERM:

     [EPERM]            The effective user ID is not the super-user, or one or
                        more filedescriptors are open directories.

For the former half, a chroot in the very same python3.7 exec
succeeded, so it must not be that. Try setting
kern.chroot_allow_open_directories to some value that isn't 0 or 1.


More information about the freebsd-hackers mailing list