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
d8d777c8
Commit
d8d777c8
authored
9 years ago
by
Jeff Vander Stoep
Committed by
Android Git Automerger
9 years ago
Browse files
Options
Downloads
Plain Diff
am
be002324
: am
ee9c0b5f
: Add priv_app domain to global seapp_context
* commit '
be002324
': Add priv_app domain to global seapp_context
parents
6ba5a2c4
be002324
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
domain.te
+1
-0
1 addition, 0 deletions
domain.te
priv_app.te
+93
-0
93 additions, 0 deletions
priv_app.te
seapp_contexts
+6
-0
6 additions, 0 deletions
seapp_contexts
tools/check_seapp.c
+1
-0
1 addition, 0 deletions
tools/check_seapp.c
with
101 additions
and
0 deletions
domain.te
+
1
−
0
View file @
d8d777c8
...
@@ -303,6 +303,7 @@ neverallow domain { cache_file cache_backup_file }:file execute;
...
@@ -303,6 +303,7 @@ neverallow domain { cache_file cache_backup_file }:file execute;
neverallow {
neverallow {
domain
domain
-untrusted_app
-untrusted_app
-priv_app
-shell
-shell
} {
} {
data_file_type
data_file_type
...
...
This diff is collapsed.
Click to expand it.
priv_app.te
0 → 100644
+
93
−
0
View file @
d8d777c8
###
### A domain for further sandboxing privileged apps.
###
type priv_app, domain;
app_domain(priv_app)
# Access the network.
net_domain(priv_app)
# Access bluetooth.
bluetooth_domain(priv_app)
# Some apps ship with shared libraries and binaries that they write out
# to their sandbox directory and then execute.
allow priv_app app_data_file:file rx_file_perms;
# Allow the allocation and use of ptys
# Used by: https://play.privileged.com/store/apps/details?id=jackpal.androidterm
create_pty(priv_app)
allow priv_app drmserver_service:service_manager find;
allow priv_app mediaserver_service:service_manager find;
allow priv_app nfc_service:service_manager find;
allow priv_app radio_service:service_manager find;
allow priv_app surfaceflinger_service:service_manager find;
allow priv_app app_api_service:service_manager find;
allow priv_app system_api_service:service_manager find;
allow priv_app persistent_data_block_service:service_manager find;
# Traverse into /mnt/media_rw for bypassing FUSE daemon
# TODO: narrow this to just MediaProvider
allow priv_app mnt_media_rw_file:dir search;
# Access to /data/media.
allow priv_app media_rw_data_file:dir create_dir_perms;
allow priv_app media_rw_data_file:file create_file_perms;
# Used by Finsky / Android "Verify Apps" functionality when
# running "adb install foo.apk".
allow priv_app shell_data_file:file r_file_perms;
allow priv_app shell_data_file:dir r_dir_perms;
# b/18504118: Allow reads from /data/anr/traces.txt
allow priv_app anr_data_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 priv_app perfprofd_data_file:file r_file_perms;
allow priv_app perfprofd_data_file:dir r_dir_perms;
')
###
### neverallow rules
###
# Receive or send uevent messages.
neverallow priv_app domain:netlink_kobject_uevent_socket *;
# Receive or send generic netlink messages
neverallow priv_app domain:netlink_socket *;
# Too much leaky information in debugfs. It's a security
# best practice to ensure these files aren't readable.
neverallow priv_app debugfs:file read;
# Do not allow privileged apps to register services.
# Only trusted components of Android should be registering
# services.
neverallow priv_app service_manager_type:service_manager add;
# Do not allow privileged apps to connect to the property service
# or set properties. b/10243159
neverallow priv_app property_socket:sock_file write;
neverallow priv_app init:unix_stream_socket connectto;
neverallow priv_app property_type:property_service set;
# Do not allow priv_app to be assigned mlstrustedsubject.
# This would undermine the per-user isolation model being
# enforced via levelFrom=user in seapp_contexts and the mls
# constraints. As there is no direct way to specify a neverallow
# on attribute assignment, this relies on the fact that fork
# permission only makes sense within a domain (hence should
# never be granted to any other domain within mlstrustedsubject)
# and priv_app is allowed fork permission to itself.
neverallow priv_app mlstrustedsubject:process fork;
# Do not allow priv_app to hard link to any files.
# In particular, if priv_app links to other app data
# files, installd will not be able to guarantee the deletion
# of the linked to file. Hard links also contribute to security
# bugs, so we want to ensure priv_app never has this
# capability.
neverallow priv_app file_type:file link;
This diff is collapsed.
Click to expand it.
seapp_contexts
+
6
−
0
View file @
d8d777c8
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
# seinfo (string)
# seinfo (string)
# name (string)
# name (string)
# path (string)
# path (string)
# isPrivApp (boolean)
# isSystemServer=true can only be used once.
# isSystemServer=true can only be used once.
# An unspecified isSystemServer defaults to false.
# An unspecified isSystemServer defaults to false.
# isOwner=true will only match for the owner/primary user.
# isOwner=true will only match for the owner/primary user.
...
@@ -14,6 +15,8 @@
...
@@ -14,6 +15,8 @@
# A user string selector that ends in * will perform a prefix match.
# A user string selector that ends in * will perform a prefix match.
# user=_app will match any regular app UID.
# user=_app will match any regular app UID.
# user=_isolated will match any isolated service UID.
# user=_isolated will match any isolated service UID.
# isPrivApp=true will only match for applications preinstalled in
# /system/priv-app.
# All specified input selectors in an entry must match (i.e. logical AND).
# All specified input selectors in an entry must match (i.e. logical AND).
# Matching is case-insensitive.
# Matching is case-insensitive.
#
#
...
@@ -24,8 +27,10 @@
...
@@ -24,8 +27,10 @@
# (4) Fixed user= string before user= prefix (i.e. ending in *).
# (4) Fixed user= string before user= prefix (i.e. ending in *).
# (5) Longer user= prefix before shorter user= prefix.
# (5) Longer user= prefix before shorter user= prefix.
# (6) Specified seinfo= string before unspecified seinfo= string.
# (6) Specified seinfo= string before unspecified seinfo= string.
# ':' character is reserved and may not be used.
# (7) Specified name= string before unspecified name= string.
# (7) Specified name= string before unspecified name= string.
# (8) Specified path= string before unspecified path= string.
# (8) Specified path= string before unspecified path= string.
# (9) Specified isPrivApp= before unspecified isPrivApp= boolean.
#
#
# Outputs:
# Outputs:
# domain (string)
# domain (string)
...
@@ -83,4 +88,5 @@ user=shared_relro domain=shared_relro
...
@@ -83,4 +88,5 @@ user=shared_relro domain=shared_relro
user=shell seinfo=platform domain=shell type=shell_data_file
user=shell seinfo=platform domain=shell type=shell_data_file
user=_isolated domain=isolated_app levelFrom=user
user=_isolated domain=isolated_app levelFrom=user
user=_app seinfo=platform domain=platform_app type=app_data_file levelFrom=user
user=_app seinfo=platform domain=platform_app type=app_data_file levelFrom=user
user=_app isPrivApp=true domain=priv_app type=app_data_file levelFrom=user
user=_app domain=untrusted_app type=app_data_file levelFrom=user
user=_app domain=untrusted_app type=app_data_file levelFrom=user
This diff is collapsed.
Click to expand it.
tools/check_seapp.c
+
1
−
0
View file @
d8d777c8
...
@@ -209,6 +209,7 @@ key_map rules[] = {
...
@@ -209,6 +209,7 @@ key_map rules[] = {
{
.
name
=
"seinfo"
,
.
type
=
dt_string
,
.
dir
=
dir_in
,
.
data
=
NULL
},
{
.
name
=
"seinfo"
,
.
type
=
dt_string
,
.
dir
=
dir_in
,
.
data
=
NULL
},
{
.
name
=
"name"
,
.
type
=
dt_string
,
.
dir
=
dir_in
,
.
data
=
NULL
},
{
.
name
=
"name"
,
.
type
=
dt_string
,
.
dir
=
dir_in
,
.
data
=
NULL
},
{
.
name
=
"path"
,
.
type
=
dt_string
,
.
dir
=
dir_in
,
.
data
=
NULL
},
{
.
name
=
"path"
,
.
type
=
dt_string
,
.
dir
=
dir_in
,
.
data
=
NULL
},
{
.
name
=
"isPrivApp"
,
.
type
=
dt_bool
,
.
dir
=
dir_in
,
.
data
=
NULL
},
/*Outputs*/
/*Outputs*/
{
.
name
=
"domain"
,
.
type
=
dt_string
,
.
dir
=
dir_out
,
.
data
=
NULL
},
{
.
name
=
"domain"
,
.
type
=
dt_string
,
.
dir
=
dir_out
,
.
data
=
NULL
},
{
.
name
=
"type"
,
.
type
=
dt_string
,
.
dir
=
dir_out
,
.
data
=
NULL
},
{
.
name
=
"type"
,
.
type
=
dt_string
,
.
dir
=
dir_out
,
.
data
=
NULL
},
...
...
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