git: ae6ac58745b5 - main - ktrace: Fix syscall number on a child return path from fork
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 14 May 2023 21:24:02 UTC
The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=ae6ac58745b58c0a3424b3714be1205821d93c51 commit ae6ac58745b58c0a3424b3714be1205821d93c51 Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2023-05-14 21:23:50 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2023-05-14 21:23:50 +0000 ktrace: Fix syscall number on a child return path from fork Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D40078 MFC after 1 week --- sys/kern/kern_fork.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 87c14670ae10..ca2357edbe36 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1125,6 +1125,9 @@ fork_exit(void (*callout)(void *, struct trapframe *), void *arg, void fork_return(struct thread *td, struct trapframe *frame) { +#ifdef KTRACE + struct syscall_args *sa; +#endif struct proc *p; p = td->td_proc; @@ -1167,8 +1170,10 @@ fork_return(struct thread *td, struct trapframe *frame) userret(td, frame); #ifdef KTRACE - if (KTRPOINT(td, KTR_SYSRET)) - ktrsysret(SYS_fork, 0, 0); + if (KTRPOINT(td, KTR_SYSRET)) { + sa = &td->td_sa; + ktrsysret(sa->code, 0, 0); + } #endif }