git: 76e5fcc2874e - stable/14 - ast: do not dereference NULL td_proc in CTR statement
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 17 Jul 2025 00:28:48 UTC
The branch stable/14 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=76e5fcc2874e821d28804a6e2c25b3f7aaf5f9ce
commit 76e5fcc2874e821d28804a6e2c25b3f7aaf5f9ce
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-07-14 21:54:34 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-07-17 00:28:21 +0000
ast: do not dereference NULL td_proc in CTR statement
(cherry picked from commit 42f1054ef12d10f3ba46770b985a320b0ceb9f2f)
---
sys/kern/subr_trap.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c
index 5a89ba8b6500..e836e5383c4b 100644
--- a/sys/kern/subr_trap.c
+++ b/sys/kern/subr_trap.c
@@ -340,8 +340,9 @@ ast_handler(struct thread *td, struct trapframe *framep, bool dtor)
td->td_ast = 0;
}
- CTR3(KTR_SYSC, "ast: thread %p (pid %d, %s)", td, td->td_proc->p_pid,
- td->td_proc->p_comm);
+ CTR3(KTR_SYSC, "ast: thread %p (pid %d, %s)", td,
+ td->td_proc == NULL ? -1 : td->td_proc->p_pid,
+ td->td_proc == NULL ? "" : td->td_proc->p_comm);
KASSERT(framep == NULL || TRAPF_USERMODE(framep),
("ast in kernel mode"));