Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F108633584
D29927.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1013 B
Referenced Files
None
Subscribers
None
D29927.diff
View Options
diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c
--- a/sys/amd64/linux/linux_ptrace.c
+++ b/sys/amd64/linux/linux_ptrace.c
@@ -506,18 +506,18 @@
}
if (lwpinfo.pl_flags & PL_FLAG_SCE) {
/*
- * The strace(1) utility depends on RAX being set to -ENOSYS
- * on syscall entry; otherwise it loops printing those:
- *
- * [ Process PID=928 runs in 64 bit mode. ]
- * [ Process PID=928 runs in x32 mode. ]
+ * Undo the mangling done in exception.S:fast_syscall_common().
*/
- l_regset.rax = -38; /* -ENOSYS */
+ l_regset.r10 = l_regset.rcx;
+ }
+ if (lwpinfo.pl_flags & (PL_FLAG_SCE | PL_FLAG_SCX)) {
/*
- * Undo the mangling done in exception.S:fast_syscall_common().
+ * In Linux, the syscall number - passed to the syscall
+ * as rax - is preserved in orig_rax; rax gets overwritten
+ * with syscall return value.
*/
- l_regset.r10 = l_regset.rcx;
+ l_regset.orig_rax = lwpinfo.pl_syscall_code;
}
len = MIN(iov.iov_len, sizeof(l_regset));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jan 28, 12:19 AM (9 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16226572
Default Alt Text
D29927.diff (1013 B)
Attached To
Mode
D29927: linux(4): fix ptrace(2) to properly handle orig_rax
Attached
Detach File
Event Timeline
Log In to Comment