[GH-ISSUE #1151] Stress-test: asan error #719

Closed
opened 2026-10-14 03:21:19 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @loverszhaokai on GitHub (Mar 26, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1151

This bug is found by fuzzzing the options of John.
#1. Compile with asan

$ export ASAN_OPTIONS='abort_on_error=1'
$ AFL_USE_ASAN=1 AFL_HARDEN=1 ./configure --enable-asan && make -sj8
#2. Reproduce

$ ./john --stress-test=1

Will run 8 OpenMP threads
NOTE: This is an ASan debug build, speed will be lower than normal
Benchmarking: descrypt, traditional crypt(3) [DES 128/128 AVX-16]... (8xOMP) DONE
Many salts: 8880K c/s real, 1135K c/s virtual
Only one salt: 7372K c/s real, 930909 c/s virtual

Benchmarking: bsdicrypt, BSDI crypt(3) ("_J9..", 725 iterations) [DES 128/128 AVX-16]... (8xOMP) DONE
Many salts: 271714 c/s real, 34389 c/s virtual
Only one salt: 208896 c/s real, 29546 c/s virtual

Benchmarking: md5crypt, crypt(3) 1 [MD5 128/128 AVX 12x]... (8xOMP) DONE
Raw: 32752 c/s real, 4239 c/s virtual

==115480== ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x000002c8c040
#0 0x7f207b70c33a (/usr/lib/x86_64-linux-gnu/libasan.so.0.0.0+0x1533a)
#1 0x7c0264 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options/run/john+0x7c0264)
#2 0x429530 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options/run/john+0x429530)
#3 0x74dca4 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options/run/john+0x74dca4)
#4 0x736c7a (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options/run/john+0x736c7a)
#5 0x759d2c (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options/run/john+0x759d2c)
#6 0x75b23e (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options/run/john+0x75b23e)
#7 0x7f2079f92ec4 (/lib/x86_64-linux-gnu/libc-2.19.so+0x21ec4)
==115480== ABORTING
Aborted

$ asan_symbolize.py
#0 0x7f207b70c33a in __interceptor_free ??:?

#1 0x7c0264 in MEMDBG_off_free   src/memdbg.c:1099
#2 0x429530 in done                         src/MD5_fmt.c:119 (discriminator 1)
#3 0x74dca4 in fmt_done                  src/formats.c:112
#4 0x736c7a in benchmark_all          src/bench.c:754
#5 0x759d2c in john_run                   src/john.c:1309
#6 0x75b23e in main                         src/john.c:1687
Originally created by @loverszhaokai on GitHub (Mar 26, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1151 This bug is found by fuzzzing the options of John. #1. Compile with asan $ export ASAN_OPTIONS='abort_on_error=1' $ AFL_USE_ASAN=1 AFL_HARDEN=1 ./configure --enable-asan && make -sj8 #2. Reproduce $ ./john --stress-test=1 Will run 8 OpenMP threads NOTE: This is an ASan debug build, speed will be lower than normal Benchmarking: descrypt, traditional crypt(3) [DES 128/128 AVX-16]... (8xOMP) DONE Many salts: 8880K c/s real, 1135K c/s virtual Only one salt: 7372K c/s real, 930909 c/s virtual Benchmarking: bsdicrypt, BSDI crypt(3) ("_J9..", 725 iterations) [DES 128/128 AVX-16]... (8xOMP) DONE Many salts: 271714 c/s real, 34389 c/s virtual Only one salt: 208896 c/s real, 29546 c/s virtual Benchmarking: md5crypt, crypt(3) $1$ [MD5 128/128 AVX 12x]... (8xOMP) DONE Raw: 32752 c/s real, 4239 c/s virtual ==115480== **ERROR**: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x000002c8c040 #0 0x7f207b70c33a (/usr/lib/x86_64-linux-gnu/libasan.so.0.0.0+0x1533a) #1 0x7c0264 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options/run/john+0x7c0264) #2 0x429530 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options/run/john+0x429530) #3 0x74dca4 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options/run/john+0x74dca4) #4 0x736c7a (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options/run/john+0x736c7a) #5 0x759d2c (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options/run/john+0x759d2c) #6 0x75b23e (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options/run/john+0x75b23e) #7 0x7f2079f92ec4 (/lib/x86_64-linux-gnu/libc-2.19.so+0x21ec4) ==115480== ABORTING Aborted $ asan_symbolize.py #0 0x7f207b70c33a in __interceptor_free ??:? ``` #1 0x7c0264 in MEMDBG_off_free src/memdbg.c:1099 #2 0x429530 in done src/MD5_fmt.c:119 (discriminator 1) #3 0x74dca4 in fmt_done src/formats.c:112 #4 0x736c7a in benchmark_all src/bench.c:754 #5 0x759d2c in john_run src/john.c:1309 #6 0x75b23e in main src/john.c:1687 ```
bsakaguchi 2026-10-14 03:21:19 +07:00
Author
Owner

@magnumripper commented on GitHub (Mar 26, 2015):

What version of gcc are you using? See #1125, you might need at least gcc-4.9 for proper operation with posix_memalign() although that is just a theory I had.

<!-- gh-comment-id:86380090 --> @magnumripper commented on GitHub (Mar 26, 2015): What version of gcc are you using? See #1125, you might need at least gcc-4.9 for proper operation with posix_memalign() although that is just a theory I had.
Author
Owner

@loverszhaokai commented on GitHub (Mar 26, 2015):

@magnumripper gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1). And I will focus on #1125, thanks.

<!-- gh-comment-id:86380594 --> @loverszhaokai commented on GitHub (Mar 26, 2015): @magnumripper gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1). And I will focus on #1125, thanks.
Author
Owner

@magnumripper commented on GitHub (Mar 26, 2015):

2. Reproduce

$ ./john --stress-test=1

==115480== ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x000002c8c040

Was there no output before this error? Your report suggests this happened immediately. If it did not, you should state so (eg "on second pass of format list, in format foobar" or "after running for seven hours" or something like that)

<!-- gh-comment-id:86382112 --> @magnumripper commented on GitHub (Mar 26, 2015): > # 2. Reproduce > > $ ./john --stress-test=1 > > # > > ==115480== ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x000002c8c040 Was there no output before this error? Your report suggests this happened immediately. If it did not, you should state so (eg "on second pass of format list, in format foobar" or "after running for seven hours" or something like that)
Author
Owner

@magnumripper commented on GitHub (Mar 26, 2015):

Just FYI the --stress-test option is experimental and has known problems. For example, many formats still leak memory when tested like this. This issue is probably a real bug though (unless it's the "too old ASan" problem).

<!-- gh-comment-id:86382985 --> @magnumripper commented on GitHub (Mar 26, 2015): Just FYI the --stress-test option is experimental and has known problems. For example, many formats still leak memory when tested like this. This issue is probably a real bug though (unless it's the "too old ASan" problem).
Author
Owner

@loverszhaokai commented on GitHub (Mar 26, 2015):

@magnumripper Thanks, I will add it.

<!-- gh-comment-id:86382989 --> @loverszhaokai commented on GitHub (Mar 26, 2015): @magnumripper Thanks, I will add it.
Author
Owner

@magnumripper commented on GitHub (Mar 27, 2015):

This is the ASan bug

<!-- gh-comment-id:87017627 --> @magnumripper commented on GitHub (Mar 27, 2015): This is the ASan bug
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#719
No description provided.