提交 2504db20 编写于 作者: J John Johansen

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: 21f60661 ("apparmor: improve overlapping domain attachment resolution")
Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
上级 3bbb7b2e
......@@ -466,7 +466,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;
}
......
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册