[GH-ISSUE #1166] --mkpc=-1 : asan error #732

Closed
opened 2026-10-14 03:21:41 +07:00 by bsakaguchi · 1 comment
Owner

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

This is not a bug, but I think it can be enhanced.
#1. Content of 7z_fmt

$7z$0$19$0$1122$8$d1f50227759415890000000000000000$1412385885$112$112$5e5b8b734adf52a64c541a5a5369023d7cccb78bd910c0092535dfb013a5df84ac692c5311d2e7bbdc580f5b867f7b5dd43830f7b4f37e41c7277e228fb92a6dd854a31646ad117654182253706dae0c069d3f4ce46121d52b6f20741a0bb39fc61113ce14d22f9184adafd6b5333f1b

#2. With ASan

$ export ASAN_OPTIONS='abort_on_error=1'
$ AFL_USE_ASAN=1 AFL_HARDEN=1 ./configure CC=gcc-4.9 --enable-asan && make -sj8
$ ./john 7z_fmt  --mkpc=-1  --skip-self-tests

Loaded 1 password hash (7z, 7-Zip [SHA256 AES 32/64])
Will run 8 OpenMP threads
Note: This format may emit false positives, so it will keep trying even after
finding a possible candidate.
==24130==WARNING: AddressSanitizer failed to allocate 0xffffffffffffffff bytes
==24130==AddressSanitizer's allocator is terminating the process instead of returning 0
==24130==If you don't like this behavior set allocator_may_return_null=1
==24130==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_allocator.cc:147 "((0)) != (0)" (0x0, 0x0)
    #0 0x7f4825280ce3 (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x59ce3)
    #1 0x7f4825284c23 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x5dc23)
    #2 0x7f4825240853 (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x19853)
    #3 0x7f4825283481 (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x5c481)
    #4 0x7f482527b790 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x54790)
    #5 0x75a6d2 in mem_alloc_func /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/memory.c:89
    #6 0x75a8e1 in mem_alloc_tiny_func /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/memory.c:186
    #7 0x72b022 in crk_init /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/cracker.c:176
    #8 0x76e929 in single_init /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/single.c:153
    #9 0x770b44 in do_single_crack /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/single.c:529
    #10 0x7175fd in do_single_pass /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/batch.c:26
    #11 0x717727 in do_batch_crack /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/batch.c:52
    #12 0x73f9f8 in john_run /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1415
    #13 0x74062e in main /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1687
    #14 0x7f4823abaec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4)
    #15 0x406cb2 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/run/john+0x406cb2)

Aborted
$ ./john 7z_fmt  --mkpc=-1

Loaded 1 password hash (7z, 7-Zip [SHA256 AES 32/64])
Will run 8 OpenMP threads
Self test failed (min keys per crypt)

#3. Without ASan

$ ./john 7z_fmt  --mkpc=-1  --skip-self-tests

Loaded 1 password hash (7z, 7-Zip [SHA256 AES 32/64])
Will run 8 OpenMP threads
Note: This format may emit false positives, so it will keep trying even after
finding a possible candidate.
mem_alloc(): Cannot allocate memory trying to allocate -1 bytes
$ ./john 7z_fmt  --mkpc=-1

Loaded 1 password hash (7z, 7-Zip [SHA256 AES 32/64])
Will run 8 OpenMP threads
Self test failed (min keys per crypt)

#4. Not a bug

Even though this is not a bug, I think we should check "--mkpc=N" which N should be bigger than 0. Should We?

Originally created by @loverszhaokai on GitHub (Mar 28, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1166 This is not a bug, but I think it can be enhanced. #1. Content of 7z_fmt ``` $7z$0$19$0$1122$8$d1f50227759415890000000000000000$1412385885$112$112$5e5b8b734adf52a64c541a5a5369023d7cccb78bd910c0092535dfb013a5df84ac692c5311d2e7bbdc580f5b867f7b5dd43830f7b4f37e41c7277e228fb92a6dd854a31646ad117654182253706dae0c069d3f4ce46121d52b6f20741a0bb39fc61113ce14d22f9184adafd6b5333f1b ``` #2. With ASan ``` shell $ export ASAN_OPTIONS='abort_on_error=1' $ AFL_USE_ASAN=1 AFL_HARDEN=1 ./configure CC=gcc-4.9 --enable-asan && make -sj8 ``` ``` shell $ ./john 7z_fmt --mkpc=-1 --skip-self-tests Loaded 1 password hash (7z, 7-Zip [SHA256 AES 32/64]) Will run 8 OpenMP threads Note: This format may emit false positives, so it will keep trying even after finding a possible candidate. ==24130==WARNING: AddressSanitizer failed to allocate 0xffffffffffffffff bytes ==24130==AddressSanitizer's allocator is terminating the process instead of returning 0 ==24130==If you don't like this behavior set allocator_may_return_null=1 ==24130==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/sanitizer_common/sanitizer_allocator.cc:147 "((0)) != (0)" (0x0, 0x0) #0 0x7f4825280ce3 (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x59ce3) #1 0x7f4825284c23 in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x5dc23) #2 0x7f4825240853 (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x19853) #3 0x7f4825283481 (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x5c481) #4 0x7f482527b790 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x54790) #5 0x75a6d2 in mem_alloc_func /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/memory.c:89 #6 0x75a8e1 in mem_alloc_tiny_func /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/memory.c:186 #7 0x72b022 in crk_init /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/cracker.c:176 #8 0x76e929 in single_init /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/single.c:153 #9 0x770b44 in do_single_crack /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/single.c:529 #10 0x7175fd in do_single_pass /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/batch.c:26 #11 0x717727 in do_batch_crack /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/batch.c:52 #12 0x73f9f8 in john_run /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1415 #13 0x74062e in main /home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/src/john.c:1687 #14 0x7f4823abaec4 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21ec4) #15 0x406cb2 (/home/zhaokai/WorkSpace/open_wall/JohnTheRipper_test_options_asan/run/john+0x406cb2) Aborted ``` ``` shell $ ./john 7z_fmt --mkpc=-1 Loaded 1 password hash (7z, 7-Zip [SHA256 AES 32/64]) Will run 8 OpenMP threads Self test failed (min keys per crypt) ``` #3. Without ASan ``` shell $ ./john 7z_fmt --mkpc=-1 --skip-self-tests Loaded 1 password hash (7z, 7-Zip [SHA256 AES 32/64]) Will run 8 OpenMP threads Note: This format may emit false positives, so it will keep trying even after finding a possible candidate. mem_alloc(): Cannot allocate memory trying to allocate -1 bytes ``` ``` shell $ ./john 7z_fmt --mkpc=-1 Loaded 1 password hash (7z, 7-Zip [SHA256 AES 32/64]) Will run 8 OpenMP threads Self test failed (min keys per crypt) ``` #4. Not a bug Even though this is not a bug, I think we should check "--mkpc=N" which N should be **bigger** than 0. Should We?
bsakaguchi 2026-10-14 03:21:41 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

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

Yes, we should. Actually I think it is a bug..

<!-- gh-comment-id:87302583 --> @magnumripper commented on GitHub (Mar 28, 2015): Yes, we should. Actually I think it is a 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#732
No description provided.