diff --git a/private/file_contexts b/private/file_contexts index f6399fb7b956543868556d93150fcc246a266766..80e192780ea998f189c59f144171510a5548b790 100644 --- a/private/file_contexts +++ b/private/file_contexts @@ -227,6 +227,7 @@ /system/bin/idmap u:object_r:idmap_exec:s0 /system/bin/update_engine u:object_r:update_engine_exec:s0 /system/bin/bspatch u:object_r:update_engine_exec:s0 +/system/bin/storaged u:object_r:storaged_exec:s0 /system/bin/webview_zygote32 u:object_r:webview_zygote_exec:s0 /system/bin/webview_zygote64 u:object_r:webview_zygote_exec:s0 /system/fake-lib(64)?/libart.* u:object_r:libart_file:s0 @@ -422,6 +423,7 @@ ############################# # debugfs files # +/sys/kernel/debug/mmc0(/.*)? u:object_r:debugfs_mmc:s0 /sys/kernel/debug/tracing(/.*)? u:object_r:debugfs_tracing:s0 /sys/kernel/debug/tracing/trace_marker u:object_r:debugfs_trace_marker:s0 diff --git a/private/storaged.te b/private/storaged.te new file mode 100644 index 0000000000000000000000000000000000000000..e9a959c63c99cb390e917ad69f6e5bb714517e3b --- /dev/null +++ b/private/storaged.te @@ -0,0 +1,19 @@ +# storaged daemon +type storaged, domain; +type storaged_exec, exec_type, file_type; + +init_daemon_domain(storaged) + +# Write to /dev/kmsg (opened in init) +allow storaged kmsg_device:chr_file { write append }; + +# Read access to pseudo filesystems +allow storaged proc:dir r_dir_perms; +r_dir_file(storaged, sysfs_type) +r_dir_file(storaged, proc_net) + +# Read access to debugfs +allow storaged debugfs_mmc:dir search; +allow storaged debugfs_mmc:file r_file_perms; + + diff --git a/public/file.te b/public/file.te index 6184eef0c1eae44c936bc5d04d2a658f6a55f3dc..0365dc9e684402a8cedb939fa533ad5c81d3166e 100644 --- a/public/file.te +++ b/public/file.te @@ -57,6 +57,7 @@ type fuse, sdcard_type, fs_type, mlstrustedobject; type sdcardfs, sdcard_type, fs_type, mlstrustedobject; type vfat, sdcard_type, fs_type, mlstrustedobject; type debugfs, fs_type; +type debugfs_mmc, fs_type, debugfs_type; type debugfs_trace_marker, fs_type, debugfs_type, mlstrustedobject; type debugfs_tracing, fs_type, debugfs_type; type pstorefs, fs_type;