blob: ae18e6860c30f063f51a01711d6b443c6b09465d [file] [log] [blame]
Alex Klyubin83ac2422017-02-07 12:41:44 -08001# blkid for untrusted block devices
2
3# Allowed read-only access to vold block devices to extract UUID/label
4allow blkid_untrusted block_device:dir search;
5allow blkid_untrusted vold_device:blk_file r_file_perms;
6
7# Allow stdin/out back to vold
8allow blkid_untrusted vold:fd use;
9allow blkid_untrusted vold:fifo_file { read write getattr };
10
11# For blkid launched through popen()
12allow blkid_untrusted blkid_exec:file rx_file_perms;
13
14###
15### neverallow rules
16###
17
18# Untrusted blkid should never be run on block devices holding sensitive data
19neverallow blkid_untrusted {
20 boot_block_device
21 frp_block_device
22 metadata_block_device
23 recovery_block_device
24 root_block_device
25 swap_block_device
26 system_block_device
27 userdata_block_device
28 cache_block_device
29 dm_device
30}:blk_file no_rw_file_perms;
31
32# Only allow entry from vold via blkid binary
33neverallow { domain -vold } blkid_untrusted:process transition;
34neverallow * blkid_untrusted:process dyntransition;
35neverallow blkid_untrusted { file_type fs_type -blkid_exec -shell_exec }:file entrypoint;