sysctl: accept slash-separated sysctl names - #2551
Closed
ijajmulani wants to merge 1 commit into
Closed
ijajmulani wants to merge 1 commit into
ijajmulani wants to merge 1 commit into
Conversation
Signed-off-by: Ijaj Mulani <ijaj.mulani@cohesity.com>
|
This repository has been migrated to https://github.com/containers/container-libs. Please open your PR there. |
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.
What this PR does / why we need it
Podman rejects slash-separated sysctl keys with:
sysctl 'net/ipv6/conf/bond1.340/autoconf' is not allowedpkg/sysctl.Validate()only accepts keys whose normalized form matches prefixes likenet.orfs.mqueue.. Slash-first sysctl names are valid persysctl.d(5)but fail the prefix check. This is a problem for network interfaces whose names contain dots (e.g. VLAN interfaces likebond1.340). For those, slash-first notation is required to set per-interface sysctls such asnet/ipv6/conf/bond1.340/autoconf.Which issue(s) this PR fixes
N/A (no existing issue filed)
Special notes for reviewers
opencontainers/runc#3257.
preserved in the returned map passed to the runtime.
Podman's allowlist validation in
containers/common.User-visible impact
Users can pass slash-separated sysctls to Podman, e.g.:
Dot-first escaped form (net.ipv6.conf.bond1/340.autoconf=0) was already accepted by prefix check; slash-first form was not.
How this was tested
go test ./pkg/sysctl/
Unit tests for convertSysctlVariableToDotsSeparator() and slash-separated VLAN interface keys
Manual: podman run --sysctl net/ipv6/conf/bond1.340/autoconf=0 with macvlan/ipvlan on a VLAN parent interface