blob: eb06672daf235d68484510c12771c3ee9656b0de [file] [log] [blame]
Inseob Kimff43be22021-06-07 16:56:56 +09001typeattribute ueventd coredomain;
2
3tmpfs_domain(ueventd)
4
Inseob Kim4eb56602021-07-09 15:51:12 +09005# 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
49# ueventd is using bootstrap bionic
50allow ueventd system_bootstrap_lib_file:dir r_dir_perms;
51allow ueventd system_bootstrap_lib_file:file { execute read open getattr map };
52