Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157798736
D53482.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
D53482.diff
View Options
diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c
--- a/sys/kern/subr_syscall.c
+++ b/sys/kern/subr_syscall.c
@@ -56,7 +56,7 @@
struct syscall_args *sa;
struct sysent *se;
int error;
- bool sy_thr_static, traced;
+ bool do_set_rv, sy_thr_static, traced;
VM_CNT_INC(v_syscall);
p = td->td_proc;
@@ -98,6 +98,10 @@
PROC_UNLOCK(p);
if ((td->td_dbgflags & TDB_USERWR) != 0) {
+ PROC_LOCK(p);
+ td->td_dbgflags &= ~TDB_USERWR;
+ PROC_UNLOCK(p);
+
/*
* Reread syscall number and arguments if debugger
* modified registers or memory.
@@ -203,12 +207,16 @@
(uintptr_t)td, "pid:%d", td->td_proc->p_pid, "error:%d", error,
"retval0:%#lx", td->td_retval[0], "retval1:%#lx",
td->td_retval[1]);
+ do_set_rv = true;
if (__predict_false(traced)) {
PROC_LOCK(p);
- td->td_dbgflags &= ~(TDB_SCE | TDB_BOUNDARY);
+ if ((td->td_dbgflags & TDB_USERWR) != 0)
+ do_set_rv = false;
+ td->td_dbgflags &= ~(TDB_SCE | TDB_BOUNDARY | TDB_USERWR);
PROC_UNLOCK(p);
}
- (p->p_sysent->sv_set_syscall_retval)(td, error);
+ if (__predict_true(do_set_rv))
+ (p->p_sysent->sv_set_syscall_retval)(td, error);
if (error != 0 && (td->td_pflags2 & TDP2_UEXTERR) != 0)
exterr_copyout(td);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 26, 7:52 AM (16 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33526679
Default Alt Text
D53482.diff (1 KB)
Attached To
Mode
D53482: syscalls: if ptrace(PT_SETREG) occured during syscall, do not do set_syscall_retval()
Attached
Detach File
Event Timeline
Log In to Comment