Page MenuHome GnuPG

libgcrypt-1.6.4: benchmark and keygen test failed due to segfault
Closed, ResolvedPublic

Description

Both segfault happened when function gcry_pk_genkey() is called. Used dbx to trace all
the way down to src/sexp.c in which this line: memcpy (c.pos, mp, nm); caused the
segfault. System information: Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC.

Details

Version
1.6.4

Event Timeline

testadizzy added projects: libgcrypt, Bug Report.
testadizzy added a subscriber: testadizzy.

testadizzy lowered the priority of this task from High to Normal.Jan 20 2016, 6:04 PM

Can't seem to edit my first post, so create this second post to provide extra info.

Ran all tests in libgcrypt/libgcrypt-1.6.4/tests directory, benchmark and keygen
failed. Here's the output:

./benchmark --verbose

.
.
.

Algorithm generate 100*sign 100*verify

RSA 1024 bit 310ms 1040ms 50ms
RSA 2048 bit 2370ms 7070ms 150ms
RSA 3072 bit 15950ms 21660ms 340ms
RSA 4096 bit 139410ms 47920ms 620ms
DSA 1024/160 - 600ms 820ms
DSA 2048/224 - 2920ms 3940ms
DSA 3072/256 - 6730ms 9520ms
ECDSA 192 bit
Segmentation Fault (core dumped)

./keygen --verbose
keygen: creating 1024 bit RSA key
keygen: creating 512 bit RSA key with e=257
keygen: creating 512 bit RSA key with default e
keygen: public exponent: 29
keygen: creating 1024 bit Elgamal key
keygen: creating 5 1024 bit DSA keys
keygen: creating 1536 bit DSA key
keygen: creating ECC key using curve NIST P-521
Segmentation Fault (core dumped)

And that other bug report was?
You have full user permissions and thus you may comment on all bug reports.

I'm sorry, do you mean the zip file that i uploaded earlier? That was just
screenshots of the output message which i listed in my second post. It's just
benchmark and keygen, and i am pretty sure both errors are related to ECC key
generation.

It's my first time using this site, please let me know if i need to provide more
information. And thanks!

Here's something i got from running dbx with benchmark (with "check -access" option
to detect illegal memory access):

dbx benchmark

Reading benchmark
Reading ld.so.1
Reading libgcrypt.so.20.0.4
Reading libgpg-error.so.0.17.0
Reading librt.so.1
Reading libsocket.so.1
Reading libc.so.1
Reading libgcc_s.so.1
Reading libaio.so.1
Reading libmd.so.1
Reading libnsl.so.1
(dbx) check -access
access checking - ON
(dbx) run --verbose
Running: benchmark --verbose
(process id 20779)
Reading rtcapihook.so
Reading libdl.so.1
Reading rtcaudit.so
Reading libmapmalloc.so.1
Reading libgen.so.1
Reading libm.so.2
Reading libm_hwcap1.so.2
Reading libc_psr.so.1
Reading rtcboot.so
Reading librtc.so
RTC: Enabling Error Checking...
RTC: Running program...

...

Algorithm generate 100*sign 100*verify

RSA 1024 bit Read from uninitialized (rui):
Attempting to read 1 byte at address 0xffbfeba8

which is 312 bytes above the current stack pointer

stopped in add_randomness at line 1085 in file "random-csprng.c"
1085 rndpool[pool_writepos++] ^= *p++;
(dbx)

Hope this helps solve the issue.

Can you please enter the command "where" in dbx after the fault?

No info recevied and thus closing. You should switch to 1.7 (and soon 1.8)
anyway. A lot of things have been fixed since 1.6.

werner claimed this task.
werner added a project: Info Needed.