evm_read_protected_xattrs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ evm_read_protected_xattrs ✨

okay so bestie, welcome to the evm_read_protected_xattrs(9) page from the Kernel API Manual πŸ’– this one's a little function in the EVM (Extended Verification Module) corner of the kernel, and honestly? it's giving "quietly doing important work" energy. let's get into it 🫢


🌸 SYNOPSIS 🌸

int evm_read_protected_xattrs (struct dentry *dentry , u8 *buffer , int
buffer_size , char type , bool canonical_fmt );

that's the whole vibe β€” it hands you back an int, which (spoiler) is either the total size of the stuff it copied or a negative value if things went sideways 😭


πŸŽ€ ARGUMENTS πŸŽ€

  • dentry β€” the dentry of the xattrs being read, like "which file are we even talking about" energy πŸ’…
  • buffer β€” the buffer where the xattr names, lengths or values get copied to. this is the destination, the main character of the copy operation ✨
  • buffer_size β€” the size of that buffer, obviously. gotta know how much room we're working with πŸŽ€
  • type β€” a char that picks what you want, and the options are iconic:
    • n β†’ names
    • l β†’ lengths
    • v β†’ values
  • canonical_fmt β€” the data format, as a bool: true means little endian, false means native format. choose wisely πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

so what does it actually do? it reads the protected xattr names (separated by | β€” yes, that's a pipe character, not me being dramatic), the lengths (as u32), or the values, for a given dentry, and then returns the total size of the data it copied πŸ’–

and here's the cute part: if buffer is NULL, it just returns the total size. no copying, no nothing, just a little "here's how much room you'd need" heads up. lowkey iconic of it, honestly 🧚

returns the total size on success, a negative value on error. that's it, that's the contract. no cap πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

the kernel file lives at ./security/integrity/evm/evm_main.c, and if you're the kind of bestie who likes to go down the rabbit hole, here's the whole friend group πŸ‘‘


okay that's the whole page, bestie, you ate that 🫢 this beauty comes to you from ./security/integrity/evm, dated October 2026, straight out of the Kernel API Manual πŸ’…βœ¨ periodt.

πŸ“¦ where this page comes from