Re: [android-security-discuss] selinux enforcing mode issue

2018-10-30 Thread Darren Greene
Ok, let me try to figure out why the owner of /sys/power/state is still showing as root. I have put getpid prints in the code, will post the rest of details. On Tuesday, October 30, 2018 at 8:46:15 PM UTC+5:30, nnk wrote: > > Yes it's expected to be system:system. It's been that way in init.rc s

Re: [android-security-discuss] selinux enforcing mode issue

2018-10-30 Thread 'Nick Kralevich' via Android Security Discussions
Yes it's expected to be system:system. It's been that way in init.rc since 2012. Similarly, the SELinux context appears incorrect, but that could be due to the fact that your tree doesn't have https://android-review.googlesource.com/c/platform/system/sepolicy/+/506555 in it. -- Nick On Tue, Oct

Re: [android-security-discuss] selinux enforcing mode issue

2018-10-30 Thread Darren Greene
Thanks. I will try it out and get back to you with details. I just checked "ls -ladZ /sys /sys/power /sys/power/state" dr-xr-xr-x 12 root root u:object_r:sysfs:s00 2018-10-30 13:37 /sys drwxr-xr-x 3 root root u:object_r:sysfs:s00 2018-10-30 13:37 /sys/power -rw

Re: [android-security-discuss] selinux enforcing mode issue

2018-10-30 Thread 'Nick Kralevich' via Android Security Discussions
Probably your easiest option is to modify autosuspend_wakeup_count.cpp, add a call to getpid(), and print out the results. That will give you the PID of the process making the call. Then you can use "ps -A -Z | grep [pid]" to get the relevant PID. Alternatively, you can insert a call to getcon() i

Re: [android-security-discuss] selinux enforcing mode issue

2018-10-30 Thread Darren Greene
Thanks for the prompt reply Nick. I should be able to get 1) and 2). However I had a question regarding 3). I am not sure what the process accessing /sys/power/state is. From the logs I can trace the call to system/core/libsuspend/autosuspend_wakeup_count.cpp, but I am not clear on the process.

Re: [android-security-discuss] selinux enforcing mode issue

2018-10-30 Thread 'Nick Kralevich' via Android Security Discussions
In the future, you may want to send your question to seli...@vger.kernel.org instead of this mailing list. To help debug this, we'll need three pieces of information. 1) The relevant SELinux policy, which can be extracted from the device using "adb pull /sys/fs/selinux/policy". Please attach it t

[android-security-discuss] selinux enforcing mode issue

2018-10-30 Thread Darren Greene
Hi, I am running Android "P" on my development board and getting a "permission denied" error. This is only seen when SELinux is in enforcing mode; if I switch to permissive things work fine. libsuspend: error opening /sys/power/state: Permission denied libsuspend: autosuspend_init failed I als