Lines Matching refs:state
69 static aa_state_t match_addr(struct aa_dfa *dfa, aa_state_t state, in match_addr() argument
74 state = aa_dfa_match_len(dfa, state, addr->sun_path, in match_addr()
77 state = aa_dfa_match_len(dfa, state, ANONYMOUS_ADDR, 1); in match_addr()
79 state = aa_dfa_null_transition(dfa, state); in match_addr()
81 return state; in match_addr()
85 aa_state_t state, u32 request, in match_to_local() argument
91 state = aa_match_to_prot(policy, state, request, PF_UNIX, type, in match_to_local()
93 if (state) { in match_to_local()
94 state = match_addr(policy->dfa, state, addr, addrlen); in match_to_local()
95 if (state) { in match_to_local()
97 state = aa_dfa_null_transition(policy->dfa, state); in match_to_local()
98 if (!state) in match_to_local()
105 return state; in match_to_local()
123 aa_state_t state, u32 request, in match_to_sk() argument
130 return match_to_local(policy, state, request, u->sk.sk_type, in match_to_sk()
138 static aa_state_t match_to_cmd(struct aa_policydb *policy, aa_state_t state, in match_to_cmd() argument
145 state = match_to_sk(policy, state, request, u, p, info); in match_to_cmd()
146 if (state && !*p) { in match_to_cmd()
147 state = aa_dfa_match_len(policy->dfa, state, &cmd, 1); in match_to_cmd()
148 if (!state) in match_to_cmd()
152 return state; in match_to_cmd()
155 static aa_state_t match_to_peer(struct aa_policydb *policy, aa_state_t state, in match_to_peer() argument
162 state = match_to_cmd(policy, state, request, u, CMD_ADDR, p, info); in match_to_peer()
163 if (state && !*p) { in match_to_peer()
164 state = match_addr(policy->dfa, state, peer_addr, peer_addrlen); in match_to_peer()
165 if (!state) in match_to_peer()
169 return state; in match_to_peer()
173 struct aa_ruleset *rule, aa_state_t state, in match_label() argument
183 if (state && !p) { in match_label()
184 state = aa_dfa_match(rule->policy->dfa, state, in match_label()
186 if (!state) in match_label()
191 return aa_do_perms(profile, rule->policy, state, request, p, ad); in match_label()
206 aa_state_t state; in profile_create_perm() local
211 state = RULE_MEDIATES_v9NET(rules); in profile_create_perm()
212 if (state) { in profile_create_perm()
213 state = aa_match_to_prot(rules->policy, state, AA_MAY_CREATE, in profile_create_perm()
217 return aa_do_perms(profile, rules->policy, state, AA_MAY_CREATE, in profile_create_perm()
231 aa_state_t state; in profile_sk_perm() local
237 state = RULE_MEDIATES_v9NET(rules); in profile_sk_perm()
238 if (state) { in profile_sk_perm()
244 state = match_to_sk(rules->policy, state, request, unix_sk(sk), in profile_sk_perm()
247 return aa_do_perms(profile, rules->policy, state, request, p, in profile_sk_perm()
259 aa_state_t state; in profile_bind_perm() local
266 state = RULE_MEDIATES_v9NET(rules); in profile_bind_perm()
267 if (state) { in profile_bind_perm()
272 state = match_to_local(rules->policy, state, AA_MAY_BIND, in profile_bind_perm()
278 return aa_do_perms(profile, rules->policy, state, AA_MAY_BIND, in profile_bind_perm()
290 aa_state_t state; in profile_listen_perm() local
297 state = RULE_MEDIATES_v9NET(rules); in profile_listen_perm()
298 if (state) { in profile_listen_perm()
306 state = match_to_cmd(rules->policy, state, AA_MAY_LISTEN, in profile_listen_perm()
308 if (state && !p) { in profile_listen_perm()
309 state = aa_dfa_match_len(rules->policy->dfa, state, in profile_listen_perm()
311 if (!state) in profile_listen_perm()
314 return aa_do_perms(profile, rules->policy, state, AA_MAY_LISTEN, in profile_listen_perm()
327 aa_state_t state; in profile_accept_perm() local
334 state = RULE_MEDIATES_v9NET(rules); in profile_accept_perm()
335 if (state) { in profile_accept_perm()
341 state = match_to_sk(rules->policy, state, AA_MAY_ACCEPT, in profile_accept_perm()
344 return aa_do_perms(profile, rules->policy, state, AA_MAY_ACCEPT, in profile_accept_perm()
357 aa_state_t state; in profile_opt_perm() local
364 state = RULE_MEDIATES_v9NET(rules); in profile_opt_perm()
365 if (state) { in profile_opt_perm()
372 state = match_to_cmd(rules->policy, state, request, unix_sk(sk), in profile_opt_perm()
374 if (state && !p) { in profile_opt_perm()
375 state = aa_dfa_match_len(rules->policy->dfa, state, in profile_opt_perm()
377 if (!state) in profile_opt_perm()
380 return aa_do_perms(profile, rules->policy, state, request, p, in profile_opt_perm()
397 aa_state_t state; in profile_peer_perm() local
405 state = RULE_MEDIATES_v9NET(rules); in profile_peer_perm()
406 if (state) { in profile_peer_perm()
415 state = match_to_peer(rules->policy, state, request, in profile_peer_perm()
420 match_label(profile, rules, state, request, in profile_peer_perm()