Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SELinux support for tee-supplicant #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions BoardConfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ ENABLE_CPUSETS := true

BOARD_SEPOLICY_DIRS := device/linaro/hikey/sepolicy

BOARD_SEPOLICY_UNION += \
file_contexts \
sepolicy.te

ifeq ($(HOST_OS), linux)
ifeq ($(TARGET_SYSTEMIMAGES_USE_SQUASHFS), true)
BOARD_SYSTEMIMAGE_FILE_SYSTEM_TYPE := squashfs
Expand Down
3 changes: 2 additions & 1 deletion init.hikey.rc
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@ service uim /system/bin/uim
user root
oneshot

service tee-supplicant /system/bin/tee-supplicant
service tee_supplicant /system/bin/tee-supplicant
class main
user root
group shell
oneshot

service wpa_supplicant /system/bin/wpa_supplicant \
Expand Down
3 changes: 3 additions & 0 deletions sepolicy/file_contexts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
/dev/dri/card0 u:object_r:gpu_device:s0
/dev/hci_tty u:object_r:hci_attach_dev:s0
/system/bin/uim u:object_r:hci_attach_exec:s0
/dev/tee[0-9]* u:object_r:tee_device:s0
/dev/teepriv[0-9]* u:object_r:tee_device:s0
/system/bin/tee-supplicant u:object_r:tee_exec:s0
4 changes: 3 additions & 1 deletion sepolicy/init.te
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# init.hikey.usb.rc writes to /config/* to set up USB
allow init configfs:dir create_file_perms;
allow init configfs:file write;
allow init configfs:lnk_file create;
allow tee system_data_file:dir write;
allow tee system_data_file:dir add_name;
allow tee system_data_file:dir create;
2 changes: 2 additions & 0 deletions ueventd.hikey.rc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/dev/hci_tty 0666 root root
/dev/ttyAMA1 0660 bluetooth net_bt_stack
/dev/mali 0666 system graphics
/dev/tee0 0660 system drmrpc
/dev/teepriv0 0660 system drmrpc