xref: /aosp_15_r20/system/sepolicy/private/e2fs.te (revision e4a36f4174b17bbab9dc043f4a65dc8d87377290)
1allow e2fs devpts:chr_file { read write getattr ioctl };
2
3allow e2fs dev_type:blk_file getattr;
4allow e2fs block_device:dir search;
5allow e2fs userdata_block_device:blk_file rw_file_perms;
6allow e2fs metadata_block_device:blk_file rw_file_perms;
7allow e2fs dm_device:blk_file rw_file_perms;
8allow e2fs zoned_block_device:blk_file rw_file_perms;
9# Vold needs to capture mkfs.ext4's output
10allow e2fs vold:fd use;
11# Need to be able to format a partition
12allow e2fs sysfs_dm:dir r_dir_perms;
13allow e2fs sysfs_dm:file r_file_perms;
14
15allowxperm e2fs { userdata_block_device metadata_block_device dm_device zoned_block_device }:blk_file ioctl {
16  BLKSECDISCARD BLKDISCARD BLKPBSZGET BLKDISCARDZEROES BLKROGET BLKREPORTZONE BLKRESETZONE
17};
18
19allow e2fs {
20  proc_filesystems
21  proc_mounts
22  proc_swaps
23}:file r_file_perms;
24
25# access /sys/fs/ext4/features
26allow e2fs sysfs_fs_ext4_features:dir search;
27allow e2fs sysfs_fs_ext4_features:file r_file_perms;
28
29# access SELinux context files
30allow e2fs file_contexts_file:file r_file_perms;
31