aa_dfa_match_until(9)
π aa_dfa_match_until(9) β from the Kernel API Manual, bestie
okay so this one's a whole vibe for anyone poking at AppArmor's DFA internals β¨ the manual name for this page is literally aa_dfa_match_until, so likeβ¦ that's your entry point, iykyk π
β¨ NAME β¨
aa_dfa_match_until β the way this one traverses @dfa until it hits an accept state or runs out of input π¦ periodt.
πΈ SYNOPSIS πΈ
aa_state_t aa_dfa_match_until (const struct aa_dfa *dfa , aa_state_t
start , const char *str , const char **retpos );
like, that's the whole signature, nothing fnord-y about it π
π ARGUMENTS π
dfaβ the dfa we're matching str against. and yes, it's (NOT NULL) β no cap, you cannot pass a null here, she will not be slaying that πstartβ the state of the dfa where you're kicking the match off πstrβ the null terminated string of bytes you're matching against the dfa. also (NOT NULL), same energy asdfafr fr π«Άretposβ gets set to the first character in str after the match OR the end of string π literally the pointer that tells you where you stopped consuming, and that's honestly so helpful
π¦ DESCRIPTION π¦
aa_dfa_match will match str against the dfa and return the state it finished matching in β that's the whole arc of this function, main character energy only πΈ
lowkey the best part? that final state is multi-use:
- you can use it to look up the accepting label π·οΈ
- or as the start state of a continuing match π₯ (yes bestie, chaining is a thing)
π RETURN π
the final state reached after input is consumed β that's it, that's the return value π
π§ SEE ALSO π§
Kernel file ./security/apparmor/match.c β the source itself, go read her, she ate β¨
unpack_table(9)verify_table_headers(9)verify_dfa(9)dfa_free(9)aa_dfa_free_kref(9)remap_data16_to_data32(9)aa_dfa_unpack(9)aa_dfa_match_len(9)aa_dfa_match(9)aa_dfa_next(9)aa_dfa_matchn_until(9)aa_dfa_leftmatch(9)
ngl go read match.c if you wanna know what's actually under the hood β that's where the lore lives π
that's the whole page bestie, no notes π this one ships out of ./security/apparmor and the docs are dated October 2026, page name still aa_dfa_match_until(9) β mwah, go forth and match ππ¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms