gnutls-cli --benchmark type overflow on 32 bit arch
Description of problem:
On 32bit gnutls-cli --benchmark-ciphers produces wrong results. Same machine 64bit installation:
Checking ciphers, payload size: 16384
3DES-CBC 27.91 MB/sec
AES-128-CBC 1.34 GB/sec
SALSA20-256 0.62 GB/sec
NULL 35.20 GB/sec
and 32bit chroot:
Checking ciphers, payload size: 16384
3DES-CBC 27.19 MB/sec
AES-128-CBC 0.47 GB/sec
SALSA20-256 0.39 GB/sec
NULL 0.40 GB/sec
Version of gnutls used:
3.6.5, but it should be present in 3.6.6 also.
Distributor of gnutls (e.g., Ubuntu, Fedora, RHEL)
Debian
How reproducible:
Always.
Steps to Reproduce:
- one Run gnutls-cli --benchmark-ciphers
This was found and diagnosed by Hiroyuki YAMAMORI as https://bugs.debian.org/920477:
The following code is the cause.
"gnutls-3.6.5/src/benchmark.h" line 45
struct benchmark_st {
struct timespec start;
unsigned long size; <== 32bit in i386 arch.
sighandler_t old_handler;
#if defined(_WIN32)
HANDLE wtimer;
HANDLE wthread;
LARGE_INTEGER alarm_timeout;
#endif
This size variable will overflow.