Skip to content
Snippets Groups Projects
Commit 0e61a7a9 authored by Nick Kralevich's avatar Nick Kralevich
Browse files

neverallow /data/anr access for isolated/untrusted apps

Add a neverallow rule (compile time assertion + CTS test) that
isolated_apps and untrusted_apps can't do anything else but append
to /data/anr/traces.txt. In particular, assert that they can't
read from the file, or overwrite other data which may already be
in the file.

Bug: 18340553
Bug: 27853304

(cherry picked from commit 369cf8cd)

Change-Id: Ib33e7ea0342ad28e5a89dfffdd9bc16fe54d8b3d
parent 70f6c34e
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,12 @@ neverallow isolated_app property_type:property_service set; ...@@ -40,6 +40,12 @@ neverallow isolated_app property_type:property_service set;
# Isolated apps should not directly open app data files themselves. # Isolated apps should not directly open app data files themselves.
neverallow isolated_app app_data_file:file open; neverallow isolated_app app_data_file:file open;
# Only allow appending to /data/anr/traces.txt (b/27853304, b/18340553)
# TODO: are there situations where isolated_apps write to this file?
# TODO: should we tighten these restrictions further?
neverallow isolated_app anr_data_file:file ~{ open append };
neverallow isolated_app anr_data_file:dir ~search;
# b/17487348 # b/17487348
# Isolated apps can only access three services, # Isolated apps can only access three services,
# activity_service, display_service and webviewupdate_service. # activity_service, display_service and webviewupdate_service.
......
...@@ -185,3 +185,7 @@ neverallow untrusted_app { ...@@ -185,3 +185,7 @@ neverallow untrusted_app {
# Do not allow untrusted_app to directly open tun_device # Do not allow untrusted_app to directly open tun_device
neverallow untrusted_app tun_device:chr_file open; neverallow untrusted_app tun_device:chr_file open;
# Only allow appending to /data/anr/traces.txt (b/27853304, b/18340553)
neverallow untrusted_app anr_data_file:file ~{ open append };
neverallow untrusted_app anr_data_file:dir ~search;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment