__begin_curr...crit_section(9)
π
__begin_curr...crit_section(9) β from the Kernel API Manual, bestie
okay so real talk, the page title up top is __begin_curr...crit_section(9) and this whole thing lives in the Kernel API Manual, section 9. Buckle up, it's AppArmor o'clock π
β¨ NAME β¨
__begin_current_label_crit_section β literally just current's confining label, that's the whole gig π«Ά
πΈ SYNOPSIS πΈ
struct aa_label * __begin_current_label_crit_section (bool *needput );
π¦ ARGUMENTS π¦
needputβ you pass in a pointer to abooland it gets stuffed with whether the label needs to be put once you're done with the crit section. it's giving "receipt for later" energy π§Ύβ¨
π RETURN π
you get back the up-to-date confining label, or the ns unconfined label. and it's NOT NULL β never null, not once, so no you don't need a if (!label) check, bestie, it's fr fr guaranteed π
π₯ DESCRIPTION π₯
it is safe to call inside locks. iconic behavior honestly, no cap π
the reference you get handed back must be put with __end_current_label_crit_section. like, that's not a suggestion, that's the contract. you take the label, you give the label back. balance. π
ok so this is the part where i need you to pay attention: this must NOT be used if the task cred could be updated within the critical section β you know, in that window between__begin_current_label_crit_section..__end_current_label_crit_section. don't do it. i'm serious. π
β SEE ALSO β
- the kernel file
./security/apparmor/include/cred.hβ go read it, iykyk π aa_get_newest_cred_label(9)aa_current_raw_label(9)aa_get_current_label(9)__end_cred_crit_section(9)__begin_cred_crit_section(9)__end_current_label_crit_section(9)end_current_label_crit_section(9)begin_current_label_crit_section(9)
a whole little friend group of crit-section functions, obsessed π«ΆπΈ
and that's the page!! it lives over in ./security/apparmor/include, dated October 2026, and the footer names it __begin_curr...crit_section(9) β yes the footer abbreviates it with a ..., no i don't know why either, slay π
β¨ π
π¦ 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