kfree_sensitive(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 🌈


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