diff options
author | lloyd <[email protected]> | 2009-01-03 03:57:33 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-01-03 03:57:33 +0000 |
commit | f9027c938fc4e2b911d367094533f9acba375586 (patch) | |
tree | 0cacbf79a5caef550a4c232c5cdb61dc277a005b /src | |
parent | 338895f290ab5d197da596836ecc03625f9091f3 (diff) |
In the Unix entropy source fast poll, clear the stat buf before
we call stat. Apparently on 32-bit Linux (or at least on Ubuntu
8.04/x86), struct stat has some padding bytes, which are not
written to by the syscall, but valgrind doesn't realize that this
is OK, and warns about uninitialized memory access when we read
the contents of the struct. Since this data is then fed into the
PRNG, the PRNG state and output becomes tainted, which makes
valgrind's output rather useless.
Diffstat (limited to 'src')
-rw-r--r-- | src/entropy/unix_procs/es_unix.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/entropy/unix_procs/es_unix.cpp b/src/entropy/unix_procs/es_unix.cpp index cf7e0a8e5..124a08da7 100644 --- a/src/entropy/unix_procs/es_unix.cpp +++ b/src/entropy/unix_procs/es_unix.cpp @@ -68,6 +68,7 @@ u32bit Unix_EntropySource::fast_poll(byte buf[], u32bit length) for(u32bit j = 0; stat_targets[j]; j++) { struct stat statbuf; + clear_mem(&statbuf, 1); ::stat(stat_targets[j], &statbuf); buf_i = xor_into_buf(buf, buf_i, length, statbuf); } |