Bug 498103

Summary: Clean up/merge linux sys_ptrace PRE/POST wrappers
Product: [Developer tools] valgrind Reporter: Mark Wielaard <mark>
Component: generalAssignee: Julian Seward <jseward>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 3.24 GIT   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=468575
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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