diff options
author | Milan Broz <gmazyland@gmail.com> | 2014-11-22 09:36:04 +0100 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2015-06-23 15:28:33 +0800 |
commit | 0596b350c482f03eda8ed40867404bb2953b3e49 (patch) | |
tree | 2ae7111e15ea5c879b5f291dfbaa2c049f999de8 /drivers | |
parent | 0db03f43a007e764bf2a747e9cf742e07eb72b9a (diff) |
dm crypt: use memzero_explicit for on-stack buffer
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>
Cc: stable@vger.kernel.org
(cherry picked from commit 1a71d6ffe18c0d0f03fc8531949cc8ed41d702ee)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/dm-crypt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index fc8c10d2e6e2..421f8118c587 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -711,7 +711,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; } |