Skip to content

Left-running service description can name an unrelated process if a member's PID is reused #2260

Open

Description

@AbirAbbas

Found by the review of #2039, which ported the existing Linux path to macOS.

describe in internal/executor/service.go lists a process group's members (processgroup.Members), then reads the naming member's argv with cmdline(pid) in a separate step. If that member exits and its PID is reused in between, the report can carry an unrelated process's argv. Linux has had this order since before #2039 (it reads /proc//cmdline after the member walk), and #2039 brings the same order to macOS.

Impact: it affects only the label and argv in a left-running service report. Membership, ports and the process group itself are unaffected. On macOS PIDs are allocated sequentially, so reuse inside that window is unlikely. The fix would be to re-check that the PID is still in the group (and has the same start time) after reading argv, on both OSes.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions