git: cdbdd15ecd8d - stable/13 - ktrace: Fix syscall number on a child return path from fork
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Jun 2023 08:20:31 UTC
The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=cdbdd15ecd8de38f6b460330d046e8b94c010f86 commit cdbdd15ecd8de38f6b460330d046e8b94c010f86 Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2023-05-14 21:23:50 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2023-06-29 08:15:57 +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 (cherry picked from commit ae6ac58745b58c0a3424b3714be1205821d93c51) --- 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 068dfdb097d3..eebe2e2259f2 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1118,6 +1118,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; @@ -1160,7 +1163,9 @@ 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 }