* PTRACE_GET_SYSCALL_INFO requires PTRACE_O_TRACESYSGOOD but not documented
@ 2022-05-28 6:03 Nate Eldredge
0 siblings, 0 replies; only message in thread
From: Nate Eldredge @ 2022-05-28 6:03 UTC (permalink / raw)
To: linux-kernel
It seems that the PTRACE_GET_SYSCALL_INFO function of ptrace(2) only works
properly if the tracer has set the PTRACE_O_TRACESYSGOOD option. The man
page doesn't mention this requirement. Is it intentional?
The issue is that ptrace_get_syscall_info() in kernel/ptrace.c only calls
the ptrace_get_syscall_info_{entry,exit} functions to fully populate the
ptrace_syscall_info struct if child->last_siginfo->si_code == SIGTRAP |
0x80. And the 0x80 bit is only set when PTRACE_O_TRACESYSGOOD is in
effect. Otherwise, the struct always comes back to userspace with op ==
PTRACE_SYSCALL_INFO_NONE and the entry (or exit) member is not filled in
with the system call arguments (or return value).
--
Nate Eldredge
nate@thatsmathematics.com
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-28 6:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-28 6:03 PTRACE_GET_SYSCALL_INFO requires PTRACE_O_TRACESYSGOOD but not documented Nate Eldredge
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.