forked fromtorvalds/linux
- Notifications
You must be signed in to change notification settings - Fork0
Commit453431a
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 informationthat should not be leaked to other future users of the same memoryobjects.Rename kzfree() to kfree_sensitive() to follow the example of the recentlyadded kvfree_sensitive() and make the intention of the API more explicit.In addition, memzero_explicit() is used to clear the memory to make surethat 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 addinga 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.comSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>1 parent57c720d commit453431a
File tree
114 files changed
+323
-320
lines changed- arch
- s390/crypto
- x86/power
- crypto
- asymmetric_keys
- drivers
- crypto
- allwinner
- sun8i-ce
- sun8i-ss
- amlogic
- caam
- cavium
- cpt
- nitrox
- zip
- ccp
- ccree
- marvell
- cesa
- octeontx
- nx
- virtio
- md
- misc
- net
- ethernet
- hisilicon/hns3/hns3pf
- intel/ixgbe
- ppp
- wireguard
- wireless
- intel/iwlwifi/pcie
- intersil/orinoco
- s390/crypto
- staging
- ks7010
- rtl8723bs/core
- wlan-ng
- target/iscsi
- fs
- cifs
- crypto
- ecryptfs
- include
- crypto
- internal
- linux
- lib
- mpi
- mm
- net
- atm
- bluetooth
- core
- ipv4
- mac80211
- mac802154
- sctp
- sunrpc/auth_gss
- tipc
- wireless
- scripts/coccinelle/free
- security
- apparmor
- include
- keys
- encrypted-keys
- trusted-keys
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
114 files changed
+323
-320
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | | - | |
| 252 | + | |
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
445 | | - | |
| 445 | + | |
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
| 305 | + | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
571 | 571 | | |
572 | 572 | | |
573 | 573 | | |
574 | | - | |
| 574 | + | |
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
| 379 | + | |
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
| 450 | + | |
451 | 451 | | |
452 | 452 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1218 | 1218 | | |
1219 | 1219 | | |
1220 | 1220 | | |
1221 | | - | |
| 1221 | + | |
1222 | 1222 | | |
1223 | 1223 | | |
1224 | | - | |
| 1224 | + | |
1225 | 1225 | | |
1226 | 1226 | | |
1227 | | - | |
| 1227 | + | |
1228 | 1228 | | |
1229 | 1229 | | |
1230 | 1230 | | |
1231 | 1231 | | |
1232 | 1232 | | |
1233 | | - | |
| 1233 | + | |
1234 | 1234 | | |
1235 | 1235 | | |
1236 | 1236 | | |
| |||
1701 | 1701 | | |
1702 | 1702 | | |
1703 | 1703 | | |
1704 | | - | |
| 1704 | + | |
1705 | 1705 | | |
1706 | 1706 | | |
1707 | 1707 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
| 127 | + | |
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| |||
0 commit comments
Comments
(0)