kasan_slab_free(9)
π 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:
kasan_unpoison_new_object(9)kasan_poison_new_object(9)kasan_slab_pre_free(9)kasan_mempool_poison_pages(9)kasan_mempool_unpoison_pages(9)kasan_mempool_poison_object(9)kasan_mempool_unpoison_object(9)kasan_report(9)
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
- 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