su.te 1.84 KB
Newer Older
1
# File types must be defined for file_contexts.
2
type su_exec, exec_type, file_type;
Stephen Smalley's avatar
Stephen Smalley committed
3

4
userdebug_or_eng(`
5 6 7
  # Domain used for su processes, as well as for adbd and adb shell
  # after performing an adb root command.  The domain definition is
  # wrapped to ensure that it does not exist at all on -user builds.
Nick Kralevich's avatar
Nick Kralevich committed
8
  type su, domain, mlstrustedsubject;
9
  domain_auto_trans(shell, su_exec, su)
Nick Kralevich's avatar
Nick Kralevich committed
10

11 12 13
  # Allow dumpstate to call su on userdebug / eng builds to collect
  # additional information.
  domain_auto_trans(dumpstate, su_exec, su)
14

15 16 17 18
  # Make sure that dumpstate runs the same from the "su" domain as
  # from the "init" domain.
  domain_auto_trans(su, dumpstate_exec, dumpstate)

19 20
  # su is also permissive to permit setenforce.
  permissive su;
Sreeram Ramachandran's avatar
Sreeram Ramachandran committed
21

Nick Kralevich's avatar
Nick Kralevich committed
22
  # Add su to various domains
Sreeram Ramachandran's avatar
Sreeram Ramachandran committed
23
  net_domain(su)
Nick Kralevich's avatar
Nick Kralevich committed
24
  app_domain(su)
Nick Kralevich's avatar
Nick Kralevich committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

  dontaudit su self:capability_class_set *;
  dontaudit su kernel:security *;
  dontaudit su kernel:system *;
  dontaudit su self:memprotect *;
  dontaudit su domain:process *;
  dontaudit su domain:fd *;
  dontaudit su domain:dir *;
  dontaudit su domain:lnk_file *;
  dontaudit su domain:{ fifo_file file } *;
  dontaudit su domain:socket_class_set *;
  dontaudit su domain:ipc_class_set *;
  dontaudit su domain:key *;
  dontaudit su fs_type:filesystem *;
  dontaudit su {fs_type dev_type file_type}:dir_file_class_set *;
  dontaudit su node_type:node *;
  dontaudit su node_type:{ tcp_socket udp_socket rawip_socket } *;
  dontaudit su netif_type:netif *;
  dontaudit su port_type:socket_class_set *;
  dontaudit su port_type:{ tcp_socket dccp_socket } *;
  dontaudit su domain:peer *;
  dontaudit su domain:binder *;
  dontaudit su property_type:property_service *;
48 49 50 51
  dontaudit su service_manager_type:service_manager *;
  dontaudit su keystore:keystore_key *;
  dontaudit su domain:debuggerd *;
  dontaudit su domain:drmservice *;
52
  dontaudit su unlabeled:filesystem *;
53
')