Treating unknown/unavailable capabilities
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- go, linux
- Domain
- operating-systems, security
Research direction
Start by reviewing the capability handling around prctl(PR_CAP_AMBIENT), prctl(PR_CAPBSET_DROP), and capset(2), along with issue #4358 and the referenced capability-package fix. The issue is a maintainer RFC, so completion requires an agreed warning-versus-error policy for the listed failure cases before implementation and tests can be defined.
Written by the indexing model from the issue text.
Description
Description
This is more of a request for comments than a bug.
Background
(a) runc and runtime-spec used to treat capabilities from config.json as a must (i.e. if a requested capability could not be set, an error must be returned).
(b) This has changed in runtime-spec since https://github.com/opencontainers/runtime-spec/pull/1094. The spec now says:
Any value which cannot be mapped to a relevant kernel interface, or cannot be granted otherwise MUST be logged as a warning by the runtime. Runtimes SHOULD NOT fail if the container configuration requests capabilities that cannot be granted, for example, if the runtime operates in a restricted environment with a limited set of capabilities.
(c) The above change was partially implemented in https://github.com/opencontainers/runc/pull/2854. By "partially" I mean that runc now warns, not errors, in the following two cases:
- when a capability name specified is not recognized (for example, a misspelled or made up name, or a recently added capability that runc is not yet aware);
- when a capability is known, but not (yet) supported by a currently running kernel (i.e. it's an older kernel).
(d) Also, due to a bug in capability package (fixed in it's moby/sys fork, see https://github.com/kolyshkin/capability/pull/3), any error when raising an ambient capability (using prctl(PR_CAP_AMBIENT)) which is not present in both the permitted and the inheritable sets was silently ignored.
(e) For all other cases, such as when a valid (known and supported) capability can not be granted, runc still returns an error. This includes:
- dropping capabilities from the bounding set (using
prctl(PR_CAPBSET_DROP)) when runc doesn't haveCAP_SETPCAP(unlikely to happen); - any errors from capset(2); quoting capset(2) man page:
- An attempt was made to add a capability to the permitted set;
- An attempt was made to set a capability in the effective set that is not in the permitted set.
- An attempt was made to add a capability to the inheritable set, and either:
- that capability was not in the caller's bounding set; or
- the capability was not in the caller's permitted set and the caller lacked the CAP_SETPCAP capability in its effective set.
Questions
- In (d) above, do we want to switch from a silence to a warning (this is what #4358 does) or to an error?
- In (e) above, do we want to switch from an error to a warning?
@opencontainers/runc-maintainers PTAL.
- Dominant language
- Go
- Stars
- 13.5k
- Forks
- 2.3k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 30
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from opencontainers/runc
-
`root.readonly` is silently ignored (rootfs left writable) when the container has no mount namespace Openllm-generated
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
opencontainers/runc#5371 ·
-
llm-generated
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
opencontainers/runc#5370 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
opencontainers/runc#2214 · 3 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
opencontainers/runc#1679 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
opencontainers/runc#5474 ·
All issues in opencontainers/runc
Similar issues
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
blinklabs-io/bursa#904 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
yanet-platform/ipfw-go#129 ·
-
bug confmap/provider/googlesecretmanagerprovider needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
open-telemetry/opentelemetry-collector-contrib#51273 · 2 comments ·
-
bug: AI Gateway client filter lists "Unknown" twice when NULL and literal Unknown clients coexist Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100