sgdisk.te 745 Bytes
Newer Older
1 2 3 4 5 6 7 8
# sgdisk called from vold
type sgdisk, domain;
type sgdisk_exec, exec_type, file_type;

# Allowed to read/write low-level partition tables
allow sgdisk block_device:dir search;
allow sgdisk vold_device:blk_file rw_file_perms;

9 10 11
# Inherit and use pty created by android_fork_execvp()
allow sgdisk devpts:chr_file { read write ioctl getattr };

12 13 14 15
# Allow stdin/out back to vold
allow sgdisk vold:fd use;
allow sgdisk vold:fifo_file { read write getattr };

16 17 18
# Used to probe kernel to reload partition tables
allow sgdisk self:capability sys_admin;

19 20 21 22
# Only allow entry from vold
neverallow { domain -vold } sgdisk:process transition;
neverallow domain sgdisk:process dyntransition;
neverallow sgdisk { file_type fs_type -sgdisk_exec }:file entrypoint;