[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)
committerMichael Vogt <mvo@debian.org>
Thu, 17 Feb 2022 15:29:46 +0000 (15:29 +0000)
commit43e2f7c9c63daa4ae436b068e89c48b5d0944f02
tree10dbbe458d03e6856011feb8c0c5c17cef71b091
parent8561877645ede04c86390acd8d83b88381669d17
[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