blob: dab52103ccd67c2ef78bca334a54a7a9ef136335 [file] [log] [blame]
Nick Kralevich88ce9512014-01-09 15:25:36 -08001# File types must be defined for file_contexts.
Stephen Smalley01301542013-09-27 10:38:14 -04002type su_exec, exec_type, file_type;
Stephen Smalley2dd4e512012-01-04 12:33:27 -05003
Nick Kralevich88ce9512014-01-09 15:25:36 -08004userdebug_or_eng(`
Stephen Smalleyb3cb9692014-02-21 13:45:29 -05005 # 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.
Nick Kralevichb54f92b2014-09-22 17:44:00 -07008 type su, domain, mlstrustedsubject;
Nick Kralevich88ce9512014-01-09 15:25:36 -08009 domain_auto_trans(shell, su_exec, su)
Nick Kralevich09e6abd2013-12-13 22:19:45 -080010
Nick Kralevich88ce9512014-01-09 15:25:36 -080011 # Allow dumpstate to call su on userdebug / eng builds to collect
12 # additional information.
13 domain_auto_trans(dumpstate, su_exec, su)
Stephen Smalleyd99e6d52013-12-02 14:18:11 -050014
Christopher Ferris5ec38c42015-01-29 12:11:55 -080015 # Make sure that dumpstate runs the same from the "su" domain as
16 # from the "init" domain.
17 domain_auto_trans(su, dumpstate_exec, dumpstate)
18
Nick Kralevich88ce9512014-01-09 15:25:36 -080019 # su is also permissive to permit setenforce.
20 permissive su;
Sreeram Ramachandranbc320182014-05-02 14:50:26 -070021
Nick Kralevich213bb452014-07-12 12:46:58 -070022 # Add su to various domains
Sreeram Ramachandranbc320182014-05-02 14:50:26 -070023 net_domain(su)
Nick Kralevich213bb452014-07-12 12:46:58 -070024 app_domain(su)
Nick Kralevichaf7deff2014-05-27 15:46:39 -070025
26 dontaudit su self:capability_class_set *;
27 dontaudit su kernel:security *;
28 dontaudit su kernel:system *;
29 dontaudit su self:memprotect *;
30 dontaudit su domain:process *;
31 dontaudit su domain:fd *;
32 dontaudit su domain:dir *;
33 dontaudit su domain:lnk_file *;
34 dontaudit su domain:{ fifo_file file } *;
35 dontaudit su domain:socket_class_set *;
36 dontaudit su domain:ipc_class_set *;
37 dontaudit su domain:key *;
38 dontaudit su fs_type:filesystem *;
39 dontaudit su {fs_type dev_type file_type}:dir_file_class_set *;
40 dontaudit su node_type:node *;
41 dontaudit su node_type:{ tcp_socket udp_socket rawip_socket } *;
42 dontaudit su netif_type:netif *;
43 dontaudit su port_type:socket_class_set *;
44 dontaudit su port_type:{ tcp_socket dccp_socket } *;
45 dontaudit su domain:peer *;
46 dontaudit su domain:binder *;
47 dontaudit su property_type:property_service *;
Nick Kralevichbf254b42015-01-06 12:50:19 -080048 dontaudit su service_manager_type:service_manager *;
49 dontaudit su keystore:keystore_key *;
50 dontaudit su domain:debuggerd *;
51 dontaudit su domain:drmservice *;
Nick Kralevich88ce9512014-01-09 15:25:36 -080052')