Module Name: src
Committed By: christos
Date: Sun Dec 15 17:42:34 UTC 2024
Modified Files:
src/sys/kern: sys_ptrace_common.c
Log Message:
PR/58896: Martin Husemann: PT_KILL will not deliver a kill signal to a stopped
process: When the process is stopped, the code resumes it instead of sending
the signal. Change it so that if we are sending SIGKILL, resume and send
the signal.
To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/kern/sys_ptrace_common.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/sys_ptrace_common.c
diff -u src/sys/kern/sys_ptrace_common.c:1.93 src/sys/kern/sys_ptrace_common.c:1.94
--- src/sys/kern/sys_ptrace_common.c:1.93 Sun Dec 15 11:26:56 2024
+++ src/sys/kern/sys_ptrace_common.c Sun Dec 15 12:42:34 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_ptrace_common.c,v 1.93 2024/12/15 16:26:56 christos Exp $ */
+/* $NetBSD: sys_ptrace_common.c,v 1.94 2024/12/15 17:42:34 christos Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -107,7 +107,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.93 2024/12/15 16:26:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.94 2024/12/15 17:42:34 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_ptrace.h"
@@ -965,7 +965,9 @@ ptrace_sendsig(struct lwp *l, int req, s
proc_unstop(t);
else
lwp_unstop(lt);
- return 0;
+
+ if (signo != SIGKILL)
+ return 0;
}
KASSERT(req == PT_KILL || req == PT_STOP || req == PT_ATTACH);