Skip to content

x/sys: new syscall.PtraceInterrupt for linux #34755

Closed

Description

@pjbgf

A new func inside syscall to expose the use of PTRACE_INTERRUPT.

PTRACE_INTERRUPT (since Linux 3.4)
Stop a tracee. If the tracee is running or sleeping in kernel
space and PTRACE_SYSCALL is in effect, the system call is
interrupted and syscall-exit-stop is reported. (The inter‐
rupted system call is restarted when the tracee is restarted.)
If the tracee was already stopped by a signal and PTRACE_LIS‐
TEN was sent to it, the tracee stops with PTRACE_EVENT_STOP
and WSTOPSIG(status) returns the stop signal. If any other
ptrace-stop is generated at the same time (for example, if a
signal is sent to the tracee), this ptrace-stop happens. If
none of the above applies (for example, if the tracee is run‐
ning in user space), it stops with PTRACE_EVENT_STOP with
WSTOPSIG(status) == SIGTRAP. PTRACE_INTERRUPT only works on
tracees attached by PTRACE_SEIZE.
source: ptrace in Linux

The flag already exists in the codebase:

PTRACE_INTERRUPT = 0x4207

Activity

  1. added this to the Proposal milestone on Oct 8, 2019
  2. gopherbot commented on Oct 8, 2019

    @gopherbot
    Contributor

    Change https://golang.org/cl/199504 mentions this issue: unix: add new func PtraceInterrupt on Linux

  3. changed the title [-]proposal: x/sys: new syscall.PtraceInterrupt for linux[/-] [+]x/sys: new syscall.PtraceInterrupt for linux[/+] on Oct 8, 2019
  4. locked and limited conversation to collaborators on Oct 7, 2020
  5. added a commit that references this issue on Jun 7, 2024
    543471e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions