common: Allow kernel to load firmware from /vendor/firmware
authorAndreas Schneider <asn@cryptomilk.org>
Mon, 16 Mar 2020 17:33:09 +0000 (18:33 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 1 Apr 2020 05:43:22 +0000 (07:43 +0200)
Change-Id: I4ec18a2857d1cc3a63aaf4e94904005a0c5fbc41

common/vendor/file.te
common/vendor/file_contexts
common/vendor/kernel.te [new file with mode: 0644]

index a1c4b23506d88d8705eb92ec582e81fadd74565c..8983ac04a968c55e80114a1c20b020e71326399a 100644 (file)
@@ -9,3 +9,6 @@ type sysfs_wifi, sysfs_type, r_fs_type, fs_type;
 
 type sysfs_backlight_writable, sysfs_type, rw_fs_type, fs_type;
 type sysfs_wifi_writable, sysfs_type, rw_fs_type, fs_type;
+
+### VENDOR
+type vendor_firmware_file, file_type, vendor_file_type;
index b9df7248df35cddd6306b722f83e8a45dde11714..aa29f77cdd379d584f34e7bdcbf94c26ef0824c9 100644 (file)
@@ -10,3 +10,5 @@
 /(vendor|system/vendor)/bin/hw/android\.hardware\.vibrator@[0-9].[0-9]-service\.samsung-haptic    u:object_r:hal_vibrator_default_exec:s0
 /(vendor|system/vendor)/bin/hw/vendor\.samsung_slsi\.hardware\.configstore@[0-9]\.[0-9]-service   u:object_r:hal_vendor_configstore_default_exec:s0
 /(vendor|system/vendor)/bin/hw/vendor\.samsung_slsi\.hardware\.ExynosHWCServiceTW@[0-9]\.[0-9]-service    u:object_r:hal_vendor_hwcservice_default_exec:s0
+
+/(vendor|system/vendor)/firmware(/.*)?       u:object_r:vendor_firmware_file:s0
diff --git a/common/vendor/kernel.te b/common/vendor/kernel.te
new file mode 100644 (file)
index 0000000..b016aad
--- /dev/null
@@ -0,0 +1,5 @@
+# kernel.te
+
+# /vendor/firmware/
+allow kernel vendor_firmware_file:dir r_dir_perms;
+allow kernel vendor_firmware_file:file r_file_perms;