apparmor: gate make fine grained unix mediation behind v9 abi
authorJohn Johansen <john.johansen@canonical.com>
Sat, 12 Oct 2024 11:43:34 +0000 (04:43 -0700)
committerJohn Johansen <john.johansen@canonical.com>
Sat, 18 Jan 2025 14:47:13 +0000 (06:47 -0800)
commitdcd7a559411e8e1cd627ad20ac70faee77329380
tree4fbe1e847dd034df3d5aca0f211fa640f45d04b9
parentc05e705812d179f4b85aeacc34a555a42bc4f9ac
apparmor: gate make fine grained unix mediation behind v9 abi

Fine grained unix mediation in Ubuntu used ABI v7, and policy using
this has propogated onto systems where fine grained unix mediation was
not supported. The userspace policy compiler supports downgrading
policy so the policy could be shared without changes.

Unfortunately this had the side effect that policy was not updated for
the none Ubuntu systems and enabling fine grained unix mediation on
those systems means that a new kernel can break a system with existing
policy that worked with the previous kernel. With fine grained af_unix
mediation this regression can easily break the system causing boot to
fail, as it affect unix socket files, non-file based unix sockets, and
dbus communication.

To aoid this regression move fine grained af_unix mediation behind
a new abi. This means that the system's userspace and policy must
be updated to support the new policy before it takes affect and
dropping a new kernel on existing system will not result in a
regression.

The abi bump is done in such a way as existing policy can be activated
on the system by changing the policy abi declaration and existing unix
policy rules will apply. Policy then only needs to be incrementally
updated, can even be backported to existing Ubuntu policy.

Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/af_unix.c
security/apparmor/apparmorfs.c
security/apparmor/file.c
security/apparmor/include/policy.h