linux-stable/net/core
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
..
bpf_sk_storage.c bpf: Expose socket storage to BPF_PROG_TYPE_CGROUP_SOCK 2020-07-31 00:43:49 +02:00
datagram.c
datagram.h
dev.c It's been a busy cycle for documentation - hopefully the busiest for a 2020-08-04 22:47:54 -07:00
dev_addr_lists.c net: explain the lockdep annotations for dev_uc_unsync() 2020-06-28 21:38:27 -07:00
dev_ioctl.c net: Call into DSA netdevice_ops wrappers 2020-07-20 16:48:22 -07:00
devlink.c devlink: Pass extack when setting trap's action and group's parameters 2020-08-03 18:06:46 -07:00
drop_monitor.c net: Add MODULE_DESCRIPTION entries to network modules 2020-06-20 21:33:57 -07:00
dst.c
dst_cache.c
failover.c
fib_notifier.c
fib_rules.c fib: Fix undef compile warning 2020-08-03 18:01:49 -07:00
filter.c bpf: Expose socket storage to BPF_PROG_TYPE_CGROUP_SOCK 2020-07-31 00:43:49 +02:00
flow_dissector.c net/flow_dissector: add packet hash dissection 2020-07-24 15:23:31 -07:00
flow_offload.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-07-25 17:49:04 -07:00
gen_estimator.c
gen_stats.c
gro_cells.c
hwbm.c
link_watch.c
lwt_bpf.c
lwtunnel.c
Makefile
neighbour.c net: neighbor: add fdb extended attribute 2020-06-24 14:36:33 -07:00
net-procfs.c
net-sysfs.c The main changes in this cycle were: 2020-08-03 14:58:38 -07:00
net-sysfs.h
net-traces.c
net_namespace.c
netclassid_cgroup.c
netevent.c
netpoll.c
netprio_cgroup.c
page_pool.c
pktgen.c
ptp_classifier.c
request_sock.c
rtnetlink.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2020-08-03 18:27:40 -07:00
scm.c fs: Add receive_fd() wrapper for __receive_fd() 2020-07-13 11:03:44 -07:00
secure_seq.c
skbuff.c net: Pass NULL to skb_network_protocol() when we don't care about vlan depth 2020-08-03 15:38:31 -07:00
skmsg.c bpf, sockmap: RCU dereferenced psock may be used outside RCU block 2020-06-28 08:33:28 -07:00
sock.c mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
sock_diag.c
sock_map.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-07-11 00:46:00 -07:00
sock_reuseport.c udp: Copy has_conns in reuseport_grow(). 2020-07-21 15:31:02 -07:00
stream.c
sysctl_net_core.c bpf: Check correct cred for CAP_SYSLOG in bpf_dump_raw_ok() 2020-07-08 16:01:21 -07:00
timestamping.c
tso.c net: tso: add UDP segmentation support 2020-06-18 20:46:23 -07:00
utils.c
xdp.c bpf, xdp: Remove XDP_QUERY_PROG and XDP_QUERY_PROG_HW XDP commands 2020-07-25 20:37:02 -07:00