-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android O: Permission denied on /proc entries for htop and top #299
Comments
This is not an issue with Termux. Starting in Android Nougat, apps are no longer allowed to see running processes. |
This issue is different, in Nougat, htop and associated tools can see processes in the current shell, but not all as we know. In Android O, access is denied to /proc entries making these tools completely broken. See the report output, this is not an issue on Nougat. |
This would mean rewriting top and other tools, and I'm not even sure it'd be possible then. |
Looks like a permission request issue to me. My guess is O exposes some new permission schemes that needed to be adapted to. |
Why would there be permission in the API for reading running processes? Pretty useless imo. |
From an issue on the Google issue tracker:
So this is indeed an intended change in Android 0. |
Will this effect ps and killall as well? |
@iammer Yes as they use the same thing. |
Here's the background on what's going on with this: https://android-developers.googleblog.com/2017/07/seccomp-filter-in-android-o.html Of course, Google in their infinite wisdom gives no opt-in work around besides flashing a custom kernel which does not have seccomp. |
Is it just /proc/stat that is being removed or the entire /proc ? I ask since my main concern is being able to kill daemon processes I have started. I.E EDIT: After some testing, I guess the daemon processes are killed eventually just takes some time. |
I think the issue I just filed may be related to this #414. In my case, I use RVM with termux and the script calls |
@jwhipp I don't think, that this has anything to do with seccomp. I just checked, and switching SELinux mode to permissive allowed me to view Seccomp is commonly used to ban entire system calls, which should be of no interest to apps. Seccomp rules can be used to dynamically sandbox specific system calls by combining it with |
There are applications showing system information, like CPU usage and so. Without access to /proc/stat they are dead.... What are uses that do not use their phone just for calls/facebook/mail supposed to do? Isn't there any API to avoid this stupid limitation? I'm really pissed off by last Android versions.... restrictions, restrictions. With each version is going to be more "iOS" like which is terrible. |
@kstoykov Secure = iOS like? |
@Alexander-- That information was based on digging from XDA which led me to the Android developer blog on the subject. From the linked Article: "Android O includes a single seccomp filter installed into zygote, the process from which all the Android applications are derived. Because the filter is installed into zygote—and therefore all apps—the Android security team took extra caution to not break existing apps. The seccomp filter allows: How did you manage to turn SELinux off with out root? Reason I say that is root -should- be allowed to to /proc even with seccomp enabled. The test would be access to /proc with out root. I still think Google should've found a way to disable with developer options. @kstoykov - You have two choices. 1 - Root, 2 - Install a kernel that does not have seccomp |
does vtop works in Android O termux? node module use also process like vtop...and what about Glances? |
Indeed, The article you linked to has no indication that seccomp has any bearing on |
After a day of reading I can totally agree that reading a file from virtual file system is not a "system call". Where should be something else why such reads are disabled. Also reading data for CPU frequency is disabled as well. Anyway Google wants it that way and we can't do anything.... "Security after all", right? Stating to think why do I have to pay $600 for high-end device and then use it as old Nokia 3310 + facebook, instead of using them as computers which they really are... So disappointed.... |
Ok so I think what we need a good list of what works and doesn't with just SELinux in permissive or disabled. @Alexander-- What ROM/device? I'd love to try it, I'm on a Pixel XL stock. Another thing to remember is that some of these tools make system calls as well as read /proc. With out looking at the ps/top/htop code I am not sure to what extent. |
Yup, they have totally gone nuts with curtailing access to /proc contents. Even try with Android emulator (no idea if You can gain some insight into specific restrictions even without viewing SELinux rules, just run
via adb ( |
I suppose that with future security restriction will be more and more, anyway LineageOS ftw, root ftw :) |
Well, is it possible to use proot to intercept any calls to /proc, and translate to our own implemented faked /proc? |
I think we would just have to recompile every binary with a fake proc path eg /data/data/com.termux/files/emuproc |
@V0idSt4r Yes, I think so, but it's too tricky and difficult to implement a full userland fake /proc, to be honest. |
How to use htop as root? Termux doesnt even find it |
Htop is working on android 8.0 on my Galaxy S9+. Its able to read all processes within termux. But I notice it read my ram as out of 4.98gb when the device has 6gb. |
You can run htop as root using the 'tsu' utlity.
Then to run, drop to root shell, set your TERM envvar, then you can run it as before. Still experiencing this on Lineage 15.1 on both Lenovo Tab 3 plus and Nexus 6. Going from the info here, the workaround above is going to be the only way to resolve on most devices. |
Issue solvable either via Variants like "faked" /proc are wontfix. Though, it is doable by supplying fake "/proc/stat" file via proot, but this will make top/htop produce fake output. |
szkoda że google takie rzeczy robi |
Any updates on this gentlemen? Why the issue is closed even? Don't you guys think that a Linux without |
You need to bind mount fake proc
It seems this will be used as default bind mounts on |
@kotoOo Of issue is closed, then perhaps there is a reason maybe? Android restrictions (security hardening) is NOT a subject for attempting to be bypassing (this isn't possible without rooting) or workarounds in Termux-wide scope. Under proot you can still use fake /proc entries like @wmcb-tech suggested. But as they are fake, functionality of proc viewing tools would be limited. |
I'm testing the Android O Dev Preview and I've found some up-coming issues with Termux to put on the radar for Android O compatibility.
Utilities that read /proc (top, htop, etc.) are not working in Termux.
Examples:
htop: Cannot open /proc/stat: Permission denied
top: can't open 'stat': Permission denied
I'm guessing this is due to further locked down SELinux in Android O.
The text was updated successfully, but these errors were encountered: