提交 6604d4c1 编写于 作者: J John Johansen

apparmor: allow policydb to be used as the file dfa

Newer policy will combine the file and policydb dfas, allowing for
better optimizations. However to support older policy we need to
keep the ability to address the "file" dfa separately. So dup
the policydb as if it is the file dfa and set the appropriate start
state.
Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
上级 293a4886
...@@ -611,11 +611,15 @@ static struct aa_profile *unpack_profile(struct aa_ext *e) ...@@ -611,11 +611,15 @@ static struct aa_profile *unpack_profile(struct aa_ext *e)
error = PTR_ERR(profile->file.dfa); error = PTR_ERR(profile->file.dfa);
profile->file.dfa = NULL; profile->file.dfa = NULL;
goto fail; goto fail;
} } else if (profile->file.dfa) {
if (!unpack_u32(e, &profile->file.start, "dfa_start")) if (!unpack_u32(e, &profile->file.start, "dfa_start"))
/* default start state */ /* default start state */
profile->file.start = DFA_START; profile->file.start = DFA_START;
} else if (profile->policy.dfa &&
profile->policy.start[AA_CLASS_FILE]) {
profile->file.dfa = aa_get_dfa(profile->policy.dfa);
profile->file.start = profile->policy.start[AA_CLASS_FILE];
}
if (!unpack_trans_table(e, profile)) if (!unpack_trans_table(e, profile))
goto fail; goto fail;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册