kfree_sensitive(9)
πΈ NAME πΈ
okay so bestie, welcome to kfree_sensitive(9) from the Kernel API Manual β it's literally the βclear sensitive information in memory before freeingβ function. Wipe the secrets, then free. Main character cleanup energy, no cap. π
β¨ SYNOPSIS β¨
void kfree_sensitive (const void *p );
π ARGUMENTS π
pβ the object to free the memory of. That's the whole argument, bestie. π
π¦ DESCRIPTION π¦
The memory of the object that p points to is zeroed before it gets freed. Like, the sensitive info gets scrubbed first β the way that it should be. β¨
If p is NULL, kfree_sensitive does nothing. Literally nothing. No notes. π
π NOTE π
ok so important vibe check: this function zeroes the whole allocated buffer, and that buffer can be a good deal bigger than the requested buffer size you passed to kmalloc. So be careful when you're using this function in performance sensitive code. Not me warning you twice β the manpage said it first. π
π SEE ALSO π
- Kernel file
./mm/slab_common.c __kmem_cache_create_args(9)kmem_buckets_create(9)kmem_cache_shrink(9)kmem_dump_obj(9)struct kvfree_rcu_bulk_data(9)struct kfree_rcu_cpu_work(9)struct kfree_rcu_cpu(9)kvfree_rcu_barrier(9)kvfree_rcu_barrier_on_cache(9)
and that's the page, bestie π«Ά source/version ./mm, date October 2026, page kfree_sensitive(9) β slay and stay safe out there πβ¨
π¦ 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