Repository navigation
feat(linux): tasksmack-helper's socket inodes attribute other users' connections in the Processes table (#2728) - #2947
Merged
Conversation
…tes for the Processes table (#2728) Protocol v4 adds a batched ReadProcessCounters request: one round trip for every process whose handle count or /proc/[pid]/io the probe was refused. The helper checks each target's start time, counts /proc/[pid]/fd and parses /proc/[pid]/io with the parser LinuxProcessProbe now shares (ProcIoParser.h), leaving out a target that has gone or been reused. BrokeredProcessProbe asks only while a helper session is already held (callIfIdle, 1 s timeout), never prompts, and stops asking after an ErrorReply from an older helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…2728) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… read (#2728) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ounters-2728 # Conflicts: # tasksmack.md
…connections in the Processes table (#2728) Protocol v5: ReadProcessCounters can ask for each process's socket inodes (withSockets), and each entry carries them behind a third flags bit, capped at MAX_COUNTER_SOCKET_INODES over the reply. The helper reads every /proc/[pid]/fd link for them after the start-time check. BrokeredProcessProbe asks for sockets at the inode map's cadence (INODE_PID_CACHE_TTL_MS), for the processes whose links were refused, and readSocketTraffic() credits the connections the probe's own map left unowned to them, with their start time. Between asks the last read's processes keep their network columns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ers; tidy (#2728) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
mgradwohl
enabled auto-merge (squash)
October 25, 2026 22:56
mgradwohl
disabled auto-merge
October 26, 2026 00:04
mgradwohl
enabled auto-merge (squash)
October 26, 2026 00:04
This was referenced Oct 26, 2026
mgradwohl
added a commit
that referenced
this pull request
Oct 26, 2026
… pinned clang-format, as CI does (#3022) (#3023) It used the PATH clang-format, which can differ from the mirrors-clang-format rev CI pins (#2947 passed it locally with 22.1.2 and failed CI's 22.1.8). With pre-commit installed the hook now runs its clang-format hook on the file; without it, it falls back to the PATH binary and says so. Fixes #3022 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of #2728 (Linux helper coverage, after #2938): with the helper held, the Processes table's Net Sent and Net Received now cover other users' processes. The probe attributes each connection by mapping socket inodes to PIDs through
/proc/<pid>/fdlinks. Another user's links are refused, so those connections stayed unowned and the columns read unavailable.ProcessCountersRequest::withSockets(one byte, 0 or 1). EachProcessCountersEntrycarriessocketInodesbehind a third flags bit (4). Any other flag bit, or inodes without that bit, is refused. Inodes are capped atMAX_COUNTER_SOCKET_INODES(2^18) across the whole reply; an entry that would pass the cap goes back without its sockets but keeps its other figures.readProcessCountersAt(..., withSockets)reads every fd link through the same/proc/<pid>handle, after the start-time check.socketsReadis set only when the listing finished and no link was refused.BrokeredProcessProbeasks for sockets at the inner inode map's cadence (INODE_PID_CACHE_TTL_MS), not on every refresh, and only for processes whose network counters were refused (and only when the probe has network counters).readSocketTraffic()credits the connections the inner map left unowned to the helper's owners, with their start time. Between asks, the last read's processes keep their network columns. Like feat(linux): tasksmack-helper reads other users' FD counts and I/O bytes for the Processes table (#2728) #2938, it only uses a helper that's already running, never prompts, and stops asking after anErrorReply.helper-handshake.py's v5 Hello, and docs in tasksmack.md and the FAQ.PR Size
Type of Change
Checklist
clang-tidyand addressed any warningsclang-formaton my changespre-commit run --all-filesor installed pre-commit hooksTesting
cmake --build --preset debug -j 4 TASKSMACK_REQUIRE_DISPLAY=1 TASKSMACK_REQUIRE_SDBUS=1 xvfb-run -a env -u WAYLAND_DISPLAY ctest --preset debug -j 4 # 682/682New or changed tests:
BrokerProtocolTest: thewithSocketsround trip and its 0/1 byte; the sockets flag bit; inodes refused without it;AnEntryWhoseSocketsWouldPassTheCapGoesWithoutThem.ProcessCountersReadTest.WithSocketsListsTheInodeOfASocketItHolds, which opens a socket and finds itsst_ino.BrokeredProcessProbeTest.TheHelpersSocketInodesAttributeConnectionsTheProbeLeftUnowned: one ask, attribution of the matching inode only, no second ask before the cadence, and the attribution still standing.PkexecBrokerTest...ProcessCountersnow asks for sockets from the real helper under its enforcing seccomp filter ([Security] tasksmack-helper: add a seccomp allow-list (and maybe Landlock) after the capability drop; UID 0 + CAP_SYS_PTRACE isn't containment #2752), so the link reads are covered by the allow-list.Additional Notes
v0.10.0, no backport. Still to do for #2728 on Linux: hidepid listing through the helper, service actions, and the title bar's text.
🤖 Generated with Claude Code