Skip to content
Snippets Groups Projects
Commit c15d54ef authored by Jeff Vander Stoep's avatar Jeff Vander Stoep
Browse files

domain_deprecated: remove proc access

Remove "granted" logspam. Grante the observed permissions to the
individual processes that need them and remove the permission from
domain_deprecated.

avc: granted { read open } for comm="ndroid.settings"
path="/proc/version" dev="proc" ino=4026532081
scontext=u:r:system_app:s0 tcontext=u:object_r:proc:s0 tclass=file
avc: granted { getattr } for comm=4173796E635461736B202332
path="/proc/pagetypeinfo" dev="proc" ino=4026532129
scontext=u:r:system_app:s0 tcontext=u:object_r:proc:s0 tclass=file

avc: granted { read open } for comm="uncrypt" path="/proc/cmdline"
dev="proc" ino=4026532072 scontext=u:r:uncrypt:s0
tcontext=u:object_r:proc:s0 tclass=file

avc: granted { read open } for comm="update_engine"
path="/proc/sys/kernel/random/boot_id" dev="proc" ino=15852829
scontext=u:r:update_engine:s0 tcontext=u:object_r:proc:s0 tclass=file

avc: granted { read open } for comm="tiveportallogin"
path="/proc/vmstat" dev="proc" ino=4026532130
scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:proc:s0
tclass=file

This change is specifically not granting the following since it
should not be allowed:
avc: granted { read open } for comm="crash_dump64"
path="/proc/filesystems" dev="proc" ino=4026532416
scontext=u:r:dex2oat:s0 tcontext=u:object_r:proc:s0 tclass=file
avc: granted { read } for comm="crash_dump64" name="filesystems"
dev="proc" ino=4026532416 scontext=u:r:dex2oat:s0
tcontext=u:object_r:proc:s0 tclass=file
avc: granted { getattr } for comm="crash_dump64"
path="/proc/filesystems" dev="proc" ino=4026532416
scontext=u:r:dex2oat:s0 tcontext=u:object_r:proc:s0 tclass=file

Bug: 64032843
Bug: 28760354
Test: build
Change-Id: Ib309e97b6229bdf013468dca34f606c0e8da96d0
parent 21b4a925
No related branches found
No related tags found
No related merge requests found
# rules removed from the domain attribute # rules removed from the domain attribute
# Read access to pseudo filesystems. # Read access to pseudo filesystems.
r_dir_file(domain_deprecated, proc)
r_dir_file(domain_deprecated, sysfs) r_dir_file(domain_deprecated, sysfs)
userdebug_or_eng(` userdebug_or_eng(`
auditallow {
domain_deprecated
-fsck
-fsck_untrusted
-sdcardd
-system_server
-update_engine
-vold
} proc:file r_file_perms;
auditallow {
domain_deprecated
-fsck
-fsck_untrusted
-system_server
-vold
} proc:lnk_file { open ioctl lock }; # getattr read granted in domain
auditallow { auditallow {
domain_deprecated domain_deprecated
-fingerprintd -fingerprintd
......
...@@ -41,6 +41,9 @@ allow platform_app vfat:file create_file_perms; ...@@ -41,6 +41,9 @@ allow platform_app vfat:file create_file_perms;
# com.android.systemui # com.android.systemui
allow platform_app rootfs:dir getattr; allow platform_app rootfs:dir getattr;
# com.android.captiveportallogin reads /proc/vmstat
allow platform_app proc:file r_file_perms;
allow platform_app audioserver_service:service_manager find; allow platform_app audioserver_service:service_manager find;
allow platform_app cameraserver_service:service_manager find; allow platform_app cameraserver_service:service_manager find;
allow platform_app drmserver_service:service_manager find; allow platform_app drmserver_service:service_manager find;
......
...@@ -84,5 +84,8 @@ allow system_app keystore:keystore_key { ...@@ -84,5 +84,8 @@ allow system_app keystore:keystore_key {
# /sys access # /sys access
r_dir_file(system_app, sysfs_type) r_dir_file(system_app, sysfs_type)
# settings app reads /proc/version and /proc/pagetypeinfo
allow system_app proc:file r_file_perms;
control_logd(system_app) control_logd(system_app)
read_runtime_log_tags(system_app) read_runtime_log_tags(system_app)
...@@ -37,3 +37,6 @@ allow uncrypt block_device:dir r_dir_perms; ...@@ -37,3 +37,6 @@ allow uncrypt block_device:dir r_dir_perms;
allow uncrypt userdata_block_device:blk_file w_file_perms; allow uncrypt userdata_block_device:blk_file w_file_perms;
r_dir_file(uncrypt, rootfs) r_dir_file(uncrypt, rootfs)
# uncrypt reads /proc/cmdline
allow uncrypt proc:file r_file_perms;
...@@ -38,10 +38,8 @@ allow update_engine_common shell_exec:file rx_file_perms; ...@@ -38,10 +38,8 @@ allow update_engine_common shell_exec:file rx_file_perms;
# Allow update_engine_common to suspend, resume and kill the postinstall program. # Allow update_engine_common to suspend, resume and kill the postinstall program.
allow update_engine_common postinstall:process { signal sigstop sigkill }; allow update_engine_common postinstall:process { signal sigstop sigkill };
# access /proc/misc # access /proc/misc and /proc/sys/kernel/random/boot_id
# Access is also granted to proc:file, but it is likely unneeded allow update_engine proc:file r_file_perms;
# due to the more specific grant to proc_misc immediately below.
allow update_engine proc:file r_file_perms; # delete candidate
allow update_engine proc_misc:file r_file_perms; allow update_engine proc_misc:file r_file_perms;
# read directories on /system and /vendor # read directories on /system and /vendor
......
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