Skip to content
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

rebase: config: Make capabilities, noNewPrivileges, and rlimits Linux-only (again) #880

Merged

Conversation

dqminh
Copy link
Contributor

@dqminh dqminh commented Jul 5, 2017

This rebased @wking's #835 changes, and added a clarification on POSIX-specific properties such as rlimits.

Roll back the genericization from 718f9f3 (minor narrative cleanup
regarding config compatibility, 2017-01-30, opencontainers#673).  Lifting the
restriction there seems to have been motivated by "Solaris supports
capabilities", but that was before the split into a capabilities
object which happened in eb114f0 (Add ambient and bounding capability
support, 2017-02-02, opencontainers#675).  It's not clear if Solaris supports
ambient caps, or what Solaris API noNewPrivileges were punting to [1].
And John Howard has recently confirmed that Windows does not support
capabilities and is unlikely to do so in the future [2].  He also
confirmed that Windows does not support rlimits [3].  John's statement
didn't directly address noNewPrivileges, but we can always restore any
of these properties to the Solaris/Windows platforms if/when we get
docs about which API we're punting to on those platforms.

Also add some backticks, remove the hyphens in "OPTIONAL) - the",
standardize lines I touch to use "the process" [4], and use four-space
indents here to keep Pandoc happy (see 7795661 (runtime.md: Fix
sub-bullet indentation, 2016-06-08, opencontainers#495).

[1]: opencontainers#673 (comment)
[2]: opencontainers#810 (comment)
[3]: opencontainers#835 (comment)
[4]: opencontainers#809 (comment)

Signed-off-by: W. Trevor King <[email protected]>
// LinuxRlimit type and restrictions
type LinuxRlimit struct {
// POSIXRlimit type and restrictions
type POSIXRlimit struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ugly but i suppose this lints correctly.

@vbatts
Copy link
Member

vbatts commented Jul 5, 2017

LGTM

Approved with PullApprove

config.md Outdated
* **`hard`** (uint64, REQUIRED) - the ceiling for the soft limit that could be set by an unprivileged process.
Only a privileged process (e.g. under Linux: one with the CAP_SYS_RESOURCE capability) can raise a hard limit.
* **`type`** (string, REQUIRED) the platform resource being limited.
* Linux: valid values are defined in the [`getrlimit(2)`][setrlimit.2] man page, such as `RLIMIT_MSGQUEUE`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[`getrlimit(2)`][setrlimit.2]

Is this discrepancy intentional (get vs set)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah no, i think it was a rename in previous commit, but i forgot to fix it. Will fix it now.

wking and others added 2 commits July 5, 2017 16:13
This property was initially Linux-specific.  718f9f3 (minor narrative
cleanup regarding config compatibility, 2017-01-30, opencontainers#673) removed the
Linux restriction, but the rlimit concept is from POSIX and Windows
doesn't support it [1].  This commit adds new subsections for the
POSIX-specific and Linux-specific process entries (to match the
approach we currently use for process.user), and punts to POSIX for
the Solaris values and compliance testing approach.  If/when we get a
Solaris-specific doc for valid values, we can replace the POSIX punt
there, but we probably want to continue punting to POSIX for
getrlimit(3)-based compliance testing.

I've renamed the overly-specific LinuxRlimit to POSIXRlimit.  We could
use the generic Rlimit, but then we'd be stuck if/when Windows adds
support for some rlimit-like thing that doesn't match up cleanly
enough for us to use the POSIX structure.

[1]: opencontainers#835 (comment)

Signed-off-by: W. Trevor King <[email protected]>
This change makes rlimits less abount linux and solaris, but expands the
explanation a bit to all systems that supports POSIX rlimits, but with
linux and solaris as examples.

Signed-off-by: Daniel Dao <[email protected]>
@dqminh dqminh force-pushed the wking-linux-only-capabilities-again branch from 9d93cbb to f7335bd Compare July 5, 2017 15:14
@tianon
Copy link
Member

tianon commented Jul 5, 2017

LGTM

Approved with PullApprove

2 similar comments
@vbatts
Copy link
Member

vbatts commented Jul 5, 2017

LGTM

Approved with PullApprove

@mrunalp
Copy link
Contributor

mrunalp commented Jul 5, 2017

LGTM

Approved with PullApprove

@mrunalp mrunalp merged commit f4d221c into opencontainers:master Jul 5, 2017
@vbatts vbatts mentioned this pull request Jul 5, 2017
wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request Jul 10, 2017
Through f4d221c (Merge pull request opencontainers#880 from
dqminh/wking-linux-only-capabilities-again, 2017-07-05).  The rc6
release picked up an earlier version of these notes, and those entries
are mostly unchanged except for:

* The credentialSpec entry, which was opencontainers#814 for credentialspec and now
  also includes opencontainers#859 for credentialSpec.

* The root(.path) Hyper-V entry, which was opencontainers#820 for root.path and now
  also includes opencontainers#838 for root.  I also moved this into the "breaking
  changes" section, because rc5 Hyper-V configs required root to be
  set, and rc6 Hyper-V configs require it to not be set.  Although
  whether rc5 allowed Hyper-V configs at all is not clear to me.

* Fixed indenting for the typo-fixes entry, as well as a number of
  more recent typo-fix PRs.

Signed-off-by: W. Trevor King <[email protected]>
wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request Jul 11, 2017
Through f4d221c (Merge pull request opencontainers#880 from
dqminh/wking-linux-only-capabilities-again, 2017-07-05).  The rc6
release picked up an earlier version of these notes, and those entries
are mostly unchanged except for:

* The credentialSpec entry, which was opencontainers#814 for credentialspec and now
  also includes opencontainers#859 for credentialSpec.

* The root(.path) Hyper-V entry, which was opencontainers#820 for root.path and now
  also includes opencontainers#838 for root.  I also moved this into the "breaking
  changes" section, because rc5 Hyper-V configs required root to be
  set, and rc6 Hyper-V configs require it to not be set.  Although
  whether rc5 allowed Hyper-V configs at all is not clear to me.

* Fixed indenting for the typo-fixes entry, as well as a number of
  more recent typo-fix PRs.

Signed-off-by: W. Trevor King <[email protected]>
wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request Aug 31, 2017
Fixing a typo I'd made in 5292e9c (config: Make rlimits
POSIX-specific, 2017-05-23, opencontainers#880).

Signed-off-by: W. Trevor King <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants