summaryrefslogtreecommitdiff
path: root/fs/cifs/cifsencrypt.c
diff options
context:
space:
mode:
authorAurelien Aptel <aaptel@suse.com>2018-01-25 17:59:39 +0300
committerSteve French <smfrench@gmail.com>2018-01-27 02:03:00 +0300
commit97f4b7276b829a8927ac903a119bef2f963ccc58 (patch)
tree51545e98eaf4b2bacaf6aeb19dabe57453fc77b7 /fs/cifs/cifsencrypt.c
parent2026b06e9ce8521dae1a71654dc5a39e7ce3b871 (diff)
downloadlinux-97f4b7276b829a8927ac903a119bef2f963ccc58.tar.xz
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/cifsencrypt.c')
-rw-r--r--fs/cifs/cifsencrypt.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index 68abbb0db608..f2b0a7f124da 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -325,9 +325,8 @@ int calc_lanman_hash(const char *password, const char *cryptkey, bool encrypt,
{
int i;
int rc;
- char password_with_pad[CIFS_ENCPWD_SIZE];
+ char password_with_pad[CIFS_ENCPWD_SIZE] = {0};
- memset(password_with_pad, 0, CIFS_ENCPWD_SIZE);
if (password)
strncpy(password_with_pad, password, CIFS_ENCPWD_SIZE);