[PATCH 12/36] cmd/libsnap-confine-private: Don't fail open on apparmor confinement
authorAlex Murray <alex.murray@canonical.com>
Wed, 17 Nov 2021 04:02:09 +0000 (14:32 +1030)
committerMarkus Koschany <apo@debian.org>
Tue, 13 Jun 2023 09:28:53 +0000 (10:28 +0100)
commit5fc6460e6f6fdf6beb5a4ea7870c999ae0df5020
tree59a8e571c8019172048d5c2d77bf759cd85eb7d1
parent2333a89e9be6e042a019411522d59e72d626abd1
[PATCH 12/36] cmd/libsnap-confine-private: Don't fail open on apparmor confinement

aa_is_enabled() can be made to fail by setting low open file limits or
similar - in this case, snap-confine would continue executing as though it
were unconfined. However, this can be detected by checking errno more
closely - so only fail open when we know AppArmor either is not supported
or has been explicitly disabled at boot and otherwise fail closed.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
Gbp-Pq: Topic cve202144730
Gbp-Pq: Name 0012-cmd-libsnap-confine-private-Don-t-fail-open-on-appar.patch
cmd/libsnap-confine-private/apparmor-support.c