summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorMilan Broz <gmazyland@gmail.com>2014-11-22 09:36:04 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-08 10:30:18 -0800
commit6425e7b0c86689e8788fdc892c503d1c2ba40004 (patch)
tree146490bcb6752ba9de1e56e5d1df30e082f15fe9 /drivers/md
parent3c737ac94b10d6daa476478131c3c4832039d843 (diff)
downloadlwn-6425e7b0c86689e8788fdc892c503d1c2ba40004.tar.gz
lwn-6425e7b0c86689e8788fdc892c503d1c2ba40004.zip
dm crypt: use memzero_explicit for on-stack buffer
commit 1a71d6ffe18c0d0f03fc8531949cc8ed41d702ee upstream. Use memzero_explicit to cleanup sensitive data allocated on stack to prevent the compiler from optimizing and removing memset() calls. Signed-off-by: Milan Broz <gmazyland@gmail.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-crypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index fc93b9330af4..08981be7baa1 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -705,7 +705,7 @@ static int crypt_iv_tcw_whitening(struct crypt_config *cc,
for (i = 0; i < ((1 << SECTOR_SHIFT) / 8); i++)
crypto_xor(data + i * 8, buf, 8);
out:
- memset(buf, 0, sizeof(buf));
+ memzero_explicit(buf, sizeof(buf));
return r;
}