Bug 498103 - Clean up/merge linux sys_ptrace PRE/POST wrappers
Summary: Clean up/merge linux sys_ptrace PRE/POST wrappers
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.24 GIT
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-31 22:48 UTC by Mark Wielaard
Modified: 2024-12-31 22:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Wielaard 2024-12-31 22:48:33 UTC
Most linux arches have architecture specific POST/PRE(sys_ptrace) wrappers.
But they only handle a subset of (current) ptrace commands.

The linux-riscv port (bug #468575) adds a default case:
VG_(umsg)("WARNING: unhandled ptrace request %ld.\n", SARG1);

Which produces:
==173031== WARNING: unhandled ptrace request 16.
==173031== WARNING: unhandled ptrace request 17.
(which is PTRACE_ATTACH and PTRACE_DETACH also not explicitly handled by any other linux arch)

linux-ppc32 doesn't wrap ptrace at all.

There are some generic ptrace helpers:
linux_POST_getregset/linux_PRE_setregset/linux_PRE_getregset/linux_POST_traceme

None of the newer linux ptrace commands are handled though.
For example:

PTRACE_GET_SYSCALL_INFO
PTRACE_SECCOMP_GET_FILTER
PTRACE_SETSIGMASK
PTRACE_GETSIGMASK
PTRACE_PEEKSIGINFO