termux / proot

An chroot-like implementation using ptrace.
https://wiki.termux.com/wiki/PRoot
Other
795 stars 163 forks source link

Operation not permitted #59

Open zengbo opened 5 years ago

zengbo commented 5 years ago

When I use proot, I got

proot error: ptrace(TRACEME): Operation not permitted proot error: execve("/data/data/com.termux/files/usr/bin/bash"): Operation not permitted proot info: possible causes:

michalbednarski commented 5 years ago

This error occured very early at proot startup, so either it's running under some kind of debugger (Which might be part of system, use grep TracerPid /proc/self/status to check (0 means no debugger, which is expected before starting proot), or debugging interfaces are broken on your device (Check if you can use strace or gdb on your device, if they don't work proot also cannot)

QGB commented 3 years ago

@michalbednarski I encountered same error , my /proc/self/status

Umask:  0022
State:  R (running)
Tgid:   9
Ngid:   0
Pid:    9
PPid:   8
TracerPid:  0
Uid:    2001    2001    2001    2001
Gid:    2001    2001    2001    2001
FDSize: 256
Groups:  
NStgid: 9
NSpid:  9
NSpgid: 8
NSsid:  8
VmPeak:   239724 kB
VmSize:   174848 kB
VmLck:         0 kB
VmPin:         0 kB
VmHWM:     63688 kB
VmRSS:     63688 kB
RssAnon:       50568 kB
RssFile:       13120 kB
RssShmem:          0 kB
VmData:    58380 kB
VmStk:       132 kB
VmExe:      2560 kB
VmLib:      8364 kB
VmPTE:       252 kB
VmSwap:        0 kB
HugetlbPages:          0 kB
CoreDumping:    0
Threads:    2
SigQ:   0/257045
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000000000
SigIgn: 0000000001001000
SigCgt: 0000000180010002
CapInh: 00000000a80425fb
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: 00000000a80425fb
CapAmb: 0000000000000000
NoNewPrivs: 0
Seccomp:    2
Speculation_Store_Bypass:   thread force mitigated
Cpus_allowed:   ffff,ffffffff
Cpus_allowed_list:  0-47
Mems_allowed:   00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001
Mems_allowed_list:  0
voluntary_ctxt_switches:    171599
nonvoluntary_ctxt_switches: 121
2004seraph commented 1 month ago

I got the exact same error when i tried to run proot -0 java, @michalbednarski 's suggestions didn't give me any clues.

I also got this bug and used the workaround: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1202161.

However since I'm on GrapheneOS, I tried turning on exploit protection compatibility mode for Termux and it started working! I can try to narrow it down to which protection setting stops it from working if needed.