kasan_slab_pre_free(9)
kasan_slab_pre_free(9) π
Welcome to the Kernel API Manual, bestie β¨ todayβs main character is kasan_slab_pre_free, and sheβs literally the vibe check before the slab allocator frees an object π
πΈ NAME πΈ
kasan_slab_pre_free β check whether freeing a slab object is safe. Yes, the name is the whole assignment, and she ate π
β¨ SYNOPSIS β¨
bool kasan_slab_pre_free (struct kmem_cache *s , void *object );
π¦ ARGUMENTS π¦
sβ the man page just says-- undescribed --, so bestie, Iβm not gonna invent lore π. Itβs astruct kmem_cache *, and thatβs what we know.objectβ the object to be freed. Thatβs the one getting the pre-free safety check π«Ά.
π DESCRIPTION π
Okay so this function checks whether freeing the given object is safe. It may check for double-free and invalid-free bugs and report them. So itβs giving βsecurity guard at the club doorβ energy, not βactually free itβ energy π₯.
It is intended only for use by the slab allocator. No borrowing it for random side quests, bestie β slab-allocator-only territory π«.
And the return value? Return true if freeing the object is unsafe; false otherwise. Yep, the boolean is kinda not matching the βsafeβ wording in a cute way β true means unsafe, so read it twice before you get cocky π.
π₯ SEE ALSO π₯
Kernel file ./include/linux/kasan.h, plus these iconique functions:
kasan_unpoison_new_object(9)kasan_poison_new_object(9)kasan_slab_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)
Signed off from source ./include/linux, October 2026, Kernel API Manual β stay safe out there, bestie πβ¨
π¦ 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