blob: 1e2adef0d67562ac92aa3424948d78c94774b473 [file] [log] [blame]
Nick Kralevich88ce9512014-01-09 15:25:36 -08001userdebug_or_eng(`
Alex Klyubin6b558dc2017-03-24 09:30:19 -07002 typeattribute su coredomain;
3
Nick Kralevich88ce9512014-01-09 15:25:36 -08004 domain_auto_trans(shell, su_exec, su)
Nick Kralevich88ce9512014-01-09 15:25:36 -08005 # Allow dumpstate to call su on userdebug / eng builds to collect
6 # additional information.
7 domain_auto_trans(dumpstate, su_exec, su)
Stephen Smalleyd99e6d52013-12-02 14:18:11 -05008
Christopher Ferris5ec38c42015-01-29 12:11:55 -08009 # Make sure that dumpstate runs the same from the "su" domain as
10 # from the "init" domain.
11 domain_auto_trans(su, dumpstate_exec, dumpstate)
12
Joe Onorato41f93db2016-11-20 23:23:04 -080013 # Put the incident command into its domain so it is the same on user, userdebug and eng.
14 domain_auto_trans(su, incident_exec, incident)
15
Orion Hodson8f75f762020-10-16 15:29:55 +010016 # Put the odrefresh command into its domain.
17 domain_auto_trans(su, odrefresh_exec, odrefresh)
18
Primiano Tucci1a9f4f72018-01-24 16:07:09 +000019 # Put the perfetto command into its domain so it is the same on user, userdebug and eng.
20 domain_auto_trans(su, perfetto_exec, perfetto)
21
Alan Stokes8b4d6122023-12-20 12:36:18 +000022 # Allow accessing virtualization (e.g. via the vm command) - ensures virtmgr runs in its
23 # own domain.
24 virtualizationservice_use(su)
David Brazdil55d808c2022-12-15 13:38:42 +000025
Nick Kralevich35e92392017-11-01 10:17:28 -070026 # su is also permissive to permit setenforce.
Nick Kralevich88ce9512014-01-09 15:25:36 -080027 permissive su;
Sreeram Ramachandranbc320182014-05-02 14:50:26 -070028
dcashman3e8dbf02016-12-08 11:23:34 -080029 app_domain(su)
Janis Danisevskisd3451f82020-07-27 13:06:11 -070030
31 # Do not audit accesses to keystore2 namespace for the su domain.
32 dontaudit su keystore2_key_type:{ keystore2 keystore2_key } *;
Inseob Kim75806ef2024-03-27 17:18:41 +090033
34 typeattribute su mlstrustedsubject;
35
36 # Add su to various domains
37 net_domain(su)
38
39 # grant su access to vndbinder
40 vndbinder_use(su)
41
42 dontaudit su self:capability_class_set *;
43 dontaudit su self:capability2 *;
44 dontaudit su kernel:security *;
45 dontaudit su { kernel file_type }:system *;
46 dontaudit su self:memprotect *;
47 dontaudit su domain:anon_inode *;
48 dontaudit su domain:{ process process2 } *;
49 dontaudit su domain:fd *;
50 dontaudit su domain:dir *;
51 dontaudit su domain:lnk_file *;
52 dontaudit su domain:{ fifo_file file } *;
53 dontaudit su domain:socket_class_set *;
54 dontaudit su domain:ipc_class_set *;
55 dontaudit su domain:key *;
56 dontaudit su {fs_type fusefs_type}:filesystem *;
57 dontaudit su {fs_type dev_type file_type}:dir_file_class_set *;
58 dontaudit su node_type:node *;
59 dontaudit su node_type:{ tcp_socket udp_socket rawip_socket } *;
60 dontaudit su netif_type:netif *;
61 dontaudit su port_type:socket_class_set *;
62 dontaudit su port_type:{ tcp_socket dccp_socket } *;
63 dontaudit su domain:peer *;
64 dontaudit su domain:binder *;
65 dontaudit su property_type:property_service *;
66 dontaudit su property_type:file *;
67 dontaudit su service_manager_type:service_manager *;
68 dontaudit su hwservice_manager_type:hwservice_manager *;
69 dontaudit su vndservice_manager_type:service_manager *;
70 dontaudit su servicemanager:service_manager list;
71 dontaudit su hwservicemanager:hwservice_manager list;
72 dontaudit su vndservicemanager:service_manager list;
73 dontaudit su keystore:keystore2 *;
74 dontaudit su domain:drmservice *;
75 dontaudit su unlabeled:filesystem *;
76 dontaudit su postinstall_file:filesystem *;
77 dontaudit su domain:bpf *;
78 dontaudit su unlabeled:vsock_socket *;
79 dontaudit su self:perf_event *;
80
81 # VTS tests run in the permissive su domain on debug builds, but the HALs
82 # being tested run in enforcing mode. Because hal_foo_server is enforcing
83 # su needs to be declared as hal_foo_client to grant hal_foo_server
84 # permission to interact with it.
85 typeattribute su halclientdomain;
86 typeattribute su hal_allocator_client;
87 typeattribute su hal_atrace_client;
88 typeattribute su hal_audio_client;
89 typeattribute su hal_authsecret_client;
90 typeattribute su hal_bluetooth_client;
91 typeattribute su hal_bootctl_client;
92 typeattribute su hal_camera_client;
93 typeattribute su hal_configstore_client;
94 typeattribute su hal_confirmationui_client;
95 typeattribute su hal_contexthub_client;
96 typeattribute su hal_drm_client;
97 typeattribute su hal_cas_client;
98 typeattribute su hal_dumpstate_client;
99 typeattribute su hal_fingerprint_client;
100 typeattribute su hal_gatekeeper_client;
101 typeattribute su hal_gnss_client;
102 typeattribute su hal_graphics_allocator_client;
103 typeattribute su hal_graphics_composer_client;
104 typeattribute su hal_health_client;
105 typeattribute su hal_input_classifier_client;
106 typeattribute su hal_ir_client;
107 typeattribute su hal_keymaster_client;
108 typeattribute su hal_light_client;
Haofan Wangf5ff3eb2024-10-23 05:30:53 +0000109 typeattribute su hal_mediaquality_client;
Inseob Kim75806ef2024-03-27 17:18:41 +0900110 typeattribute su hal_memtrack_client;
111 typeattribute su hal_neuralnetworks_client;
112 typeattribute su hal_nfc_client;
113 typeattribute su hal_oemlock_client;
114 typeattribute su hal_power_client;
115 typeattribute su hal_rebootescrow_client;
116 typeattribute su hal_secretkeeper_client;
117 typeattribute su hal_secure_element_client;
118 typeattribute su hal_sensors_client;
119 typeattribute su hal_telephony_client;
120 typeattribute su hal_tetheroffload_client;
121 typeattribute su hal_thermal_client;
122 typeattribute su hal_tv_cec_client;
123 typeattribute su hal_tv_hdmi_cec_client;
124 typeattribute su hal_tv_hdmi_connection_client;
125 typeattribute su hal_tv_hdmi_earc_client;
126 typeattribute su hal_tv_input_client;
127 typeattribute su hal_tv_tuner_client;
128 typeattribute su hal_usb_client;
129 typeattribute su hal_vibrator_client;
130 typeattribute su hal_vr_client;
131 typeattribute su hal_weaver_client;
132 typeattribute su hal_wifi_client;
133 typeattribute su hal_wifi_hostapd_client;
134 typeattribute su hal_wifi_supplicant_client;
Nick Kralevich88ce9512014-01-09 15:25:36 -0800135')