summaryrefslogtreecommitdiff
path: root/security/apparmor
diff options
context:
space:
mode:
authorJohn Johansen <john.johansen@canonical.com>2025-11-14 00:14:36 -0800
committerSasha Levin <sashal@kernel.org>2026-03-04 07:20:25 -0500
commit0563743d3f7041d902c2de96cd5c1a9586761186 (patch)
tree315425c96fbbdf9e62f05bfb6e68d1635b8130d3 /security/apparmor
parent32928c1749e8a0162b168a5bb87c1b67e37281ff (diff)
downloadlinux-0563743d3f7041d902c2de96cd5c1a9586761186.tar.gz
linux-0563743d3f7041d902c2de96cd5c1a9586761186.tar.bz2
linux-0563743d3f7041d902c2de96cd5c1a9586761186.zip
apparmor: remove apply_modes_to_perms from label_match
[ Upstream commit b2e27be2948f2f8c38421cd554b5fc9383215648 ] The modes shouldn't be applied at the point of label match, it just results in them being applied multiple times. Instead they should be applied after which is already being done by all callers so it can just be dropped from label_match. Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com> Signed-off-by: John Johansen <john.johansen@canonical.com> Stable-dep-of: a4c9efa4dbad ("apparmor: make label_match return a consistent value") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'security/apparmor')
-rw-r--r--security/apparmor/label.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/security/apparmor/label.c b/security/apparmor/label.c
index 178eca800dda..217bd6709023 100644
--- a/security/apparmor/label.c
+++ b/security/apparmor/label.c
@@ -1327,7 +1327,6 @@ next:
goto fail;
}
*perms = *aa_lookup_perms(rules->policy, state);
- aa_apply_modes_to_perms(profile, perms);
if ((perms->allow & request) != request)
return -EACCES;
@@ -1380,7 +1379,6 @@ static int label_components_match(struct aa_profile *profile,
next:
tmp = *aa_lookup_perms(rules->policy, state);
- aa_apply_modes_to_perms(profile, &tmp);
aa_perms_accum(perms, &tmp);
label_for_each_cont(i, label, tp) {
if (!aa_ns_visible(profile->ns, tp->ns, subns))
@@ -1389,7 +1387,6 @@ next:
if (!state)
goto fail;
tmp = *aa_lookup_perms(rules->policy, state);
- aa_apply_modes_to_perms(profile, &tmp);
aa_perms_accum(perms, &tmp);
}