Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 599272 - gpg/libgcrypt segmentation fault
Summary: gpg/libgcrypt segmentation fault
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-09 10:32 UTC by Samuel Tardieu
Modified: 2016-11-09 11:20 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Tardieu 2016-11-09 10:32:24 UTC
Running linux-4.7.10-hardened, using "gpg -e -r RECIPIENT" on any file and with any key will lead to a segmentation fault in libgcrypt rijndael selftest procedure.

This is with app-crypt/gnupg-2.1.15 and dev-libs/libgcrypt-1.7.3.

I have no proof that this is due to the use of -hardened, but the lack of reports in the issue tracking system makes me suspect it (I don't have access to a non-hardened Gentoo to test this).

(gdb) r -e -r sam@rfc1149.net
Starting program: /usr/bin/gpg -e -r sam@rfc1149.net

Program received signal SIGSEGV, Segmentation fault.
_gcry_aes_ssse3_decrypt (ctx=0x39c93a0, dst=0x33bef331305 <_aes_schedule_core+725> "f\017\357\330f\017\070", src=<optimized out>)
    at /usr/src/debug/dev-libs/libgcrypt-1.7.3/libgcrypt-1.7.3/cipher/rijndael-ssse3-amd64.c:430
430       asm volatile ("movdqu %%xmm0, %[dst]\n\t"

(gdb) bt
#0  _gcry_aes_ssse3_decrypt (ctx=0x39c93a0, dst=0x33bef331305 <_aes_schedule_core+725> "f\017\357\330f\017\070", src=<optimized out>)
    at /usr/src/debug/dev-libs/libgcrypt-1.7.3/libgcrypt-1.7.3/cipher/rijndael-ssse3-amd64.c:430
#1  0x0000033bef32df48 in selftest_basic_128 () at /usr/src/debug/dev-libs/libgcrypt-1.7.3/libgcrypt-1.7.3/cipher/rijndael.c:1532
#2  0x0000033bef32d99b in selftest () at /usr/src/debug/dev-libs/libgcrypt-1.7.3/libgcrypt-1.7.3/cipher/rijndael.c:1681
#3  do_setkey (ctx=0x33befc232f0,
    key=0x33befc2301c "\235\236\221\230\321\363\372\200K\373ԡke-\334Z\306\355\017)\210Mt\305t\301\270\222,", keylen=4013102988)
    at /usr/src/debug/dev-libs/libgcrypt-1.7.3/libgcrypt-1.7.3/cipher/rijndael.c:285
#4  0x0000033bef30b397 in cipher_setkey (keylen=keylen@entry=3555960435440,
    key=key@entry=0x33befc2301c "\235\236\221\230\321\363\372\200K\373ԡke-\334Z\306\355\017)\210Mt\305t\301\270\222,",
    c=c@entry=0x33befc23070) at /usr/src/debug/dev-libs/libgcrypt-1.7.3/libgcrypt-1.7.3/cipher/cipher.c:633
#5  _gcry_cipher_setkey (hd=hd@entry=0x33befc23070, key=key@entry=0x33befc2301c, keylen=keylen@entry=32)
    at /usr/src/debug/dev-libs/libgcrypt-1.7.3/libgcrypt-1.7.3/cipher/cipher.c:1064
#6  0x0000033bef2ffe9e in gcry_cipher_setkey (hd=0x33befc23070, key=key@entry=0x33befc2301c, keylen=32)
    at /usr/src/debug/dev-libs/libgcrypt-1.7.3/libgcrypt-1.7.3/src/visibility.c:724
#7  0x0000000000429eb8 in make_session_key (dek=0x33befc23008) at seskey.c:54
#8  0x000000000044ec1d in encrypt_crypt (ctrl=ctrl@entry=0x39ba670, filefd=filefd@entry=-1, filename=filename@entry=0x0,
    remusr=<optimized out>, use_symkey=0, provided_keys=0x0, outputfd=-1) at encrypt.c:633
#9  0x000000000040cc42 in main (argc=0, argv=0x39c4e75eae8) at gpg.c:3922
Comment 1 Samuel Tardieu 2016-11-09 11:19:02 UTC
This issue can be closed: gcc was not compiled with the right profile. Recompiling it and using it to recompile libgcrypt solved it.
Comment 2 Samuel Tardieu 2016-11-09 11:20:03 UTC
Right status is probably "invalid".