From 414256292a691f147c39087574b5eb09d598136c Mon Sep 17 00:00:00 2001 From: Duncaen Date: Tue, 20 Sep 2016 17:45:56 +0200 Subject: [PATCH] bin/xbps-uchroot: mount / as private --- bin/xbps-uchroot/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/xbps-uchroot/main.c b/bin/xbps-uchroot/main.c index dd64333e..412bb72b 100644 --- a/bin/xbps-uchroot/main.c +++ b/bin/xbps-uchroot/main.c @@ -364,6 +364,13 @@ main(int argc, char **argv) SECBIT_NOROOT|SECBIT_NOROOT_LOCKED) == -1) { die("prctl SECBIT_NOROOT"); } + + /* mount as private, systemd mounts it as shared by default */ + if (mount(NULL, "/", "none", MS_PRIVATE|MS_REC, NULL) == -1) + die("Failed to mount / private"); + if (mount(NULL, "/", "none", MS_PRIVATE|MS_REMOUNT|MS_NOSUID, NULL) == -1) + die("Failed to remount /"); + /* setup our overlayfs if set */ if (overlayfs) chrootdir = setup_overlayfs(chrootdir, ruid, rgid,