-
Notifications
You must be signed in to change notification settings - Fork 557
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
config-linux: Clearer punt to kernel for linux.devices #829
Conversation
12469b2
to
05d9130
Compare
05d9130
to
89b13e5
Compare
Adding this to the label for a next release. If you feel particular for 1.0.0, state so. |
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 <[email protected]>
We don't want to bind the spec to kernel headers and specific implementations. |
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). |
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 <[email protected]>
This is a bit awkward, since:
mknod(2)
(which, for example, does not use thec
/b
/u
/p
characters).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
path
handling and explicitly declared the appropriate mount namespace (impactspath
) and PID namespace (impactsuid
andgid
).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 #690, #780 and punting to the kernel, although in this case we're not changing the JSON Schema because the existing local validation (valid
type
characters and thefileMode
range) both feed into a singlemode_t
integer 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.