linux-stable/drivers/crypto/ccree
Waiman Long 453431a549 mm, treewide: rename kzfree() to kfree_sensitive()
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/kzfree/kfree_sensitive/'

followed by some editing of the kfree_sensitive() kerneldoc and adding
a kzfree backward compatibility macro in slab.h.

[akpm@linux-foundation.org: fs/crypto/inline_crypt.c needs linux/slab.h]
[akpm@linux-foundation.org: fix fs/crypto/inline_crypt.c some more]

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Waiman Long <longman@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: David Howells <dhowells@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: James Morris <jmorris@namei.org>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Joe Perches <joe@perches.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Jason A . Donenfeld" <Jason@zx2c4.com>
Link: http://lkml.kernel.org/r/20200616154311.12314-3-longman@redhat.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-07 11:33:22 -07:00
..
cc_aead.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
cc_aead.h crypto: ccree - refactor AEAD IV in AAD handling 2020-03-12 23:00:16 +11:00
cc_buffer_mgr.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
cc_buffer_mgr.h crypto: ccree - use u32 for SRAM addresses 2020-02-22 09:25:44 +08:00
cc_cipher.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
cc_cipher.h crypto: ccree - copyright header update 2019-04-25 15:38:14 +08:00
cc_crypto_ctx.h crypto: ccree - copyright header update 2019-04-25 15:38:14 +08:00
cc_debugfs.c crypto: ccree - constify struct debugfs_reg32 2020-05-15 16:15:00 +10:00
cc_debugfs.h crypto: ccree - copyright header update 2019-04-25 15:38:14 +08:00
cc_driver.c crypto: ccree - use existing dev helper in init_cc_resources() 2020-02-22 09:25:46 +08:00
cc_driver.h crypto: ccree - remove pointless comment 2020-03-12 23:00:16 +11:00
cc_fips.c crypto: ccree - fix typos in comments 2019-12-11 16:36:54 +08:00
cc_fips.h crypto: ccree - add function to handle cryptocell tee fips error 2019-04-25 15:38:16 +08:00
cc_hash.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
cc_hash.h crypto: ccree - improve kerneldoc in cc_hash.[ch] 2020-02-22 09:25:45 +08:00
cc_host_regs.h crypto: ccree - add HW engine config check 2019-06-27 14:28:00 +08:00
cc_hw_queue_defs.h crypto: ccree - update register handling macros 2020-03-12 23:00:16 +11:00
cc_kernel_regs.h crypto: ccree - copyright header update 2019-04-25 15:38:14 +08:00
cc_lli_defs.h crypto: ccree - allow more AEAD assoc data fragments 2019-04-25 15:38:15 +08:00
cc_pm.c crypto: ccree - make cc_pm_{suspend,resume}() static 2020-02-22 09:25:44 +08:00
cc_pm.h crypto: ccree - make cc_pm_{suspend,resume}() static 2020-02-22 09:25:44 +08:00
cc_request_mgr.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
cc_request_mgr.h crypto: ccree - improve kerneldoc in cc_request_mgr.[ch] 2020-02-22 09:25:46 +08:00
cc_sram_mgr.c crypto: ccree - improve kerneldoc in cc_sram_mgr.[ch] 2020-02-22 09:25:46 +08:00
cc_sram_mgr.h crypto: ccree - improve kerneldoc in cc_sram_mgr.[ch] 2020-02-22 09:25:46 +08:00
Makefile crypto: ccree - drop legacy ivgen support 2019-07-26 14:51:55 +10:00