Nikhilesh Reddy | 7851fba | 2014-08-29 11:49:14 -0700 | [diff] [blame] | 1 | # rfs_access - rfs_access daemon |
| 2 | type rfs_access, domain; |
| 3 | type rfs_access_exec, exec_type, file_type; |
| 4 | init_daemon_domain(rfs_access) |
| 5 | |
| 6 | #The files created by rfs_access process in the /data folder will have type rfs_data_file |
| 7 | type_transition rfs_access system_data_file:{ dir file } rfs_data_file; |
| 8 | |
| 9 | #To read the uio char device |
| 10 | allow rfs_access uio_device:chr_file { read write open }; |
| 11 | |
| 12 | #For QMI sockets |
| 13 | allow rfs_access self:socket { create_socket_perms }; |
| 14 | |
| 15 | #For Wakelocks |
| 16 | allow rfs_access self:capability2 block_suspend; |
| 17 | allow rfs_access sysfs_wake_lock:file { open write append }; |
| 18 | |
| 19 | #To create the /data/rfs |
| 20 | allow rfs_access system_data_file:dir { write add_name }; |
| 21 | |
| 22 | #For system folder entries |
| 23 | allow rfs_access rfs_system_file:dir search; |
| 24 | allow rfs_access rfs_system_file:lnk_file read; |
| 25 | |
| 26 | #For data folder entries |
| 27 | allow rfs_access rfs_data_file:dir { write search create add_name }; |
| 28 | allow rfs_access rfs_data_file:file { open read write create append getattr }; |
| 29 | |
| 30 | #For ramdump entries in /data/tombstones. |
| 31 | allow rfs_access tombstone_data_file:dir { write search create add_name }; |
| 32 | allow rfs_access tombstone_data_file:file { open read write create append getattr }; |
| 33 | |
| 34 | #For firmware entries in /firmware to read NHLOS.bin files ( only perms to read and get attributes). |
| 35 | allow rfs_access firmware_file:dir { search }; |
| 36 | allow rfs_access firmware_file:file { open read getattr }; |
| 37 | |
| 38 | #Prevent other domains from accessing RFS data files. |
| 39 | neverallow { domain -rfs_access -kernel -recovery -init userdebug_or_eng(`-su') -init_shell } rfs_data_file:dir { write search create add_name }; |
| 40 | neverallow { domain -rfs_access -kernel -recovery -init userdebug_or_eng(`-su') -init_shell } rfs_data_file:file { open read write create append getattr }; |
Avijit Kanti Das | b73cff1 | 2014-11-05 16:36:30 -0800 | [diff] [blame] | 41 | |
| 42 | allow rfs_access self:capability { setuid setpcap net_raw }; |
| 43 | allow rfs_access smem_log_device:chr_file rw_file_perms; |