Home
last modified time | relevance | path

Searched refs:dfa (Results 1 – 17 of 17) sorted by relevance

/security/apparmor/
Dmatch.c197 static int verify_dfa(struct aa_dfa *dfa) in verify_dfa() argument
202 state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; in verify_dfa()
203 trans_count = dfa->tables[YYTD_ID_NXT]->td_lolen; in verify_dfa()
207 if (!(BASE_TABLE(dfa)[i] & MATCH_FLAG_DIFF_ENCODE) && in verify_dfa()
208 (DEFAULT_TABLE(dfa)[i] >= state_count)) in verify_dfa()
210 if (base_idx(BASE_TABLE(dfa)[i]) + 255 >= trans_count) { in verify_dfa()
217 if (NEXT_TABLE(dfa)[i] >= state_count) in verify_dfa() local
219 if (CHECK_TABLE(dfa)[i] >= state_count) in verify_dfa() local
228 (BASE_TABLE(dfa)[j] & MATCH_FLAG_DIFF_ENCODE) && in verify_dfa()
229 !(BASE_TABLE(dfa)[j] & MARK_DIFF_ENCODE); in verify_dfa()
[all …]
Dmount.c193 static unsigned int match_mnt_flags(struct aa_dfa *dfa, unsigned int state, in match_mnt_flags() argument
200 state = aa_dfa_next(dfa, state, i + 1); in match_mnt_flags()
213 static struct aa_perms compute_mnt_perms(struct aa_dfa *dfa, in compute_mnt_perms() argument
217 .allow = dfa_user_allow(dfa, state), in compute_mnt_perms()
218 .audit = dfa_user_audit(dfa, state), in compute_mnt_perms()
219 .quiet = dfa_user_quiet(dfa, state), in compute_mnt_perms()
220 .xindex = dfa_user_xindex(dfa, state), in compute_mnt_perms()
240 static int do_match_mnt(struct aa_dfa *dfa, unsigned int start, in do_match_mnt() argument
247 AA_BUG(!dfa); in do_match_mnt()
250 state = aa_dfa_match(dfa, start, mntpnt); in do_match_mnt()
[all …]
Dfile.c224 struct aa_perms aa_compute_fperms(struct aa_dfa *dfa, unsigned int state, in aa_compute_fperms() argument
235 perms.allow = map_old_perms(dfa_user_allow(dfa, state)); in aa_compute_fperms()
236 perms.audit = map_old_perms(dfa_user_audit(dfa, state)); in aa_compute_fperms()
237 perms.quiet = map_old_perms(dfa_user_quiet(dfa, state)); in aa_compute_fperms()
238 perms.xindex = dfa_user_xindex(dfa, state); in aa_compute_fperms()
240 perms.allow = map_old_perms(dfa_other_allow(dfa, state)); in aa_compute_fperms()
241 perms.audit = map_old_perms(dfa_other_audit(dfa, state)); in aa_compute_fperms()
242 perms.quiet = map_old_perms(dfa_other_quiet(dfa, state)); in aa_compute_fperms()
243 perms.xindex = dfa_other_xindex(dfa, state); in aa_compute_fperms()
248 if (ACCEPT_TABLE(dfa)[state] & 0x80000000) in aa_compute_fperms()
[all …]
Dpolicy_unpack.c443 struct aa_dfa *dfa = NULL; in unpack_dfa() local
457 dfa = aa_dfa_unpack(blob + pad, size - pad, flags); in unpack_dfa()
459 if (IS_ERR(dfa)) in unpack_dfa()
460 return dfa; in unpack_dfa()
464 return dfa; in unpack_dfa()
826 profile->policy.dfa = unpack_dfa(e); in unpack_profile()
827 if (IS_ERR(profile->policy.dfa)) { in unpack_profile()
828 error = PTR_ERR(profile->policy.dfa); in unpack_profile()
829 profile->policy.dfa = NULL; in unpack_profile()
831 } else if (!profile->policy.dfa) { in unpack_profile()
[all …]
Dlib.c325 void aa_compute_perms(struct aa_dfa *dfa, unsigned int state, in aa_compute_perms() argument
329 .allow = dfa_user_allow(dfa, state), in aa_compute_perms()
330 .audit = dfa_user_audit(dfa, state), in aa_compute_perms()
331 .quiet = dfa_user_quiet(dfa, state), in aa_compute_perms()
337 perms->allow |= map_other(dfa_other_allow(dfa, state)); in aa_compute_perms()
338 perms->audit |= map_other(dfa_other_audit(dfa, state)); in aa_compute_perms()
339 perms->quiet |= map_other(dfa_other_quiet(dfa, state)); in aa_compute_perms()
387 state = aa_dfa_next(profile->policy.dfa, in aa_profile_match_label()
Ddomain.c104 state = aa_dfa_match(profile->file.dfa, state, "&"); in match_component()
106 return aa_dfa_match(profile->file.dfa, state, tp->base.hname); in match_component()
110 state = aa_dfa_match_len(profile->file.dfa, state, ":", 1); in match_component()
111 state = aa_dfa_match(profile->file.dfa, state, ns_name); in match_component()
112 state = aa_dfa_match_len(profile->file.dfa, state, ":", 1); in match_component()
113 return aa_dfa_match(profile->file.dfa, state, tp->base.hname); in match_component()
159 state = aa_dfa_match(profile->file.dfa, state, "//&"); in label_compound_match()
164 *perms = aa_compute_fperms(profile->file.dfa, state, &cond); in label_compound_match()
217 tmp = aa_compute_fperms(profile->file.dfa, state, &cond); in label_components_match()
226 tmp = aa_compute_fperms(profile->file.dfa, state, &cond); in label_components_match()
[all …]
Dnet.c124 state = aa_dfa_match_len(profile->policy.dfa, state, (char *) &buffer, in aa_profile_af_perm()
126 aa_compute_perms(profile->policy.dfa, state, &perms); in aa_profile_af_perm()
Dpolicy_ns.c111 ns->unconfined->file.dfa = aa_get_dfa(nulldfa); in alloc_ns()
112 ns->unconfined->policy.dfa = aa_get_dfa(nulldfa); in alloc_ns()
Dlabel.c1281 return aa_dfa_match(profile->policy.dfa, state, tp->base.hname); in match_component()
1285 state = aa_dfa_match_len(profile->policy.dfa, state, ":", 1); in match_component()
1286 state = aa_dfa_match(profile->policy.dfa, state, ns_name); in match_component()
1287 state = aa_dfa_match_len(profile->policy.dfa, state, ":", 1); in match_component()
1288 return aa_dfa_match(profile->policy.dfa, state, tp->base.hname); in match_component()
1332 state = aa_dfa_match(profile->policy.dfa, state, "//&"); in label_compound_match()
1337 aa_compute_perms(profile->policy.dfa, state, perms); in label_compound_match()
1388 aa_compute_perms(profile->policy.dfa, state, &tmp); in label_components_match()
1397 aa_compute_perms(profile->policy.dfa, state, &tmp); in label_components_match()
Dapparmorfs.c614 struct aa_dfa *dfa; in profile_query_cb() local
619 if (profile->file.dfa && *match_str == AA_CLASS_FILE) { in profile_query_cb()
620 dfa = profile->file.dfa; in profile_query_cb()
621 state = aa_dfa_match_len(dfa, profile->file.start, in profile_query_cb()
626 tmp = aa_compute_fperms(dfa, state, &cond); in profile_query_cb()
628 } else if (profile->policy.dfa) { in profile_query_cb()
631 dfa = profile->policy.dfa; in profile_query_cb()
632 state = aa_dfa_match_len(dfa, profile->policy.start[0], in profile_query_cb()
635 aa_compute_perms(dfa, state, &tmp); in profile_query_cb()
Dipc.c200 state = aa_dfa_next(profile->policy.dfa, in profile_signal_perm()
Dpolicy.c234 aa_put_dfa(profile->policy.dfa); in aa_free_profile()
547 profile->file.dfa = aa_get_dfa(nulldfa); in aa_new_null_profile()
548 profile->policy.dfa = aa_get_dfa(nulldfa); in aa_new_null_profile()
/security/apparmor/include/
Dfile.h143 #define dfa_user_allow(dfa, state) (((ACCEPT_TABLE(dfa)[state]) & 0x7f) | \ argument
144 ((ACCEPT_TABLE(dfa)[state]) & 0x80000000))
145 #define dfa_user_audit(dfa, state) ((ACCEPT_TABLE2(dfa)[state]) & 0x7f) argument
146 #define dfa_user_quiet(dfa, state) (((ACCEPT_TABLE2(dfa)[state]) >> 7) & 0x7f) argument
147 #define dfa_user_xindex(dfa, state) \ argument
148 (dfa_map_xindex(ACCEPT_TABLE(dfa)[state] & 0x3fff))
150 #define dfa_other_allow(dfa, state) ((((ACCEPT_TABLE(dfa)[state]) >> 14) & \ argument
152 ((ACCEPT_TABLE(dfa)[state]) & 0x80000000))
153 #define dfa_other_audit(dfa, state) (((ACCEPT_TABLE2(dfa)[state]) >> 14) & 0x7f) argument
154 #define dfa_other_quiet(dfa, state) \ argument
[all …]
Dmatch.h124 unsigned int aa_dfa_match_len(struct aa_dfa *dfa, unsigned int start,
126 unsigned int aa_dfa_match(struct aa_dfa *dfa, unsigned int start,
128 unsigned int aa_dfa_next(struct aa_dfa *dfa, unsigned int state,
130 unsigned int aa_dfa_match_until(struct aa_dfa *dfa, unsigned int start,
132 unsigned int aa_dfa_matchn_until(struct aa_dfa *dfa, unsigned int start,
153 unsigned int aa_dfa_leftmatch(struct aa_dfa *dfa, unsigned int start,
163 static inline struct aa_dfa *aa_get_dfa(struct aa_dfa *dfa) in aa_get_dfa() argument
165 if (dfa) in aa_get_dfa()
166 kref_get(&(dfa->count)); in aa_get_dfa()
168 return dfa; in aa_get_dfa()
[all …]
Dpolicy.h75 struct aa_dfa *dfa; member
222 return aa_dfa_match_len(profile->policy.dfa, in PROFILE_MEDIATES()
233 return aa_dfa_match_len(profile->policy.dfa, state, (char *) &be_af, 2); in PROFILE_MEDIATES_AF()
Dlib.h85 static inline unsigned int aa_dfa_null_transition(struct aa_dfa *dfa, in aa_dfa_null_transition() argument
89 return aa_dfa_next(dfa, start, 0); in aa_dfa_null_transition()
Dperms.h144 void aa_compute_perms(struct aa_dfa *dfa, unsigned int state,