kfence_free(9)
π kfence_free(9) π
okay so bestie, welcome to the kfence_free page from the Kernel API Manual β grab a lil snack, this one's short and sweet π
β¨ NAME β¨
kfence_free β the "hey, maybe this is a KFENCE object?" release move, aka trying to hand an arbitrary heap object back to the KFENCE pool π
πΈ SYNOPSIS πΈ
bool kfence_free (void *addr );
π¦ ARGUMENTS π¦
addrβ the object you're trying to free, bestie. that's it. that's the whole vibe π
β RETURN β
falseβ the object does not belong to the KFENCE pool, so it got ignored πtrueβ slay, the object was released to the KFENCE pool π
π DESCRIPTION π
Release a KFENCE object and mark it as freed β¨ May be called on any object β yes, literally any object, even the non-KFENCE ones β because it makes integrating the hooks into the allocator's free codepath way simpler π«Ά
But listen: the allocator must check the return value to figure out whether it was a KFENCE object or not. no skipping the vibe check, fr fr π₯
π SEE ALSO π
- Kernel file
./include/linux/kfence.h is_kfence_address(9)kfence_alloc_pool_and_metadata(9)kfence_init(9)kfence_shutdown_cache(9)kfence_alloc(9)kfence_ksize(9)kfence_object_start(9)__kfence_free(9)kfence_handle_page_fault(9)__kfence_obj_info(9)
and that's the whole page, icon periodt π
β¨ this lil gem lives over in ./include/linux and it's dated October 2026 β go read the whole kfence family, they're giving main character energy ππ
π¦ 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