Page MenuHomeFreeBSD

D61597.1794849810.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D61597.1794849810.diff

diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -1050,7 +1050,10 @@
void *addr;
int data, error, i;
- error = 0;
+ error = ptrace_check_allowed(td, req, pd_mode, pid);
+ if (error != 0)
+ return (error);
+
addr = &r;
data = udata;
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
@@ -709,7 +709,7 @@
return (error);
}
-static int
+int
ptrace_check_allowed(struct thread *td, int req, bool pd_mode, pid_t pid)
{
if (!allow_ptrace)
diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h
--- a/sys/sys/ptrace.h
+++ b/sys/sys/ptrace.h
@@ -292,6 +292,8 @@
#endif
void ptrace_unsuspend(struct proc *p);
+int ptrace_check_allowed(struct thread *td, int req, bool pd_mode,
+ pid_t pid);
int ptrace_action(struct thread *td, int req, bool pd_mode, pid_t pid,
int pfd, lwpid_t lwpid, void *addr, int data);

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 16, 5:23 PM (17 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41785005
Default Alt Text
D61597.1794849810.diff (1 KB)

Event Timeline