Lines Matching +full:state +full:- +full:labels
1 /* SPDX-License-Identifier: GPL-2.0-only */
37 (V) ? 0 : -ENOMEM; \
51 #define vec_last(VEC, SIZE) ((VEC)[(SIZE) - 1])
52 #define vec_ns(VEC, SIZE) (vec_last((VEC), (SIZE))->ns)
53 #define vec_labelset(VEC, SIZE) (&vec_ns((VEC), (SIZE))->labels)
54 #define cleanup_domain_vec(V, L) cleanup_label_vec((V), (L)->size)
65 /* struct aa_labelset - set of labels for a namespace
67 * Labels are reference counted; aa_labelset does not contribute to label
78 for ((N) = rb_first(&(LS)->root); (N); (N) = rb_next(N))
86 FLAG_USER_DEFINED = 0x20, /* user based profile - lower privs */
112 /* struct aa_label - lazy labeling struct
118 * @flags: stale and other flags - values may change under label set lock
142 #define label_isprofile(X) ((X)->flags & FLAG_PROFILE)
143 #define label_unconfined(X) ((X)->flags & FLAG_UNCONFINED)
145 #define label_is_stale(X) ((X)->flags & FLAG_STALE)
146 #define __label_make_stale(X) ((X)->flags |= FLAG_STALE)
147 #define labels_ns(X) (vec_ns(&((X)->vec[0]), (X)->size))
148 #define labels_set(X) (&labels_ns(X)->labels)
150 #define labels_profile(X) ((X)->vec[(X)->size - 1])
157 for ((I).i = 0; ((P) = (L)->vec[(I).i]); ++((I).i))
161 for (++((I).i); ((P) = (L)->vec[(I).i]); ++((I).i))
166 if ((I).j >= (L2)->size) { \
176 ((P1) = (L1)->vec[(I).i]) && ((P2) = (L2)->vec[(I).j]); \
192 ((P) = (L)->vec[(I).i]); \
208 while ((L)->vec[___i] && (L)->vec[___i]->ns != (NS)) \
215 ((P) = (L)->vec[(I).i]); \
264 if (RULE_MEDIATES(&profile->rules, (C))) { \
336 aa_state_t state; in aa_label_strn_split() local
338 state = aa_dfa_matchn_until(stacksplitdfa, DFA_START, str, n, &pos); in aa_label_strn_split()
339 if (!ACCEPT_TABLE(stacksplitdfa)[state]) in aa_label_strn_split()
342 return pos - 3; in aa_label_strn_split()
348 aa_state_t state; in aa_label_str_split() local
350 state = aa_dfa_match_until(stacksplitdfa, DFA_START, str, &pos); in aa_label_str_split()
351 if (!ACCEPT_TABLE(stacksplitdfa)[state]) in aa_label_str_split()
354 return pos - 3; in aa_label_str_split()
362 struct aa_label *label, aa_state_t state, bool subns,
367 * __aa_get_label - get a reference count to uncounted label reference
376 if (l && kref_get_unless_zero(&l->count)) in __aa_get_label()
385 kref_get(&(l->count)); in aa_get_label()
392 * aa_get_label_rcu - increment refcount on a label that can be replaced
405 } while (c && !kref_get_unless_zero(&c->count)); in aa_get_label_rcu()
412 * aa_get_newest_label - find the newest version of @l
427 AA_BUG(!l->proxy); in aa_get_newest_label()
428 AA_BUG(!l->proxy->label); in aa_get_newest_label()
433 tmp = aa_get_label_rcu(&l->proxy->label); in aa_get_newest_label()
445 kref_put(&l->count, aa_label_kref); in aa_put_label()
455 kref_get(&(proxy->count)); in aa_get_proxy()
463 kref_put(&proxy->count, aa_proxy_kref); in aa_put_proxy()