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. --- pkg/csource/generated.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'pkg/csource') diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go index 27ed3e967..ddd5ca1b7 100644 --- a/pkg/csource/generated.go +++ b/pkg/csource/generated.go @@ -2938,6 +2938,7 @@ static void setup_common() #endif #if SYZ_EXECUTOR || SYZ_SANDBOX_NONE || SYZ_SANDBOX_SETUID || SYZ_SANDBOX_NAMESPACE +#include #include #include #include @@ -3039,16 +3040,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 @@ -3073,6 +3076,7 @@ static int do_sandbox_setuid(void) #if SYZ_EXECUTOR || SYZ_SANDBOX_NAMESPACE #include +#include #include static int real_uid; -- cgit mrf-deployment