From bf0bf05a0ceffa08baba8ccfa0dc47259847b15e Mon Sep 17 00:00:00 2001
From: David Anderson <dvander@google.com>
Date: Tue, 30 Oct 2018 15:39:28 -0700
Subject: [PATCH] Allow BLKIOMIN and BLKALIGNOFF ioctls to the super device in
 fastbootd.

These ioctls are similar to BLKGETSIZE64; they return benign information
about the partition's alignment, and are used by liblp to optimally
align dynamic partition extents.

The system_block_device is included here because on retrofit devices,
the "super" partition is mapped to the system partition.

Bug: 116802789
Test: fastboot flashall
Change-Id: I38282904828105cf5f16ce9d4b5884d2b0e89d38
---
 public/fastbootd.te | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/public/fastbootd.te b/public/fastbootd.te
index 783d2bd4b..fe1005e4d 100644
--- a/public/fastbootd.te
+++ b/public/fastbootd.te
@@ -47,6 +47,11 @@ recovery_only(`
     userdata_block_device
   }:blk_file { w_file_perms getattr ioctl };
 
+  allowxperm fastbootd {
+    system_block_device
+    super_block_device
+  }:blk_file ioctl { BLKIOMIN BLKALIGNOFF };
+
   allowxperm fastbootd {
     metadata_block_device
     userdata_block_device
-- 
GitLab