aa_write_access(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 of ubuf
  • ppos β€” 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