Skip to content

Commit

Permalink
Sepolicy changes for bluez to access uhid
Browse files Browse the repository at this point in the history
Resolve selinux premission for HID

Below avc denials that are fixed with this patch -

avc:  denied  { read write } for  pid=656 comm="bluetoothd" name="uhid" dev="devtmpfs" ino=841 scontext=system_u:system_r:bluetooth_t:s0-s15:c0.c1023 tcontext=system_u:object_r:uhid_device_t:s0 tclass=chr_file permissive=0

Signed-off-by: Amisha Jain <[email protected]>
  • Loading branch information
Amisha Jain authored and pebenito committed Jun 5, 2024
1 parent d53aa53 commit 7a33b4b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions policy/modules/kernel/devices.if
Original file line number Diff line number Diff line change
Expand Up @@ -5858,3 +5858,21 @@ interface(`dev_unconfined',`

typeattribute $1 devices_unconfined_type;
')

#####################
## <summary>
## Allow open/read/write uhid device
## </summary>
## <param name="domain">
## <summary>
## Domain allowed rw to uhid device
## to communicate with uhid input node
## </summary>
## </param>
#
interface(`dev_rw_uhid',`
gen_require(`
type uhid_device_t;
')
allow $1 uhid_device_t:chr_file rw_chr_file_perms ;
')
1 change: 1 addition & 0 deletions policy/modules/services/bluetooth.te
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ dev_rw_generic_usb_dev(bluetooth_t)
dev_read_urand(bluetooth_t)
dev_rw_input_dev(bluetooth_t)
dev_rw_wireless(bluetooth_t)
dev_rw_uhid(bluetooth_t)

domain_use_interactive_fds(bluetooth_t)
domain_dontaudit_search_all_domains_state(bluetooth_t)
Expand Down

0 comments on commit 7a33b4b

Please sign in to comment.