Skip to content

apparmor: explicitly set abi/3.0#8

Open
thaJeztah wants to merge 1 commit intomainfrom
apparmor_abi3
Open

apparmor: explicitly set abi/3.0#8
thaJeztah wants to merge 1 commit intomainfrom
apparmor_abi3

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Feb 14, 2026

relates to:

apparmor: explicitly set abi/3.0

This explicitly sets the AppArmor ABI to 3.0. In AppArmor ABI higher than 4.0, network no longer includes network unix, resulting in access to unix sockets being denied (also see https://gitlab.com/apparmor/apparmor/-/issues/561):

apparmor="DENIED" operation="create" class="net" info="failed protocol match" error=-13 profile="cri>

The recommendation is to either pin to abi <abi/4.0>, in the policy or to update it to use the newer syntax. Given that we need to account for some LTS distros that do not yet support ABI 4.0, we pin to ABI 3.0.

This is a similar patch as was included in containerd (containerd@a6f03a7). From that patch:

This change sets the AppArmor policy used by containerd to indicate it
is abi/3.0. This was chosen based on some code archeology which
indicated that containerd 1.7 came out in March 2023, before the
AppArmor 4.0 ABI. The AppArmor policies themselves date to much older;
the last apparmor version-checks were removed in containerd@4baa187
and containerd@c990e3f, and both were looking for AppArmor 2.8.96 or
older, pointing to abi/3.0 being the "correct" one to pick.

Nothing is preventing containerd from migrating to a newer AppArmor
ABI; note, however, that anything newer than abi/4.0 will need
modifications to preserve UNIX domain sockets.


// baseTemplate defines the default apparmor profile for containers.
//
// It explicitly sets the AppArmor ABI to 3.0. In AppArmor 4.0 ABI, "network"

Choose a reason for hiding this comment

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

nit: ABI 4.0 is actually fine. It's anything newer than 4.0 (which is a function of apparmor+kernel) which is the problem.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, thanks! Let me try rephrasing 🤗

Copy link
Member Author

Choose a reason for hiding this comment

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

Slightly updated to outline that it's "higher than", but that we picked 3.0 to account for some LTS distros not yet supporting 4.0; thanks!

This explicitly sets the AppArmor ABI to 3.0. In AppArmor ABI higher than 4.0,
`network` no longer includes `network unix`, resulting in access to unix sockets
being denied (also see https://gitlab.com/apparmor/apparmor/-/issues/561):

    apparmor="DENIED" operation="create" class="net" info="failed protocol match" error=-13 profile="cri-containerd.apparmor.d" pid=138752 comm=2E4E455420545020576F726B6572 family="unix" sock_type="dgram" protocol=0 requested="create" denied="create" addr=none

The recommendation is to either pin to abi `<abi/4.0>`, in the policy or to
update it to use the newer syntax. Given that we need to account for some
LTS distros that do not yet support ABI 4.0, we pin to ABI 3.0.

This is a similar patch as was included in containerd ([containerd@a6f03a7]).
From that patch:

> This change sets the AppArmor policy used by containerd to indicate it
> is `abi/3.0`. This was chosen based on some code archeology which
> indicated that containerd 1.7 came out in March 2023, before the
> AppArmor 4.0 ABI. The AppArmor policies themselves date to much older;
> the last apparmor version-checks were removed in [containerd@4baa187]
> and [containerd@c990e3f], and both were looking for AppArmor 2.8.96 or
> older, pointing to abi/3.0 being the "correct" one to pick.
>
> Nothing is preventing containerd from migrating to a newer AppArmor
> ABI; note, however, that anything newer than `abi/4.0` will need
> modifications to preserve UNIX domain sockets.

[containerd@4baa187]: containerd/containerd@4baa187
[containerd@c990e3f]: containerd/containerd@c990e3f
[containerd@a6f03a7]: containerd/containerd@a6f03a7

Co-authored-by: Alex Chernyakhovsky <alex@achernya.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
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.

2 participants