blob: 43411024cbf4a6f933f4533d4c7d48a299f18976 [file] [log] [blame]
Stephen Smalley8a0c25e2014-09-23 09:11:30 -04001# Any toolbox command run by init.
2# At present, the only known usage is for running mkswap via fs_mgr.
3# Do NOT use this domain for toolbox when run by any other domain.
4type toolbox, domain;
5type toolbox_exec, exec_type, file_type;
Stephen Smalley8a0c25e2014-09-23 09:11:30 -04006
7init_daemon_domain(toolbox)
8
9# /dev/__null__ created by init prior to policy load,
10# open fd inherited by fsck.
11allow toolbox tmpfs:chr_file { read write ioctl };
12
13# Inherit and use pty created by android_fork_execvp_ext().
Nick Kralevichd94b78c2014-12-19 16:19:05 -080014allow toolbox devpts:chr_file { read write getattr ioctl };
Stephen Smalley8a0c25e2014-09-23 09:11:30 -040015
16# mkswap-specific.
17# Read/write block devices used for swap partitions.
18# Assign swap_block_device type any such partition in your
19# device/<vendor>/<product>/sepolicy/file_contexts file.
Nick Kralevich0bc6c802014-12-19 17:21:52 -080020allow toolbox block_device:dir search;
Stephen Smalley8a0c25e2014-09-23 09:11:30 -040021allow toolbox swap_block_device:blk_file rw_file_perms;
22
23# Only allow entry from init via the toolbox binary.
24neverallow { domain -init } toolbox:process transition;
25neverallow domain toolbox:process dyntransition;
26neverallow toolbox { file_type fs_type -toolbox_exec}:file entrypoint;