dm-crypt: use memzero_explicit for on-stack buffer
PATCH 1/1 dm-crypt: use memzero_explicit for on-stack buffer
Use memzero_explicit to cleanup sensitive data allocated on stack to prevent compiler optimize and remove memset() calls.
Signed-off-by Milan Broz <[email protected]>
--- drivers/md/dm-crypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/dm-crypt.c +1 -1
@@ -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; }
Signature · 1 line
2.1.3