bpf_get_dentry_xattr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… bpf_get_dentry_xattr β€” get xattr of a dentry

okay so bestie, welcome to the manual page for bpf_get_dentry_xattr, straight out of the Kernel API Manual ✨ this one's a lil kfunc that goes and fetches an extended attribute for you. it's giving "running errands but make it kernel-space" πŸŽ€


✨ SYNOPSIS ✨

__bpf_kfunc int bpf_get_dentry_xattr (struct dentry *dentry , const char
*name__str , struct bpf_dynptr *value_p );

that's the whole vibe. three args, one int coming back, no cap 🌸


🫢 ARGUMENTS 🫢

  • dentry β€” the dentry you wanna pull the xattr from, bestie. that's the target 🎯
  • name__str β€” the name of the xattr. literally just the name, don't overthink it πŸ’…
  • value_p β€” the output buffer where the xattr's value lands. it's the lil basket you're carrying the goods home in 🧺

πŸ’– DESCRIPTION πŸ’–

so the actual job: get xattr name__str of dentry, and store the output in value_ptr. simple as that, periodt ✨

but hold up β€” for security reasons, only name__str with the prefixes "user." or "security.bpf." are allowed πŸ”’ ngl that's the important part, don't skip it. anything else? not allowed, and that is on purpose, bestie πŸ™ˆ

🌈 RETURN 🌈

  • length of the xattr value on success πŸ‘‘ (slay)
  • a negative value on error πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./fs/bpf_fs_kfuncs.c β€” that's where the whole friend group hangs out 🫢

like, the entire xattr-adjacent crew. go read them too, iykyk πŸ“šπŸ’œ


and that's a wrap, bestie! πŸŽ€ this page comes to you from ./fs, dated October 2026 β€” mwah, go get those xattrs, i'm obsessed with you fr fr β­πŸ’–

πŸ“¦ where this page comes from