1
0
Fork 0
alistair23-linux/net/sunrpc
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
..
auth_gss mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
xprtrdma xprtrdma: fix incorrect header size calculations 2020-07-15 13:01:01 -04:00
Kconfig SUNRPC: Drop redundant CONFIG_ from CONFIG_SUNRPC_DISABLE_INSECURE_ENCTYPES 2019-07-06 14:54:53 -04:00
Makefile SUNRPC: remove generic cred code. 2018-12-19 13:52:46 -05:00
addr.c net: sunrpc: Fix off-by-one issues in 'rpc_ntop6' 2020-05-27 10:08:26 -04:00
auth.c sunrpc: add missing newline when printing parameter 'auth_hashtable_size' by sysfs 2020-06-11 13:33:48 -04:00
auth_null.c SUNRPC: Add rpc_auth::au_ralign field 2019-02-14 11:48:36 -05:00
auth_unix.c SUNRPC: Use the client user namespace when encoding creds 2019-04-26 16:24:32 -04:00
backchannel_rqst.c SUNRPC: Destroy the back channel when we destroy the host transport 2019-10-30 12:04:35 -04:00
cache.c SUNRPC/cache: Fix unsafe traverse caused double-free in cache_purge 2020-04-13 10:28:21 -04:00
clnt.c SUNRPC: Set SOFTCONN when destroying GSS contexts 2020-06-11 13:33:48 -04:00
debugfs.c NFS client updates for Linux 5.3 2019-07-18 14:32:33 -07:00
netns.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rpc_pipe.c sunrpc: fixed rollback in rpc_gssd_dummy_populate() 2020-06-26 08:43:14 -04:00
rpcb_clnt.c SUNRPC: Remove unreachable error condition in rpcb_getport_async() 2020-05-28 18:15:00 -04:00
sched.c SUNRPC: Don't start a timer on an already queued rpc task 2020-04-04 19:59:27 -04:00
socklib.c SUNRPC: Refactor xs_sendpages() 2020-03-16 12:04:33 -04:00
socklib.h SUNRPC: Refactor xs_sendpages() 2020-03-16 12:04:33 -04:00
stats.c proc: convert everything to "struct proc_ops" 2020-02-04 03:05:26 +00:00
sunrpc.h sunrpc: check that domain table is empty at module unload. 2020-05-28 18:15:00 -04:00
sunrpc_syms.c sunrpc: check that domain table is empty at module unload. 2020-05-28 18:15:00 -04:00
svc.c Merge branch 'nfsd-5.8' of git://linux-nfs.org/~cel/cel-2.6 into for-5.8-incoming 2020-05-21 10:58:15 -04:00
svc_xprt.c NFS Client Updates for Linux 5.8 2020-06-11 12:22:41 -07:00
svcauth.c sunrpc: check that domain table is empty at module unload. 2020-05-28 18:15:00 -04:00
svcauth_unix.c sunrpc: Remove unused function ip_map_update 2020-05-06 16:00:11 -04:00
svcsock.c Remove uninitialized_var() macro for v5.9-rc1 2020-08-04 13:49:43 -07:00
sysctl.c sysctl: pass kernel pointers to ->proc_handler 2020-04-27 02:07:40 -04:00
timer.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
xdr.c SUNRPC: Properly set the @subbuf parameter of xdr_buf_subsegment() 2020-06-26 08:45:23 -04:00
xprt.c SUNRPC: Trace transport lifetime events 2020-06-11 13:33:48 -04:00
xprtmultipath.c SUNRPC: Optimise transport balancing code 2019-07-18 14:43:52 -04:00
xprtsock.c treewide: Remove uninitialized_var() usage 2020-07-16 12:35:15 -07:00