diff options
author | John Johansen <john.johansen@canonical.com> | 2022-03-26 09:58:15 +0100 |
---|---|---|
committer | John Johansen <john.johansen@canonical.com> | 2022-07-19 11:52:36 +0200 |
commit | 2504db207146543736e877241f3b3de005cbe056 (patch) | |
tree | feaa7a3e2737a2bc8d2365c6e235c7755b5eacd6 /security/apparmor/domain.c | |
parent | apparmor: fix setting unconfined mode on a loaded profile (diff) | |
download | linux-2504db207146543736e877241f3b3de005cbe056.tar.xz linux-2504db207146543736e877241f3b3de005cbe056.zip |
apparmor: fix overlapping attachment computation
When finding the profile via patterned attachments, the longest left
match is being set to the static compile time value and not using the
runtime computed value.
Fix this by setting the candidate value to the greater of the
precomputed value or runtime computed value.
Fixes: 21f606610502 ("apparmor: improve overlapping domain attachment resolution")
Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security/apparmor/domain.c')
-rw-r--r-- | security/apparmor/domain.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c index d71023f5c9c4..91689d34d281 100644 --- a/security/apparmor/domain.c +++ b/security/apparmor/domain.c @@ -466,7 +466,7 @@ restart: * xattrs, or a longer match */ candidate = profile; - candidate_len = profile->xmatch_len; + candidate_len = max(count, profile->xmatch_len); candidate_xattrs = ret; conflict = false; } |