Re: [PATCH] mm: Add kvfree_sensitive() for freeing sensitive data objects

From: Matthew Wilcox
Date: Mon Apr 06 2020 - 13:26:25 EST


On Mon, Apr 06, 2020 at 10:20:24AM -0700, Joe Perches wrote:
> > You really don't seem to get the whole "kzfree() has absolutely
> > _nothing_ to do with kzalloc() apart from a dubious implementation
> > details".
>
> API function naming symmetry is good.

It's good when there's actual symmetry between the two functions.

kvalloc() memory should be freed with kvfree(). That makes
sense. kzalloc() memory should not normally be freed with kzfree().
The symmetry hurts you, not helps you.