Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7f6092dc authored by John Johansen's avatar John Johansen Committed by Greg Kroah-Hartman
Browse files

apparmor: fix overlapping attachment computation



commit 2504db207146543736e877241f3b3de005cbe056 upstream.

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: 21f60661 ("apparmor: improve overlapping domain attachment resolution")
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 98ab8dfa
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -460,7 +460,7 @@ static struct aa_label *find_attach(const struct linux_binprm *bprm,
				 * xattrs, or a longer match
				 */
				candidate = profile;
				candidate_len = profile->xmatch_len;
				candidate_len = max(count, profile->xmatch_len);
				candidate_xattrs = ret;
				conflict = false;
			}
+1 −1
Original line number Diff line number Diff line
@@ -135,7 +135,7 @@ struct aa_profile {

	const char *attach;
	struct aa_dfa *xmatch;
	int xmatch_len;
	unsigned int xmatch_len;
	enum audit_mode audit;
	long mode;
	u32 path_flags;