vold: allow ioctls BLKDISCARD and BLKGETSIZE
BLKDISCARD is used by vold while wiping block devices https://android.googlesource.com/platform/system/vold/+/b2455747a92957d109a050b8f3e394d87d085086/Utils.cpp#619 BLKGETSIZE is used to determine the size of the block device. Ideally code should not be using this ioctl, as it fails for devices >= 2T in size. Vold indirectly uses this when executing /system/bin/newfs_msdos. Arguably this is a bug in newfs_msdos, as BLKGETSIZE64 should be used instead. Code: https://android.googlesource.com/platform/external/newfs_msdos/+/0c7e133c7fde67911efb7bd920d4f0ab0c269af8/mkfs_msdos.c#845 Addresses the following denials: audit(0.0:24): avc: denied { ioctl } for comm="Binder:588_2" path="/dev/block/vold/public:7,9" dev="tmpfs" ino=106407 ioctlcmd=1277 scontext=u:r:vold:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file permissive=0 audit(0.0:25): avc: denied { ioctl } for comm="newfs_msdos" path="/dev/block/vold/public:7,9" dev="tmpfs" ino=106407 ioctlcmd=1260 scontext=u:r:vold:s0 tcontext=u:object_r:vold_device:s0 tclass=blk_file permissive=0 Test: policy compiles. Bug: 119562530 Change-Id: Ib7198daf150d6f2578545a6a402e0313069ea2b4
Loading
Please register or sign in to comment