[GH-ISSUE #1548] opencl_mscash_fmt_plug.c:364 SegFault #1011

Closed
opened 2026-10-14 03:31:50 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @loverszhaokai on GitHub (Jul 12, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1548

#1. Reproduce

$ cat pwfile

M$test29ab60bdb4493822b175486810ac2abe63

$ CC=clang ./configure --enable-opencl && make -sj8
$ ./john pwfile

Segmentation fault: 11

#2. lldb Debug

$ lldb -- ../john err_pwfiles/pwfile.mscash-opencl

(lldb) target create "../john"
Current executable set to '../john' (x86_64).
(lldb) settings set -- target.run-args  "err_pwfiles/pwfile.mscash-opencl"
(lldb) r
Process 60329 launched: '../john' (x86_64)
Process 60329 stopped
* thread #1: tid = 0x56cfa, 0x000000010014d6d0 john`prepare [inlined] valid(ciphertext=0x00007fff5fbcf690) + 11 at opencl_mscash_fmt_plug.c:364, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1)
    frame #0: 0x000000010014d6d0 john`prepare [inlined] valid(ciphertext=0x00007fff5fbcf690) + 11 at opencl_mscash_fmt_plug.c:364
   361          return 0;
   362      hash = p = strrchr(ciphertext, '#') + 1;
   363      while (*p)
-> 364          if (atoi16[ARCH_INDEX(*p++)] == 0x7f)
   365              return 0;
   366      return p - hash == 32;
   367  }
(lldb) bt
* thread #1: tid = 0x56cfa, 0x000000010014d6d0 john`prepare [inlined] valid(ciphertext=0x00007fff5fbcf690) + 11 at opencl_mscash_fmt_plug.c:364, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1)
  * frame #0: 0x000000010014d6d0 john`prepare [inlined] valid(ciphertext=0x00007fff5fbcf690) + 11 at opencl_mscash_fmt_plug.c:364
    frame #1: 0x000000010014d6c5 john`prepare(split_fields=0x00007fff5fbcf470, self=0x00000001008c5d70) + 101 at opencl_mscash_fmt_plug.c:384
    frame #2: 0x00000001001ea5d1 john`ldr_split_line(login=<unavailable>, ciphertext=0x00007fff5fbcf590, gecos=<unavailable>, home=<unavailable>, uid=<unavailable>, source=<unavailable>, format=<unavailable>, db_opts=<unavailable>, line=<unavailable>) + 4017 at loader.c:721
    frame #3: 0x00000001001e8c65 john`ldr_load_pw_line(db=0x00000001007e57a8, line=<unavailable>) + 245 at loader.c:865
    frame #4: 0x00000001001ea979 john`read_file(db=<unavailable>, name=<unavailable>, flags=<unavailable>, process_line=<unavailable>) + 521 at loader.c:135
    frame #5: 0x00000001001e7034 john`john_load + 1300 at john.c:1024
    frame #6: 0x00000001001e45cd john`john_init(name=0x00007fff5fbff9ab, argc=2, argv=0x00007fff5fbff850) + 669 at john.c:1308
    frame #7: 0x00000001001e42a3 john`main(argc=2, argv=0x00007fff5fbff850) + 1235 at john.c:1754
    frame #8: 0x00007fff89c0d5c9 libdyld.dylib`start + 1
(lldb)
Originally created by @loverszhaokai on GitHub (Jul 12, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1548 #1. Reproduce $ cat pwfile ``` M$test29ab60bdb4493822b175486810ac2abe63 ``` $ CC=clang ./configure --enable-opencl && make -sj8 $ ./john pwfile ``` Segmentation fault: 11 ``` #2. lldb Debug $ lldb -- ../john err_pwfiles/pwfile.mscash-opencl ``` C (lldb) target create "../john" Current executable set to '../john' (x86_64). (lldb) settings set -- target.run-args "err_pwfiles/pwfile.mscash-opencl" (lldb) r Process 60329 launched: '../john' (x86_64) Process 60329 stopped * thread #1: tid = 0x56cfa, 0x000000010014d6d0 john`prepare [inlined] valid(ciphertext=0x00007fff5fbcf690) + 11 at opencl_mscash_fmt_plug.c:364, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1) frame #0: 0x000000010014d6d0 john`prepare [inlined] valid(ciphertext=0x00007fff5fbcf690) + 11 at opencl_mscash_fmt_plug.c:364 361 return 0; 362 hash = p = strrchr(ciphertext, '#') + 1; 363 while (*p) -> 364 if (atoi16[ARCH_INDEX(*p++)] == 0x7f) 365 return 0; 366 return p - hash == 32; 367 } (lldb) bt * thread #1: tid = 0x56cfa, 0x000000010014d6d0 john`prepare [inlined] valid(ciphertext=0x00007fff5fbcf690) + 11 at opencl_mscash_fmt_plug.c:364, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1) * frame #0: 0x000000010014d6d0 john`prepare [inlined] valid(ciphertext=0x00007fff5fbcf690) + 11 at opencl_mscash_fmt_plug.c:364 frame #1: 0x000000010014d6c5 john`prepare(split_fields=0x00007fff5fbcf470, self=0x00000001008c5d70) + 101 at opencl_mscash_fmt_plug.c:384 frame #2: 0x00000001001ea5d1 john`ldr_split_line(login=<unavailable>, ciphertext=0x00007fff5fbcf590, gecos=<unavailable>, home=<unavailable>, uid=<unavailable>, source=<unavailable>, format=<unavailable>, db_opts=<unavailable>, line=<unavailable>) + 4017 at loader.c:721 frame #3: 0x00000001001e8c65 john`ldr_load_pw_line(db=0x00000001007e57a8, line=<unavailable>) + 245 at loader.c:865 frame #4: 0x00000001001ea979 john`read_file(db=<unavailable>, name=<unavailable>, flags=<unavailable>, process_line=<unavailable>) + 521 at loader.c:135 frame #5: 0x00000001001e7034 john`john_load + 1300 at john.c:1024 frame #6: 0x00000001001e45cd john`john_init(name=0x00007fff5fbff9ab, argc=2, argv=0x00007fff5fbff850) + 669 at john.c:1308 frame #7: 0x00000001001e42a3 john`main(argc=2, argv=0x00007fff5fbff850) + 1235 at john.c:1754 frame #8: 0x00007fff89c0d5c9 libdyld.dylib`start + 1 (lldb) ```
bsakaguchi 2026-10-14 03:31:50 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@sayan1an commented on GitHub (Jul 12, 2015):

Please test 1efe5fb511

<!-- gh-comment-id:120720448 --> @sayan1an commented on GitHub (Jul 12, 2015): Please test 1efe5fb5112c3ba693ec0a1cfbc0cb80037a9daa
Author
Owner

@loverszhaokai commented on GitHub (Jul 12, 2015):

Fixed by github.com/magnumripper/JohnTheRipper@1efe5fb511

<!-- gh-comment-id:120721615 --> @loverszhaokai commented on GitHub (Jul 12, 2015): Fixed by https://github.com/magnumripper/JohnTheRipper/commit/1efe5fb5112c3ba693ec0a1cfbc0cb80037a9daa
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#1011
No description provided.