Allow fastbootd to wipe userdata.
This is needed for flashall -w to wipe userdata.
Bug: 113648914
Test: fastboot erase userdata
Change-Id: I7e89cf885c9a67c78de67b79ed16af7e50104bf7
diff --git a/public/fastbootd.te b/public/fastbootd.te
index 1d39d50..bba5ab9 100644
--- a/public/fastbootd.te
+++ b/public/fastbootd.te
@@ -44,6 +44,11 @@
allow fastbootd misc_block_device:blk_file rw_file_perms;
+ # Required to wipe userdata
+ allow fastbootd userdata_block_device:blk_file { w_file_perms getattr ioctl };
+ allowxperm fastbootd userdata_block_device:blk_file ioctl { BLKGETSIZE64 BLKSECDISCARD
+ BLKDISCARD };
+
allow fastbootd proc_cmdline:file r_file_perms;
allow fastbootd rootfs:dir r_dir_perms;
allow fastbootd sysfs_dt_firmware_android:file r_file_perms;