Skip to content
Snippets Groups Projects
Commit c4ef3630 authored by Tri Vo's avatar Tri Vo
Browse files

shell: neverallow access to 'proc' label.

Added access to proc_uptime and proc_asound to address these denials:

avc: denied { read } for name="uptime" dev="proc" ino=4026532080
scontext=u:r:shell:s0 tcontext=u:object_r:proc_uptime:s0 tclass=file
permissive=1

avc: denied { getattr } for path="/proc/asound/version" dev="proc"
ino=4026532017 scontext=u:r:shell:s0 tcontext=u:object_r:proc_asound:s0
tclass=file permissive=1

Bug: 65643247
Test: device boots with no denial from 'shell' domain.
Test: lsmod, ps, top, netstat
Test: No denials triggered from CtsSecurityHostTestCases
Test: external/toybox/run-tests-on-android.sh does not pass, but triggers
no denials from 'shell' domain to 'proc' type.

Change-Id: Ia4c26fd616e33e5962c6707a855dc24e338ec153
parent 499fd010
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,6 @@ full_treble_only(` ...@@ -27,7 +27,6 @@ full_treble_only(`
-dumpstate -dumpstate
-platform_app -platform_app
-priv_app -priv_app
-shell
-system_app -system_app
-vold -vold
-vendor_init -vendor_init
......
...@@ -107,16 +107,21 @@ hwbinder_use(shell) ...@@ -107,16 +107,21 @@ hwbinder_use(shell)
allow shell hwservicemanager:hwservice_manager list; allow shell hwservicemanager:hwservice_manager list;
# allow shell to look through /proc/ for lsmod, ps, top, netstat. # allow shell to look through /proc/ for lsmod, ps, top, netstat.
r_dir_file(shell, proc)
r_dir_file(shell, proc_net) r_dir_file(shell, proc_net)
allow shell proc_filesystems:file r_file_perms;
allow shell proc_interrupts:file r_file_perms; allow shell {
allow shell proc_meminfo:file r_file_perms; proc_asound
allow shell proc_modules:file r_file_perms; proc_filesystems
allow shell proc_stat:file r_file_perms; proc_interrupts
allow shell proc_timer:file r_file_perms; proc_meminfo
allow shell proc_version:file r_file_perms; proc_modules
allow shell proc_zoneinfo:file r_file_perms; proc_stat
proc_timer
proc_uptime
proc_version
proc_zoneinfo
}:file r_file_perms;
r_dir_file(shell, cgroup) r_dir_file(shell, cgroup)
allow shell domain:dir { search open read getattr }; allow shell domain:dir { search open read getattr };
allow shell domain:{ file lnk_file } { open read getattr }; allow shell domain:{ file lnk_file } { open read getattr };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment