[GH-ISSUE #1979] ASan error in home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:294 (split()) when testing Raw-MD*-opencl #1324

Closed
opened 2026-10-14 03:44:23 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @frank-dittrich on GitHub (Jan 5, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/1979

(bleeding-jumbo)src $ ../run/john --list=build-info 
Version: 1.8.0.6-jumbo-1-1819-gbcc9c47
Build: linux-gnu 64-bit AVX2-ac ASan
SIMD: AVX2, interleaving: MD4:3 MD5:3 SHA1:1 SHA256:1 SHA512:1
$JOHN is ../run/
Format interface version: 13
Max. number of reported tunable costs: 3
Rec file version: REC4
Charset file version: CHR3
CHARSET_MIN: 1 (0x01)
CHARSET_MAX: 255 (0xff)
CHARSET_LENGTH: 24
SALT_HASH_SIZE: 1048576
Max. Markov mode level: 400
Max. Markov mode password length: 30
gcc version: 5.3.1
GNU libc version: 2.21 (loaded: 2.21)
OpenCL headers version: 1.2
Crypto library: OpenSSL
OpenSSL library version: 0100010bf
OpenSSL 1.0.1k-fips 8 Jan 2015
GMP library version: 6.0.0
Regex library version: 1.3  (loaded: 1.3.1)
File locking: fcntl()
fseek(): fseek
ftell(): ftell
fopen(): fopen
memmem(): System's
Built with these debugging options
    ASan (Address Sanitizer debugging)

Benchmarking: Raw-MD4-opencl [MD4 OpenCL]... Options used: -I ../run/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=1 -DDEV_VER_MINOR=2 -D_OPENCL_COMPILER -D OFFSET_TABLE_SIZE=20 -D HASH_TABLE_SIZE=17 -D SHIFT64_OT_SZ=16 -D SHIFT64_HT_SZ=1 -D NUM_LOADED_HASHES=14 -D NUM_INT_KEYS=1 -D SELECT_CMP_STEPS=4 -D BITMAP_SIZE_BITS_LESS_ONE=32767 -D USE_LOCAL_BITMAPS=1 -D IS_STATIC_GPU_MASK=0 -D CONST_CACHE_SIZE=134217728 -D LOC_0=-1 -D LOC_1=-1 -D LOC_2=-1 -D LOC_3=-1 $JOHN/kernels/md4_kernel.cl

Self test GWS: 1048576, LWS: 64
DONE
Raw:    2599K c/s real, 24197K c/s virtual

Benchmarking: Raw-MD5-opencl [MD5 OpenCL]... =================================================================
==7894==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000b65b1e at pc 0x7ff373c45d55 bp 0x7ffc00178a50 sp 0x7ffc001781f8
READ of size 33 at 0x000000b65b1e thread T0
    #0 0x7ff373c45d54 in __asan_memcpy (/lib64/libasan.so.2+0x8cd54)
    #1 0x790633 in split /home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:294
    #2 0x6f76a1 in ocl_hc_128_prepare_table_test /home/fd/git/JtR/src/opencl_hash_check_128_plug.c:108
    #3 0x792bb5 in reset /home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:612
    #4 0x88f92b in fmt_self_test_body /home/fd/git/JtR/src/formats.c:444
    #5 0x892661 in fmt_self_test /home/fd/git/JtR/src/formats.c:1593
    #6 0x8757d4 in benchmark_format /home/fd/git/JtR/src/bench.c:255
    #7 0x877357 in benchmark_all /home/fd/git/JtR/src/bench.c:687
    #8 0x8a01bb in john_run /home/fd/git/JtR/src/john.c:1587
    #9 0x8a197f in main /home/fd/git/JtR/src/john.c:1973
    #10 0x7ff371f9a6ff in __libc_start_main (/lib64/libc.so.6+0x206ff)
    #11 0x407338 in _start (/home/fd/git/JtR/run/john+0x407338)

0x000000b65b1e is located 0 bytes to the right of global variable '*.LC69' defined in 'opencl_rawmd5_fmt_plug.c' (0xb65b00) of size 30
  '*.LC69' is ascii string '{MD5}CY9rzUYh03PK3k6DJie09g=='
SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 __asan_memcpy
Shadow bytes around the buggy address:
  0x000080164b10: 00 04 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9
  0x000080164b20: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x000080164b30: 00 04 f9 f9 f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9
  0x000080164b40: 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 06 f9 f9 f9
  0x000080164b50: f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9
=>0x000080164b60: 00 00 00[06]f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x000080164b70: 01 f9 f9 f9 f9 f9 f9 f9 00 00 00 02 f9 f9 f9 f9
  0x000080164b80: 00 00 00 07 f9 f9 f9 f9 00 00 00 00 06 f9 f9 f9
  0x000080164b90: f9 f9 f9 f9 00 00 00 00 05 f9 f9 f9 f9 f9 f9 f9
  0x000080164ba0: 00 00 00 00 03 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x000080164bb0: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
==7894==ABORTING

Unfortunately, I cannot reproduce with just testing this individual format.
I just get what looks like memleaks in beignet:

(bleeding-jumbo)src $ ../run/john --test=0 --format=Raw-MD4-opencl
Device 0: Intel(R) HD Graphics Haswell GT2 Desktop
Testing: Raw-MD4-opencl [MD4 OpenCL]... Options used: -I ../run/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=1 -DDEV_VER_MINOR=2 -D_OPENCL_COMPILER -D OFFSET_TABLE_SIZE=20 -D HASH_TABLE_SIZE=17 -D SHIFT64_OT_SZ=16 -D SHIFT64_HT_SZ=1 -D NUM_LOADED_HASHES=14 -D NUM_INT_KEYS=1 -D SELECT_CMP_STEPS=4 -D BITMAP_SIZE_BITS_LESS_ONE=32767 -D USE_LOCAL_BITMAPS=1 -D IS_STATIC_GPU_MASK=0 -D CONST_CACHE_SIZE=134217728 -D LOC_0=-1 -D LOC_1=-1 -D LOC_2=-1 -D LOC_3=-1 $JOHN/kernels/md4_kernel.cl
Self test GWS: 64, LWS: 8
PASS

=================================================================
==8256==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 96 byte(s) in 2 object(s) allocated from:
    #0 0x7f8db7dc7872 in operator new(unsigned long) (/lib64/libasan.so.2+0x99872)
    #1 0x7f8dab2b587c in gbe::PrintfParser::runOnFunction(llvm::Function&) /home/fd/git/beignet/backend/src/llvm/llvm_printf_parser.cpp:543
    #2 0x7f8dac1fab41 in llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/local/lib64/beignet//libgbe.so+0x1370b41)

Direct leak of 2 byte(s) in 2 object(s) allocated from:
    #0 0x7f8db7d9072f in strdup (/lib64/libasan.so.2+0x6272f)
    #1 0x7f8dabdda063 in LLVMLinkModules (/usr/local/lib64/beignet//libgbe.so+0xf50063)
    #2 0x7f8dac879d37 in vtable for llvm::CallbackVH (/usr/local/lib64/beignet//libgbe.so+0x19efd37)

SUMMARY: AddressSanitizer: 98 byte(s) leaked in 4 allocation(s).

Testing all opencl formats again results in

(bleeding-jumbo)src $ ../run/john --test=0 --format=opencl --verbosity=3
Device 0: Intel(R) HD Graphics Haswell GT2 Desktop
Testing: sha1crypt-opencl, (NetBSD) [PBKDF1-SHA1 OpenCL 4x]... PASS
Testing: oldoffice-opencl, MS Office <= 2003 [MD5/SHA1 RC4 OpenCL]... PASS
Testing: PBKDF2-HMAC-MD4-opencl [PBKDF2-MD4 OpenCL 4x]... PASS
Testing: PBKDF2-HMAC-MD5-opencl [PBKDF2-MD5 OpenCL 4x]... PASS
Testing: PBKDF2-HMAC-SHA1-opencl [PBKDF2-SHA1 OpenCL 4x]... PASS
Testing: rar-opencl, RAR3 (length 5) [SHA1 OpenCL AES]... PASS
Testing: RAR5-opencl [PBKDF2-SHA256 OpenCL]... PASS
Testing: truecrypt-opencl, TrueCrypt AES256_XTS [RIPEMD160 OpenCL]... PASS
Testing: lotus5-opencl, Lotus Notes/Domino 5 [OpenCL]... PASS
Testing: agilekeychain-opencl, 1Password Agile Keychain [PBKDF2-SHA1 OpenCL AES]... PASS
Testing: bcrypt-opencl ("$2a$05", 32 iterations) [Blowfish OpenCL]... PASS
Testing: blockchain-opencl, blockchain My Wallet [PBKDF2-SHA1 OpenCL AES]... PASS
Testing: md5crypt-opencl, crypt(3) $1$ [MD5 OpenCL]... PASS
Testing: sha256crypt-opencl, crypt(3) $5$ (rounds=5000) [SHA256 OpenCL]... PASS
Testing: sha512crypt-opencl, crypt(3) $6$ (rounds=5000) [SHA512 OpenCL]... PASS
Testing: descrypt-opencl, traditional crypt(3) [DES OpenCL]... PASS
Testing: dmg-opencl, Apple DMG [PBKDF2-SHA1 OpenCL 3DES/AES]... PASS
Testing: encfs-opencl, EncFS [PBKDF2-SHA1 OpenCL 4x AES/Blowfish]... PASS
Testing: gpg-opencl, OpenPGP / GnuPG Secret Key [SHA1 OpenCL]... PASS
Testing: iwork-opencl, Apple iWork '09 / '13 / '14 [PBKDF2-SHA1 OpenCL 4x AES]... PASS
Testing: keychain-opencl, Mac OS X Keychain [PBKDF2-SHA1 OpenCL 3DES]... PASS
Testing: keyring-opencl, GNOME Keyring [SHA256 OpenCL AES]... PASS
Testing: krb5pa-md5-opencl, Kerberos 5 AS-REQ Pre-Auth etype 23 [MD4 HMAC-MD5 RC4 OpenCL]... PASS
Testing: krb5pa-sha1-opencl, Kerberos 5 AS-REQ Pre-Auth etype 17/18 [PBKDF2-SHA1 OpenCL 4x]... PASS
Testing: LM-opencl [DES BS OpenCL]... PASS
Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS
Testing: mscash2-opencl, MS Cache Hash 2 (DCC2) [PBKDF2-SHA1 OpenCL]... PASS
Testing: mysql-sha1-opencl, MySQL 4.1+ [SHA1 OpenCL (inefficient, development use only)]... PASS
Testing: Raw-SHA512-ng-opencl [SHA512 OpenCL]... PASS
Testing: XSHA512-ng-opencl, Mac OS X 10.7 salted [SHA512 OpenCL]... PASS
Testing: nt-opencl, NT [MD4 OpenCL]... PASS
Testing: ntlmv2-opencl, NTLMv2 C/R [MD4 HMAC-MD5 OpenCL 4x]... PASS
Testing: o5logon-opencl, Oracle O5LOGON protocol [SHA1 OpenCL AES 32/64]... PASS
Testing: ODF-opencl [SHA1 OpenCL Blowfish]... PASS
Testing: ODF-AES-opencl [SHA256 OpenCL AES]... PASS
Testing: office2007-opencl, MS Office 2007 (50,000 iterations) [SHA1 OpenCL 4x AES]... PASS
Testing: office2010-opencl, MS Office 2010 (100,000 iterations) [SHA1 OpenCL 4x AES]... PASS
Testing: PBKDF2-HMAC-SHA256-opencl, rounds=1000 [PBKDF2-SHA256 OpenCL]... PASS
Testing: phpass-opencl ($P$9 lengths 0 to 15) [MD5 OpenCL]... PASS
Testing: pwsafe-opencl, Password Safe [SHA256 OpenCL]... PASS
Testing: RAKP-opencl, IPMI 2.0 RAKP (RMCP+) [HMAC-SHA1 OpenCL 4x]... PASS
Testing: Raw-MD4-opencl [MD4 OpenCL]... PASS
Testing: Raw-MD5-opencl [MD5 OpenCL]... =================================================================
==8313==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000b65b1e at pc 0x7fbb8dc82d55 bp 0x7ffdb4408560 sp 0x7ffdb4407d08
READ of size 33 at 0x000000b65b1e thread T0
    #0 0x7fbb8dc82d54 in __asan_memcpy (/lib64/libasan.so.2+0x8cd54)
    #1 0x790633 in split /home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:294
    #2 0x6f76a1 in ocl_hc_128_prepare_table_test /home/fd/git/JtR/src/opencl_hash_check_128_plug.c:108
    #3 0x792bb5 in reset /home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:612
    #4 0x88f92b in fmt_self_test_body /home/fd/git/JtR/src/formats.c:444
    #5 0x892661 in fmt_self_test /home/fd/git/JtR/src/formats.c:1593
    #6 0x8757d4 in benchmark_format /home/fd/git/JtR/src/bench.c:255
    #7 0x877357 in benchmark_all /home/fd/git/JtR/src/bench.c:687
    #8 0x8a01bb in john_run /home/fd/git/JtR/src/john.c:1587
    #9 0x8a197f in main /home/fd/git/JtR/src/john.c:1973
    #10 0x7fbb8bfd76ff in __libc_start_main (/lib64/libc.so.6+0x206ff)
    #11 0x407338 in _start (/home/fd/git/JtR/run/john+0x407338)

0x000000b65b1e is located 0 bytes to the right of global variable '*.LC69' defined in 'opencl_rawmd5_fmt_plug.c' (0xb65b00) of size 30
  '*.LC69' is ascii string '{MD5}CY9rzUYh03PK3k6DJie09g=='
SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 __asan_memcpy
Shadow bytes around the buggy address:
  0x000080164b10: 00 04 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9
  0x000080164b20: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x000080164b30: 00 04 f9 f9 f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9
  0x000080164b40: 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 06 f9 f9 f9
  0x000080164b50: f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9
=>0x000080164b60: 00 00 00[06]f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x000080164b70: 01 f9 f9 f9 f9 f9 f9 f9 00 00 00 02 f9 f9 f9 f9
  0x000080164b80: 00 00 00 07 f9 f9 f9 f9 00 00 00 00 06 f9 f9 f9
  0x000080164b90: f9 f9 f9 f9 00 00 00 00 05 f9 f9 f9 f9 f9 f9 f9
  0x000080164ba0: 00 00 00 00 03 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x000080164bb0: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
==8313==ABORTING

Similar for just Raw-MD*-opencl:

(bleeding-jumbo)src $ ../run/john --test=0 --format=Raw-MD*-opencl --verbosity=3
Device 0: Intel(R) HD Graphics Haswell GT2 Desktop
Testing: Raw-MD4-opencl [MD4 OpenCL]... PASS
Testing: Raw-MD5-opencl [MD5 OpenCL]... =================================================================
==8412==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000b65b1e at pc 0x7fa4c0eb5d55 bp 0x7ffca803fa80 sp 0x7ffca803f228
READ of size 33 at 0x000000b65b1e thread T0
    #0 0x7fa4c0eb5d54 in __asan_memcpy (/lib64/libasan.so.2+0x8cd54)
    #1 0x790633 in split /home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:294
    #2 0x6f76a1 in ocl_hc_128_prepare_table_test /home/fd/git/JtR/src/opencl_hash_check_128_plug.c:108
    #3 0x792bb5 in reset /home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:612
    #4 0x88f92b in fmt_self_test_body /home/fd/git/JtR/src/formats.c:444
    #5 0x892661 in fmt_self_test /home/fd/git/JtR/src/formats.c:1593
    #6 0x8757d4 in benchmark_format /home/fd/git/JtR/src/bench.c:255
    #7 0x877357 in benchmark_all /home/fd/git/JtR/src/bench.c:687
    #8 0x8a01bb in john_run /home/fd/git/JtR/src/john.c:1587
    #9 0x8a197f in main /home/fd/git/JtR/src/john.c:1973
    #10 0x7fa4bf20a6ff in __libc_start_main (/lib64/libc.so.6+0x206ff)
    #11 0x407338 in _start (/home/fd/git/JtR/run/john+0x407338)

0x000000b65b1e is located 0 bytes to the right of global variable '*.LC69' defined in 'opencl_rawmd5_fmt_plug.c' (0xb65b00) of size 30
  '*.LC69' is ascii string '{MD5}CY9rzUYh03PK3k6DJie09g=='
SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 __asan_memcpy
Shadow bytes around the buggy address:
  0x000080164b10: 00 04 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9
  0x000080164b20: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x000080164b30: 00 04 f9 f9 f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9
  0x000080164b40: 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 06 f9 f9 f9
  0x000080164b50: f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9
=>0x000080164b60: 00 00 00[06]f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x000080164b70: 01 f9 f9 f9 f9 f9 f9 f9 00 00 00 02 f9 f9 f9 f9
  0x000080164b80: 00 00 00 07 f9 f9 f9 f9 00 00 00 00 06 f9 f9 f9
  0x000080164b90: f9 f9 f9 f9 00 00 00 00 05 f9 f9 f9 f9 f9 f9 f9
  0x000080164ba0: 00 00 00 00 03 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x000080164bb0: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Heap right redzone:      fb
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack partial redzone:   f4
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
==8412==ABORTING
Originally created by @frank-dittrich on GitHub (Jan 5, 2016). Original GitHub issue: https://github.com/openwall/john/issues/1979 ``` (bleeding-jumbo)src $ ../run/john --list=build-info Version: 1.8.0.6-jumbo-1-1819-gbcc9c47 Build: linux-gnu 64-bit AVX2-ac ASan SIMD: AVX2, interleaving: MD4:3 MD5:3 SHA1:1 SHA256:1 SHA512:1 $JOHN is ../run/ Format interface version: 13 Max. number of reported tunable costs: 3 Rec file version: REC4 Charset file version: CHR3 CHARSET_MIN: 1 (0x01) CHARSET_MAX: 255 (0xff) CHARSET_LENGTH: 24 SALT_HASH_SIZE: 1048576 Max. Markov mode level: 400 Max. Markov mode password length: 30 gcc version: 5.3.1 GNU libc version: 2.21 (loaded: 2.21) OpenCL headers version: 1.2 Crypto library: OpenSSL OpenSSL library version: 0100010bf OpenSSL 1.0.1k-fips 8 Jan 2015 GMP library version: 6.0.0 Regex library version: 1.3 (loaded: 1.3.1) File locking: fcntl() fseek(): fseek ftell(): ftell fopen(): fopen memmem(): System's Built with these debugging options ASan (Address Sanitizer debugging) ``` ``` Benchmarking: Raw-MD4-opencl [MD4 OpenCL]... Options used: -I ../run/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=1 -DDEV_VER_MINOR=2 -D_OPENCL_COMPILER -D OFFSET_TABLE_SIZE=20 -D HASH_TABLE_SIZE=17 -D SHIFT64_OT_SZ=16 -D SHIFT64_HT_SZ=1 -D NUM_LOADED_HASHES=14 -D NUM_INT_KEYS=1 -D SELECT_CMP_STEPS=4 -D BITMAP_SIZE_BITS_LESS_ONE=32767 -D USE_LOCAL_BITMAPS=1 -D IS_STATIC_GPU_MASK=0 -D CONST_CACHE_SIZE=134217728 -D LOC_0=-1 -D LOC_1=-1 -D LOC_2=-1 -D LOC_3=-1 $JOHN/kernels/md4_kernel.cl Self test GWS: 1048576, LWS: 64 DONE Raw: 2599K c/s real, 24197K c/s virtual Benchmarking: Raw-MD5-opencl [MD5 OpenCL]... ================================================================= ==7894==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000b65b1e at pc 0x7ff373c45d55 bp 0x7ffc00178a50 sp 0x7ffc001781f8 READ of size 33 at 0x000000b65b1e thread T0 #0 0x7ff373c45d54 in __asan_memcpy (/lib64/libasan.so.2+0x8cd54) #1 0x790633 in split /home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:294 #2 0x6f76a1 in ocl_hc_128_prepare_table_test /home/fd/git/JtR/src/opencl_hash_check_128_plug.c:108 #3 0x792bb5 in reset /home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:612 #4 0x88f92b in fmt_self_test_body /home/fd/git/JtR/src/formats.c:444 #5 0x892661 in fmt_self_test /home/fd/git/JtR/src/formats.c:1593 #6 0x8757d4 in benchmark_format /home/fd/git/JtR/src/bench.c:255 #7 0x877357 in benchmark_all /home/fd/git/JtR/src/bench.c:687 #8 0x8a01bb in john_run /home/fd/git/JtR/src/john.c:1587 #9 0x8a197f in main /home/fd/git/JtR/src/john.c:1973 #10 0x7ff371f9a6ff in __libc_start_main (/lib64/libc.so.6+0x206ff) #11 0x407338 in _start (/home/fd/git/JtR/run/john+0x407338) 0x000000b65b1e is located 0 bytes to the right of global variable '*.LC69' defined in 'opencl_rawmd5_fmt_plug.c' (0xb65b00) of size 30 '*.LC69' is ascii string '{MD5}CY9rzUYh03PK3k6DJie09g==' SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 __asan_memcpy Shadow bytes around the buggy address: 0x000080164b10: 00 04 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 0x000080164b20: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x000080164b30: 00 04 f9 f9 f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9 0x000080164b40: 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 06 f9 f9 f9 0x000080164b50: f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9 =>0x000080164b60: 00 00 00[06]f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x000080164b70: 01 f9 f9 f9 f9 f9 f9 f9 00 00 00 02 f9 f9 f9 f9 0x000080164b80: 00 00 00 07 f9 f9 f9 f9 00 00 00 00 06 f9 f9 f9 0x000080164b90: f9 f9 f9 f9 00 00 00 00 05 f9 f9 f9 f9 f9 f9 f9 0x000080164ba0: 00 00 00 00 03 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x000080164bb0: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe ==7894==ABORTING ``` Unfortunately, I cannot reproduce with just testing this individual format. I just get what looks like memleaks in beignet: ``` (bleeding-jumbo)src $ ../run/john --test=0 --format=Raw-MD4-opencl Device 0: Intel(R) HD Graphics Haswell GT2 Desktop Testing: Raw-MD4-opencl [MD4 OpenCL]... Options used: -I ../run/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=34 -DSIZEOF_SIZE_T=8 -DDEV_VER_MAJOR=1 -DDEV_VER_MINOR=2 -D_OPENCL_COMPILER -D OFFSET_TABLE_SIZE=20 -D HASH_TABLE_SIZE=17 -D SHIFT64_OT_SZ=16 -D SHIFT64_HT_SZ=1 -D NUM_LOADED_HASHES=14 -D NUM_INT_KEYS=1 -D SELECT_CMP_STEPS=4 -D BITMAP_SIZE_BITS_LESS_ONE=32767 -D USE_LOCAL_BITMAPS=1 -D IS_STATIC_GPU_MASK=0 -D CONST_CACHE_SIZE=134217728 -D LOC_0=-1 -D LOC_1=-1 -D LOC_2=-1 -D LOC_3=-1 $JOHN/kernels/md4_kernel.cl Self test GWS: 64, LWS: 8 PASS ================================================================= ==8256==ERROR: LeakSanitizer: detected memory leaks Direct leak of 96 byte(s) in 2 object(s) allocated from: #0 0x7f8db7dc7872 in operator new(unsigned long) (/lib64/libasan.so.2+0x99872) #1 0x7f8dab2b587c in gbe::PrintfParser::runOnFunction(llvm::Function&) /home/fd/git/beignet/backend/src/llvm/llvm_printf_parser.cpp:543 #2 0x7f8dac1fab41 in llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/local/lib64/beignet//libgbe.so+0x1370b41) Direct leak of 2 byte(s) in 2 object(s) allocated from: #0 0x7f8db7d9072f in strdup (/lib64/libasan.so.2+0x6272f) #1 0x7f8dabdda063 in LLVMLinkModules (/usr/local/lib64/beignet//libgbe.so+0xf50063) #2 0x7f8dac879d37 in vtable for llvm::CallbackVH (/usr/local/lib64/beignet//libgbe.so+0x19efd37) SUMMARY: AddressSanitizer: 98 byte(s) leaked in 4 allocation(s). ``` Testing all opencl formats again results in ``` (bleeding-jumbo)src $ ../run/john --test=0 --format=opencl --verbosity=3 Device 0: Intel(R) HD Graphics Haswell GT2 Desktop Testing: sha1crypt-opencl, (NetBSD) [PBKDF1-SHA1 OpenCL 4x]... PASS Testing: oldoffice-opencl, MS Office <= 2003 [MD5/SHA1 RC4 OpenCL]... PASS Testing: PBKDF2-HMAC-MD4-opencl [PBKDF2-MD4 OpenCL 4x]... PASS Testing: PBKDF2-HMAC-MD5-opencl [PBKDF2-MD5 OpenCL 4x]... PASS Testing: PBKDF2-HMAC-SHA1-opencl [PBKDF2-SHA1 OpenCL 4x]... PASS Testing: rar-opencl, RAR3 (length 5) [SHA1 OpenCL AES]... PASS Testing: RAR5-opencl [PBKDF2-SHA256 OpenCL]... PASS Testing: truecrypt-opencl, TrueCrypt AES256_XTS [RIPEMD160 OpenCL]... PASS Testing: lotus5-opencl, Lotus Notes/Domino 5 [OpenCL]... PASS Testing: agilekeychain-opencl, 1Password Agile Keychain [PBKDF2-SHA1 OpenCL AES]... PASS Testing: bcrypt-opencl ("$2a$05", 32 iterations) [Blowfish OpenCL]... PASS Testing: blockchain-opencl, blockchain My Wallet [PBKDF2-SHA1 OpenCL AES]... PASS Testing: md5crypt-opencl, crypt(3) $1$ [MD5 OpenCL]... PASS Testing: sha256crypt-opencl, crypt(3) $5$ (rounds=5000) [SHA256 OpenCL]... PASS Testing: sha512crypt-opencl, crypt(3) $6$ (rounds=5000) [SHA512 OpenCL]... PASS Testing: descrypt-opencl, traditional crypt(3) [DES OpenCL]... PASS Testing: dmg-opencl, Apple DMG [PBKDF2-SHA1 OpenCL 3DES/AES]... PASS Testing: encfs-opencl, EncFS [PBKDF2-SHA1 OpenCL 4x AES/Blowfish]... PASS Testing: gpg-opencl, OpenPGP / GnuPG Secret Key [SHA1 OpenCL]... PASS Testing: iwork-opencl, Apple iWork '09 / '13 / '14 [PBKDF2-SHA1 OpenCL 4x AES]... PASS Testing: keychain-opencl, Mac OS X Keychain [PBKDF2-SHA1 OpenCL 3DES]... PASS Testing: keyring-opencl, GNOME Keyring [SHA256 OpenCL AES]... PASS Testing: krb5pa-md5-opencl, Kerberos 5 AS-REQ Pre-Auth etype 23 [MD4 HMAC-MD5 RC4 OpenCL]... PASS Testing: krb5pa-sha1-opencl, Kerberos 5 AS-REQ Pre-Auth etype 17/18 [PBKDF2-SHA1 OpenCL 4x]... PASS Testing: LM-opencl [DES BS OpenCL]... PASS Testing: mscash-opencl, M$ Cache Hash [MD4 OpenCL]... PASS Testing: mscash2-opencl, MS Cache Hash 2 (DCC2) [PBKDF2-SHA1 OpenCL]... PASS Testing: mysql-sha1-opencl, MySQL 4.1+ [SHA1 OpenCL (inefficient, development use only)]... PASS Testing: Raw-SHA512-ng-opencl [SHA512 OpenCL]... PASS Testing: XSHA512-ng-opencl, Mac OS X 10.7 salted [SHA512 OpenCL]... PASS Testing: nt-opencl, NT [MD4 OpenCL]... PASS Testing: ntlmv2-opencl, NTLMv2 C/R [MD4 HMAC-MD5 OpenCL 4x]... PASS Testing: o5logon-opencl, Oracle O5LOGON protocol [SHA1 OpenCL AES 32/64]... PASS Testing: ODF-opencl [SHA1 OpenCL Blowfish]... PASS Testing: ODF-AES-opencl [SHA256 OpenCL AES]... PASS Testing: office2007-opencl, MS Office 2007 (50,000 iterations) [SHA1 OpenCL 4x AES]... PASS Testing: office2010-opencl, MS Office 2010 (100,000 iterations) [SHA1 OpenCL 4x AES]... PASS Testing: PBKDF2-HMAC-SHA256-opencl, rounds=1000 [PBKDF2-SHA256 OpenCL]... PASS Testing: phpass-opencl ($P$9 lengths 0 to 15) [MD5 OpenCL]... PASS Testing: pwsafe-opencl, Password Safe [SHA256 OpenCL]... PASS Testing: RAKP-opencl, IPMI 2.0 RAKP (RMCP+) [HMAC-SHA1 OpenCL 4x]... PASS Testing: Raw-MD4-opencl [MD4 OpenCL]... PASS Testing: Raw-MD5-opencl [MD5 OpenCL]... ================================================================= ==8313==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000b65b1e at pc 0x7fbb8dc82d55 bp 0x7ffdb4408560 sp 0x7ffdb4407d08 READ of size 33 at 0x000000b65b1e thread T0 #0 0x7fbb8dc82d54 in __asan_memcpy (/lib64/libasan.so.2+0x8cd54) #1 0x790633 in split /home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:294 #2 0x6f76a1 in ocl_hc_128_prepare_table_test /home/fd/git/JtR/src/opencl_hash_check_128_plug.c:108 #3 0x792bb5 in reset /home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:612 #4 0x88f92b in fmt_self_test_body /home/fd/git/JtR/src/formats.c:444 #5 0x892661 in fmt_self_test /home/fd/git/JtR/src/formats.c:1593 #6 0x8757d4 in benchmark_format /home/fd/git/JtR/src/bench.c:255 #7 0x877357 in benchmark_all /home/fd/git/JtR/src/bench.c:687 #8 0x8a01bb in john_run /home/fd/git/JtR/src/john.c:1587 #9 0x8a197f in main /home/fd/git/JtR/src/john.c:1973 #10 0x7fbb8bfd76ff in __libc_start_main (/lib64/libc.so.6+0x206ff) #11 0x407338 in _start (/home/fd/git/JtR/run/john+0x407338) 0x000000b65b1e is located 0 bytes to the right of global variable '*.LC69' defined in 'opencl_rawmd5_fmt_plug.c' (0xb65b00) of size 30 '*.LC69' is ascii string '{MD5}CY9rzUYh03PK3k6DJie09g==' SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 __asan_memcpy Shadow bytes around the buggy address: 0x000080164b10: 00 04 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 0x000080164b20: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x000080164b30: 00 04 f9 f9 f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9 0x000080164b40: 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 06 f9 f9 f9 0x000080164b50: f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9 =>0x000080164b60: 00 00 00[06]f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x000080164b70: 01 f9 f9 f9 f9 f9 f9 f9 00 00 00 02 f9 f9 f9 f9 0x000080164b80: 00 00 00 07 f9 f9 f9 f9 00 00 00 00 06 f9 f9 f9 0x000080164b90: f9 f9 f9 f9 00 00 00 00 05 f9 f9 f9 f9 f9 f9 f9 0x000080164ba0: 00 00 00 00 03 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x000080164bb0: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe ==8313==ABORTING ``` Similar for just Raw-MD*-opencl: ``` (bleeding-jumbo)src $ ../run/john --test=0 --format=Raw-MD*-opencl --verbosity=3 Device 0: Intel(R) HD Graphics Haswell GT2 Desktop Testing: Raw-MD4-opencl [MD4 OpenCL]... PASS Testing: Raw-MD5-opencl [MD5 OpenCL]... ================================================================= ==8412==ERROR: AddressSanitizer: global-buffer-overflow on address 0x000000b65b1e at pc 0x7fa4c0eb5d55 bp 0x7ffca803fa80 sp 0x7ffca803f228 READ of size 33 at 0x000000b65b1e thread T0 #0 0x7fa4c0eb5d54 in __asan_memcpy (/lib64/libasan.so.2+0x8cd54) #1 0x790633 in split /home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:294 #2 0x6f76a1 in ocl_hc_128_prepare_table_test /home/fd/git/JtR/src/opencl_hash_check_128_plug.c:108 #3 0x792bb5 in reset /home/fd/git/JtR/src/opencl_rawmd5_fmt_plug.c:612 #4 0x88f92b in fmt_self_test_body /home/fd/git/JtR/src/formats.c:444 #5 0x892661 in fmt_self_test /home/fd/git/JtR/src/formats.c:1593 #6 0x8757d4 in benchmark_format /home/fd/git/JtR/src/bench.c:255 #7 0x877357 in benchmark_all /home/fd/git/JtR/src/bench.c:687 #8 0x8a01bb in john_run /home/fd/git/JtR/src/john.c:1587 #9 0x8a197f in main /home/fd/git/JtR/src/john.c:1973 #10 0x7fa4bf20a6ff in __libc_start_main (/lib64/libc.so.6+0x206ff) #11 0x407338 in _start (/home/fd/git/JtR/run/john+0x407338) 0x000000b65b1e is located 0 bytes to the right of global variable '*.LC69' defined in 'opencl_rawmd5_fmt_plug.c' (0xb65b00) of size 30 '*.LC69' is ascii string '{MD5}CY9rzUYh03PK3k6DJie09g==' SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 __asan_memcpy Shadow bytes around the buggy address: 0x000080164b10: 00 04 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 0x000080164b20: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x000080164b30: 00 04 f9 f9 f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9 0x000080164b40: 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 06 f9 f9 f9 0x000080164b50: f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9 =>0x000080164b60: 00 00 00[06]f9 f9 f9 f9 00 00 00 00 00 00 00 00 0x000080164b70: 01 f9 f9 f9 f9 f9 f9 f9 00 00 00 02 f9 f9 f9 f9 0x000080164b80: 00 00 00 07 f9 f9 f9 f9 00 00 00 00 06 f9 f9 f9 0x000080164b90: f9 f9 f9 f9 00 00 00 00 05 f9 f9 f9 f9 f9 f9 f9 0x000080164ba0: 00 00 00 00 03 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 0x000080164bb0: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 01 f9 f9 f9 Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe ==8412==ABORTING ```
Author
Owner

@jfoug commented on GitHub (Jan 5, 2016):

Why create a new issue for this when there is already one open?

<!-- gh-comment-id:169169468 --> @jfoug commented on GitHub (Jan 5, 2016): Why create a new issue for this when there is already one open?
Author
Owner

@jfoug commented on GitHub (Jan 5, 2016):

Ok, this is a totally different problem, I think.

<!-- gh-comment-id:169170152 --> @jfoug commented on GitHub (Jan 5, 2016): Ok, this is a totally different problem, I think.
Author
Owner

@jfoug commented on GitHub (Jan 5, 2016):

Please test. I can not test opencl with ASAN builds.

<!-- gh-comment-id:169171960 --> @jfoug commented on GitHub (Jan 5, 2016): Please test. I can not test opencl with ASAN builds.
Author
Owner

@frank-dittrich commented on GitHub (Jan 5, 2016):

Why create a new issue for this when there is already one open?

Because it is apparently unrelated to the base64 conversion?

<!-- gh-comment-id:169172530 --> @frank-dittrich commented on GitHub (Jan 5, 2016): > Why create a new issue for this when there is already one open? Because it is apparently unrelated to the base64 conversion?
Author
Owner

@frank-dittrich commented on GitHub (Jan 5, 2016):

@jfoug Yes, your change fixed the issue.
Now I just get the beignet memleak:

(bleeding-jumbo)run $ ../run/john --test=0 --format=Raw-MD*-opencl --verbosity=3
Device 0: Intel(R) HD Graphics Haswell GT2 Desktop
Testing: Raw-MD4-opencl [MD4 OpenCL]... PASS
Testing: Raw-MD5-opencl [MD5 OpenCL]... PASS
All 2 formats passed self-tests!

=================================================================
==9051==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 144 byte(s) in 3 object(s) allocated from:
    #0 0x7f2da4c3a872 in operator new(unsigned long) (/lib64/libasan.so.2+0x99872)
    #1 0x7f2d981b587c in gbe::PrintfParser::runOnFunction(llvm::Function&) /home/fd/git/beignet/backend/src/llvm/llvm_printf_parser.cpp:543
    #2 0x7f2d990fab41 in llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/local/lib64/beignet//libgbe.so+0x1370b41)

Direct leak of 3 byte(s) in 3 object(s) allocated from:
    #0 0x7f2da4c0372f in strdup (/lib64/libasan.so.2+0x6272f)
    #1 0x7f2d98cda063 in LLVMLinkModules (/usr/local/lib64/beignet//libgbe.so+0xf50063)
    #2 0x7f2d99779d37 in vtable for llvm::CallbackVH (/usr/local/lib64/beignet//libgbe.so+0x19efd37)

<!-- gh-comment-id:169173064 --> @frank-dittrich commented on GitHub (Jan 5, 2016): @jfoug Yes, your change fixed the issue. Now I just get the beignet memleak: ``` (bleeding-jumbo)run $ ../run/john --test=0 --format=Raw-MD*-opencl --verbosity=3 Device 0: Intel(R) HD Graphics Haswell GT2 Desktop Testing: Raw-MD4-opencl [MD4 OpenCL]... PASS Testing: Raw-MD5-opencl [MD5 OpenCL]... PASS All 2 formats passed self-tests! ================================================================= ==9051==ERROR: LeakSanitizer: detected memory leaks Direct leak of 144 byte(s) in 3 object(s) allocated from: #0 0x7f2da4c3a872 in operator new(unsigned long) (/lib64/libasan.so.2+0x99872) #1 0x7f2d981b587c in gbe::PrintfParser::runOnFunction(llvm::Function&) /home/fd/git/beignet/backend/src/llvm/llvm_printf_parser.cpp:543 #2 0x7f2d990fab41 in llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/local/lib64/beignet//libgbe.so+0x1370b41) Direct leak of 3 byte(s) in 3 object(s) allocated from: #0 0x7f2da4c0372f in strdup (/lib64/libasan.so.2+0x6272f) #1 0x7f2d98cda063 in LLVMLinkModules (/usr/local/lib64/beignet//libgbe.so+0xf50063) #2 0x7f2d99779d37 in vtable for llvm::CallbackVH (/usr/local/lib64/beignet//libgbe.so+0x19efd37) ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1324
No description provided.