Skip to contentSkip to conversation

Solaris 11: t_lpback.sh coredump on AES-GCM

Openvpn-devel Jens Neuhalfen 2 participants 6 messages May 21, 2016 – May 22, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

./t_lpback.sh fails with AES-GCM mode on Solaris 11. CRYPTO_gcm128_setiv from libcrypto seems to jump into NULL pointer country.

This is currently no issue for me, but in case anyone cares I put the coredump on https://www.neuhalfen.name/__downloads__/openvpn/core_solaris11_aes-gcm_crash .

cheers
Jens

./t_lpback.sh
-n Testing cipher AES-128-CBC...
OK
-n Testing cipher AES-128-CFB...
OK
-n Testing cipher AES-128-CFB1...
OK
-n Testing cipher AES-128-CFB8...
OK
-n Testing cipher AES-128-GCM...
FAILED
Sat May 21 19:01:09 2016 OpenVPN 2.3_git [git:master/b207d8ae9a6b0e99] i386-pc-solaris2.11 [SSL (OpenSSL)] [IPv6] built on May 21 2016 Sat May 21 19:01:09 2016 library versions: OpenSSL 1.0.1p 9 Jul 2015
Sat May 21 19:01:09 2016 OpenVPN 2.3_git [git:master/b207d8ae9a6b0e99] i386-pc-solaris2.11 [SSL (OpenSSL)] [IPv6] built on May 21 2016 Sat May 21 19:01:09 2016 Entering OpenVPN crypto self-test mode.
Sat May 21 19:01:09 2016 TESTING ENCRYPT/DECRYPT of packet length=1
Sat May 21 19:01:09 2016 TESTING ENCRYPT/DECRYPT of packet length=2
./t_lpback.sh: line 48: 19049: Memory fault(coredump)

———————————————
gdb ../src/openvpn/openvpn core
...
Reading symbols from /export/home/jens/openvpn/src/openvpn/openvpn...done.
[New LWP 1]
[New LWP 1]
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]
Core was generated by `../src/openvpn/openvpn --test-crypto --secret key.19038 --cipher AES-256-GCM'. Program terminated with signal 11, Segmentation fault.
#0 0x00000000 in ?? ()
(gdb) bt

#0  0x00000000 in ?? ()
#1  0x07505972 in CRYPTO_gcm128_setiv () from /lib/libcrypto.so.1.0.0
#2  0x075402af in aesni_gcm_init_key () from /lib/libcrypto.so.1.0.0
#3  0x0753cc50 in EVP_CipherInit_ex () from /lib/libcrypto.so.1.0.0
#4  0x0753c968 in EVP_CipherInit () from /lib/libcrypto.so.1.0.0
#5  0x0808bc10 in cipher_ctx_reset (ctx=0x811b808, [email protected]...=0xfeffd930 "") at crypto_openssl.c:623
#6  0x0808985d in openvpn_encrypt_aead (opt=0xfeffe144, work=..., buf=0xfeffd9f0) at crypto.c:130
#7  openvpn_encrypt ([email protected]...=0xfeffd9f0, work=..., [email protected]...=0xfeffe144) at crypto.c:340
#8  0x0808ab02 in test_crypto ([email protected]...=0xfeffe144, [email protected]...=0xfeffe00c) at crypto.c:1078
#9  0x0809a4eb in test_crypto_thread (arg=0xfeffda38) at init.c:3921

#10 do_test_crypto ([email protected]...=0xfeffe358) at init.c:3947
#11 0x080b1f05 in openvpn_main ([email protected]...=6, [email protected]...=0xfeffec88) at openvpn.c:232 #12 0x080ee9c1 in main (argc=6, argv=0xfeffec88) at openvpn.c:345
(gdb) frame 1
#1 0x07505972 in CRYPTO_gcm128_setiv () from /lib/libcrypto.so.1.0.0
(gdb) info args
No symbol table info available.
(gdb) info local
No symbol table info available.
(gdb) info locals

...

#1 lore raw

Hi,

Quoted 1 line · Jens Neuhalfen

./t_lpback.sh fails with AES-GCM mode on Solaris 11. CRYPTO_gcm128_setiv from libcrypto seems to jump into NULL pointer country.

Oh, interesting. My OpenSSL on the OpenSolaris box is so old that it does not have the AES-GCM modes, so I never tested this (and, of course, "all tests pass").

Is this Sparc or Intel Solaris? Which version of OpenSSL? 32 or 64 bit?

I tried building with 1.0.2g (static libraries, 32 bit) and that actually passes GCM tests for me...

-n Testing cipher AES-128-CBC...
OK
-n Testing cipher AES-128-CFB...
OK
-n Testing cipher AES-128-CFB1...
OK
-n Testing cipher AES-128-CFB8...
OK
-n Testing cipher AES-128-GCM...
OK
...
OK
-n Testing cipher AES-256-CFB8...
OK
-n Testing cipher AES-256-GCM...
OK
-n Testing cipher AES-256-OFB...
OK
...
======================
All 2 tests passed
(1 tests were not run)
======================

OpenVPN 2.PRODUCT_VERSION_MINORPRODUCT_VERSION_PATCH [git:master/a9faebe7d4234cdf+] i386-pc-solaris2.11 [SSL (OpenSSL)] [LZO] [LZ4] [IPv6] built on May 21 2016 library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.03

... so at this point, it's hard to say...

gert

PS: and yes, our test scripts and Solaris' "echo" function do not like each other very much. And neither does the script that builds the version number from git :-)

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#2 lore raw

Hi Gert,

Quoted 10 lines

Hi,

Quoted 1 line · Jens Neuhalfen

./t_lpback.sh fails with AES-GCM mode on Solaris 11. CRYPTO_gcm128_setiv from libcrypto seems to jump into NULL pointer country.

Oh, interesting. My OpenSSL on the OpenSolaris box is so old that it does not have the AES-GCM modes, so I never tested this (and, of course, "all tests pass").

Is this Sparc or Intel Solaris? Which version of OpenSSL? 32 or 64 bit?

This is
* Solaris 11.3 on Intel 64 bit (isainfo -k —> amd64), fresh from Sun^H^H^HOracle

* OpenSSL 1.0.1p. openssl is compiled as 32 bit library (file /lib/libcrypto.so.1.0.0 —> /lib/libcrypto.so.1.0.0: ELF 32-bit LSB dynamic lib 80386 Version 1 [SSE2 SSE MMX CMOV FPU], dynamically linked, not stripped).

pkg info openssl
Name: library/security/openssl
Summary: OpenSSL - a Toolkit for Secure Sockets Layer (SSL v2/v3) and Transport Layer (TLS v1) protocols and general purpose cryptographic library
Description: OpenSSL is a full-featured toolkit implementing the Secure
Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1)
protocols as well as a full-strength general purpose
cryptography library.
Category: System/Security
State: Installed
Publisher: solaris
Version: 1.0.1.16 (1.0.1p)
Build Release: 5.11

        Branch: 0.175.3.0.0.30.0
Packaging Date: August 21, 2015 05:11:12 PM
          Size: 13.26 MB
          FMRI: pkg://solaris/library/security/[email protected]...,5.11-0.175.3.0.0.30.0:20150821T171112Z

Cheers Jens

#3 lore raw

Hi,

Quoted 4 lines · Jens Neuhalfen

This is
* Solaris 11.3 on Intel 64 bit (isainfo -k ???> amd64), fresh from Sun^H^H^HOracle

* OpenSSL 1.0.1p. openssl is compiled as 32 bit library (file /lib/libcrypto.so.1.0.0 ???> /lib/libcrypto.so.1.0.0: ELF 32-bit LSB dynamic lib 80386 Version 1 [SSE2 SSE MMX CMOV FPU], dynamically linked, not stripped).

Tried building with 1.0.1p (using gcc), and the first thing to notice is that *openssl* fails its own "make test" run (something in the RSA key test aborts with "keys do not match"). So something is fishy with that version.

Interesting enough, our "make check" *still* works nicely for me...

-n Testing cipher AES-128-GCM...
OK
-n Testing cipher AES-192-GCM...
OK
-n Testing cipher AES-256-GCM...
OK
...
All 2 tests passed

So it does look like that 1.0.1p and Solaris do not get along well, but it might depend on compiler used (I use gcc, Oracle surely does not).

The most recent version is 1.0.1t, which interestingly enough, has the same self test error...

CMS consistency test
/opt/csw/bin/perl cms-test.pl
CMS => PKCS#7 compatibility tests
signed content DER format, RSA key: verify error
make[1]: *** [test_cms] Error 1

(this works in 1.0.2, so I think it's not my local system that is funny)

Ceterum censeo: I acknowledge that something is funny here, but I do not think it's OpenVPN's fault (otherwise it should show up for me), so not much we can do about it.

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...
#4 lore raw

Hi Gert,

openssl is a joy to work with :-/

[snip]

Quoted 3 lines

Ceterum censeo: I acknowledge that something is funny here, but I do not think it's OpenVPN's fault (otherwise it should show up for me), so not much we can do about it.

A broken ssl library and openvpn - What could possibly go wrong?

But I agree, we should ignore that as out of scope for openvpn. Not much we can do for Oracle.

Jens

#5 lore raw

Hi,

Quoted 1 line · Jens Neuhalfen

A broken ssl library and openvpn - What could possibly go wrong?

We could recommend building with mbedtls... :-)

gert

Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
                                                           //www.muc.de/~gert/
Gert Doering - Munich, Germany                             [email protected]...
fax: +49-89-35655025                        [email protected]...