git: 287fe4003e2b - stable/13 - Fixes for ptrace_syscallreq()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 20 Jan 2023 03:23:46 UTC
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=287fe4003e2b05bfbbe40996a927a420addded77
commit 287fe4003e2b05bfbbe40996a927a420addded77
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-12-22 23:51:34 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-01-20 03:20:59 +0000
Fixes for ptrace_syscallreq()
Tested by: pho
(cherry picked from commit 974be51b3f6070f9aae02e115ea6099f90bc9175)
---
sys/kern/kern_sig.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
index 970c756d4a8e..63d73cf7a909 100644
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -2595,6 +2595,7 @@ ptrace_syscallreq(struct thread *td, struct proc *p,
sc = tsr->ts_sa.code;
if (sc == SYS_syscall || sc == SYS___syscall) {
+ sc = tsr->ts_sa.args[0];
memmove(&tsr->ts_sa.args[0], &tsr->ts_sa.args[1],
sizeof(register_t) * (tsr->ts_nargs - 1));
}
@@ -2615,7 +2616,7 @@ ptrace_syscallreq(struct thread *td, struct proc *p,
#endif
sy_thr_static = (se->sy_thrcnt & SY_THR_STATIC) != 0;
- audited = AUDIT_SYSCALL_ENTER(tsr->ts_syscall, td) != 0;
+ audited = AUDIT_SYSCALL_ENTER(sc, td) != 0;
if (!sy_thr_static) {
error = syscall_thread_enter(td, se);
@@ -2639,7 +2640,7 @@ ptrace_syscallreq(struct thread *td, struct proc *p,
#ifdef KDTRACE_HOOKS
if (se->sy_return != 0)
(*systrace_probe_func)(&tsr->ts_sa, SYSTRACE_RETURN,
- tsr->ts_ret->sr_error != 0 ? -1 : td->td_retval[0]);
+ tsr->ts_ret.sr_error != 0 ? -1 : td->td_retval[0]);
#endif
tsr->ts_ret.sr_retval[0] = td->td_retval[0];