From e79b8c2092308b63202666af4dae16600c318b22 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 28 Jul 2020 11:09:03 -0700 Subject: Cleanup for #inclusivefixit. Test: treehugger Change-Id: I651689e2d59c017a9bde44251d95b57e594f0b5b --- init/service_utils.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'init/service_utils.cpp') diff --git a/init/service_utils.cpp b/init/service_utils.cpp index 05e632b68..f2383d7a6 100644 --- a/init/service_utils.cpp +++ b/init/service_utils.cpp @@ -60,13 +60,14 @@ Result EnterNamespace(int nstype, const char* path) { Result SetUpMountNamespace(bool remount_proc, bool remount_sys) { constexpr unsigned int kSafeFlags = MS_NODEV | MS_NOEXEC | MS_NOSUID; - // Recursively remount / as slave like zygote does so unmounting and mounting /proc - // doesn't interfere with the parent namespace's /proc mount. This will also - // prevent any other mounts/unmounts initiated by the service from interfering - // with the parent namespace but will still allow mount events from the parent + // Recursively remount / as MS_SLAVE like zygote does so that + // unmounting and mounting /proc doesn't interfere with the parent + // namespace's /proc mount. This will also prevent any other + // mounts/unmounts initiated by the service from interfering with the + // parent namespace but will still allow mount events from the parent // namespace to propagate to the child. if (mount("rootfs", "/", nullptr, (MS_SLAVE | MS_REC), nullptr) == -1) { - return ErrnoError() << "Could not remount(/) recursively as slave"; + return ErrnoError() << "Could not remount(/) recursively as MS_SLAVE"; } // umount() then mount() /proc and/or /sys -- cgit v1.2.3