libcontainer: improve "kernel.{domainname,hostname}" sysctl handling#1827
Merged
hqhq merged 1 commit intoopencontainers:masterfrom Jun 25, 2018
cyphar:domainname-sysctl-validator
Merged
libcontainer: improve "kernel.{domainname,hostname}" sysctl handling#1827hqhq merged 1 commit intoopencontainers:masterfrom cyphar:domainname-sysctl-validator
hqhq merged 1 commit intoopencontainers:masterfrom
cyphar:domainname-sysctl-validator
Conversation
These sysctls are namespaced by CLONE_NEWUTS, and we need to use "kernel.domainname" if we want users to be able to set an NIS domainname on Linux. However we disallow "kernel.hostname" because it would conflict with the "hostname" field and cause confusion (but we include a helpful message to make it clearer to the user). Signed-off-by: Aleksa Sarai <asarai@suse.de>
This was referenced Jun 18, 2018
Member
Author
|
This is a part of moby/moby#37302. |
dqminh
reviewed
Jun 19, 2018
| switch s { | ||
| case "kernel.domainname": | ||
| // This is namespaced and there's no explicit OCI field for it. | ||
| continue |
Contributor
There was a problem hiding this comment.
i dont think we need to explicitly single out kernel.domainname here since its not a TODO for OCI either right ?
Member
Author
There was a problem hiding this comment.
This code is allowing kernel.domainname -- which is why it needs to be singled out (the comment explains why it's allowed and kernel.hostname isn't). If you try to use kernel.domainname without this patch it will fail because runc thinks its not namespaced and fails container creation.
We also can't enable everything under kernel..
Contributor
Member
Author
|
/cc @opencontainers/runc-maintainers |
Contributor
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.
These sysctls are namespaced by CLONE_NEWUTS, and we need to use
"kernel.domainname" if we want users to be able to set an NIS domainname
on Linux. However we disallow "kernel.hostname" because it would
conflict with the "hostname" field and cause confusion (but we include a
helpful message to make it clearer to the user).
Signed-off-by: Aleksa Sarai asarai@suse.de