blob: f4884d70345aad4c0861618862c825819f74d555 [file] [log] [blame]
Stephen Smalley2dd4e512012-01-04 12:33:27 -05001# ueventd seclabel is specified in init.rc since
2# it lives in the rootfs and has no unique file type.
3type ueventd, domain;
4tmpfs_domain(ueventd)
Nick Kraleviche2651972015-06-06 07:42:37 -07005
6# TODO: why is ueventd using __kmsg__ when it should just create
7# and use /dev/kmsg instead?
8type_transition ueventd device:chr_file klog_device "__kmsg__";
9allow ueventd klog_device:chr_file { create open write unlink };
10
William Roberts85c5fc22013-10-06 15:36:11 -040011security_access_policy(ueventd)
William Roberts85c5fc22013-10-06 15:36:11 -040012allow ueventd init:process sigchld;
13allow ueventd self:capability { chown mknod net_admin setgid fsetid sys_rawio dac_override fowner };
14allow ueventd device:file create_file_perms;
15allow ueventd device:chr_file rw_file_perms;
16allow ueventd sysfs:file rw_file_perms;
Nick Kralevich1d2ff862014-07-09 23:07:10 -070017allow ueventd sysfs_type:{ file lnk_file } { relabelfrom relabelto setattr getattr };
Nick Kralevichb8bdfde2014-07-03 16:10:01 -070018allow ueventd sysfs_type:dir { relabelfrom relabelto setattr r_dir_perms };
Stephen Smalley9add1f02014-05-08 13:18:52 -040019allow ueventd sysfs_devices_system_cpu:file rw_file_perms;
William Roberts85c5fc22013-10-06 15:36:11 -040020allow ueventd tmpfs:chr_file rw_file_perms;
21allow ueventd dev_type:dir create_dir_perms;
22allow ueventd dev_type:lnk_file { create unlink };
23allow ueventd dev_type:chr_file { create setattr unlink };
24allow ueventd dev_type:blk_file { create setattr unlink };
Stephen Smalley16011322014-02-24 15:06:11 -050025allow ueventd self:netlink_kobject_uevent_socket create_socket_perms;
William Roberts85c5fc22013-10-06 15:36:11 -040026allow ueventd efs_file:dir search;
27allow ueventd efs_file:file r_file_perms;
Stephen Smalley356f4be2014-05-23 11:26:19 -040028
29# Use setfscreatecon() to label /dev directories and files.
30allow ueventd self:process setfscreate;
Nick Kralevich3e113ed2015-03-02 20:10:48 -080031
32#####
33##### neverallow rules
34#####
35
36# ueventd must never set properties, otherwise deadlocks may occur.
37# https://android-review.googlesource.com/#/c/133120/6/init/devices.cpp@941
38# No writing to the property socket, connecting to init, or setting properties.
39neverallow ueventd property_socket:sock_file write;
40neverallow ueventd init:unix_stream_socket connectto;
41neverallow ueventd property_type:property_service set;