Skip to content
Snippets Groups Projects
Commit 55540755 authored by Stephen Smalley's avatar Stephen Smalley
Browse files

Label adb keys file and allow access to it.


The /adb_keys entry will only take effect if a restorecon is
applied by init.rc on a kernel that includes the rootfs labeling
support, but does no harm otherwise.

The /data/misc/adb labeling ensures correct labeling of the adb_keys
file created if the device has ro.adb.secure=1 set.

Allow adbd to read the file.

Change-Id: I97b3d86a69681330bba549491a2fb39df6cf20ef
Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
parent 513fb85c
No related branches found
No related tags found
No related merge requests found
...@@ -6,3 +6,11 @@ unconfined_domain(adbd) ...@@ -6,3 +6,11 @@ unconfined_domain(adbd)
domain_auto_trans(adbd, shell_exec, shell) domain_auto_trans(adbd, shell_exec, shell)
# this is an entrypoint # this is an entrypoint
allow adbd rootfs:file entrypoint; allow adbd rootfs:file entrypoint;
# Read /data/misc/adb/adb_keys.
allow adbd adb_keys_file:dir search;
allow adbd adb_keys_file:file r_file_perms;
# Allow access in case /data/misc/adb still has the old type.
allow adbd system_data_file:dir search;
allow adbd system_data_file:file r_file_perms;
...@@ -54,6 +54,7 @@ type wifi_data_file, file_type, data_file_type; ...@@ -54,6 +54,7 @@ type wifi_data_file, file_type, data_file_type;
type radio_data_file, file_type, data_file_type; type radio_data_file, file_type, data_file_type;
type nfc_data_file, file_type, data_file_type; type nfc_data_file, file_type, data_file_type;
type camera_calibration_file, file_type, data_file_type; type camera_calibration_file, file_type, data_file_type;
type adb_keys_file, file_type, data_file_type;
# /data/data subdirectories - app sandboxes # /data/data subdirectories - app sandboxes
type app_data_file, file_type, data_file_type; type app_data_file, file_type, data_file_type;
type platform_app_data_file, file_type, data_file_type, mlstrustedobject; type platform_app_data_file, file_type, data_file_type, mlstrustedobject;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/ u:object_r:rootfs:s0 / u:object_r:rootfs:s0
# Data files # Data files
/adb_keys u:object_r:rootfs:s0 /adb_keys u:object_r:adb_keys_file:s0
/default.prop u:object_r:rootfs:s0 /default.prop u:object_r:rootfs:s0
/fstab\..* u:object_r:rootfs:s0 /fstab\..* u:object_r:rootfs:s0
/init\..* u:object_r:rootfs:s0 /init\..* u:object_r:rootfs:s0
...@@ -175,6 +175,7 @@ ...@@ -175,6 +175,7 @@
/data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0 /data/misc/wifi(/.*)? u:object_r:wifi_data_file:s0
/data/misc/camera(/.*)? u:object_r:camera_calibration_file:s0 /data/misc/camera(/.*)? u:object_r:camera_calibration_file:s0
/data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0 /data/misc/dhcp(/.*)? u:object_r:dhcp_data_file:s0
/data/misc/adb(/.*)? u:object_r:adb_keys_file:s0
# App sandboxes # App sandboxes
/data/data/.* u:object_r:app_data_file:s0 /data/data/.* u:object_r:app_data_file:s0
# Wallpaper file. # Wallpaper file.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment