vfs_getattr_nosec(9)
π vfs_getattr_nosec β a kernel API manual moment
okay so this is a page straight out of the Kernel API Manual, and bestie, it's a short one but it matters. Sit down, grab a boba, let's get into it π
β¨ NAME β¨
vfs_getattr_nosec β getattr, but make it skip the security checks π
πΈ SYNOPSIS πΈ
int vfs_getattr_nosec (const struct path *path , struct kstat *stat ,
u32 request_mask , unsigned int query_flags );
like, that's the whole vibe. four args, one int back. no cap π
π ARGUMENTS π
pathβ the file you wanna pull attributes from, bestie. that's the target π―statβ the structure where the attributes get handed back to you. it's the little gift bag π«Άrequest_maskβ theSTATX_xxxflags, aka the lil wishlist of what the caller actually wants. be specific, the kernel loves specificity β¨query_flagsβ the query mode, and it'sAT_STATX_SYNC_TYPE. that's the whole thing, no more no less π
π DESCRIPTION π
so what does it do? it gets attributes without calling security_inode_getattr. that's the entire bit. the "nosec" in the name is not a vibe, it's literally the feature π
and like β right now? the only caller besides vfs_getattr is something internal to the filehandle lookup code. and that one's built different: it uses only the inode number and returns no attributes to any user. none. zero. so it's not out here leaking stat data to anybody π
ββοΈ
so if you're literally any other code? you probably want vfs_getattr. like, seriously. this one is not the main character for you, it's giving "internal use only" energy fr fr π§
π¦ SEE ALSO π¦
- Kernel file
./fs/stat.c fill_mg_cmtime(9)generic_fillattr(9)generic_fill_statx_attr(9)generic_fill_statx_atomic_writes(9)vfs_fstat(9)vfs_statx(9)sys_statx(9)
go read those, iykyk πβ¨
and that's the page!! mwah π shoutout to ./fs for being the source, and to October 2026 for the timestamp β iconic of them honestly ποΈπ periodt.
π¦ 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