aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2026-05-25 15:12:57 +0000
committerMark Johnston <markj@FreeBSD.org>2026-06-09 19:15:21 +0000
commit72ad7baa99c774916b04a086f4a404c62b52e852 (patch)
treeeec0e7416c3ae07e42acc045f201ac68d325e238
parent233ece107da0628cc6fbf7f4a8940f1d5eb52d72 (diff)
thr_kill2: Respect p_cansignal()
Approved by: so Security: FreeBSD-SA-26:25.thr Security: CVE-2026-45256 Reported by: Igor Gabriel Sousa e Souza Reported by: Yuxiang Yang, Yizhou Zhao, Ao Wang, Xuewei Feng, Qi Li, and Ke Xu from Tsinghua University using GLM-5.1 from Z.ai Reviewed by: emaste, kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D57237
-rw-r--r--sys/kern/kern_thr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c
index 1b5f0b1a33ad..11ceea58e849 100644
--- a/sys/kern/kern_thr.c
+++ b/sys/kern/kern_thr.c
@@ -499,7 +499,7 @@ sys_thr_kill2(struct thread *td, struct thr_kill2_args *uap)
p = ttd->td_proc;
AUDIT_ARG_PROCESS(p);
error = p_cansignal(td, p, uap->sig);
- if (uap->sig == 0)
+ if (error != 0 || uap->sig == 0)
;
else if (!_SIG_VALID(uap->sig))
error = EINVAL;