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