summaryrefslogtreecommitdiffstats
path: root/security/apparmor
diff options
context:
space:
mode:
authorchao liu <liuzgyid@outlook.com>2023-06-27 04:03:16 +0200
committerJohn Johansen <john.johansen@canonical.com>2024-11-27 04:21:05 +0100
commit9b897132424fe76bf6c61f22f9cf12af7f1d1e6a (patch)
tree8780b8c4d772bfd3b7c0d8ebed81ae212495eb20 /security/apparmor
parentapparmor: document first entry is in packed perms struct is reserved (diff)
downloadlinux-9b897132424fe76bf6c61f22f9cf12af7f1d1e6a.tar.xz
linux-9b897132424fe76bf6c61f22f9cf12af7f1d1e6a.zip
apparmor: fix 'Do simple duplicate message elimination'
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>
Diffstat (limited to 'security/apparmor')
-rw-r--r--security/apparmor/capability.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/security/apparmor/capability.c b/security/apparmor/capability.c
index 9934df16c843..bf7df6086830 100644
--- a/security/apparmor/capability.c
+++ b/security/apparmor/capability.c
@@ -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);
}