[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)
committerAlex Murray <alex.murray@canonical.com>
Tue, 29 Nov 2022 12:01:21 +0000 (12:01 +0000)
commit0da27d688d9fd9a8a2b4396b06e8e00f034b8715
tree4ea1b467ee2ac58619ffc7befc7c1a8fc5fcb333
parent0342c4af2500bb62cf3ab4e22625d72824d9836e
[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