apparmor: provide base for multiple profiles to be replaced at once

previously profiles had to be loaded one at a time, which could result
in cases where a replacement would partially succeed, and then fail
resulting in inconsitent policy.

Allow multiple profiles to replaced atomically so that the replacement
either succeeeds or fails atomically for the set of profiles.

Note: this does not provide multiple load of profiles when adding a parent
and its children as an atomic profile set. Because of this limitation
the atomic set load of profiles should not be exposed to userspace at this
time.

Signed-off-by: John Johansen <john.johansen@canonical.com>
4 files changed