domain_deprecated: remove ion access
Logs show that only dumpstate requires access.
avc: granted { read open } for comm="screencap" path="/dev/ion"
dev="tmpfs" ino=14324 scontext=u:r:dumpstate:s0
tcontext=u:object_r:ion_device:s0 tclass=chr_file
avc: granted { ioctl } for comm="screencap" path="/dev/ion" dev="tmpfs"
ino=14324 ioctlcmd=4906 scontext=u:r:dumpstate:s0
tcontext=u:object_r:ion_device:s0 tclass=chr_file
Grant ion permission to dumpstate which uses it for screencap
feature.
Bug: 28760354
Test: build. Check logs.
Change-Id: I6435b7dbf7656669dac5dcfb205cf0aeda93991b
diff --git a/public/domain_deprecated.te b/public/domain_deprecated.te
index 8f574f2..6a51e61 100644
--- a/public/domain_deprecated.te
+++ b/public/domain_deprecated.te
@@ -158,25 +158,6 @@
} cache_file:lnk_file r_file_perms;
')
-# Allow access to ion memory allocation device
-allow domain_deprecated ion_device:chr_file rw_file_perms;
-# split this auditallow into read and write perms since most domains seem to
-# only require read
-userdebug_or_eng(`
-auditallow {
- domain_deprecated
- -appdomain
- -fingerprintd
- -keystore
- -surfaceflinger
- -system_server
- -tee
- -vold
- -zygote
-} ion_device:chr_file r_file_perms;
-auditallow domain_deprecated ion_device:chr_file { write append };
-')
-
# Read access to pseudo filesystems.
r_dir_file(domain_deprecated, proc)
r_dir_file(domain_deprecated, sysfs)
diff --git a/public/dumpstate.te b/public/dumpstate.te
index 9b54329..ee27cbe 100644
--- a/public/dumpstate.te
+++ b/public/dumpstate.te
@@ -194,6 +194,9 @@
# Create a service for talking back to system_server
add_service(dumpstate, dumpstate_service)
+# use /dev/ion for screen capture
+allow dumpstate ion_device:chr_file r_file_perms;
+
###
### neverallow rules
###