Repository navigation
fix(pcap): validate selected resource limiter before capture - #7947
Conversation
[Medium impact] The PR appears safe to merge; both previous findings are addressed and no new blocking issue was found. SummaryThe PR rejects invalid Linux limiter selections before opening capture bytes. The latest changes address both previous findings:
No new actionable issues were found. Review was source-based; no tests were run. Whether another PR supersedes this one could not be checked because GitHub access required authentication. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Selected Linux limiter] --> B[Require regular executable file]
B --> C[Check version banner]
C --> D[Check required flags in help]
D --> E[Prepare resource limits]
E --> F[Acquire capture snapshot]
B -->|Rejected| G[Limiter-specific refusal]
C -->|Rejected| G
D -->|Rejected| G
Reviews (2) · Last reviewed commit: "fix(pcap): verify limiter capabilities a..." · Reviewed by Greptile |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Fixes #7292. Selecting a directory or an executable that is not util-linux prlimit could be reported as a capinfos failure or unreadable capture output. Limiter admission now rejects these selections with the configured path and
REA_TSHARK_PRLIMIT_COMMANDguidance before acquiring the capture.Problem and expected behavior
A directory can pass executable-access checks, while a non-limiter such as
/usr/bin/trueexits successfully without launching capinfos. The configured limiter must be a regular executable and report the expected util-linux version banner. A differently named selected symlink remains valid; the comparison retains its literal basename, including whitespace.Change and scope
The native-bound owner performs regular-file and version admission; the provider runs the version probe through its supervised command lifecycle and verifies selected-path identity. Cancellation, identity changes and incomplete cleanup retain their typed outcomes. Invalid UTF-8 probe output is attributed to the limiter, with captured output and diagnostics preserved.
Contract and boundary impact
Expected effects:
Evidence and regression coverage
Producer tests cover directory and non-limiter refusals, renamed and whitespace-bearing symlink names, malformed probe output, cancellation, identity changes and incomplete cleanup. A Linux-only provider regression covers a real prlimit through renamed symlinks and failure before opening the capture; it was skipped on this macOS host. The version banner establishes that the selected executable identifies itself as util-linux prlimit; it does not prove that an untrusted executable enforces resource limits.
Validation performed
npm run test:local -- src/pcap/PcapNativeBound.test.ts— 6 passed.npm run check:fast— passed.npm run test:focused -- tests/boundary/pcap/pcapProvider.test.ts tests/boundary/process/artifactSelectedCommand.test.ts— 9 passed, 37 Linux-only tests skipped on macOS; run occurred before the final whitespace control was added.git diff --check— passed.Compatibility, safety, and release
The selected Linux limiter now has a version probe and must identify itself as util-linux prlimit. Existing selected paths and output are preserved. The limiter remains trusted; its banner does not establish resource enforcement.
Author readiness
Human owner: @morluto
Before merge
type(scope): outcome.