diff options
author | 2018-01-25 15:59:39 +0100 | |
---|---|---|
committer | 2018-01-26 17:03:00 -0600 | |
commit | 97f4b7276b829a8927ac903a119bef2f963ccc58 (patch) | |
tree | 51545e98eaf4b2bacaf6aeb19dabe57453fc77b7 /fs/cifs/misc.c | |
parent | Cleanup some minor endian issues in smb3 rdma (diff) | |
download | linux-97f4b7276b829a8927ac903a119bef2f963ccc58.tar.gz linux-97f4b7276b829a8927ac903a119bef2f963ccc58.tar.bz2 linux-97f4b7276b829a8927ac903a119bef2f963ccc58.zip |
CIFS: zero sensitive data when freeing
also replaces memset()+kfree() by kzfree().
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Cc: <stable@vger.kernel.org>
Diffstat (limited to 'fs/cifs/misc.c')
-rw-r--r-- | fs/cifs/misc.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c index eea93ac15ef0..a0dbced4a45c 100644 --- a/fs/cifs/misc.c +++ b/fs/cifs/misc.c @@ -98,14 +98,11 @@ sesInfoFree(struct cifs_ses *buf_to_free) kfree(buf_to_free->serverOS); kfree(buf_to_free->serverDomain); kfree(buf_to_free->serverNOS); - if (buf_to_free->password) { - memset(buf_to_free->password, 0, strlen(buf_to_free->password)); - kfree(buf_to_free->password); - } + kzfree(buf_to_free->password); kfree(buf_to_free->user_name); kfree(buf_to_free->domainName); - kfree(buf_to_free->auth_key.response); - kfree(buf_to_free); + kzfree(buf_to_free->auth_key.response); + kzfree(buf_to_free); } struct cifs_tcon * @@ -136,10 +133,7 @@ tconInfoFree(struct cifs_tcon *buf_to_free) } atomic_dec(&tconInfoAllocCount); kfree(buf_to_free->nativeFileSystem); - if (buf_to_free->password) { - memset(buf_to_free->password, 0, strlen(buf_to_free->password)); - kfree(buf_to_free->password); - } + kzfree(buf_to_free->password); kfree(buf_to_free); } |