Skip to content

fix(linux): keep attribution for connections that predate startup - #575

Merged
domcyrus merged 4 commits into
mainfrom
fix/pre-drop-attribution-fallback
Aug 28, 2026
Merged

fix(linux): keep attribution for connections that predate startup#575
domcyrus merged 4 commits into
mainfrom
fix/pre-drop-attribution-fallback

Conversation

@domcyrus

@domcyrus domcyrus commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Keep validated startup attribution for connections that predate RustNet.
  • On Linux 5.11+, inventory pre-existing socket owners with a one-shot BPF task-file iterator after attaching the live probes.
  • Merge BPF and procfs owners by inode, rejecting sockets shared across processes as ambiguous.
  • Keep the live fentry/kprobe tracker when the optional iterator is unavailable.
  • Require no capabilities beyond the existing CAP_BPF and CAP_PERFMON eBPF setup.

Snapshot matches still require the same tuple, socket inode, PID, and process name. Live attribution always wins.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --workspace --all-features
  • cargo audit (two allowed transitive warnings)

Includes an ignored real-kernel iterator test for privileged execution.

Scope

  • No new dependencies
  • User-visible change documented under CHANGELOG.md Unreleased
  • English, Chinese, and Japanese user documentation synchronized

@domcyrus
domcyrus force-pushed the fix/pre-drop-attribution-fallback branch 5 times, most recently from 4752bbf to 66fed7c Compare August 23, 2026 12:32
@domcyrus
domcyrus force-pushed the fix/pre-drop-attribution-fallback branch from 66fed7c to 11a8a04 Compare August 23, 2026 12:45
The shared-inode rejection now applies only to the startup snapshot. The
live procfs table keeps a deterministic owner (lowest PID), so a
pre-forking server's inherited listener stays attributable.

Also validate the snapshot owner's start time: comm alone does not
survive PID reuse.
@domcyrus
domcyrus merged commit 4da0d53 into main Aug 28, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant