Skip to content
Snippets Groups Projects
Commit d9bf7b3f authored by Stephen Smalley's avatar Stephen Smalley
Browse files

neverallow write access to /data/dalvik-cache directories.

Prohibit all but a specific set of whitelisted domains
from writing to /data/dalvik-cache.  This is to prevent
code injection into apps, zygote, or system_server.

Inspired by:
https://www.nowsecure.com/blog/2015/06/16/remote-code-execution-as-system-user-on-samsung-phones/


which depended on system UID apps having write access to
/data/dalvik-cache (not allowed in AOSP policy but evidently
in those device policies).  Prevent this from recurring.

Change-Id: I282c7bf998421d794883e432b091ad1dcf9da67e
Signed-off-by: default avatarStephen Smalley <sds@tycho.nsa.gov>
parent 4b4c5645
No related branches found
No related tags found
No related merge requests found
...@@ -354,6 +354,14 @@ neverallow { ...@@ -354,6 +354,14 @@ neverallow {
-dex2oat -dex2oat
} dalvikcache_data_file:file no_w_file_perms; } dalvikcache_data_file:file no_w_file_perms;
neverallow {
domain
-init
-installd
-dex2oat
-zygote
} dalvikcache_data_file:dir no_w_dir_perms;
# Only system_server should be able to send commands via the zygote socket # Only system_server should be able to send commands via the zygote socket
neverallow { domain -zygote -system_server } zygote:unix_stream_socket connectto; neverallow { domain -zygote -system_server } zygote:unix_stream_socket connectto;
neverallow { domain -system_server } zygote_socket:sock_file write; neverallow { domain -system_server } zygote_socket:sock_file write;
......
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