[openssl-dev] [openssl.org #4463] Undefined behavior in cast/c_enc.c

noloader@gmail.com via RT rt at openssl.org
Mon Mar 21 09:51:26 UTC 2016


$ ./config -fsanitize=undefined
...
$ make test HARNESS_VERBOSE=yes
...

../test/recipes/05-test_cast.t ............
1..1
crypto/cast/c_enc.c:78:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:111:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
ecb cast5 ok
crypto/cast/c_enc.c:74:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:70:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:84:9: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:72:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:79:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:85:9: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:80:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:71:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:75:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:77:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:83:9: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:73:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:86:9: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:76:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:81:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
...

../test/recipes/20-test_enc.t .............
1..117
...
ok 38 - cast
crypto/cast/c_enc.c:76:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:86:9: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:103:9: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:113:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
ok 39 - cast base64
ok 40 - cast-cbc
ok 41 - cast-cbc base64
crypto/cast/c_enc.c:70:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'
crypto/cast/c_enc.c:119:5: runtime error: shift exponent 32 is too
large for 32-bit type 'unsigned int'

**********

$ uname -a
Linux core2 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u4
(2016-02-29) x86_64 GNU/Linux

$ gcc --version
gcc (Debian 4.9.2-10) 4.9.2

**********

$ ./config -fsanitize=undefined
Operating system: x86_64-whatever-linux2
Configuring for linux-x86_64
Configuring OpenSSL version 1.1.0-pre5-dev (0x0x10100005L)
    no-crypto-mdebug [default]  OPENSSL_NO_CRYPTO_MDEBUG (skip dir)
    no-crypto-mdebug-backtrace [forced]
OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE (skip dir)
    no-dynamic-engine [forced]
    no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128 (skip dir)
    no-egd          [default]  OPENSSL_NO_EGD (skip dir)
    no-heartbeats   [default]  OPENSSL_NO_HEARTBEATS (skip dir)
    no-md2          [default]  OPENSSL_NO_MD2 (skip dir)
    no-rc5          [default]  OPENSSL_NO_RC5 (skip dir)
    no-sctp         [default]  OPENSSL_NO_SCTP (skip dir)
    no-shared       [default]
    no-ssl-trace    [default]  OPENSSL_NO_SSL_TRACE (skip dir)
    no-ssl3         [default]  OPENSSL_NO_SSL3 (skip dir)
    no-ssl3-method  [default]  OPENSSL_NO_SSL3_METHOD (skip dir)
    no-unit-test    [default]  OPENSSL_NO_UNIT_TEST (skip dir)
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS (skip dir)
    no-zlib         [default]
    no-zlib-dynamic [default]
Configuring for linux-x86_64
IsMK1MF       =no
CC            =gcc
CFLAG         =-Wall -O3 -pthread -m64 -DL_ENDIAN
-fsanitize=undefined -Wa,--noexecstack
SHARED_CFLAG  =-fPIC
DEFINES       =DSO_DLFCN HAVE_DLFCN_H OPENSSL_THREADS
OPENSSL_NO_DYNAMIC_ENGINE OPENSSL_PIC OPENSSL_IA32_SSE2
OPENSSL_BN_ASM_MONT OPENSSL_BN_ASM_MONT5 OPENSSL_BN_ASM_GF2m SHA1_ASM
SHA256_ASM SHA512_ASM MD5_ASM AES_ASM VPAES_ASM BSAES_ASM GHASH_ASM
ECP_NISTZ256_ASM POLY1305_ASM
LFLAG         =
PLIB_LFLAG    =
EX_LIBS       =-ldl
APPS_OBJ      =
CPUID_OBJ     =x86_64cpuid.o
UPLINK_OBJ    =
BN_ASM        =asm/x86_64-gcc.o x86_64-mont.o x86_64-mont5.o
x86_64-gf2m.o rsaz_exp.o rsaz-x86_64.o rsaz-avx2.o
EC_ASM        =ecp_nistz256.o ecp_nistz256-x86_64.o
DES_ENC       =des_enc.o fcrypt_b.o
AES_ENC       =aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o
aesni-x86_64.o aesni-sha1-x86_64.o aesni-sha256-x86_64.o
aesni-mb-x86_64.o
BF_ENC        =bf_enc.o
CAST_ENC      =c_enc.o
RC4_ENC       =rc4-x86_64.o rc4-md5-x86_64.o
RC5_ENC       =rc5_enc.o
MD5_OBJ_ASM   =md5-x86_64.o
SHA1_OBJ_ASM  =sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
sha1-mb-x86_64.o sha256-mb-x86_64.o
RMD160_OBJ_ASM=
CMLL_ENC      =cmll-x86_64.o cmll_misc.o
MODES_OBJ     =ghash-x86_64.o aesni-gcm-x86_64.o
PADLOCK_OBJ   =e_padlock-x86_64.o
CHACHA_ENC    =chacha-x86_64.o
POLY1305_OBJ  =poly1305-x86_64.o
BLAKE2_OBJ    =
PROCESSOR     =
RANLIB        =/usr/bin/ranlib
ARFLAGS       =
PERL          =/usr/bin/perl

SIXTY_FOUR_BIT_LONG mode

Configured for linux-x86_64.


-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=4463
Please log in as guest with password guest if prompted



More information about the openssl-dev mailing list