No description
Find a file
Jiyong Park 8d21c924d7 Don't unmount /storage for early native processes
Motivation:

Early processes launched before the runtime APEX - that hosts the bionic
libs - is activated can't use the bionic libs from the APEX, but from the
system partition (which we call the bootstrap bionic). Other processes
after the APEX activation should use the bionic libs from the APEX.
In order to let both types of processes to access the bionic libs via
the same standard paths /system/lib/{libc|libdl|libm}.so, some mount
namespace magic is used.

To be specific, when the device boots, the init initially bind-mounts
the bootstrap bionic libs to the standard paths with MS_PRIVATE. Early
processes are then executed with their own mount namespaces (via
unshare(CLONE_NEWNS)). After the runtime APEX is activated, init
bind-mounts the bionic libs in the APEX to the same standard paths.
Processes launched thereafter use the bionic libs from the APEX (which
can be updated.)

Important thing is that, since the propagation type of the mount points
(the standard paths) is 'private', the new bind-mount events for the
updated bionic libs should not affect the early processes. Otherwise,
they would experience sudden change of bionic libs at runtime. However,
other mount/unmounts events outside of the private mount points are
still shared across early/late processes as before. This is made possible
because the propagation type of / is 'shared' .

Problem:

vold uses the equality of the mount namespace to filter-out processes
that share the global mount namespace (the namespace of the init). However,
due to the aforementioned change, the early processes are not filtered
out because they have different mount namespaces. As a result,
umount2("/storage/") is executed on them and this unmount event
becomes visible to the global mount namespace (because as mentioned before /
is 'shared').

Solution:

Fiter-out the early processes by skipping a native (non-Java) process
whose UID is < AID_APP. The former condition is because all early
processes are native ones; i.e., zygote is started after the runtime
APEX is activated. The latter condition is to not filter-out native
processes created locally by apps.

Bug: 120266448
Test: m; device boots

Change-Id: I054deedc4af8421854cf35be84e14995523a259a
2019-03-04 16:22:41 +09:00
bench Abort long-running benchmarks, report progress. 2017-11-07 09:57:12 -07:00
binder/android/os Add supportsCheckpoint 2019-01-22 17:58:03 -08:00
fs Refactor ForkExecvp to improve locking behaviour 2018-12-06 09:37:02 -08:00
model Create new mount directory /mnt/runtime/full. 2019-01-18 23:48:45 +00:00
tests Fix search for values in blkId output 2019-02-05 16:57:40 -08:00
.clang-format Get ourselves some clang-format. 2017-10-18 12:17:36 -06:00
Android.bp Don't unmount /storage for early native processes 2019-03-04 16:22:41 +09:00
AppFuseUtil.cpp Extract AppFuse as a util 2018-11-14 07:28:06 +00:00
AppFuseUtil.h Extract AppFuse as a util 2018-11-14 07:28:06 +00:00
Benchmark.cpp Update vold to log only debug or higher level messages. 2018-09-21 11:16:51 -07:00
Benchmark.h clang-format many files. 2018-09-18 15:41:22 -07:00
BenchmarkGen.h Abort long-running benchmarks, report progress. 2017-11-07 09:57:12 -07:00
CheckEncryption.cpp Test that plaintext can't be read from disk for encrypted files. 2017-10-27 15:14:56 -07:00
CheckEncryption.h Test that plaintext can't be read from disk for encrypted files. 2017-10-27 15:14:56 -07:00
Checkpoint.cpp Make restore validation fast by using a map 2019-02-28 09:49:54 -08:00
Checkpoint.h Add supportsCheckpoint 2019-01-22 17:58:03 -08:00
CleanSpec.mk Add an empty CleanSpec.mk 2010-03-08 18:05:25 -08:00
cryptfs.cpp Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
cryptfs.h clang-format many files. 2018-09-18 15:41:22 -07:00
Devmapper.cpp Update vold to log only debug or higher level messages. 2018-09-21 11:16:51 -07:00
Devmapper.h clang-format many files. 2018-09-18 15:41:22 -07:00
EncryptInplace.cpp EncryptInplace: Rename variable 2018-12-20 10:38:31 -08:00
EncryptInplace.h Add a mount with metadata encryption service 2018-02-01 10:08:17 -08:00
FileDeviceUtils.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
FileDeviceUtils.h clang-format many files. 2018-09-18 15:41:22 -07:00
FsCrypt.cpp Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
FsCrypt.h vold: rename from "ext4 encryption" to fscrypt 2018-10-25 17:12:32 -07:00
IdleMaint.cpp Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
IdleMaint.h Add functions to handle idle maintenance 2017-11-14 15:12:30 -08:00
KeyBuffer.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
KeyBuffer.h clang-format many files. 2018-09-18 15:41:22 -07:00
Keymaster.cpp Explain the rationale for not using StrongBox in vold. 2018-05-17 15:24:56 -06:00
Keymaster.h vold: const-ify some of the API 2018-12-20 10:38:15 -08:00
KeyStorage.cpp Fsync directories after creating files 2019-01-07 04:30:08 -08:00
KeyStorage.h vold: Pass std::string by const reference 2018-12-20 10:38:31 -08:00
KeyUtil.cpp Add Support for metadata key with rollback 2018-12-14 14:55:28 -08:00
KeyUtil.h Add Support for metadata key with rollback 2018-12-14 14:55:28 -08:00
Loop.cpp Update vold to log only debug or higher level messages. 2018-09-21 11:16:51 -07:00
Loop.h clang-format many files. 2018-09-18 15:41:22 -07:00
main.cpp Enable metadata encryption for userdata_gsi. 2019-02-14 08:29:26 -08:00
MetadataCrypt.cpp Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
MetadataCrypt.h vold: rename from "ext4 encryption" to fscrypt 2018-10-25 17:12:32 -07:00
MoveStorage.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
MoveStorage.h clang-format many files. 2018-09-18 15:41:22 -07:00
NetlinkHandler.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
NetlinkHandler.h clang-format many files. 2018-09-18 15:41:22 -07:00
NetlinkManager.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
NetlinkManager.h clang-format many files. 2018-09-18 15:41:22 -07:00
OWNERS Add OWNERS in system/vold 2017-06-09 14:55:46 -07:00
PREUPLOAD.cfg vold should be fully developed in AOSP. 2018-09-11 12:08:43 -06:00
Process.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
Process.h Move to modern utility methods from android::base. 2017-10-17 12:40:51 -06:00
ScryptParameters.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
ScryptParameters.h clang-format many files. 2018-09-18 15:41:22 -07:00
secdiscard.cpp clang-format many files. 2018-09-18 15:41:22 -07:00
sehandle.h clang-format many files. 2018-09-18 15:41:22 -07:00
Utils.cpp Fix search for values in blkId output 2019-02-05 16:57:40 -08:00
Utils.h Add UnmountTreeWithPrefix util method. 2019-01-17 01:42:48 -08:00
vdc.cpp Add supportsCheckpoint 2019-01-22 17:58:03 -08:00
vdc.rc Remove all references to FDE enable wipe 2017-12-22 11:17:15 -08:00
vold.rc vold: Grant root group 2018-08-08 17:08:02 -07:00
vold_prepare_subdirs.cpp Create subdirs in system_ce/ for multi-user backup 2019-01-17 12:53:16 +00:00
VoldNativeService.cpp Add supportsCheckpoint 2019-01-22 17:58:03 -08:00
VoldNativeService.h Add supportsCheckpoint 2019-01-22 17:58:03 -08:00
VoldUtil.cpp Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
VoldUtil.h Move over to the C++ Fstab class 2019-01-31 12:34:39 -08:00
VolumeManager.cpp Don't unmount /storage for early native processes 2019-03-04 16:22:41 +09:00
VolumeManager.h vold: const-ify some of the API 2018-12-20 10:38:15 -08:00
wait_for_keymaster.cpp add wait_for_keymaster 2018-05-09 12:59:18 -07:00
wait_for_keymaster.rc Add rc file for wait_for_keymaster 2018-05-15 16:15:21 -07:00