Change mount propagation to private

PiperOrigin-RevId: 289639932
Change-Id: Iac976134d5f43dcdfe895446d7caab463cc70d1a
This commit is contained in:
Wiktor Garbacz 2020-01-14 06:31:53 -08:00 committed by Copybara-Service
parent 18776b6f16
commit c2bd47e978

View File

@ -322,6 +322,9 @@ void Namespace::InitializeNamespaces(uid_t uid, gid_t gid, int32_t clone_flags,
SAPI_RAW_PCHECK(chdir("/") == 0, SAPI_RAW_PCHECK(chdir("/") == 0,
"changing cwd after mntns initialization failed"); "changing cwd after mntns initialization failed");
SAPI_RAW_PCHECK(mount("/", "/", "", MS_PRIVATE | MS_REC, nullptr) == 0,
"changing mount propagation to private failed");
if (SAPI_VLOG_IS_ON(2)) { if (SAPI_VLOG_IS_ON(2)) {
SAPI_RAW_VLOG(2, "Dumping the sandboxee's filesystem:"); SAPI_RAW_VLOG(2, "Dumping the sandboxee's filesystem:");
LogFilesystem("/"); LogFilesystem("/");