config-linux: Clearer punt to kernel for linux.devices#829
Closed
wking wants to merge 1 commit intoopencontainers:masterfrom
Closed
config-linux: Clearer punt to kernel for linux.devices#829wking wants to merge 1 commit intoopencontainers:masterfrom
wking wants to merge 1 commit intoopencontainers:masterfrom
Conversation
12469b2 to
05d9130
Compare
05d9130 to
89b13e5
Compare
Member
|
Adding this to the label for a next release. If you feel particular for 1.0.0, state so. |
Contributor
Author
|
On Wed, May 24, 2017 at 08:44:30AM -0700, v1.0.0.batts wrote:
If you feel particular for 1.0.0, state so.
Without this PR, there are no runtime-oriented MUST-level requirements
for linux.devices. A runtime can ignore linux.devices and still be
compliant. More on this issue in #746. So if we punt this to
post-1.0, we will certify those runtimes as “1.0 compliant” if anyone
submits them for certification.
|
89b13e5 to
b486f4b
Compare
This is a bit awkward, since: * It's not a direct wrapper around mknod(2) (which, for example, does not use the c/b/u/p characters). * The runtime doesn't have to use mknod, so binding it to mknod(1)-ish invocations doesn't make much sense. Instead, I've bound it to POSIX's stat(3) to show what compliance testing (and anything else inside the container) can expect the results (however the runtime accomplishes them) to look like. The previous wording wasn't clear on whether symlinks were an allowed approach. The new wording explicitly allows them by using stat(1)-like symlink resolution. I've also clarified relative 'path' handling and explicitly declared the appropriate mount namespace (impacts 'path') and PID namespace (impacts 'uid' and 'gid'). Because we're focused on post-create stat calls, I've also added new wording about handling duplicate 'path' values. I've used POSIX reference where possible (vs. Linux man pages), because they contain sufficient detail for this section, have well-versioned URLs, and are more likely to be portable if this section ever applies to non-Linux configs (BSD? Solaris?). Related to recent discussion around punting to the kernel [1,2], although in this case we're not changing the JSON Schema because the existing local validation (valid 'type' characters and the 'fileMode' range) both feed into a single mode_t integer in the stat(3) and mknod(2) APIs. For a cleaner kernel punt, we could drop 'type', lift the range limit on 'fileMode', and map it directly to st.st_mode. But that seemed like a big backwards-compat shift for this commit. [1]: opencontainers#780 [2]: opencontainers#690 (comment) Signed-off-by: W. Trevor King <wking@tremily.us>
Contributor
Author
Member
|
We don't want to bind the spec to kernel headers and specific implementations. |
Contributor
Author
This was not binding the spec to kernel headers, it was binding it to headers defined by POSIX. See also “I've used POSIX reference where possible…” in the topic post for this PR. The only non-POSIX portion of this PR is So the only way to access those major/minor numbers is through some Linux-specific interface like major(3)/minor(3) or bit-shifting (like runtime-tools does). |
wking
added a commit
to wking/opencontainer-runtime-spec
that referenced
this pull request
Jun 6, 2017
I'd rather address runtime compliance by breaking this down into explicit checks based on POSIX stat(3) calls. But with that approach rejected [1], mentioning symlinks here helps motivate runtime-tools' choice of os.Stat [2,3] (which follows symlinks) vs. os.Lstat (which does not [4]). [1]: opencontainers#829 (comment) [2]: https://github.com/opencontainers/runtime-tools/blob/f5c82b3918bdfc3ed4b594dcfab4d1554beaf992/cmd/runtimetest/main.go#L319 [3]: https://golang.org/pkg/os/#Stat [4]: https://golang.org/pkg/os/#Lstat Signed-off-by: W. Trevor King <wking@tremily.us>
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.
This is a bit awkward, since:
mknod(2)(which, for example, does not use thec/b/u/pcharacters).mknod(2), so binding it tomknod(1)-ish invocations doesn't make much sense.Instead, I've bound it to POSIX's
stat(3)to show what compliance testing (and anything else inside the container) can expect the results (however the runtime accomplishes them) to look like.The previous wording wasn't clear on whether symlinks were an allowed approach. The new wording explicitly allows them by using
stat(1)-like symlink resolution.I've also clarified relative
pathhandling and explicitly declared the appropriate mount namespace (impactspath) and PID namespace (impactsuidandgid).Because we're focused on post-create stat calls, I've also added new wording about handling duplicate
pathvalues.I've used POSIX reference where possible (vs. Linux man pages), because they contain sufficient detail for this section, have well-versioned URLs, and are more likely to be portable if this section ever applies to non-Linux configs (BSD? Solaris?).
Related to recent discussion around #690, #780 and punting to the kernel, although in this case we're not changing the JSON Schema because the existing local validation (valid
typecharacters and thefileModerange) both feed into a singlemode_tinteger in thestat(3)andmknod(2)APIs. For a cleaner kernel punt, we could droptype, lift the range limit onfileMode, and map it directly tost.st_mode. But that seemed like a big backwards-compat shift for this PR.