Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use /proc/sys/net/core/dev_weight to determine if we are in the root netns. #10711

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

copybara-service[bot]
Copy link

Use /proc/sys/net/core/dev_weight to determine if we are in the root netns.

After 19249c0724f2 ("net: make net.core.{r,w}mem_{default,max} namespaced")
/proc/sys/net/core/rmem_default is present in non-initial netns as well.

/proc/sys/net/core/dev_weight has existed from the beginning of Linux git repo
in 1da177e4c3f4 ("Linux-2.6.12-rc2"). So it should be safe to use this file.

Demo:

$ sudo ip netns add foo
$ sudo ip netns exec foo stat /proc/sys/net/core/dev_weight
stat: cannot statx '/proc/sys/net/core/dev_weight': No such file or directory
$ sudo ip netns delete foo

Fixes #10704

@copybara-service copybara-service bot added the exported Issue was exported automatically label Jul 31, 2024
…netns.

After 19249c0724f2 ("net: make net.core.{r,w}mem_{default,max} namespaced")
/proc/sys/net/core/rmem_default is present in non-initial netns as well.

/proc/sys/net/core/dev_weight has existed from the beginning of Linux git repo
in 1da177e4c3f4 ("Linux-2.6.12-rc2"). So it should be safe to use this file.

Demo:
```
$ sudo ip netns add foo
$ sudo ip netns exec foo stat /proc/sys/net/core/dev_weight
stat: cannot statx '/proc/sys/net/core/dev_weight': No such file or directory
$ sudo ip netns delete foo
```

Fixes #10704

PiperOrigin-RevId: 658087447
@copybara-service copybara-service bot merged commit 19f6b0c into master Jul 31, 2024
0 of 2 checks passed
@copybara-service copybara-service bot deleted the test/cl658068358 branch July 31, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exported Issue was exported automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/proc/sys/net/core/rmem_default is visible in non-root network namespaces in recent Linux kernels
1 participant