Skip to content

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Apr 8, 2021

relates to #42181, which fixes a test that was revealed by libcontainer no longer performing the same check

Use containerd's apparmor package to detect if apparmor can be used

The runc/libcontainer apparmor package on master no longer checks if apparmor_parser
is enabled, or if we are running docker-in-docker.

While those checks are not relevant to runc (as it doesn't load the profile), these
checks are relevant to us (and containerd). So switching to use the containerd
apparmor package, which does include the needed checks.

vendor: github.com/containerd/containerd b9092fae15f1814a5402bea1ceb0fa21ce1c785c

This patch picks the first commit in containerd that exports the AppArmor package
functions to keep the vendor diff small (there are some updates to that package
after this, but those will be included in other patches).

full diff: containerd/containerd@fbf1a72...55eda46

…f9c13994bf68

This patch picks the first commit in containerd that exports the AppArmor package
functions to keep the vendor diff small (there are some updates to that package
after this, but those will be included in other patches).

full diff: containerd/containerd@fbf1a72...55eda46

Signed-off-by: Sebastiaan van Stijn <[email protected]>
The runc/libcontainer apparmor package on master no longer checks if apparmor_parser
is enabled, or if we are running docker-in-docker.

While those checks are not relevant to runc (as it doesn't load the profile), these
checks _are_ relevant to us (and containerd). So switching to use the containerd
apparmor package, which does include the needed checks.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah marked this pull request as ready for review April 8, 2021 18:22
@thaJeztah thaJeztah force-pushed the apparmor_detect_fix branch from 261868f to 2834f84 Compare April 8, 2021 18:22
Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

@tiborvass
Copy link
Contributor

tiborvass commented Apr 9, 2021

I don't see any difference between the old IsEnabled and the new HostSupports apart from the new code checking sysfs only once. I was told it's not yet vendored but it's in runc master, but runc master has the same HostSupports code as this PR. ok I see now opencontainers/runc@bfb4ea1#diff-4faf243067bfdd2c1f09a8c5e63bb5b8ea8077a0712277bcdee17ecce333e232

@tiborvass tiborvass merged commit 68bec0f into moby:master Apr 9, 2021
@thaJeztah thaJeztah deleted the apparmor_detect_fix branch April 9, 2021 23:19
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Nov 9, 2021
Possibly more dependencies need to be updated, and instead of this we should cherry-pick.
This is just a quick check "what would it look like if we bumped the version in this branch";

Updating to containerd 1.5

Last containerd update in 20.10 is moby@1f88736 (moby#41688)

- moby@ab1dd80 moby#42274
- moby@5761fca moby#42274
- moby@42ef2c5 moby#42276
- moby@6202322 moby#42254
- moby@7c1c123 moby#42249
- moby@84df737 moby#42636
- moby@4fc2d4d moby#42656
- moby@3d58d13 moby#42697
- moby@582ef29 moby#42994

Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Nov 9, 2021
Possibly more dependencies need to be updated, and instead of this we should cherry-pick.
This is just a quick check "what would it look like if we bumped the version in this branch";

Updating to containerd 1.5

Last containerd update in 20.10 is moby@1f88736 (moby#41688)

- moby@ab1dd80 moby#42274
- moby@5761fca moby#42274
- moby@42ef2c5 moby#42276
- moby@6202322 moby#42254
- moby@7c1c123 moby#42249
- moby@84df737 moby#42636
- moby@4fc2d4d moby#42656
- moby@3d58d13 moby#42697
- moby@582ef29 moby#42994

Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Mar 18, 2022
Possibly more dependencies need to be updated, and instead of this we should cherry-pick.
This is just a quick check "what would it look like if we bumped the version in this branch";

Updating to containerd 1.5

Last containerd update in 20.10 is moby@1f88736 (moby#41688)

- moby@ab1dd80 moby#42274
- moby@5761fca moby#42274
- moby@42ef2c5 moby#42276
- moby@6202322 moby#42254
- moby@7c1c123 moby#42249
- moby@84df737 moby#42636
- moby@4fc2d4d moby#42656
- moby@3d58d13 moby#42697
- moby@582ef29 moby#42994
- moby@458b4aa moby#43025

Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Mar 18, 2022
Possibly more dependencies need to be updated, and instead of this we should cherry-pick.
This is just a quick check "what would it look like if we bumped the version in this branch";

Updating to containerd 1.5

Last containerd update in 20.10 is moby@1f88736 (moby#41688)

- moby@ab1dd80 moby#42274
- moby@5761fca moby#42274
- moby@42ef2c5 moby#42276
- moby@6202322 moby#42254
- moby@7c1c123 moby#42249
- moby@84df737 moby#42636
- moby@4fc2d4d moby#42656
- moby@3d58d13 moby#42697
- moby@582ef29 moby#42994
- moby@458b4aa moby#43025

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants