Skip to content
Snippets Groups Projects
Commit b8104a47 authored by Christopher Tate's avatar Christopher Tate
Browse files

Move staged backup content to a specific cache subdir

Also narrowly specify the domain for the local transport's bookkeeping.

Bug 26834865

Change-Id: I2eea8a10f29356ffecabd8e102f7afa90123c535
parent 02bffbb8
No related branches found
No related tags found
No related merge requests found
...@@ -270,7 +270,7 @@ neverallow { ...@@ -270,7 +270,7 @@ neverallow {
-recovery # for /tmp/update_binary in tmpfs -recovery # for /tmp/update_binary in tmpfs
} { fs_type -rootfs }:file execute; } { fs_type -rootfs }:file execute;
# Files from cache should never be executed # Files from cache should never be executed
neverallow domain { cache_file cache_backup_file cache_recovery_file }:file execute; neverallow domain { cache_file cache_backup_file cache_private_backup_file cache_recovery_file }:file execute;
# Protect most domains from executing arbitrary content from /data. # Protect most domains from executing arbitrary content from /data.
neverallow { neverallow {
......
...@@ -145,9 +145,10 @@ typealias app_data_file alias platform_app_data_file; ...@@ -145,9 +145,10 @@ typealias app_data_file alias platform_app_data_file;
typealias app_data_file alias download_file; typealias app_data_file alias download_file;
# Default type for anything under /cache # Default type for anything under /cache
type cache_file, file_type, mlstrustedobject; type cache_file, file_type, mlstrustedobject;
# Type for /cache/.*\.{data|restore} and default # Type for /cache/backup_stage/* (fd interchange with apps)
# type for anything under /cache/backup
type cache_backup_file, file_type, mlstrustedobject; type cache_backup_file, file_type, mlstrustedobject;
# type for anything under /cache/backup (local transport storage)
type cache_private_backup_file, file_type;
# Type for anything under /cache/recovery # Type for anything under /cache/recovery
type cache_recovery_file, file_type, mlstrustedobject; type cache_recovery_file, file_type, mlstrustedobject;
# Default type for anything under /efs # Default type for anything under /efs
......
...@@ -319,11 +319,12 @@ ...@@ -319,11 +319,12 @@
# Cache files # Cache files
# #
/cache(/.*)? u:object_r:cache_file:s0 /cache(/.*)? u:object_r:cache_file:s0
/cache/.*\.data u:object_r:cache_backup_file:s0
/cache/.*\.restore u:object_r:cache_backup_file:s0
# LocalTransport (backup) uses this directory
/cache/backup(/.*)? u:object_r:cache_backup_file:s0
/cache/recovery(/.*)? u:object_r:cache_recovery_file:s0 /cache/recovery(/.*)? u:object_r:cache_recovery_file:s0
# General backup/restore interchange with apps
/cache/backup_stage(/.*)? u:object_r:cache_backup_file:s0
# LocalTransport (backup) uses this subtree
/cache/backup(/.*)? u:object_r:cache_private_backup_file:s0
############################# #############################
# sysfs files # sysfs files
# #
......
...@@ -337,14 +337,12 @@ allow system_server { appdomain autoplay_app }:{ fifo_file unix_stream_socket } ...@@ -337,14 +337,12 @@ allow system_server { appdomain autoplay_app }:{ fifo_file unix_stream_socket }
# Allow abstract socket connection # Allow abstract socket connection
allow system_server rild:unix_stream_socket connectto; allow system_server rild:unix_stream_socket connectto;
# BackupManagerService lets PMS create a data backup file # BackupManagerService needs to manipulate backup data files
allow system_server cache_backup_file:dir rw_dir_perms;
allow system_server cache_backup_file:file create_file_perms; allow system_server cache_backup_file:file create_file_perms;
# Relabel /data/backup # LocalTransport works inside /cache/backup
allow system_server backup_data_file:dir { relabelto relabelfrom }; allow system_server cache_private_backup_file:dir create_dir_perms;
# Relabel /cache/.*\.{data|restore} allow system_server cache_private_backup_file:file create_file_perms;
allow system_server cache_backup_file:file { relabelto relabelfrom };
# LocalTransport creates and relabels /cache/backup
allow system_server cache_backup_file:dir { relabelto relabelfrom create_dir_perms };
# Allow system to talk to usb device # Allow system to talk to usb device
allow system_server usb_device:chr_file rw_file_perms; allow system_server usb_device:chr_file rw_file_perms;
......
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