mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
fail soft if sandboxee exits before init is ptraced
PiperOrigin-RevId: 270254470 Change-Id: Ifa13f4fe0e7ae91b79fc689e1d7dcb2a49b09cde
This commit is contained in:
parent
0aec7a511b
commit
d43d09c746
|
@ -205,7 +205,13 @@ void Monitor::Run() {
|
|||
&init_pid);
|
||||
|
||||
if (init_pid > 0) {
|
||||
PCHECK(ptrace(PTRACE_SEIZE, init_pid, 0, PTRACE_O_EXITKILL) == 0);
|
||||
if (ptrace(PTRACE_SEIZE, init_pid, 0, PTRACE_O_EXITKILL) != 0) {
|
||||
if (errno == ESRCH) {
|
||||
SetExitStatusCode(Result::SETUP_ERROR, Result::FAILED_PTRACE);
|
||||
return;
|
||||
}
|
||||
PLOG(FATAL) << "attaching to init process failed";
|
||||
}
|
||||
}
|
||||
|
||||
if (pid_ <= 0 || (should_have_init && init_pid <= 0)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user