Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

security/keys: use kvfree_sensitive()

Use kvfree_sensitive() instead of open-coding it.

Signed-off-by: Denis Efremov <efremov@linux.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Reviewed-by: Ben Boeckel <mathstuf@gmail.com>

authored by

Denis Efremov and committed by
David Howells
272a1219 8fe62e0c

+3 -6
+3 -6
security/keys/big_key.c
··· 121 121 *path = file->f_path; 122 122 path_get(path); 123 123 fput(file); 124 - memzero_explicit(buf, enclen); 125 - kvfree(buf); 124 + kvfree_sensitive(buf, enclen); 126 125 } else { 127 126 /* Just store the data in a buffer */ 128 127 void *data = kmalloc(datalen, GFP_KERNEL); ··· 139 140 err_enckey: 140 141 kfree_sensitive(enckey); 141 142 error: 142 - memzero_explicit(buf, enclen); 143 - kvfree(buf); 143 + kvfree_sensitive(buf, enclen); 144 144 return ret; 145 145 } 146 146 ··· 271 273 err_fput: 272 274 fput(file); 273 275 error: 274 - memzero_explicit(buf, enclen); 275 - kvfree(buf); 276 + kvfree_sensitive(buf, enclen); 276 277 } else { 277 278 ret = datalen; 278 279 memcpy(buffer, key->payload.data[big_key_data], datalen);