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
d352fba1
Commit
d352fba1
authored
10 years ago
by
Stephen Smalley
Committed by
Android Git Automerger
10 years ago
Browse files
Options
Downloads
Plain Diff
am
42fb824c
: Refactor the shell domains.
* commit '
42fb824c
': Refactor the shell domains.
parents
0bcbc6c4
42fb824c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
app.te
+1
-1
1 addition, 1 deletion
app.te
attributes
+0
-3
0 additions, 3 deletions
attributes
domain.te
+1
-1
1 addition, 1 deletion
domain.te
init_shell.te
+2
-4
2 additions, 4 deletions
init_shell.te
shell.te
+36
-2
36 additions, 2 deletions
shell.te
shelldomain.te
+0
-37
0 additions, 37 deletions
shelldomain.te
with
40 additions
and
48 deletions
app.te
+
1
−
1
View file @
d352fba1
...
...
@@ -316,7 +316,7 @@ neverallow { appdomain -unconfineddomain }
# Access to syslog(2) or /proc/kmsg.
neverallow { appdomain -system_app }
kernel:system { syslog_mod syslog_console };
neverallow { appdomain -system_app -shell
domain
}
neverallow { appdomain -system_app -shell }
kernel:system syslog_read;
# Ability to perform any filesystem operation other than statfs(2).
...
...
This diff is collapsed.
Click to expand it.
attributes
+
0
−
3
View file @
d352fba1
...
...
@@ -50,9 +50,6 @@ attribute mlstrustedobject;
# Domains that are allowed all permissions ("unconfined").
attribute unconfineddomain;
# All domains used for shells.
attribute shelldomain;
# All domains used for apps.
attribute appdomain;
...
...
This diff is collapsed.
Click to expand it.
domain.te
+
1
−
1
View file @
d352fba1
...
...
@@ -248,7 +248,7 @@ neverallow {
domain
-appdomain
-dumpstate
-shell
domain
-shell
userdebug_or_eng(`-su')
-system_server
-zygote
...
...
This diff is collapsed.
Click to expand it.
init_shell.te
+
2
−
4
View file @
d352fba1
# Restricted domain for shell processes spawned by init.
# Normally these are shell commands or scripts invoked via sh
# from an init*.rc file. No service should ever run in this domain.
type init_shell, domain
, shelldomain
;
type init_shell, domain;
domain_auto_trans(init, shell_exec, init_shell)
unconfined_domain(init_shell)
# inherits from shelldomain.te
permissive_or_unconfined(init_shell)
This diff is collapsed.
Click to expand it.
shell.te
+
36
−
2
View file @
d352fba1
# Domain for shell processes spawned by ADB or console service.
type shell, domain,
shelldomain,
mlstrustedsubject;
type shell, domain, mlstrustedsubject;
type shell_exec, exec_type, file_type;
# Create and use network sockets.
...
...
@@ -17,4 +17,38 @@ control_logd(shell)
allow shell anr_data_file:dir r_dir_perms;
allow shell anr_data_file:file r_file_perms;
# inherits from shelldomain.te
# Access /data/local/tmp.
allow shell shell_data_file:dir create_dir_perms;
allow shell shell_data_file:file create_file_perms;
allow shell shell_data_file:file rx_file_perms;
# adb bugreport
unix_socket_connect(shell, dumpstate, dumpstate)
allow shell rootfs:dir r_dir_perms;
allow shell devpts:chr_file rw_file_perms;
allow shell tty_device:chr_file rw_file_perms;
allow shell console_device:chr_file rw_file_perms;
allow shell input_device:chr_file rw_file_perms;
allow shell system_file:file x_file_perms;
allow shell shell_exec:file rx_file_perms;
allow shell zygote_exec:file rx_file_perms;
r_dir_file(shell, apk_data_file)
# Set properties.
unix_socket_connect(shell, property, init)
allow shell shell_prop:property_service set;
allow shell ctl_dumpstate_prop:property_service set;
allow shell debug_prop:property_service set;
allow shell powerctl_prop:property_service set;
# systrace support - allow atrace to run
# debugfs doesn't support labeling individual files, so we have
# to grant read access to all of /sys/kernel/debug.
# Directory read access and file write access is already granted
# in domain.te.
allow shell debugfs:file r_file_perms;
# allow shell to run dmesg
allow shell kernel:system syslog_read;
This diff is collapsed.
Click to expand it.
shelldomain.te
deleted
100644 → 0
+
0
−
37
View file @
0bcbc6c4
# Rules for all shell domains (e.g. console service and adb shell).
# Access /data/local/tmp.
allow shelldomain shell_data_file:dir create_dir_perms;
allow shelldomain shell_data_file:file create_file_perms;
allow shelldomain shell_data_file:file rx_file_perms;
# adb bugreport
unix_socket_connect(shelldomain, dumpstate, dumpstate)
allow shelldomain rootfs:dir r_dir_perms;
allow shelldomain devpts:chr_file rw_file_perms;
allow shelldomain tty_device:chr_file rw_file_perms;
allow shelldomain console_device:chr_file rw_file_perms;
allow shelldomain input_device:chr_file rw_file_perms;
allow shelldomain system_file:file x_file_perms;
allow shelldomain shell_exec:file rx_file_perms;
allow shelldomain zygote_exec:file rx_file_perms;
r_dir_file(shelldomain, apk_data_file)
# Set properties.
unix_socket_connect(shelldomain, property, init)
allow shelldomain shell_prop:property_service set;
allow shelldomain ctl_dumpstate_prop:property_service set;
allow shelldomain debug_prop:property_service set;
allow shelldomain powerctl_prop:property_service set;
# systrace support - allow atrace to run
# debugfs doesn't support labeling individual files, so we have
# to grant read access to all of /sys/kernel/debug.
# Directory read access and file write access is already granted
# in domain.te.
allow shelldomain debugfs:file r_file_perms;
# allow shell to run dmesg
allow shelldomain kernel:system syslog_read;
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