[dm-crypt] Memory leak when using openssl backend

Per Johansson per.x.johansson at axis.com
Tue Oct 11 10:58:59 CEST 2016


I have found a memory leak when using openssl backend. I don't know if 
this is the proper way to report it.

The problem is that crypt_hash_init() and crypt_hash_restart() calls 
EVP_DigestInit() but  crypt_hash_final() calls EVP_DigestFinal_ex(). 
This results in that the context struct is zeroed when 
crypt_hash_restart() calls EVP_DigestInit(), and the memory allocated by 
the previous call to EVP_DigestInit() is lost. The version of openssl we 
use is 1.0.2g. This leak might not occur in later versions of openssl 
that has changed how those functions work.

I have attached a suggested fix that only uses the _ex versions of the 
EVP functions.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-memory-leak-when-using-openssl-backend.patch
Type: text/x-patch
Size: 1203 bytes
Desc: not available
URL: <http://www.saout.de/pipermail/dm-crypt/attachments/20161011/77bb3eb3/attachment.bin>

More information about the dm-crypt mailing list