HomeFreeBSD

linux: Fix usage of ptrace(PT_GET_SC_ARGS)

Description

linux: Fix usage of ptrace(PT_GET_SC_ARGS)

The native handler expects the argument to be a pointer to an array of 8
syscall arguments, whereas the emulation provided an array that holds up
to 6.

Handle this by adding a new range of Linuxulator-specific ptrace
commands. In particular, introduce PTLINUX_GET_SC_ARGS, which always
copies exactly six arguments. This fixes the problem and removes the
hack of checking the target thread ABI to decide whether to apply a
Linux-specific quirk to PT_GET_SC_ARGS.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D50758

(cherry picked from commit 48a656c588f9fb995b9c524b57dd5febd9f69168)

Details

Provenance
markjAuthored on Jun 13 2025, 7:03 PM
Reviewer
kib
Differential Revision
D50758: linux: Fix usage of ptrace(PT_GET_SC_ARGS)
Parents
rGf56b66f1260a: tests: Add a regression test for commit 7587f6d4840f8
Branches
Unknown
Tags
Unknown