|
From: Bruce C. <bru...@po...> - 2012-03-27 21:53:58
|
I'm building a C99 app on ubuntu 10.4 using openssl. Valgrind is reporting hundreds of the errors below. I have read through the manual/help and used the techniques described in the excellent article http://wiki.wxwidgets.org/Valgrind_Suppression_File_Howto. 99% of these are caused by a value created in RAND_load_file (I am seperately investigating building openssl with -DPURIFY). I could get rid of all these if I could tell Valgrind to ignore any value created by RAND_load_file. Is there such a capability? ==00:00:00:17.356 30844== Conditional jump or move depends on uninitialised value(s) ==00:00:00:17.356 30844== at 0x423F92B: SHA1_Final (in /lib/i686/cmov/libcrypto.so.0.9.8) ==00:00:00:17.356 30844== by 0x42ABBB6: ??? (in /lib/i686/cmov/libcrypto.so.0.9.8) ==00:00:00:17.356 30844== by 0x42A7614: EVP_DigestFinal_ex (in /lib/i686/cmov/libcrypto.so.0.9.8) ==00:00:00:17.356 30844== by 0x4247F2F: HMAC_Final (in /lib/i686/cmov/libcrypto.so.0.9.8) ==00:00:00:17.356 30844== by 0x41D3931: tls1_mac (in /lib/i686/cmov/libssl.so.0.9.8) ==00:00:00:17.356 30844== by 0x41CD932: ssl3_read_bytes (in /lib/i686/cmov/libssl.so.0.9.8) ==00:00:00:17.356 30844== by 0x41CEA15: ssl3_get_message (in /lib/i686/cmov/libssl.so.0.9.8) ==00:00:00:17.356 30844== by 0x41CF00D: ssl3_get_finished (in /lib/i686/cmov/libssl.so.0.9.8) ==00:00:00:17.356 30844== by 0x41C8FCD: ssl3_connect (in /lib/i686/cmov/libssl.so.0.9.8) ==00:00:00:17.356 30844== by 0x41DE719: SSL_connect (in /lib/i686/cmov/libssl.so.0.9.8) ==00:00:00:17.356 30844== by 0x418A6B0: ??? (in /usr/lib/libcurl.so.4.1.1) ==00:00:00:17.356 30844== by 0x418BA02: ??? (in /usr/lib/libcurl.so.4.1.1) ==00:00:00:17.356 30844== Uninitialised value was created by a stack allocation ==00:00:00:17.356 30844== at 0x42A2956: RAND_load_file (in /lib/i686/cmov/libcrypto.so.0.9.8) thanks |
|
From: Bruce C. <bru...@po...> - 2012-03-28 06:46:40
|
On 28/03/2012 4:56 PM, Igmar Palsenberg wrote: > >> ......I could get rid of all these if I could tell Valgrind to ignore >> any value created by RAND_load_file. Is there such a capability? >> >> ==00:00:00:17.356 30844== Conditional jump or move depends on >> uninitialised value(s) >> ==00:00:00:17.356 30844== at 0x423F92B: SHA1_Final (in >> /lib/i686/cmov/libcrypto.so.0.9.8) >> ==00:00:00:17.356 30844== by 0x418BA02: ??? (in >> /usr/lib/libcurl.so.4.1.1) >> ==00:00:00:17.356 30844== Uninitialised value was created by a stack >> allocation >> ==00:00:00:17.356 30844== at 0x42A2956: RAND_load_file (in >> /lib/i686/cmov/libcrypto.so.0.9.8) >> > This was / is caused by the RNG using uninitialized bytes for it's > RNG. There was an article on slashdot a while ago, when the Debian guys > issues a patch to initialize the values (due to a valgrind report). > Result : Insecure SSH keys. See > http://wiki.debian.org/SSLkeys#End_User_Summary for more information. > > My advice : Write a suppression for this. > > > > Igmar Thanks for the link - I'm aware of PRNG debian "solution" and debates around valgrind/openssl. >> Write a suppression for this. That's my question - how? Or rather - can I write a suppression that doesn't include the stack but just says ignore the error for any value created in RAND_load_file? My impression is I can't. |
|
From: Matthias S. <zz...@ge...> - 2012-03-28 18:38:23
|
On 28.03.2012 08:46, Bruce Cartland wrote: > On 28/03/2012 4:56 PM, Igmar Palsenberg wrote: >> >>> ......I could get rid of all these if I could tell Valgrind to >>> ignore any value created by RAND_load_file. Is there such a capability? >>> >>> ==00:00:00:17.356 30844== Conditional jump or move depends on >>> uninitialised value(s) >>> ==00:00:00:17.356 30844== at 0x423F92B: SHA1_Final (in >>> /lib/i686/cmov/libcrypto.so.0.9.8) >>> ==00:00:00:17.356 30844== by 0x418BA02: ??? (in >>> /usr/lib/libcurl.so.4.1.1) >>> ==00:00:00:17.356 30844== Uninitialised value was created by a >>> stack allocation >>> ==00:00:00:17.356 30844== at 0x42A2956: RAND_load_file (in >>> /lib/i686/cmov/libcrypto.so.0.9.8) >>> >> This was / is caused by the RNG using uninitialized bytes for it's >> RNG. There was an article on slashdot a while ago, when the Debian guys >> issues a patch to initialize the values (due to a valgrind report). >> Result : Insecure SSH keys. See >> http://wiki.debian.org/SSLkeys#End_User_Summary for more information. >> >> My advice : Write a suppression for this. >> >> >> >> Igmar > Thanks for the link - I'm aware of PRNG debian "solution" and debates > around valgrind/openssl. > > >> Write a suppression for this. > > That's my question - how? Or rather - can I write a suppression that > doesn't include the stack but just says ignore the error for any value > created in RAND_load_file? My impression is I can't. > Maybe it is possible (without looking at the code) to just change that method to set the variable to defined using VALGRIND_MAKE_MEM_DEFINED. Matthias |
|
From: Bruce C. <bru...@po...> - 2012-04-02 07:55:10
|
On 29/03/2012 5:38 AM, Matthias Schwarzott wrote: > Maybe it is possible (without looking at the code) to just change that > method to set the variable to defined using VALGRIND_MAKE_MEM_DEFINED. > > Matthias > Brilliant. Thanks Matthias. I wasn't aware of these macros that can be used in code (only been using Valgrind for a couple of weeks :). I used this to tell valgrind that a couple of values being passed to my callback by libcurl were actually defined. I don't actually know why they're undefined but they're outside my control. This got rid of hundreds of errors that were "polluting" the output. cheers Bruce |