Skip to content

feat(linux): the Processes table lists the processes hidepid hides while the helper runs (#2728) - #2979

Merged
mgradwohl merged 5 commits into
mainfrom
feat/helper-hidepid-merge-2728
Oct 26, 2026
Merged

mgradwohl merged 5 commits into
mainfrom
feat/helper-hidepid-merge-2728

Conversation

@mgradwohl

Copy link
Copy Markdown
Owner

Description

Part of #2728: slice 3 of 3 for "processes hidden by hidepid (the helper lists them)", after #2972 (the parsing seam, protocol v6 and the helper reader). With this, the Processes table lists the processes hidepid hides from TaskSmack whenever a helper session is running.

PR Size

✅ Small to medium (~170 lines, 9 files).

Type of Change

  • New feature (non-breaking change that adds functionality)

Checklist

  • I have read the CONTRIBUTING guidelines
  • My code follows the project's coding standards
  • I have run clang-tidy and addressed any warnings
  • I have run clang-format on my changes
  • I have run pre-commit run --all-files or installed pre-commit hooks
  • I have added tests that prove my fix/feature works
  • All new and existing tests pass
  • I have updated documentation as needed

Testing

TASKSMACK_REQUIRE_DISPLAY=1 TASKSMACK_REQUIRE_SDBUS=1 xvfb-run -a env -u WAYLAND_DISPLAY ctest --preset debug -j 4   # 683/683

New tests, with a MockProcessProbe::setProcessFromFiles hook:

  • BrokeredProcessProbeTest.ProcessesHidepidHidesAreListedByTheHelperAndJoinTheList:
    • the request carries the visible PIDs;
    • the hidden process joins the list;
    • a record whose start time changed is dropped;
    • the counters read covers the hidden process;
    • no call ever waits behind another.
  • …NothingHiddenOrAHelperThatRefusesMeansNoListing: nothing is asked when nothing is hidden, and a helper that answers with an error is asked once.

Additional Notes

v0.10.0, no backport. The rest of #2728's Linux list is service actions through the helper. That needs a design call, because the helper's seccomp filter (#2752) forbids the new socket a D-Bus connection to systemd needs, so I'll raise it with the maintainer before writing code.

🤖 Generated with Claude Code

mgradwohl and others added 5 commits October 25, 2026 19:58
…, and processFromFiles() builds a record from text alone (#2728)

The first of three slices for listing processes hidepid hides from TaskSmack
(the maintainer chose a fixed file allow-list the helper returns as text):
stat, statm, status, io and cgroup each split into the read through the
/proc/[pid] handle, unchanged, and an apply...() on the text. The new
processFromFiles(pid, ProcFileTexts) composes those, applyCmdline() and
readProcessCommand()'s zombie rule into the record enumerate() builds, with
the FD count and network counters left for the helper's counters read.
No behavior change for enumerate().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ads the processes hidepid hides as a fixed set of their /proc files (#2728)

The second of three slices: HiddenProcessesRequest names the PIDs TaskSmack
already sees; the helper lists every other process under /proc and returns,
for each, its start time and the text of stat, statm, status, cmdline, io
and cgroup only (HiddenProcessesRead.h), each capped at MAX_STRING_BYTES. The
reply stops short of a frame, or of MAX_HIDDEN_PROCESSES, and says it was cut.
Windows' helper answers it with an error (no hidepid).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ile the helper runs (#2728)

The third slice: IProcessProbe gains processFromFiles() (ProcFileTexts moves
to ProcessTypes.h; LinuxProcessProbe's is the override), and
BrokeredProcessProbe, when the probe's capabilities say processes are hidden
and a helper session is running, sends ListHiddenProcesses with the PIDs it
sees, builds each hidden process's record from its files' text, keeps it only
when its start time matches the helper's, and appends it before the counters
read, which then fills its FD count, I/O and network like any refused
process's. A helper that answers with an error isn't asked again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ile the helper runs (#2728)

The third slice: IProcessProbe gains processFromFiles() (ProcFileTexts moves
to ProcessTypes.h; LinuxProcessProbe's is the override), and
BrokeredProcessProbe, when the probe's capabilities say processes are hidden
and a helper session is running, sends ListHiddenProcesses with the PIDs it
sees, builds each hidden process's record from its files' text, keeps it only
when its start time matches the helper's, and appends it before the counters
read, which then fills its FD count, I/O and network like any refused
process's. A helper that answers with an error isn't asked again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mgradwohl mgradwohl added this to the v0.10.0 milestone Oct 26, 2026
@mgradwohl mgradwohl added enhancement New feature or request linux testing Platform agent:WSL Owned by the Linux/WSL Claude session (bug-fix conveyor) labels Oct 26, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

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

Labels

agent:WSL Owned by the Linux/WSL Claude session (bug-fix conveyor) documentation Improvements or additions to documentation enhancement New feature or request linux Platform testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant