exec_ptrace_handled: fix delivery of non-stop signals.
We need to deliver signals to the tracee as long as it is not a group stop. Fixes a hang while tracing another sudo process.
This commit is contained in:
@@ -868,18 +868,15 @@ exec_ptrace_handled(pid_t pid, int status, void *intercept)
|
||||
"%s: %d: group-stop signal %d",
|
||||
__func__, (int)pid, stopsig);
|
||||
group_stop = true;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
/* Signal-delivery-stop, deliver signal. */
|
||||
sudo_debug_printf(SUDO_DEBUG_INFO,
|
||||
"%s: %d: signal-delivery-stop signal %d",
|
||||
__func__, (int)pid, stopsig);
|
||||
signo = stopsig;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* Not a stop signal so not a group-stop. */
|
||||
sudo_debug_printf(SUDO_DEBUG_INFO,
|
||||
"%s: %d: signal %d", __func__, (int)pid, stopsig);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -896,7 +893,7 @@ exec_ptrace_handled(pid_t pid, int status, void *intercept)
|
||||
} else {
|
||||
/* Restart child. */
|
||||
if (ptrace(PTRACE_CONT, pid, NULL, signo) == -1)
|
||||
sudo_warn("ptrace(PTRACE_CONT, %d, NULL, %d)", (int)pid, stopsig);
|
||||
sudo_warn("ptrace(PTRACE_CONT, %d, NULL, %ld)", (int)pid, signo);
|
||||
}
|
||||
|
||||
debug_return_bool(signo == 0);
|
||||
|
Reference in New Issue
Block a user