Skip to content

proc: include values in /proc/net/netstat#13275

Open
Haihan-Jiang wants to merge 1 commit into
google:masterfrom
Haihan-Jiang:codex/gvisor-netstat-values
Open

proc: include values in /proc/net/netstat#13275
Haihan-Jiang wants to merge 1 commit into
google:masterfrom
Haihan-Jiang:codex/gvisor-netstat-values

Conversation

@Haihan-Jiang
Copy link
Copy Markdown

Fixes #13151.

/proc/net/netstat currently emits only the TcpExt field-name row in gVisor. Linux emits netstat rows in name/value pairs, and consumers such as metric parsers expect the value row to have the same number of fields as the header row. Without the value row, parsers report a field-count mismatch.

This change keeps the existing TcpExt fields and emits a matching TcpExt value row populated with zeroes for the stats gVisor does not track yet. That resolves the header/data length mismatch without pretending to implement non-zero counters.

I also added a proc unit test for matching name/value field counts and enabled the existing /proc/net/netstat syscall format check under gVisor.

Validation:

  • gofmt -w pkg/sentry/fsimpl/proc/task_net.go pkg/sentry/fsimpl/proc/tasks_sys_test.go
  • git diff --check
  • attempted bazel test //pkg/sentry/fsimpl/proc:proc_test //test/syscalls/linux:proc_net_test on macOS; local Bazel failed before executing tests due the host toolchain missing C++ standard library headers for external deps.
  • attempted SDKROOT=$(xcrun --show-sdk-path) ... bazel test //pkg/sentry/fsimpl/proc:proc_test; local Bazel then failed before executing tests because /usr/bin/aarch64-linux-gnu-gcc is not installed.
  • attempted go test ./pkg/sentry/fsimpl/proc; unsupported for this repo checkout because generated proto packages/build-constrained files are provided through Bazel.

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.

/proc/*/net/netstat is missing the value row

1 participant