aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/generated.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-07-25 14:49:45 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-07-27 10:22:23 +0200
commit22105302cc5569eff9c8dc0cb4bbf5397d479942 (patch)
tree165987fe11764ffb738c296f23987446daacff99 /pkg/csource/generated.go
parentc7725f52b1e4034799fda6f801e62cf060ad341b (diff)
executor: ignore unshare errors in setuid sandbox
We already do this in sandbox=none, but forgot about setuid.
Diffstat (limited to 'pkg/csource/generated.go')
-rw-r--r--pkg/csource/generated.go12
1 files changed, 8 insertions, 4 deletions
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 <sched.h>
#include <sys/prctl.h>
#include <sys/resource.h>
#include <sys/time.h>
@@ -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 <linux/capability.h>
+#include <sched.h>
#include <sys/mman.h>
static int real_uid;