linux-sg2042/drivers/crypto/caam
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
..
Kconfig crypto: caam - fix typos 2020-06-15 17:38:54 +10:00
Makefile crypto: caam/qi2 - Add printing dpseci fq stats using debugfs 2019-08-02 14:44:01 +10:00
caamalg.c crypto: caam - silence .setkey in case of bad key length 2020-07-31 18:25:27 +10:00
caamalg_desc.c crypto: caam - update xts sector size for large input length 2020-03-06 12:28:25 +11:00
caamalg_desc.h crypto: caam - update rfc4106 sh desc to support zero length input 2019-08-09 15:11:48 +10:00
caamalg_qi.c crypto: caam - silence .setkey in case of bad key length 2020-07-31 18:25:27 +10:00
caamalg_qi2.c crypto: caam/qi2 - add module alias 2020-07-31 18:25:28 +10:00
caamalg_qi2.h crypto: Replace zero-length array with flexible-array member 2020-03-06 12:28:21 +11:00
caamhash.c crypto: drivers - set the flag CRYPTO_ALG_ALLOCATES_MEMORY 2020-07-16 21:49:10 +10:00
caamhash_desc.c crypto: caam - keep both virtual and dma key addresses 2019-08-09 15:11:49 +10:00
caamhash_desc.h crypto: caam - keep both virtual and dma key addresses 2019-08-09 15:11:49 +10:00
caampkc.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
caampkc.h crypto: caam - add crypto_engine support for RSA algorithms 2020-02-22 09:25:48 +08:00
caamrng.c crypto: caam - limit single JD RNG output to maximum of 16 bytes 2020-03-30 11:50:50 +11:00
compat.h crypto: caam - Remove broken arc4 support 2020-07-16 21:49:00 +10:00
ctrl.c crypto: caam - Fix argument type in handle_imx6_err005766 2020-06-18 17:26:43 +10:00
ctrl.h crypto: caam - staticize caam_get_era() 2018-04-21 00:58:36 +08:00
desc.h crypto: caam - fix typos 2020-06-15 17:38:54 +10:00
desc_constr.h crypto: caam - select DMA address size at runtime 2019-08-30 18:05:30 +10:00
dpseci-debugfs.c crypto: caam/qi2 - Add printing dpseci fq stats using debugfs 2019-08-02 14:44:01 +10:00
dpseci-debugfs.h crypto: caam/qi2 - Add printing dpseci fq stats using debugfs 2019-08-02 14:44:01 +10:00
dpseci.c crypto: caam/qi2 - add support for dpseci_reset() 2020-06-18 17:19:45 +10:00
dpseci.h crypto: caam/qi2 - add support for dpseci_reset() 2020-06-18 17:19:45 +10:00
dpseci_cmd.h crypto: caam/qi2 - add support for dpseci_reset() 2020-06-18 17:19:45 +10:00
error.c crypto: caam - add more RNG hw error codes 2020-07-31 18:25:28 +10:00
error.h crypto: caam - fix return code in completion callbacks 2019-08-09 15:11:45 +10:00
intern.h crypto: caam - drop global context pointer and init_done 2020-03-30 11:50:49 +11:00
jr.c crypto: caam/jr - remove incorrect reference to caam_jr_register() 2020-07-31 18:25:27 +10:00
jr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
key_gen.c crypto: caam - change return code in caam_jr_enqueue function 2020-02-22 09:25:47 +08:00
key_gen.h crypto: caam - add Derived Key Protocol (DKP) support 2017-12-28 17:56:48 +11:00
pdb.h crypto: caam - fix typos 2020-06-15 17:38:54 +10:00
pkc_desc.c crypto: caam - select DMA address size at runtime 2019-08-30 18:05:30 +10:00
qi.c crypto: caam/qi - optimize frame queue cleanup 2020-02-13 17:05:25 +08:00
qi.h crypto: caam/qi - optimize frame queue cleanup 2020-02-13 17:05:25 +08:00
regs.h crypto: caam - remove deadcode on 32-bit platforms 2020-07-31 18:25:27 +10:00
sg_sw_qm.h crypto: caam - use len instead of nents for bulding HW S/G table 2019-06-20 14:18:33 +08:00
sg_sw_qm2.h crypto: caam - use len instead of nents for bulding HW S/G table 2019-06-20 14:18:33 +08:00
sg_sw_sec4.h crypto: caam - use len instead of nents for bulding HW S/G table 2019-06-20 14:18:33 +08:00