Skip to content
Snippets Groups Projects
  • Stephen Smalley's avatar
    b0db712b
    Clean up, unify, and deduplicate app domain rules. · b0db712b
    Stephen Smalley authored
    
    Coalesce a number of allow rules replicated among multiple
    app domains.
    
    Get rid of duplicated rules already covered by domain, appdomain,
    or platformappdomain rules.
    
    Split the platformappdomain rules to their own platformappdomain.te
    file, document them more fully, and note the inheritance in each
    of the relevant *_app.te files.
    
    Generalize isolated app unix_stream_socket rules to all app domains
    to resolve denials such as:
    
    avc:  denied  { read write } for  pid=11897 comm="Binder_2" path="socket:[203881]" dev="sockfs" ino=203881 scontext=u:r:release_app:s0 tcontext=u:r:untrusted_app:s0 tclass=unix_stream_socket
    
    avc:  denied  { getattr } for  pid=11990 comm=4173796E635461736B202334 path="socket:[203881]" dev="sockfs" ino=203881 scontext=u:r:release_app:s0 tcontext=u:r:untrusted_app:s0 tclass=unix_stream_socket
    
    avc:  denied  { getopt } for  pid=11990 comm=4173796E635461736B202334 scontext=u:r:release_app:s0 tcontext=u:r:untrusted_app:s0 tclass=unix_stream_socket
    
    avc:  denied  { read write } for  pid=6890 comm="Binder_10" path="socket:[205010]" dev="sockfs" ino=205010 scontext=u:r:release_app:s0 tcontext=u:r:media_app:s0 tclass=unix_stream_socket
    
    avc:  denied  { getattr } for  pid=11990 comm=4173796E635461736B202334 path="socket:[205010]" dev="sockfs" ino=205010 scontext=u:r:release_app:s0 tcontext=u:r:media_app:s0 tclass=unix_stream_socket
    
    avc:  denied  { getopt } for  pid=11990 comm=4173796E635461736B202334 scontext=u:r:release_app:s0 tcontext=u:r:media_app:s0 tclass=unix_stream_socket
    
    Change-Id: I770d7d51d498b15447219083739153265d951fe5
    Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
    b0db712b
    History
    Clean up, unify, and deduplicate app domain rules.
    Stephen Smalley authored
    
    Coalesce a number of allow rules replicated among multiple
    app domains.
    
    Get rid of duplicated rules already covered by domain, appdomain,
    or platformappdomain rules.
    
    Split the platformappdomain rules to their own platformappdomain.te
    file, document them more fully, and note the inheritance in each
    of the relevant *_app.te files.
    
    Generalize isolated app unix_stream_socket rules to all app domains
    to resolve denials such as:
    
    avc:  denied  { read write } for  pid=11897 comm="Binder_2" path="socket:[203881]" dev="sockfs" ino=203881 scontext=u:r:release_app:s0 tcontext=u:r:untrusted_app:s0 tclass=unix_stream_socket
    
    avc:  denied  { getattr } for  pid=11990 comm=4173796E635461736B202334 path="socket:[203881]" dev="sockfs" ino=203881 scontext=u:r:release_app:s0 tcontext=u:r:untrusted_app:s0 tclass=unix_stream_socket
    
    avc:  denied  { getopt } for  pid=11990 comm=4173796E635461736B202334 scontext=u:r:release_app:s0 tcontext=u:r:untrusted_app:s0 tclass=unix_stream_socket
    
    avc:  denied  { read write } for  pid=6890 comm="Binder_10" path="socket:[205010]" dev="sockfs" ino=205010 scontext=u:r:release_app:s0 tcontext=u:r:media_app:s0 tclass=unix_stream_socket
    
    avc:  denied  { getattr } for  pid=11990 comm=4173796E635461736B202334 path="socket:[205010]" dev="sockfs" ino=205010 scontext=u:r:release_app:s0 tcontext=u:r:media_app:s0 tclass=unix_stream_socket
    
    avc:  denied  { getopt } for  pid=11990 comm=4173796E635461736B202334 scontext=u:r:release_app:s0 tcontext=u:r:media_app:s0 tclass=unix_stream_socket
    
    Change-Id: I770d7d51d498b15447219083739153265d951fe5
    Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
system_app.te 858 B
#
# Apps that run with the system UID, e.g. com.android.system.ui,
# com.android.settings.  These are not as privileged as the system
# server.
#
type system_app, domain;
permissive_or_unconfined(system_app)
app_domain(system_app)
net_domain(system_app)
binder_service(system_app)

# Read and write system data files.
# May want to split into separate types.
allow system_app system_data_file:dir create_dir_perms;
allow system_app system_data_file:file create_file_perms;

# Read wallpaper file.
allow system_app wallpaper_file:file r_file_perms;

# Write to dalvikcache.
allow system_app dalvikcache_data_file:file { write setattr };

# Write to properties
unix_socket_connect(system_app, property, init)
allow system_app debug_prop:property_service set;
allow system_app radio_prop:property_service set;
allow system_app system_prop:property_service set;