blob: 4bd55cfc947b2ba6bbdc2b0e1665d10999cb9f9b [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 };
18allow ueventd tmpfs:chr_file rw_file_perms;
19allow ueventd dev_type:dir create_dir_perms;
20allow ueventd dev_type:lnk_file { create unlink };
21allow ueventd dev_type:chr_file { getattr create setattr unlink };
22allow ueventd dev_type:blk_file { getattr relabelfrom relabelto create setattr unlink };
23allow ueventd self:netlink_kobject_uevent_socket create_socket_perms_no_ioctl;
24
25# Get SELinux enforcing status.
26r_dir_file(ueventd, selinuxfs)
27
28# Access for /vendor/ueventd.rc and /vendor/firmware
29r_dir_file(ueventd, vendor_file_type)
30
31# Access for /apex/*/firmware
32allow ueventd apex_mnt_dir:dir r_dir_perms;
33
34# Get file contexts for new device nodes
35allow ueventd file_contexts_file:file r_file_perms;
36
37# Use setfscreatecon() to label /dev directories and files.
38allow ueventd self:process setfscreate;
39
40# Allow ueventd to read androidboot.android_dt_dir from kernel cmdline or bootconfig.
41allow ueventd proc_cmdline:file r_file_perms;
42allow ueventd proc_bootconfig:file r_file_perms;
43
44# ueventd loads modules in response to modalias events.
45allow ueventd self:global_capability_class_set sys_module;
46allow ueventd vendor_file:system module_load;
47allow ueventd kernel:key search;
48
David Andersone09c0ee2023-05-16 15:58:08 -070049# Query device-mapper to extract name/uuid in response to uevents.
50allow ueventd dm_device:chr_file rw_file_perms;
51allow ueventd self:capability sys_admin;
52
Inseob Kime1389972021-07-19 07:48:34 +000053# ueventd is using bootstrap bionic
Jiyong Park16c1ae32022-01-23 23:55:41 +090054use_bootstrap_libs(ueventd)
Inseob Kime1389972021-07-19 07:48:34 +000055
Inseob Kim5ee61a72021-09-17 19:31:45 +090056# ueventd sets ro.cold_boot_done to signal to init that cold boot has completed.
57set_prop(ueventd, cold_boot_done_prop)