aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_linux.h
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-01-18 17:27:27 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-01-18 19:58:49 +0100
commitb7f99b54aef0b9663286a56f268f7c0833391265 (patch)
tree3733ed0076da8802376a0a175fd18faf74a2a786 /executor/common_linux.h
parent3661e26e7422758a1a204e69960d9c982c041805 (diff)
sys/linux: more selinux descriptions
Diffstat (limited to 'executor/common_linux.h')
-rw-r--r--executor/common_linux.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/executor/common_linux.h b/executor/common_linux.h
index 3e84f333e..8b8a5c3f8 100644
--- a/executor/common_linux.h
+++ b/executor/common_linux.h
@@ -873,13 +873,18 @@ static int namespace_sandbox_proc(void* arg)
fail("mkdir failed");
if (mount(NULL, "./syz-tmp/newroot/proc", "proc", 0, NULL))
fail("mount(proc) failed");
+ if (mkdir("./syz-tmp/newroot/selinux", 0700))
+ fail("mkdir failed");
+ if (mount("/selinux", "./syz-tmp/newroot/selinux", NULL, MS_BIND | MS_REC | MS_PRIVATE, NULL))
+ fail("mount(selinuxfs) failed");
if (mkdir("./syz-tmp/pivot", 0777))
fail("mkdir failed");
if (syscall(SYS_pivot_root, "./syz-tmp", "./syz-tmp/pivot")) {
- debug("pivot_root failed");
+ debug("pivot_root failed\n");
if (chdir("./syz-tmp"))
fail("chdir failed");
} else {
+ debug("pivot_root OK\n");
if (chdir("/"))
fail("chdir failed");
if (umount2("./pivot", MNT_DETACH))