]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
apparmor: fix 'Do simple duplicate message elimination'
authorchao liu <liuzgyid@outlook.com>
Tue, 27 Jun 2023 02:03:16 +0000 (10:03 +0800)
committerJohn Johansen <john.johansen@canonical.com>
Wed, 27 Nov 2024 03:21:05 +0000 (19:21 -0800)
Multiple profiles shared 'ent->caps', so some logs missed.

Fixes: 0ed3b28ab8bf ("AppArmor: mediation of non file objects")
Signed-off-by: chao liu <liuzgyid@outlook.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
security/apparmor/capability.c

index 9934df16c8431de3e42f38ccbaee0a40713dfa8a..bf7df60868308d0581fae211946f5bd2679149f1 100644 (file)
@@ -96,6 +96,8 @@ static int audit_caps(struct apparmor_audit_data *ad, struct aa_profile *profile
                return error;
        } else {
                aa_put_profile(ent->profile);
+               if (profile != ent->profile)
+                       cap_clear(ent->caps);
                ent->profile = aa_get_profile(profile);
                cap_raise(ent->caps, cap);
        }