Inseob Kim | ff43be2 | 2021-06-07 16:56:56 +0900 | [diff] [blame] | 1 | type e2fs, domain, coredomain; |
| 2 | type e2fs_exec, system_file_type, exec_type, file_type; |
| 3 | |
| 4 | allow e2fs devpts:chr_file { read write getattr ioctl }; |
| 5 | |
| 6 | allow e2fs dev_type:blk_file getattr; |
| 7 | allow e2fs block_device:dir search; |
| 8 | allow e2fs userdata_block_device:blk_file rw_file_perms; |
| 9 | allow e2fs metadata_block_device:blk_file rw_file_perms; |
| 10 | allow e2fs dm_device:blk_file rw_file_perms; |
| 11 | allowxperm e2fs { userdata_block_device metadata_block_device dm_device }:blk_file ioctl { |
| 12 | BLKSECDISCARD BLKDISCARD BLKPBSZGET BLKDISCARDZEROES BLKROGET |
| 13 | }; |
| 14 | |
| 15 | # Allow e2fs to format /dev/block/vd* |
| 16 | allow e2fs vd_device:blk_file rw_file_perms; |
| 17 | allowxperm e2fs vd_device:blk_file ioctl { |
| 18 | BLKSECDISCARD BLKDISCARD BLKPBSZGET BLKDISCARDZEROES BLKROGET |
| 19 | }; |
| 20 | |
| 21 | allow e2fs { |
| 22 | proc_filesystems |
| 23 | proc_mounts |
| 24 | proc_swaps |
| 25 | }:file r_file_perms; |
| 26 | |
| 27 | # access /sys/fs/ext4/features |
| 28 | allow e2fs sysfs_fs_ext4_features:dir search; |
| 29 | allow e2fs sysfs_fs_ext4_features:file r_file_perms; |
| 30 | |
| 31 | # access SELinux context files |
| 32 | allow e2fs file_contexts_file:file r_file_perms; |