aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/generated.go
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2020-10-09 10:44:28 -0700
committerDmitry Vyukov <dvyukov@google.com>2020-10-09 21:48:35 +0200
commit93817d892548db363431ebb7f31518df0d8582ec (patch)
treec94b9dd892cea496c4e3d00105f96c7e614c6f7a /pkg/csource/generated.go
parentdcf117a24d23d280b2e9128caac89cea86de617a (diff)
executor: set parent-death signal after changing user or group ID-s
The parent-death signal is set in sandbox_common, but then setresuid and setresgid clear it and we need to set it again. Signed-off-by: Andrei Vagin <avagin@google.com>
Diffstat (limited to 'pkg/csource/generated.go')
-rw-r--r--pkg/csource/generated.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/csource/generated.go b/pkg/csource/generated.go
index 2d3263b65..ff758df9b 100644
--- a/pkg/csource/generated.go
+++ b/pkg/csource/generated.go
@@ -7995,6 +7995,7 @@ static int do_sandbox_setuid(void)
fail("failed to setresgid");
if (syscall(SYS_setresuid, nobody, nobody, nobody))
fail("failed to setresuid");
+ prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
loop();
@@ -8762,6 +8763,7 @@ static int do_sandbox_android(void)
if (setresuid(UNTRUSTED_APP_UID, UNTRUSTED_APP_UID, UNTRUSTED_APP_UID) != 0)
fail("setresuid failed");
+ prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0);
syz_setfilecon(".", SELINUX_LABEL_APP_DATA_FILE);
syz_setcon(SELINUX_CONTEXT_UNTRUSTED_APP);