From 22105302cc5569eff9c8dc0cb4bbf5397d479942 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 25 Jul 2018 14:49:45 +0200 Subject: executor: ignore unshare errors in setuid sandbox We already do this in sandbox=none, but forgot about setuid. --- executor/common_linux.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'executor/common_linux.h') diff --git a/executor/common_linux.h b/executor/common_linux.h index 1819739c5..5f3eec25f 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -1427,6 +1427,7 @@ static void setup_common() #endif #if SYZ_EXECUTOR || SYZ_SANDBOX_NONE || SYZ_SANDBOX_SETUID || SYZ_SANDBOX_NAMESPACE +#include #include #include #include @@ -1536,16 +1537,18 @@ static int do_sandbox_none(void) static int do_sandbox_setuid(void) { - if (unshare(CLONE_NEWPID)) - fail("unshare(CLONE_NEWPID)"); + if (unshare(CLONE_NEWPID)) { + debug("unshare(CLONE_NEWPID): %d\n", errno); + } int pid = fork(); if (pid != 0) return wait_for_loop(pid); setup_common(); sandbox_common(); - if (unshare(CLONE_NEWNET)) - fail("unshare(CLONE_NEWNET)"); + if (unshare(CLONE_NEWNET)) { + debug("unshare(CLONE_NEWNET): %d\n", errno); + } #if SYZ_EXECUTOR || SYZ_TUN_ENABLE initialize_tun(); #endif @@ -1573,6 +1576,7 @@ static int do_sandbox_setuid(void) #if SYZ_EXECUTOR || SYZ_SANDBOX_NAMESPACE #include +#include #include static int real_uid; -- cgit mrf-deployment