linux/drivers/s390/crypto
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
..
ap_bus.c tasklets API update for v5.9-rc1 2020-08-04 13:40:35 -07:00
ap_bus.h mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
ap_card.c s390/ap: introduce new ap function ap_get_qdev() 2020-05-20 10:22:51 +02:00
ap_debug.h s390/zcrypt: Make ap init functions static. 2018-04-10 07:39:01 +02:00
ap_queue.c s390/ap: rename and clarify ap state machine related stuff 2020-07-03 10:49:49 +02:00
Makefile s390/zcrypt: add new low level ep11 functions support file 2020-01-30 13:07:55 +01:00
pkey_api.c s390/pkey: fix smatch warning inconsistent indenting 2020-07-03 10:49:21 +02:00
vfio_ap_drv.c s390/zcrypt: CEX7S exploitation support 2019-09-19 12:56:06 +02:00
vfio_ap_ops.c s390/vfio: use fallthrough; 2020-03-25 12:39:38 +01:00
vfio_ap_private.h s390: ap: implement PAPQ AQIC interception in kernel 2019-07-02 16:00:28 +02:00
zcrypt_api.c s390/zcrypt: split ioctl function into smaller code units 2020-07-03 10:49:39 +02:00
zcrypt_api.h s390/zcrypt: ep11 structs rework, export zcrypt_send_ep11_cprb 2020-01-30 13:07:55 +01:00
zcrypt_card.c s390/zcrypt: replace snprintf/sprintf with scnprintf 2020-03-23 13:41:54 +01:00
zcrypt_cca_key.h s390/zcrypt: zcrypt device driver cleanup 2018-10-09 11:21:35 +02:00
zcrypt_ccamisc.c s390/zcrypt: code beautification and struct field renames 2020-07-03 10:49:34 +02:00
zcrypt_ccamisc.h s390: Replace zero-length array with flexible-array member 2020-02-27 16:02:21 +01:00
zcrypt_cex2a.c s390/ap: remove power management code from ap bus and drivers 2020-03-27 10:22:47 +01:00
zcrypt_cex2a.h s390/zcrypt: zcrypt device driver cleanup 2018-10-09 11:21:35 +02:00
zcrypt_cex2c.c s390/zcrypt: provide cex4 cca sysfs attributes for cex3 2020-07-03 10:49:54 +02:00
zcrypt_cex2c.h s390/zcrypt: zcrypt device driver cleanup 2018-10-09 11:21:35 +02:00
zcrypt_cex4.c s390/zcrypt: provide cex4 cca sysfs attributes for cex3 2020-07-03 10:49:54 +02:00
zcrypt_cex4.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
zcrypt_debug.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
zcrypt_ep11misc.c s390/zcrypt: use kzalloc 2020-06-16 13:44:04 +02:00
zcrypt_ep11misc.h s390/pkey/zcrypt: Support EP11 AES secure keys 2020-01-30 13:07:56 +01:00
zcrypt_error.h s390/zcrypt: code beautification and struct field renames 2020-07-03 10:49:34 +02:00
zcrypt_msgtype6.c s390/zcrypt: code beautification and struct field renames 2020-07-03 10:49:34 +02:00
zcrypt_msgtype6.h s390/zcrypt: code beautification and struct field renames 2020-07-03 10:49:34 +02:00
zcrypt_msgtype50.c s390/zcrypt: code beautification and struct field renames 2020-07-03 10:49:34 +02:00
zcrypt_msgtype50.h s390/zcrypt: zcrypt device driver cleanup 2018-10-09 11:21:35 +02:00
zcrypt_queue.c s390/zcrypt: code beautification and struct field renames 2020-07-03 10:49:34 +02:00