Home | History | Annotate | Download | only in sepolicy
      1 # File types must be defined for file_contexts.
      2 type su_exec, exec_type, file_type;
      3 
      4 userdebug_or_eng(`
      5   # Domain used for su processes, as well as for adbd and adb shell
      6   # after performing an adb root command.  The domain definition is
      7   # wrapped to ensure that it does not exist at all on -user builds.
      8   type su, domain;
      9   domain_auto_trans(shell, su_exec, su)
     10 
     11   # Allow dumpstate to call su on userdebug / eng builds to collect
     12   # additional information.
     13   domain_auto_trans(dumpstate, su_exec, su)
     14 
     15   # su is also permissive to permit setenforce.
     16   permissive su;
     17 
     18   # Add su to various domains
     19   net_domain(su)
     20   app_domain(su)
     21 
     22   dontaudit su self:capability_class_set *;
     23   dontaudit su kernel:security *;
     24   dontaudit su kernel:system *;
     25   dontaudit su self:memprotect *;
     26   dontaudit su domain:process *;
     27   dontaudit su domain:fd *;
     28   dontaudit su domain:dir *;
     29   dontaudit su domain:lnk_file *;
     30   dontaudit su domain:{ fifo_file file } *;
     31   dontaudit su domain:socket_class_set *;
     32   dontaudit su domain:ipc_class_set *;
     33   dontaudit su domain:key *;
     34   dontaudit su fs_type:filesystem *;
     35   dontaudit su {fs_type dev_type file_type}:dir_file_class_set *;
     36   dontaudit su node_type:node *;
     37   dontaudit su node_type:{ tcp_socket udp_socket rawip_socket } *;
     38   dontaudit su netif_type:netif *;
     39   dontaudit su port_type:socket_class_set *;
     40   dontaudit su port_type:{ tcp_socket dccp_socket } *;
     41   dontaudit su domain:peer *;
     42   dontaudit su domain:binder *;
     43   dontaudit su property_type:property_service *;
     44 ')
     45