proot-me / proot

chroot, mount --bind, and binfmt_misc without privilege/setup for Linux
https://proot-me.github.io
GNU General Public License v2.0
2.09k stars 380 forks source link

Nested invocations of proot fail #310

Open sattlerc opened 3 years ago

sattlerc commented 3 years ago

I tried nesting invocations of proot:

$ proot proot proot true

Expected Behavior

The program call should succeed.

Actual Behavior

proot error: ptrace(TRACEME): Operation not permitted
proot error: execve("/usr/bin/true"): Operation not permitted
proot info: It seems your kernel contains this bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1202161
To workaround it, set the env. variable PROOT_NO_SECCOMP to 1.
fatal error: see `proot --help`.

The referenced bug is from 2013 and has been fixed for a long time.

Specifications

sattlerc commented 3 years ago

Before I used master, I used 5.1.0 (I was not able to compile 5.2.0 due to #250). However, that did not even pass this check:

~$ proot true
proot info: pid 15183: terminated with signal 11

I'm guessing that is related to #106.

Setting PROOT_NO_SECCOMP=1 yields no errors here and with the program call from the bug report.

oxr463 commented 2 years ago
proot -V
 _____ _____              ___
|  __ \  __ \_____  _____|   |_
|   __/     /  _  \/  _  \    _|
|__|  |__|__\_____/\_____/\____| v5.3.0

built-in accelerators: process_vm = yes, seccomp_filter = yes

Visit https://proot-me.github.io for help, bug reports, suggestions, patches, ...
Copyright (C) 2022 PRoot Developers, licensed under GPL v2 or later.

proot proot proot true
proot error: ptrace(TRACEME): Operation not permitted
proot error: execve("/bin/true"): Operation not permitted
proot info: It seems your kernel contains this bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1202161
To workaround it, set the env. variable PROOT_NO_SECCOMP to 1.
fatal error: see `proot --help`.

PROOT_NO_SECCOMP=1 proot proot proot true

echo $?
0

Source: https://github.com/proot-me/proot/blob/master/src/cli/cli.c#L131