kasan_slab_free(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… kasan_slab_free(9) β€” Kernel API Manual, bestie edition ✨

okay so we're in the Kernel API Manual and this page is about kasan_slab_free, which is genuinely iconic for reasons we're about to get into. grab ur lil iced coffee πŸ“ and let's go.


🌸 NAME 🌸

kasan_slab_free β€” Poison, initialize, and quarantine a slab object. that's the whole vibe, no cap πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

bool kasan_slab_free (struct kmem_cache *s , void *object , bool init , bool still_accessible , bool no_quarantine );

✨ ARGUMENTS ✨

  • s (struct kmem_cache *) β€” bestie, the manpage literally says -- undescribed -- πŸ’€ so we're not gonna sit here and make stuff up. it is what it is.
  • object β€” Object to be freed. main character of this whole situation fr fr.
  • init β€” Whether to initialize the object. cute lil yes/no.
  • still_accessible β€” Whether the object contents are still accessible. lowkey important, see below πŸ‘€
  • no_quarantine β€” the manpage says -- undescribed -- again 😭 iconic mystery behavior, honestly.

πŸ”₯ DESCRIPTION πŸ”₯

So this function is out here informing everyone that a slab object has been freed and is not supposed to be accessed anymore β€” except when still_accessible is set. and why would that be? because that means the object is in a SLAB_TYPESAFE_BY_RCU cache and an RCU grace period might not have passed yet. the way that detail matters 😭✨

For KASAN modes that have integrated memory initialization β€” that's kasan_has_integrated_init == true β€” this function also initializes the object's memory. for other modes, the init argument is literally ignored. ignored! not even looked at! πŸ’€

This function might also take ownership of the object to quarantine it. when that happens, KASAN will defer freeing the object to a later stage and handle it internally until then. the return value is the receipts: it indicates whether KASAN took ownership of the object. 🫢

⚠️ okay important caveat bestie: this function is intended only for use by the slab allocator. like, respectfully, not for you and not for your random code. periodt.

Return true if KASAN took ownership of the object; false otherwise. slay.

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/kasan.h and all these iconic neighbors:


mwah πŸ’– this lil page comes from ./include/linux, dated October 2026, and it's serving kasan_slab_free(9) realness. go forth and do not access freed objects, i'm begging πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from