-
Notifications
You must be signed in to change notification settings - Fork 791
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
Fix path substitution to enable setting sysctls on vlan interfaces #779
Conversation
be73a6a
to
e657ad7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm, do you mind adding some tests for this? @mmirecki
/lgtm too. Thanks, @mmirecki ! |
To test it properly it would have to be tested with namespaces sysctl's, which is currently not doable with the current test framwork. Currently we test the sysctl's with "net.ipv4.conf.all" which would work here. |
@mmirecki this is a potential directory traversal issue, since we don't actually validate that IFNAME is sane. Can you check to make sure that IFNAME doesn't contain any "/"? We should also add a check to ensure that the resolved path doesn't escape |
e657ad7
to
81a6a3b
Compare
Added validateArgs to validate the interface name does not contain any path separators. |
This commit changes the order of substituting sysctl path to first handle . to / change, before substituting the interface name. This is needed as vlan interfaces have a . in the name, which should not be changed. Signed-off-by: mmirecki <mmirecki@redhat.com>
81a6a3b
to
198ab12
Compare
@squeed could you please look again? Added the requested validation |
/lgtm |
Fix path substitution to enable setting sysctls on vlan interfaces
This commit changes the order of substituting sysctl path to first handle . to / change, before substituting the interface name. This is needed as vlan interfaces have a . in the name, which should not be changed.