Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AndroidSystemSEPolicy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Werner Sembach
AndroidSystemSEPolicy
Commits
7d66f783
Commit
7d66f783
authored
9 years ago
by
Dehao Chen
Browse files
Options
Downloads
Patches
Plain Diff
Update sepolicy to add label for /data/misc/perfprofd.
Bug: 19483574 Change-Id: I7e4c0cf748d2b216dcb3aede3803883552b58b64
parent
ccc8608c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
domain.te
+1
-0
1 addition, 0 deletions
domain.te
file.te
+1
-0
1 addition, 0 deletions
file.te
file_contexts
+1
-0
1 addition, 0 deletions
file_contexts
perfprofd.te
+15
-10
15 additions, 10 deletions
perfprofd.te
untrusted_app.te
+7
-0
7 additions, 0 deletions
untrusted_app.te
with
25 additions
and
10 deletions
domain.te
+
1
−
0
View file @
7d66f783
...
@@ -183,6 +183,7 @@ neverallow {
...
@@ -183,6 +183,7 @@ neverallow {
-dumpstate
-dumpstate
-system_server
-system_server
userdebug_or_eng(`-procrank')
userdebug_or_eng(`-procrank')
userdebug_or_eng(`-perfprofd')
} self:capability sys_ptrace;
} self:capability sys_ptrace;
# Limit device node creation to these whitelisted domains.
# Limit device node creation to these whitelisted domains.
...
...
This diff is collapsed.
Click to expand it.
file.te
+
1
−
0
View file @
7d66f783
...
@@ -116,6 +116,7 @@ type vpn_data_file, file_type, data_file_type;
...
@@ -116,6 +116,7 @@ type vpn_data_file, file_type, data_file_type;
type wifi_data_file, file_type, data_file_type;
type wifi_data_file, file_type, data_file_type;
type zoneinfo_data_file, file_type, data_file_type;
type zoneinfo_data_file, file_type, data_file_type;
type vold_data_file, file_type, data_file_type;
type vold_data_file, file_type, data_file_type;
type perfprofd_data_file, file_type, data_file_type, mlstrustedobject;
# Compatibility with type names used in vanilla Android 4.3 and 4.4.
# Compatibility with type names used in vanilla Android 4.3 and 4.4.
typealias audio_data_file alias audio_firmware_file;
typealias audio_data_file alias audio_firmware_file;
...
...
This diff is collapsed.
Click to expand it.
file_contexts
+
1
−
0
View file @
7d66f783
...
@@ -247,6 +247,7 @@
...
@@ -247,6 +247,7 @@
/data/misc/wifi/hostapd(/.*)? u:object_r:wpa_socket:s0
/data/misc/wifi/hostapd(/.*)? u:object_r:wpa_socket:s0
/data/misc/zoneinfo(/.*)? u:object_r:zoneinfo_data_file:s0
/data/misc/zoneinfo(/.*)? u:object_r:zoneinfo_data_file:s0
/data/misc/vold(/.*)? u:object_r:vold_data_file:s0
/data/misc/vold(/.*)? u:object_r:vold_data_file:s0
/data/misc/perfprofd(/.*)? u:object_r:perfprofd_data_file:s0
/data/system/heapdump(/.*)? u:object_r:heapdump_data_file:s0
/data/system/heapdump(/.*)? u:object_r:heapdump_data_file:s0
# Bootchart data
# Bootchart data
...
...
This diff is collapsed.
Click to expand it.
perfprofd.te
+
15
−
10
View file @
7d66f783
...
@@ -18,19 +18,13 @@ userdebug_or_eng(`
...
@@ -18,19 +18,13 @@ userdebug_or_eng(`
allow perfprofd system_file:file rx_file_perms;
allow perfprofd system_file:file rx_file_perms;
# perfprofd reads a config file from /data/data/com.google.android.gms/files
# perfprofd reads a config file from /data/data/com.google.android.gms/files
# opens a file for writing in the same directory
allow perfprofd app_data_file:file r_file_perms;
allow perfprofd app_data_file:file rw_file_perms;
allow perfprofd app_data_file:dir rw_dir_perms;
# perfprofd looks for the existence of a semaphore file to determine
# whether collection is enabled/disabled (where the semphore file is
# created by some other entity, e.g. gms)
allow perfprofd app_data_file:dir search;
allow perfprofd app_data_file:dir search;
allow perfprofd self:capability { dac_override };
allow perfprofd self:capability { dac_override };
# perfprofd
reads pro
file
s
f
rom /data/data/..., encodes them,
# perfprofd
opens a
file f
or writing in /data/misc/perfprofd
# and then dumps the encoded profiles back to /data/data/....
allow perfprofd perfprofd_data_file:file create_file_perms;
allow perfprofd
app
_data_file:dir
_file_class_set create_file
_perms;
allow perfprofd
perfprofd
_data_file:dir
rw_dir
_perms;
# perfprofd uses the system log
# perfprofd uses the system log
read_logd(perfprofd);
read_logd(perfprofd);
...
@@ -39,6 +33,17 @@ userdebug_or_eng(`
...
@@ -39,6 +33,17 @@ userdebug_or_eng(`
# simpleperf uses ioctl() to turn on kernel perf events measurements
# simpleperf uses ioctl() to turn on kernel perf events measurements
allow perfprofd self:capability sys_admin;
allow perfprofd self:capability sys_admin;
# simpleperf needs to examine /proc to collect task/thread info
r_dir_file(perfprofd, domain)
# simpleperf needs to access /proc/<pid>/exec
allow perfprofd self:capability { sys_resource sys_ptrace };
neverallow perfprofd domain:process ptrace;
# simpleperf needs open/read any file that turns up in a profile
# to see whether it has a build ID
allow perfprofd exec_type:file r_file_perms;
# simpleperf is going to execute "sleep"
# simpleperf is going to execute "sleep"
allow perfprofd toolbox_exec:file x_file_perms;
allow perfprofd toolbox_exec:file x_file_perms;
...
...
This diff is collapsed.
Click to expand it.
untrusted_app.te
+
7
−
0
View file @
7d66f783
...
@@ -93,6 +93,13 @@ allow untrusted_app persistent_data_block_service:service_manager find;
...
@@ -93,6 +93,13 @@ allow untrusted_app persistent_data_block_service:service_manager find;
allow untrusted_app { apk_tmp_file apk_private_tmp_file }:dir r_dir_perms;
allow untrusted_app { apk_tmp_file apk_private_tmp_file }:dir r_dir_perms;
allow untrusted_app { apk_tmp_file apk_private_tmp_file }:file r_file_perms;
allow untrusted_app { apk_tmp_file apk_private_tmp_file }:file r_file_perms;
# Allow GMS core to access perfprofd output, which is stored
# in /data/misc/perfprofd/. GMS core will need to list all
# data stored in that directory to process them one by one.
userdebug_or_eng(`
allow untrusted_app perfprofd_data_file:file r_file_perms;
allow untrusted_app perfprofd_data_file:dir r_dir_perms;
')
###
###
### neverallow rules
### neverallow rules
###
###
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment