apparmor: allow change_profile for nested container runtimes#2548
Closed
Mohataseem89 wants to merge 1 commit into
Closed
apparmor: allow change_profile for nested container runtimes#2548Mohataseem89 wants to merge 1 commit into
Mohataseem89 wants to merge 1 commit into
Conversation
Signed-off-by: Mohataseem Khan <mohataseem89@gmail.com>
|
This repository has been migrated to https://github.com/containers/container-libs. Please open your PR there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: podman-container-tools/podman#28992"
Problem
On kernel 6.17, starting a container via the Docker-compat API
(docker compose / docker CLI pointed at the podman socket) from inside a
systemd/Quadlet-launched container fails with:
The outer container runs under
containers-default-*. When crun insidethat container tries to write an AppArmor profile name to
/proc/thread-self/attr/apparmor/execfor the child container, thekernel rejects it because
change_profileis not permitted by the outercontainer's profile.
Native
podman runfrom the host is unaffected (process is unconfined).podman --remoteis also unaffected. Only the compat API path frominside a confined systemd container triggers this.
Reported: podman-container-tools/podman#28992
Downstream: moghtech/komodo#1488
Fix
Add
change_profile -> **,inside the>= 208096version guard,alongside the existing signal rules for crun/runc/podman. This gives
OCI runtimes running inside a container permission to assign AppArmor
profiles to their child processes.
Testing
reproduction:
--cgroups=split --sdnotify=conmonand the host's rootful podman socket bind-mounted.
docker run alpine echo hiagainst thesocket.
crun: unable to assign security attribute