git: 3b85009a7eff - stable/15 - ktrace: do not enqueue request if the process' ktrioparams are freed
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 27 Jan 2026 00:39:44 UTC
The branch stable/15 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=3b85009a7effecf8643a6bfd260b735490ae1344
commit 3b85009a7effecf8643a6bfd260b735490ae1344
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-01-20 15:01:08 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-01-27 00:38:22 +0000
ktrace: do not enqueue request if the process' ktrioparams are freed
(cherry picked from commit 6bb3f208617b58a54e2204eb31bae3f9a86117a7)
---
sys/kern/kern_ktrace.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/sys/kern/kern_ktrace.c b/sys/kern/kern_ktrace.c
index 15a8a4ab4fa4..b58e69a3f38e 100644
--- a/sys/kern/kern_ktrace.c
+++ b/sys/kern/kern_ktrace.c
@@ -373,11 +373,17 @@ ktr_getrequest(int type)
static void
ktr_enqueuerequest(struct thread *td, struct ktr_request *req)
{
+ bool sched_ast;
mtx_lock(&ktrace_mtx);
- STAILQ_INSERT_TAIL(&td->td_proc->p_ktr, req, ktr_list);
+ sched_ast = td->td_proc->p_ktrioparms != NULL;
+ if (sched_ast)
+ STAILQ_INSERT_TAIL(&td->td_proc->p_ktr, req, ktr_list);
+ else
+ ktr_freerequest_locked(req);
mtx_unlock(&ktrace_mtx);
- ast_sched(td, TDA_KTRACE);
+ if (sched_ast)
+ ast_sched(td, TDA_KTRACE);
}
/*