From a9b6884b3a0321f4bd576aba9ec44acc3598e368 Mon Sep 17 00:00:00 2001 From: jonerlin Date: Tue, 26 Nov 2024 06:59:59 +0000 Subject: [PATCH] allow hal_bluetooth_btlinux write sysfs file 12-04 19:32:23.040000 1002 784 784 I auditd : type=1400 audit(0.0:30): avc: denied { write } for comm="binder:784_2" name="uart_dbg" dev="sysfs" ino=60136 scontext=u:r:hal_bluetooth_btlinux:s0 tcontext=u:object_r:sysfs_bt_uart:s0 tclass=file permissive=0 12-04 19:32:23.040000 1002 784 784 W binder:784_2: type=1400 audit(0.0:30): avc: denied { write } for name="uart_dbg" dev="sysfs" ino=60136 scontext=u:r:hal_bluetooth_btlinux:s0 tcontext=u:object_r:sysfs_bt_uart:s0 tclass=file permissive=0 Bug: 376774204 Test: v2/pixel-pts/release/bootstress/1200counts/suspend-resume Flag: EXEMPT project configuration patch Change-Id: I6c1a28d0e5e22b03b088d64d550fd475d796ae67 --- vendor/file.te | 1 + vendor/genfs_contexts | 3 +++ vendor/hal_bluetooth_btlinux.te | 3 +++ 3 files changed, 7 insertions(+) diff --git a/vendor/file.te b/vendor/file.te index 46f792e..9c90033 100644 --- a/vendor/file.te +++ b/vendor/file.te @@ -61,6 +61,7 @@ type chre_socket, file_type; # BT type vendor_bt_data_file, file_type, data_file_type; +type sysfs_bt_uart, sysfs_type, fs_type; # Vendor sched files userdebug_or_eng(` diff --git a/vendor/genfs_contexts b/vendor/genfs_contexts index 0f4531f..1de2c8e 100644 --- a/vendor/genfs_contexts +++ b/vendor/genfs_contexts @@ -493,3 +493,6 @@ genfscon sysfs /devices/platform/pwmleds/leds/green/max_brightness u:obje # CPU genfscon sysfs /kernel/metrics/cpuidle_histogram/cpuidle_histogram u:object_r:sysfs_cpu:s0 genfscon sysfs /kernel/metrics/cpuidle_histogram/cpucluster_histogram u:object_r:sysfs_cpu:s0 + +# Bluetooth +genfscon sysfs /devices/platform/155d0000.serial/uart_dbg u:object_r:sysfs_bt_uart:s0 diff --git a/vendor/hal_bluetooth_btlinux.te b/vendor/hal_bluetooth_btlinux.te index 65e037d..272c372 100644 --- a/vendor/hal_bluetooth_btlinux.te +++ b/vendor/hal_bluetooth_btlinux.te @@ -1 +1,4 @@ +# Allow triggering uart skip suspend +allow hal_bluetooth_btlinux sysfs_bt_uart:file w_file_perms; + allow hal_bluetooth_btlinux vendor_bt_data_file:sock_file create_file_perms;