Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144018383
D49430.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D49430.id.diff
View Options
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c
--- a/sys/kern/kern_sig.c
+++ b/sys/kern/kern_sig.c
@@ -343,6 +343,14 @@
* the postsig() loop was performed.
*/
sigfastblock_setpend(td, resched_sigs);
+
+ /*
+ * Clear td_sa.code: signal to ptrace that syscall arguments
+ * are unavailable after this point. This AST handler is the
+ * last chance for ptracestop() to signal the tracer before
+ * the tracee returns to userspace.
+ */
+ td->td_sa.code = 0;
}
static void
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -1168,7 +1168,8 @@
case PT_GET_SC_ARGS:
CTR1(KTR_PTRACE, "PT_GET_SC_ARGS: pid %d", p->p_pid);
- if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0
+ if (((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0 &&
+ td2->td_sa.code == 0)
#ifdef COMPAT_FREEBSD32
|| (wrap32 && !safe)
#endif
@@ -1511,12 +1512,9 @@
pl->pl_sigmask = td2->td_sigmask;
pl->pl_siglist = td2->td_siglist;
strcpy(pl->pl_tdname, td2->td_name);
- if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) != 0) {
+ if (td2->td_sa.code != 0) {
pl->pl_syscall_code = td2->td_sa.code;
pl->pl_syscall_narg = td2->td_sa.callp->sy_narg;
- } else {
- pl->pl_syscall_code = 0;
- pl->pl_syscall_narg = 0;
}
CTR6(KTR_PTRACE,
"PT_LWPINFO: tid %d (pid %d) event %d flags %#x child pid %d syscall %d",
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Feb 4, 10:55 AM (15 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28434021
Default Alt Text
D49430.id.diff (1 KB)
Attached To
Mode
D49430: ptrace(2): expand ability to fetch syscall parameters
Attached
Detach File
Event Timeline
Log In to Comment