blob: 1601e61cb90f770f713c6b7c07670c2b55f53a16 [file] [log] [blame]
Dennis Shen26592572024-02-25 15:44:51 +00001# aconfigd -- manager for aconfig flags
Nick Kralevich62bcb0d2024-10-11 11:31:50 -07002type aconfigd, domain, coredomain;
Dennis Shen26592572024-02-25 15:44:51 +00003type aconfigd_exec, exec_type, file_type, system_file_type;
4
Dennis Shen26592572024-02-25 15:44:51 +00005init_daemon_domain(aconfigd)
6
Dennis Shen26592572024-02-25 15:44:51 +00007allow aconfigd metadata_file:dir search;
8
9allow aconfigd {
10 aconfig_storage_metadata_file
11 aconfig_storage_flags_metadata_file
12}:dir create_dir_perms;
13
14allow aconfigd {
15 aconfig_storage_metadata_file
16 aconfig_storage_flags_metadata_file
17}:file create_file_perms;
18
Dennis Shen89a2c692024-03-19 02:33:00 +000019# allow aconfigd to access shell_data_file for atest
20userdebug_or_eng(`
21 allow aconfigd shell_data_file:dir search;
Dennis Shen328f9112024-03-21 18:58:11 +000022 allow aconfigd shell_data_file:file { getattr read open map };
Dennis Shen89a2c692024-03-19 02:33:00 +000023')
24
Nick Kralevich62bcb0d2024-10-11 11:31:50 -070025# allow aconfigd to log to the kernel dmesg via a file descriptor
26# passed from init to aconfigd
27allow aconfigd kmsg_device:chr_file write;
Dennis Shenf008c292024-02-28 18:08:10 +000028
Dennis Shenf008c292024-02-28 18:08:10 +000029# allow aconfigd to read vendor partition storage files
30allow aconfigd vendor_aconfig_storage_file:file r_file_perms;
31allow aconfigd vendor_aconfig_storage_file:dir r_dir_perms;
Dennis Shenf6106362024-05-17 17:24:20 +000032
33# allow aconfigd to read /apex dir
34allow aconfigd apex_mnt_dir:dir r_dir_perms;
35allow aconfigd apex_mnt_dir:file r_file_perms;
Nick Kralevich62bcb0d2024-10-11 11:31:50 -070036
37###
38### Neverallow assertions
39###
40
41# only init is allowed to enter the aconfigd domain
42neverallow { domain -init } aconfigd:process transition;
43neverallow * aconfigd:process dyntransition;