lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 14 Apr 2020 14:06:56 +0100
From:   David Howells <>
To:     Waiman Long <>,
cc:     Andrew Morton <>,
        David Howells <>,
        Jarkko Sakkinen <>,
        James Morris <>,
        "Serge E. Hallyn" <>,
        Linus Torvalds <>,
        Joe Perches <>,
        Matthew Wilcox <>,
        David Rientjes <>,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Subject: Re: [PATCH 1/2] mm, treewide: Rename kzfree() to kfree_sensitive()

Waiman Long <> wrote:

> As said by Linus:
>   A symmetric naming is only helpful if it implies symmetries in use.
>   Otherwise it's actively misleading.
>   In "kzalloc()", the z is meaningful and an important part of what the
>   caller wants.
>   In "kzfree()", the z is actively detrimental, because maybe in the
>   future we really _might_ want to use that "memfill(0xdeadbeef)" or
>   something. The "zero" part of the interface isn't even _relevant_.
> The main reason that kzfree() exists is to clear sensitive information
> that should not be leaked to other future users of the same memory
> objects.
> Rename kzfree() to kfree_sensitive() to follow the example of the
> recently added kvfree_sensitive() and make the intention of the API
> more explicit. In addition, memzero_explicit() is used to clear the
> memory to make sure that it won't get optimized away by the compiler.
> The renaming is done by using the command sequence:
>   git grep -w --name-only kzfree |\
>   xargs sed -i 's/\bkzfree\b/kfree_sensitive/'
> followed by some editing of the kfree_sensitive() kerneldoc and the
> use of memzero_explicit() instead of memset().
> Suggested-by: Joe Perches <>
> Signed-off-by: Waiman Long <>

Since this changes a lot of crypto stuff, does it make sense for it to go via
the crypto tree?

Acked-by: David Howells <>

Powered by blists - more mailing lists