From 778c3c7f4aab140d92fab0d9d29c784d3271982f Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Thu, 24 Sep 2020 05:56:02 -0700 Subject: [PATCH] sm6150-common: sepolicy: Allow ioctl to zram_swap for performance This fixes permission denied when setting F2FS_PIN_FILE. [ 46.726131] init: [libfs_mgr]Failed to set pin_file for f2fs: /data/per_boot/zram_swap: Permission denied [ 46.726151] init: [libfs_mgr]Failure of zram backing device file for '/dev/block/zram0' [ 46.726341] type=1400 audit(1601025878.312:17): avc: denied { ioctl } for comm="init" path="/data/per_boot/zram_swap" dev="dm-9" ino=4868 ioctlcmd=0xf50d scontext=u:r:init:s0 tcontext=u:object_r:per_boot_file:s0 tclass=file permissive=0 Bug: 169311165 Signed-off-by: Jaegeuk Kim Change-Id: I982f70556284ac55d659bae6aff93b84d71e67f0 --- sepolicy/vendor/init.te | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sepolicy/vendor/init.te b/sepolicy/vendor/init.te index 870c379..c4bbfec 100644 --- a/sepolicy/vendor/init.te +++ b/sepolicy/vendor/init.te @@ -1,2 +1,5 @@ dontaudit init bt_firmware_file:filesystem getattr; dontaudit init firmware_file:filesystem getattr; + +allow init per_boot_file:file ioctl; +allowxperm init per_boot_file:file ioctl { F2FS_IOC_SET_PIN_FILE };