Skip to content

oci.WithPrivileged: set the current caps, not the known caps#5017

Merged
estesp merged 2 commits intocontainerd:masterfrom
AkihiroSuda:parse-cap
Feb 23, 2021
Merged

oci.WithPrivileged: set the current caps, not the known caps#5017
estesp merged 2 commits intocontainerd:masterfrom
AkihiroSuda:parse-cap

Conversation

@AkihiroSuda
Copy link
Member

@AkihiroSuda AkihiroSuda commented Feb 6, 2021

This change is needed for running the latest containerd inside Docker that is not aware of the recently added caps (BPF, PERFMON, CHECKPOINT_RESTORE).

Without this change, containerd inside Docker fails to run containers with "apply caps: operation not permitted" error.

See kubernetes-sigs/kind#2058

NOTE: The caller process of this function is now assumed to be as privileged as possible.

@AkihiroSuda AkihiroSuda force-pushed the parse-cap branch 2 times, most recently from e6862c7 to aa31742 Compare February 6, 2021 16:08
@containerd containerd deleted a comment from theopenlab-ci bot Feb 6, 2021
@AkihiroSuda AkihiroSuda force-pushed the parse-cap branch 2 times, most recently from 5bc576c to 98a0349 Compare February 6, 2021 16:56
@containerd containerd deleted a comment from theopenlab-ci bot Feb 6, 2021
@containerd containerd deleted a comment from theopenlab-ci bot Feb 6, 2021
@AkihiroSuda AkihiroSuda force-pushed the parse-cap branch 6 times, most recently from 312abe7 to ec4e375 Compare February 6, 2021 18:40
@containerd containerd deleted a comment from theopenlab-ci bot Feb 6, 2021
@containerd containerd deleted a comment from theopenlab-ci bot Feb 6, 2021
@AkihiroSuda AkihiroSuda changed the title oci.WithAllCapabilities: set the current caps, not the known caps oci.WithPrivileged: set the current caps, not the known caps Feb 6, 2021
@theopenlab-ci
Copy link

theopenlab-ci bot commented Feb 6, 2021

Build succeeded.

@BenTheElder
Copy link
Contributor

@fuweid other than the nits above is this approach acceptable?

kubernetes-sigs/kind#2058 we are trying to figure out if we should implement some workaround specific to our project (a runc shim?) or if we can depend on shipping a broad solution here.

also thank you @AkihiroSuda !

@fuweid
Copy link
Member

fuweid commented Feb 10, 2021

@BenTheElder the approach looks good to me right now:) And I am still wondering whether it is impacted on systemd service case or not. Will update it later

This change is needed for running the latest containerd inside Docker
that is not aware of the recently added caps (BPF, PERFMON, CHECKPOINT_RESTORE).

Without this change, containerd inside Docker fails to run containers with
"apply caps: operation not permitted" error.

See kubernetes-sigs/kind 2058

NOTE: The caller process of this function is now assumed to be as
privileged as possible.

Signed-off-by: Akihiro Suda <[email protected]>
No substantial code change

Signed-off-by: Akihiro Suda <[email protected]>
@AkihiroSuda AkihiroSuda requested review from dims and dmcgowan February 17, 2021 05:52
@cpuguy83
Copy link
Member

I was hoping that a null cap list in the oci spec would allow inheriting caps, but nope 😢

@BenTheElder
Copy link
Contributor

BenTheElder commented Feb 23, 2021

gentle ping @dims @dmcgowan (I hope this is OK! in Kubernetes it would be, but I'm not sure here)

EDIT: Closely watching this PR as KIND will either have to rollback (and be in an awkward state without #5020), get this patch, or do something hacky to emulate this outside of containerd.

Copy link
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 757be0a into containerd:master Feb 23, 2021
dweomer added a commit to dweomer/cri that referenced this pull request May 20, 2021
This is a CRI-specific backport of the changes in containerd/containerd#5017

Signed-off-by: Jacob Blain Christen <[email protected]>
dweomer added a commit to k3s-io/cri that referenced this pull request May 20, 2021
This is a CRI-specific backport of the changes in containerd/containerd#5017

Signed-off-by: Jacob Blain Christen <[email protected]>
dweomer added a commit to dweomer/containerd that referenced this pull request May 20, 2021
dweomer added a commit to k3s-io/containerd that referenced this pull request May 20, 2021
dweomer added a commit to dweomer/k3s that referenced this pull request May 20, 2021
Pull in backport of containerd/containerd#5017

Addresses k3s-io#3296

Signed-off-by: Jacob Blain Christen <[email protected]>
dweomer added a commit to dweomer/k3s that referenced this pull request May 20, 2021
Pull in backport of containerd/containerd#5017

Addresses k3s-io#3296

Signed-off-by: Jacob Blain Christen <[email protected]>
brandond pushed a commit to brandond/containerd that referenced this pull request Jul 19, 2021
brandond pushed a commit to brandond/cri that referenced this pull request Jul 20, 2021
This is a CRI-specific backport of the changes in containerd/containerd#5017

Signed-off-by: Jacob Blain Christen <[email protected]>
brandond pushed a commit to brandond/containerd that referenced this pull request Jul 20, 2021
brandond pushed a commit to brandond/containerd that referenced this pull request Aug 13, 2021
brandond pushed a commit to k3s-io/containerd that referenced this pull request Oct 4, 2021
brandond pushed a commit to brandond/containerd that referenced this pull request Nov 18, 2021
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.

7 participants