Re: Bad Magic

Michał Trojnara <[email protected]>
Newsgroups gmane.network.stunnel.user
Message-ID <[email protected]>
On 21.02.2017 16:04, Melzer, Jacob wrote:
> 2017.02.21 09:31:25 LOG5[ui]: stunnel 5.40 on powerpc-ibm-aix6.1.0.0
> platform
> 2017.02.21 09:31:25 LOG5[ui]: Compiled/running with OpenSSL 1.0.2j  26
> Sep 2016
[cut]
> INTERNAL ERROR: Bad magic at OpenSSL, line 0

This is the way stunnel detects heap corruption.  Something is very
wrong with your deployment.  This could either be caused by stunnel or
by OpenSSL.  I suspect the latter, as your client works fine.  There is
very little architecture-dependent code in stunnel, so a bug in stunnel
would likely cause it to fail miserably also in the client mode.

> mem.CRYPTO_free() at 0xd97dd8d8
> bn_lib.bn_expand2@AF37_5() at 0xd97e8da4
> bn_mont.BN_mod_mul_montgomery() at 0xd981e150
> ecp_mont.ec_GFp_mont_field_mul() at 0xd9837a18
> ecp_smpl.ec_GFp_simple_point_get_affine_coordinates() at 0xd9839890
> ec_lib.EC_POINT_get_affine_coordinates_GFp() at 0xd9a81dfc
> ecp_oct.ec_GFp_simple_point2oct() at 0xd9acc0d4
> ec_oct.EC_POINT_point2oct() at 0xd9acb754
> ssl3_send_server_key_exchange() at 0xd99e7c28
> ssl3_accept() at 0xd99e9950
> SSL_accept() at 0xd99c0b98

It may be an issue in big number implementation.  It is hard to be sure,
because your heap was already corrupted before the CRYPTO_free() call.

> Should I be concerned that it looks like it is executing "free_function"
> from within an if statement "if OPENSSL_VERSION_NUMBER<0x1010000L but my
> openssl version is
> 
> 2017.02.21 09:31:35 LOG5[ui]: Compiled/running with OpenSSL 1.0.2j  26
> Sep 2016

Yes, "OPENSSL_VERSION_NUMBER<0x10100000L" means "older than OpenSSL 1.1.0".

> -          I had the same problem with earlier versions of openssl.

What about newer versions (1.1.0e, 1.0.2k)?

A debug build of OpenSSL may also be useful to get a more detailed stack
trace.

Also, make sure you're *not* using the IBM's build of OpenSSL, as it
contains some additional bugs courtesy of IBM.

Best regards,
	Mike

_______________________________________________
stunnel-users mailing list
[email protected]
https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users
signature.asc (application/pgp-signature, 884 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYrL3HAAoJEC78f/DUFuAU84wP/3x6jMRAFGyeyfn8u+vSpgfB
SFn/niJBaf5WZBTIj+F/cxDS/ZYAyuS3sQIcJLCjVEt+UWKhcgntY4nnXVS/Lrf/
MtAylitGvOWFdQYdTSQDCzKkHDokCQ0eF825fD9/DxUqAKRF7P1whyINEOd+Vkeh
vtbwZorzl1EwdCyzf7mUDH/Ux14mhPkd7j4SEq8h5RIHpHuz4rcI+cXHfnL0NaLd
c9VPuMm81vhHnIylqnSpYfsfOGA43aMJP0qYjqjDv/nuZsdEUatf35c2gyruT+Nh
C3LZF4lpN4K8MGocV7njj0mp99uN7XTiT3hSQwJhpVwSyS8rSCGR4C3PRYk8v3K6
a1nYhFVqktvnkDy/IvuGKAn6t4KvOlqOh43hI4aOsC10/QWJJSCUysI1B+3359cc
tPhCf3QQptHgcCd6o/0gtXDW2cdE6s1f69+dwuD9nT7n+/vu5tstU0hQMQgiDjI/
JCYDrhqZvgpKLXb5W8iR1I1PufN/D+GzaALmL+TTr5dUHkKfyp60UBkRIP16E4IL
udox5Vu08RNmnoCAcN7zCvIicMqPNhUV8gA3L5W60A1yVH4qC58V0iHoZkoYUkJJ
ke+zEDzqWLj0tLgmv4zxw12zUEPckNItosXH9TBAXv8KUVGbpTAlSouS6FrbG+FH
W3tvmL3PpXV7eqyWSGOG
=/Pq5
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.