blob: 2f25703fe5d026e66c4e9638555249a234289dbb [file] [log] [blame]
Inseob Kime1389972021-07-19 07:48:34 +00001typeattribute ueventd coredomain;
2
3tmpfs_domain(ueventd)
4
5# Write to /dev/kmsg.
6allow ueventd kmsg_device:chr_file rw_file_perms;
7
8allow ueventd self:global_capability_class_set { chown mknod net_admin setgid fsetid sys_rawio dac_override dac_read_search fowner setuid };
9allow ueventd device:file create_file_perms;
10
11r_dir_file(ueventd, rootfs)
12
13# ueventd needs write access to files in /sys to regenerate uevents
14allow ueventd sysfs_type:file w_file_perms;
15r_dir_file(ueventd, sysfs_type)
16allow ueventd sysfs_type:{ file lnk_file } { relabelfrom relabelto setattr };
17allow ueventd sysfs_type:dir { relabelfrom relabelto setattr };
Nikita Ioffe73282e42024-03-04 21:45:37 +000018# the open-dice0 device is now created in first_stage_init, ueventd needs these permissions
19# so that it can relabel it to open_dice_device, so that microdroid_manager can access it.
20allow ueventd tmpfs:chr_file { relabelfrom rw_file_perms setattr };
21allow ueventd open_dice_device:chr_file relabelto;
Inseob Kime1389972021-07-19 07:48:34 +000022allow ueventd dev_type:dir create_dir_perms;
23allow ueventd dev_type:lnk_file { create unlink };
24allow ueventd dev_type:chr_file { getattr create setattr unlink };
25allow ueventd dev_type:blk_file { getattr relabelfrom relabelto create setattr unlink };
26allow ueventd self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
27
28# Get SELinux enforcing status.
29r_dir_file(ueventd, selinuxfs)
30
31# Access for /vendor/ueventd.rc and /vendor/firmware
32r_dir_file(ueventd, vendor_file_type)
33
34# Access for /apex/*/firmware
35allow ueventd apex_mnt_dir:dir r_dir_perms;
36
37# Get file contexts for new device nodes
38allow ueventd file_contexts_file:file r_file_perms;
39
40# Use setfscreatecon() to label /dev directories and files.
41allow ueventd self:process setfscreate;
42
43# Allow ueventd to read androidboot.android_dt_dir from kernel cmdline or bootconfig.
44allow ueventd proc_cmdline:file r_file_perms;
45allow ueventd proc_bootconfig:file r_file_perms;
46
47# ueventd loads modules in response to modalias events.
48allow ueventd self:global_capability_class_set sys_module;
49allow ueventd vendor_file:system module_load;
50allow ueventd kernel:key search;
51
David Andersone09c0ee2023-05-16 15:58:08 -070052# Query device-mapper to extract name/uuid in response to uevents.
53allow ueventd dm_device:chr_file rw_file_perms;
54allow ueventd self:capability sys_admin;
55
Inseob Kime1389972021-07-19 07:48:34 +000056# ueventd is using bootstrap bionic
Jiyong Park16c1ae32022-01-23 23:55:41 +090057use_bootstrap_libs(ueventd)
Inseob Kime1389972021-07-19 07:48:34 +000058
Inseob Kim5ee61a72021-09-17 19:31:45 +090059# ueventd sets ro.cold_boot_done to signal to init that cold boot has completed.
60set_prop(ueventd, cold_boot_done_prop)