Skip to content
Snippets Groups Projects
Commit 17cfd3fc authored by dcashman's avatar dcashman
Browse files

Keep pre-existing sysfs write permissions.

Commit: b144ebab added the sysfs_usb
type and granted the read perms globally, but did not add write
permissions for all domains that previously had them.  Add the ability
to write to sysfs_usb for all domains that had the ability to write to
those files previously (sysfs).

Address denials such as:
type=1400 audit(1904.070:4): avc:  denied  { write } for  pid=321 comm="ueventd" name="uevent" dev="sysfs" ino=1742 scontext=u:r:ueventd:s0 tcontext=u:object_r:sysfs_usb:s0 tclass=file permissive=0

Bug: 28417852
Change-Id: I4562ea73f2158ebefba74b58ca572f2176d1b849
parent 92e79e22
No related branches found
No related tags found
No related merge requests found
......@@ -82,6 +82,9 @@ domain_auto_trans(dumpstate, vdc_exec, vdc)
# TODO: create a new file class, instead of allowing write access to all of /sys
allow dumpstate sysfs:file w_file_perms;
# TODO: added to match above sysfs rule. Remove me?
allow dumpstate sysfs_usb:file w_file_perms;
# Other random bits of data we want to collect
allow dumpstate qtaguid_proc:file r_file_perms;
allow dumpstate debugfs:file r_file_perms;
......
......@@ -13,6 +13,9 @@ allow gpsd gps_socket:sock_file create_file_perms;
# XXX Label sysfs files with a specific type?
allow gpsd sysfs:file rw_file_perms;
# TODO: added to match above sysfs rule. Remove me?
allow gpsd sysfs_usb:file w_file_perms;
allow gpsd gps_device:chr_file rw_file_perms;
# Execute the shell or system commands.
......
......@@ -19,6 +19,9 @@ binder_call(healthd, system_server)
# TODO: Split into a separate type?
allow healthd sysfs:file write;
# TODO: added to match above sysfs rule. Remove me?
allow healthd sysfs_usb:file write;
allow healthd sysfs_batteryinfo:file r_file_perms;
###
......
......@@ -32,6 +32,9 @@ allow netd proc_net:file write;
# XXX Split into its own type.
allow netd sysfs:file write;
# TODO: added to match above sysfs rule. Remove me?
allow netd sysfs_usb:file write;
# Needed to update /data/misc/wifi/hostapd.conf
# TODO: See what we can do to reduce the need for
# these capabilities
......
......@@ -17,6 +17,9 @@ allow nfc nfc_data_file:notdevfile_class_set create_file_perms;
allow nfc sysfs_nfc_power_writable:file rw_file_perms;
allow nfc sysfs:file write;
# TODO: added to match above sysfs rule. Remove me?
allow nfc sysfs_usb:file write;
# SoundPool loading and playback
allow nfc mediaserver_service:service_manager find;
allow nfc audioserver_service:service_manager find;
......
......@@ -190,6 +190,9 @@ allow system_server sysfs_mac_address:file r_file_perms;
allow system_server sysfs_thermal:dir search;
allow system_server sysfs_thermal:file r_file_perms;
# TODO: added to match above sysfs rule. Remove me?
allow system_server sysfs_usb:file w_file_perms;
# Access devices.
allow system_server device:dir r_dir_perms;
allow system_server mdns_socket:sock_file rw_file_perms;
......
......@@ -14,6 +14,7 @@ allow ueventd self:capability { chown mknod net_admin setgid fsetid sys_rawio da
allow ueventd device:file create_file_perms;
allow ueventd device:chr_file rw_file_perms;
allow ueventd sysfs:file rw_file_perms;
allow ueventd sysfs_usb:file w_file_perms;
allow ueventd sysfs_hwrandom:file w_file_perms;
allow ueventd sysfs_zram_uevent:file w_file_perms;
allow ueventd sysfs_type:{ file lnk_file } { relabelfrom relabelto setattr getattr };
......
......@@ -90,6 +90,9 @@ allow vold self:capability { sys_ptrace kill };
# XXX Label sysfs files with a specific type?
allow vold sysfs:file rw_file_perms;
# TODO: added to match above sysfs rule. Remove me?
allow vold sysfs_usb:file w_file_perms;
allow vold kmsg_device:chr_file rw_file_perms;
# Run fsck in the fsck domain.
......
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