aa_write_access(9)
β¨ aa_write_access β¨
okay bestie, welcome to aa_write_access(9) from the Kernel API Manual β it's giving "generic permissions and data query" and honestly? iconic. π
πΈ NAME πΈ
aa_write_access β generic permissions and data query π«Ά
π SYNOPSIS π
ssize_t aa_write_access (struct file *file , const char __user *ubuf ,
size_t count , loff_t *ppos );
π¦ ARGUMENTS π¦
fileβ pointer to open apparmorfs/access file β¨ubufβ user buffer containing the complete query string (NOT NULL, like literally do not pass NULL, that's not the vibe) πcountβ size ofubufpposβ position in the file (MUST BE ZERO β zero or nothing, bestie, no cap) π
π DESCRIPTION π
So here's the tea β: this lets you do one permissions query or one data query per open, write, and read sequence. One. Singular. Don't get greedy. π
And the only queries currently supported are label-based queries for permissions or data. That's the whole menu, periodt.
π Permissions queries
For permissions queries, ubuf must begin with "label ", followed by the profile query specific format described in the query_label function documentation. iykyk β go read that one too. πβ¨
π Data queries
For data queries, ubuf must have the form "data <LABEL> <KEY> ", where <LABEL> is the name of the security confinement context and <KEY> is the name of the data to retrieve. Slay, you got this. π
π RETURN π
Number of bytes written β or -errno on failure. (Yeah, the classic. π)
π SEE ALSO π
Kernel file ./security/apparmor/apparmorfs.c, plus the whole friend group:
mangle_name(9)__aafs_setup_d_inode(9)aafs_create(9)aafs_create_file(9)aafs_create_dir(9)aafs_remove(9)aa_simple_write_to_buffer(9)aa_get_data_from_compressed(9)query_data(9)query_label(9)__next_ns(9)__first_profile(9)__next_profile(9)next_profile(9)p_start(9)p_next(9)p_stop(9)seq_show_profile(9)entry_create_file(9)entry_create_dir(9)entry_remove_file(9)entry_remove_dir(9)aa_destroy_aafs(9)aa_create_aafs(9)
and that's the whole page, bestie β mwah π
source situation: ./security/apparmor Β· dated October 2026 Β· go off, kernel era π§ββοΈβ¨
π¦ 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