From: chao liu Date: Tue, 27 Jun 2023 02:03:16 +0000 (+0800) Subject: apparmor: fix 'Do simple duplicate message elimination' X-Git-Tag: v4.19.325~40 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=449aae4ef27b82701706b8717cb36ec6a52b3274;p=thirdparty%2Fkernel%2Fstable.git apparmor: fix 'Do simple duplicate message elimination' [ Upstream commit 9b897132424fe76bf6c61f22f9cf12af7f1d1e6a ] Multiple profiles shared 'ent->caps', so some logs missed. Fixes: 0ed3b28ab8bf ("AppArmor: mediation of non file objects") Signed-off-by: chao liu Signed-off-by: John Johansen Signed-off-by: Sasha Levin --- diff --git a/security/apparmor/capability.c b/security/apparmor/capability.c index 752f73980e308..8c99e8150bab9 100644 --- a/security/apparmor/capability.c +++ b/security/apparmor/capability.c @@ -98,6 +98,8 @@ static int audit_caps(struct common_audit_data *sa, 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); }