padlock + SIGSEGV

Nikos Mavrogiannopoulos nmav at gnutls.org
Sun Jan 27 11:08:47 CET 2008


In some occasions I've noticed some segmentation fauls on padlock code. This 
was using the debian libldap + gnutls13 + libgcrypt 1.4.0.

I'm trying to understand why this is happening, but I have no clue. Notice 
that the stack changes after entering the "asm volatile". To make it more 
interesting gnutls-cli compiled with gnutls13 and libgcrypt 1.4.0 works as 
expected. gnutls_global_init() is used in both cases so it shouldn't be 
initialization error. Any suggestions on why this might happen?

gdb ls
(gdb) break do_padlock
Breakpoint 4 at 0xb7958dca: file rijndael.c, line 2043.
(gdb) run -al /home/
Breakpoint 4 at 0xb79b4dca: file rijndael.c, line 2043.
[Switching to Thread -1210574656 (LWP 12034)]

Breakpoint 2, do_padlock (ctx=0xbfc3addc, decrypt_flag=0, 
bx=0xbfc3afe8 "(�\006\b��\237������o��", 
    ax=0xb79f9ac8 "\001K�\"x�\2353\035Q\200\0206C�\232") at rijndael.c:2043
2043    {
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0xb79b4e41 in do_padlock (ctx=0xbfc3ac5c, decrypt_flag=<value optimized out>, 
    bx=0xbfc3afe8 "(�\006\b��\237������o��", ax=0x1 <Address 0x1 out of 
bounds>) at rijndael.c:2062
2062      asm volatile 
(gdb) 
(gdb) bt
#0  0xb79b4e41 in do_padlock (ctx=0xbfc3ac5c, decrypt_flag=<value optimized 
out>, 
    bx=0xbfc3afe8 "(�\006\b��\237������o��", ax=0x1 <Address 0x1 out of 
bounds>) at rijndael.c:2062
#1  0xb79b5442 in rijndael_encrypt (context=0xbfc3addc, b=0x1 <Address 0x1 out 
of bounds>, 
    a=0xb79f9ac8 "\001K�\"x�\2353\035Q\200\0206C�\232") at rijndael.c:2091
#2  0xb79b5b54 in rijndael_setkey (context=0x808dee0, 
key=0x80900e8 "\034L�g�5D\231j>#�=\0024���\b\b�\001\t\b ", 
    keylen=16) at rijndael.c:2288
#3  0xb79a1123 in _gcry_cipher_ctl (h=0x808de90, cmd=1, buffer=0x80900e8, 
buflen=16) at cipher.c:774
#4  0xb7998e62 in gcry_cipher_ctl (h=0x808de90, cmd=1, buffer=0x80900e8, 
buflen=16) at visibility.c:504
#5  0xb7b1f4d3 in ?? () from /usr/lib/libgnutls.so.13
#6  0x0808de90 in ?? ()
#7  0x00000001 in ?? ()
#8  0x080900e8 in ?? ()
#9  0x00000010 in ?? ()
#10 0x0806b1b8 in ?? ()
#11 0xb7b4c91c in ?? () from /usr/lib/libgnutls.so.13
#12 0xbfc3b0b4 in ?? ()
#13 0xb7affa72 in _gnutls_cipher_init () from /usr/lib/libgnutls.so.13
Backtrace stopped: frame did not save the PC
(gdb) 




More information about the Gcrypt-devel mailing list