1# Domain for update_engine daemon.
2# update_engine uses the boot_control_hal.
3type update_engine, domain, domain_deprecated, boot_control_hal;
4type update_engine_exec, exec_type, file_type;
5type update_engine_data_file, file_type, data_file_type;
6
7init_daemon_domain(update_engine);
8net_domain(update_engine);
9
10# Following permissions are needed for update_engine.
11allow update_engine self:process { setsched };
12allow update_engine self:capability { fowner sys_admin };
13allow update_engine kmsg_device:chr_file w_file_perms;
14allow update_engine update_engine_exec:file rx_file_perms;
15wakelock_use(update_engine);
16
17# Ignore these denials.
18dontaudit update_engine kernel:process setsched;
19
20# Allow using persistent storage in /data/misc/update_engine.
21allow update_engine update_engine_data_file:dir { create_dir_perms };
22allow update_engine update_engine_data_file:file { create_file_perms };
23
24# Allow update_engine to reach block devices in /dev/block.
25allow update_engine block_device:dir search;
26
27# Allow read/write on system and boot partitions.
28allow update_engine boot_block_device:blk_file rw_file_perms;
29allow update_engine system_block_device:blk_file rw_file_perms;
30
31# Don't allow kernel module loading, just silence the logs.
32dontaudit update_engine kernel:system module_request;
33
34# Allow update_engine to mount on the /postinstall directory and reset the
35# labels on the mounted filesystem to postinstall_file.
36allow update_engine postinstall_mnt_dir:dir mounton;
37allow update_engine postinstall_file:filesystem { mount unmount relabelfrom relabelto };
38allow update_engine labeledfs:filesystem relabelfrom;
39
40# Allow update_engine to read and execute postinstall_file.
41allow update_engine postinstall_file:file rx_file_perms;
42allow update_engine postinstall_file:lnk_file r_file_perms;
43allow update_engine postinstall_file:dir r_dir_perms;
44
45# The postinstall program is run by update_engine and will always be tagged as a
46# postinstall_file regardless of its attributes in the new system.
47domain_auto_trans(update_engine, postinstall_file, postinstall)
48
49# A postinstall program is typically a shell script (with a #!), so we allow
50# to execute those.
51allow update_engine shell_exec:file rx_file_perms;
52
53# Register the service to perform Binder IPC.
54binder_use(update_engine)
55allow update_engine update_engine_service:service_manager { add };
56
57# Allow update_engine to call the callback function provided by priv_app.
58binder_call(update_engine, priv_app)
59