diff options
author | John Johansen <john.johansen@canonical.com> | 2013-07-11 06:12:43 +0200 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2013-08-14 20:42:07 +0200 |
commit | 038165070aa55375d4bdd2f84b34a486feca63d6 (patch) | |
tree | 327014e8b5120a0ccc66418159c72f769e9b174d /security/apparmor/policy_unpack.c | |
parent | apparmor: make free_profile available outside of policy.c (diff) | |
download | linux-038165070aa55375d4bdd2f84b34a486feca63d6.tar.xz linux-038165070aa55375d4bdd2f84b34a486feca63d6.zip |
apparmor: allow setting any profile into the unconfined state
Allow emulating the default profile behavior from boot, by allowing
loading of a profile in the unconfined state into a new NS.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Diffstat (limited to 'security/apparmor/policy_unpack.c')
-rw-r--r-- | security/apparmor/policy_unpack.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/security/apparmor/policy_unpack.c b/security/apparmor/policy_unpack.c index ce15313896ee..cac0aa075787 100644 --- a/security/apparmor/policy_unpack.c +++ b/security/apparmor/policy_unpack.c @@ -511,12 +511,16 @@ static struct aa_profile *unpack_profile(struct aa_ext *e) goto fail; if (!unpack_u32(e, &tmp, NULL)) goto fail; - if (tmp) + if (tmp & PACKED_FLAG_HAT) profile->flags |= PFLAG_HAT; if (!unpack_u32(e, &tmp, NULL)) goto fail; - if (tmp) + if (tmp == PACKED_MODE_COMPLAIN) profile->mode = APPARMOR_COMPLAIN; + else if (tmp == PACKED_MODE_KILL) + profile->mode = APPARMOR_KILL; + else if (tmp == PACKED_MODE_UNCONFINED) + profile->mode = APPARMOR_UNCONFINED; if (!unpack_u32(e, &tmp, NULL)) goto fail; if (tmp) |