Protect runtime storage mount points.
We have a bunch of magic that mounts the correct view of storage access based on the runtime permissions of an app, but we forgot to protect the real underlying data sources; oops. This series of changes just bumps the directory heirarchy one level to give us /mnt/runtime which we can mask off as 0700 to prevent people from jumping to the exposed internals. Also add CTS tests to verify that we're protecting access to internal mount points like this. Bug: 22964288 Change-Id: I74dbdcb01d4fabe92166b8043a74c6a1e93c6d5f
This commit is contained in:
@@ -298,11 +298,11 @@ static bool MountEmulatedStorage(uid_t uid, jint mount_mode,
|
||||
|
||||
String8 storageSource;
|
||||
if (mount_mode == MOUNT_EXTERNAL_DEFAULT) {
|
||||
storageSource = "/mnt/runtime_default";
|
||||
storageSource = "/mnt/runtime/default";
|
||||
} else if (mount_mode == MOUNT_EXTERNAL_READ) {
|
||||
storageSource = "/mnt/runtime_read";
|
||||
storageSource = "/mnt/runtime/read";
|
||||
} else if (mount_mode == MOUNT_EXTERNAL_WRITE) {
|
||||
storageSource = "/mnt/runtime_write";
|
||||
storageSource = "/mnt/runtime/write";
|
||||
} else {
|
||||
// Sane default of no storage visible
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user