kfence_ksize(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, this is the kfence_ksize(9) page from the Kernel API Manual, and it's literally here to spill the tea on KFENCE object sizes 🫢✨

🌸 NAME 🌸

kfence_ksize β€” get actual amount of memory allocated for a KFENCE object πŸ’…

✨ SYNOPSIS ✨

size_t kfence_ksize (const void *addr );

πŸŽ€ ARGUMENTS πŸŽ€

  • addr β€” pointer to a heap object 🧚

πŸ’– RETURN πŸ’–

  • 0 β€” not a KFENCE object, must call __ksize instead,
  • non-0 β€” this many bytes can be accessed without causing a memory error.
so if you get 0, bestie, that's your cue to go call __ksize instead 😌

πŸ¦‹ DESCRIPTION πŸ¦‹

kfence_ksize returns the number of bytes requested for a KFENCE object at allocation time. This number may be less than the object size of the corresponding struct kmem_cache. That's the whole vibe β€” iconic, precise, no cap πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/kfence.h is the home base for this whole situation, and the squad is:


mwah πŸ’‹ source/version: ./include/linux Β· date: October 2026 Β· page: kfence_ksize(9) β€” that's a wrap, bestie πŸŽ€βœ¨

πŸ“¦ where this page comes from