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
..
2020-06-30 00:32:59 +02:00
2020-07-31 11:49:08 +02:00
2020-08-03 18:19:23 -07:00
2020-08-05 11:43:47 -07:00
2020-08-05 20:13:21 -07:00
2020-08-04 01:22:02 +02:00
2020-07-13 15:07:34 +01:00
2020-07-08 22:31:51 -07:00
2020-07-27 08:55:03 +01:00
2020-06-22 13:21:00 +02:00
2020-08-02 01:02:12 -07:00
2020-08-05 20:13:21 -07:00
2020-06-25 22:25:13 -07:00
2020-07-24 15:41:53 -07:00
2020-06-25 00:50:31 +02:00
2020-06-25 00:50:31 +02:00
2020-08-05 19:24:27 -07:00
2020-07-22 18:19:03 -07:00
2020-07-17 00:16:50 +01:00
2020-08-04 14:47:45 -07:00
2020-07-27 14:24:51 +02:00
2020-07-21 16:05:40 +05:30
2020-07-27 14:55:22 +01:00
2020-08-05 20:13:21 -07:00
2020-07-15 20:34:02 -07:00
2020-07-28 15:51:31 +01:00
2020-08-04 18:11:58 -07:00
2020-07-22 10:22:05 +02:00
2020-08-03 19:30:59 -07:00
2020-07-19 18:16:40 -07:00
2020-06-25 08:23:22 -07:00
2020-07-21 11:12:31 -04:00
2020-07-08 17:20:46 -06:00
2020-07-08 17:20:46 -06:00
2020-07-21 08:24:52 -05:00
2020-06-29 09:09:08 -06:00
2020-07-08 10:48:35 -07:00
2020-07-17 07:15:10 -06:00
2020-07-08 17:05:53 -06:00
2020-07-28 10:22:19 -06:00
2020-08-05 11:12:34 -07:00
2020-07-17 20:18:16 -07:00
2020-06-22 22:22:58 +02:00
2020-07-25 20:16:35 -07:00
2020-07-17 20:18:16 -07:00
2020-08-01 20:38:28 -07:00
2020-07-24 15:41:54 -07:00
2020-07-21 13:26:26 -07:00
2020-06-25 16:17:05 +02:00
2020-06-24 09:16:02 -06:00
2020-07-19 20:14:42 +02:00
2020-07-08 16:20:01 -06:00
2020-07-09 16:28:44 -07:00
2020-07-07 13:34:11 -07:00
2020-07-19 18:16:40 -07:00
2020-08-04 13:26:06 -07:00
2020-08-03 14:11:08 -07:00
2020-07-16 12:35:31 -07:00
2020-08-04 13:49:43 -07:00
2020-08-03 14:25:40 -07:00
2020-06-24 17:08:33 +02:00
2020-06-24 17:08:31 +02:00
2020-07-24 13:56:23 +02:00
2020-07-21 15:48:40 +02:00
2020-06-17 17:28:08 +02:00
2020-07-02 13:03:30 +02:00
2020-07-29 18:38:30 +02:00
2020-07-16 21:49:09 +10:00
2020-06-24 09:16:02 -06:00
2020-07-10 13:54:00 -07:00
2020-07-30 17:22:57 +09:00
2020-08-03 11:57:03 -07:00
2020-08-05 13:02:45 -07:00
2020-07-10 15:39:29 +05:30
2020-07-16 16:58:37 +02:00
2020-07-21 09:42:19 +02:00
2020-08-04 22:47:54 -07:00
2020-07-23 15:31:38 +10:00
2020-07-24 17:00:08 +02:00
2020-06-16 19:25:20 +02:00
2020-07-27 12:14:28 +02:00
2020-07-09 10:14:29 +03:00
2020-06-24 17:16:42 +02:00
2020-07-24 14:59:04 +02:00
2020-07-24 15:03:42 +02:00
2020-07-08 12:39:05 -07:00
2020-07-10 16:17:22 +02:00
2020-06-17 00:07:38 +02:00
2020-07-13 11:03:45 -07:00
2020-07-25 20:16:34 -07:00
2020-07-14 19:25:41 +02:00
2020-07-14 14:45:41 +02:00
2020-08-04 22:47:54 -07:00
2020-07-21 16:02:13 -07:00
2020-07-21 16:02:41 -07:00
2020-07-17 20:18:00 -06:00
2020-07-10 12:00:01 +02:00
2020-07-20 17:00:02 -07:00
2020-06-24 15:45:51 +10:00
2020-07-10 16:24:28 -03:00
2020-07-17 16:06:14 +02:00
2020-06-20 09:16:19 +00:00
2020-07-27 20:16:58 +02:00
2020-07-24 17:12:41 -07:00
2020-06-19 13:41:59 -07:00
2020-08-03 10:54:54 +02:00
2020-07-14 13:46:42 -07:00
2020-07-07 15:48:38 -07:00
2020-07-20 13:28:16 -04:00
2020-06-23 15:11:19 -07:00
2020-07-24 13:56:23 +02:00
2020-07-27 14:17:36 +02:00
2020-06-23 10:08:31 +02:00
2020-07-30 11:16:01 -07:00
2020-07-24 12:42:42 -07:00
2020-07-24 17:12:41 -07:00
2020-06-28 17:01:20 +02:00
2020-07-27 16:20:40 +02:00
2020-07-27 08:55:04 +01:00
2020-07-04 10:02:06 +02:00
2020-07-31 12:11:58 +02:00
2020-07-04 10:02:06 +02:00
2020-06-24 09:16:02 -06:00
2020-06-19 14:17:05 -06:00
2020-07-08 15:59:57 -07:00
2020-06-26 10:01:08 -06:00
2020-07-09 20:12:19 -07:00
2020-07-23 10:33:12 +02:00
2020-07-02 15:51:48 +02:00
2020-08-06 12:59:31 -07:00
2020-07-09 13:29:42 -04:00
2020-07-22 14:41:29 +02:00
2020-07-22 14:42:07 +02:00
2020-06-27 15:20:03 -07:00
2020-07-01 07:27:24 -06:00
2020-07-20 17:59:43 -07:00
2020-08-02 20:39:44 -07:00
2020-07-28 10:45:46 +02:00
2020-07-29 16:14:24 +02:00
2020-06-23 16:39:23 -07:00
2020-06-22 16:28:34 -07:00
2020-06-26 13:40:09 -07:00
2020-07-10 15:08:09 +02:00
2020-07-23 09:35:36 +02:00
2020-07-28 16:20:33 -03:00
2020-08-07 11:33:21 -07:00
2020-06-26 00:27:37 -07:00
2020-07-23 09:12:15 +02:00
2020-07-31 18:08:59 +10:00
2020-07-24 15:41:54 -07:00
2020-07-24 15:41:54 -07:00
2020-07-24 15:41:54 -07:00
2020-08-05 20:13:21 -07:00
2020-07-24 15:41:54 -07:00
2020-07-15 07:45:25 -07:00
2020-07-21 10:50:36 +01:00
2020-07-29 07:45:20 +02:00
2020-07-29 07:45:21 +02:00
2020-07-29 17:12:08 +02:00
2020-07-29 17:12:08 +02:00
2020-07-28 22:49:52 +02:00
2020-07-28 15:51:32 +01:00
2020-07-01 10:49:02 +02:00
2020-07-28 15:51:32 +01:00
2020-07-28 15:51:32 +01:00
2020-06-30 15:57:34 -07:00
2020-08-03 19:30:59 -07:00
2020-06-16 20:45:08 -07:00
2020-07-23 17:34:18 +10:00
2020-07-16 12:32:25 -07:00
2020-08-03 13:01:22 -07:00
2020-06-30 16:58:27 -05:00
2020-07-21 10:50:37 +01:00
2020-08-05 20:13:21 -07:00
2020-06-20 22:14:53 +10:00
2020-08-03 15:01:02 -07:00
2020-08-05 20:13:21 -07:00
2020-07-28 17:07:06 -07:00
2020-07-14 15:14:27 +02:00
2020-06-24 17:16:42 +02:00
2020-07-27 13:52:36 +02:00
2020-08-03 23:24:26 -07:00
2020-07-27 17:46:24 +09:00
2020-07-25 20:16:32 -07:00
2020-07-21 10:50:37 +01:00
2020-07-13 22:43:43 -07:00
2020-08-03 23:24:26 -07:00
2020-07-27 17:46:24 +09:00
2020-07-27 17:46:24 +09:00
2020-06-29 11:58:11 -07:00
2020-08-03 14:39:35 -07:00
2020-06-29 12:00:46 -07:00
2020-06-29 11:59:26 -07:00
2020-06-29 11:59:26 -07:00
2020-06-29 11:59:25 -07:00
2020-07-17 00:03:11 +01:00
2020-07-28 17:09:49 -07:00
2020-07-22 13:39:31 +02:00
2020-07-16 23:19:51 +02:00
2020-07-06 16:07:25 +02:00
2020-07-20 11:50:47 +01:00
2020-08-06 11:55:43 -07:00
2020-07-13 09:40:21 +01:00
2020-08-04 21:00:11 -07:00
2020-07-29 16:14:24 +02:00
2020-07-29 17:14:38 +02:00
2020-07-20 09:39:11 +02:00
2020-08-03 15:04:48 -07:00
2020-06-30 10:46:39 -07:00
2020-08-07 11:33:22 -07:00
2020-06-28 17:01:20 +02:00
2020-06-28 17:01:20 +02:00
2020-07-28 13:43:40 -07:00
2020-06-17 18:33:13 +02:00
2020-06-17 18:33:13 +02:00
2020-07-15 12:45:06 +03:00
2020-06-26 00:27:37 -07:00
2020-08-05 20:13:21 -07:00
2020-07-01 19:16:30 +02:00
2020-06-30 12:18:08 -06:00
2020-07-27 14:11:22 +02:00
2020-07-31 17:00:44 -07:00
2020-06-22 19:58:06 +03:00
2020-07-08 11:14:22 +02:00
2020-06-18 11:37:03 +02:00
2020-06-29 12:01:44 -07:00
2020-07-24 08:16:01 +03:00
2020-07-24 09:26:23 +03:00
2020-07-29 16:14:18 +02:00
2020-06-18 12:10:37 -07:00
2020-07-04 09:35:36 -05:00
2020-07-15 16:48:11 +02:00
2020-07-07 11:58:59 -05:00
2020-07-20 15:04:32 +02:00
2020-07-10 13:45:32 +02:00
2020-06-26 00:27:38 -07:00
2020-07-10 14:55:25 +02:00
2020-06-24 17:08:31 +02:00
2020-07-24 12:42:41 -07:00