openwall / openwall/john

Runtime warnings with ASAN and UBSAN

Open
#4,693 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

maintenance/cleanup
Dominant language
C
Stars
13.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Might be false-positive

$ ./john --test=0 --format=-opencl
Will run 8 OpenMP threads
Testing: descrypt, traditional crypt(3) [DES 256/256 AVX2]... (8xOMP) DES_bs.c:552:2: runtime error: load of misaligned address 0x7f8e635072c1 for type 'long int', which requires 8 byte alignment
0x7f8e635072c1: note: pointer points here
 00 00 00  1f 02 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
              ^ 
DES_bs.c:553:2: runtime error: load of misaligned address 0x7f8e635072e1 for type 'long int', which requires 8 byte alignment
0x7f8e635072e1: note: pointer points here
 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
              ^ 
DES_bs.c:555:2: runtime error: load of misaligned address 0x7f8e63507261 for type 'long int', which requires 8 byte alignment
0x7f8e63507261: note: pointer points here
 00 00 00  e0 ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ff ff ff ff ff
              ^ 
DES_bs.c:556:2: runtime error: load of misaligned address 0x7f8e63507281 for type 'long int', which requires 8 byte alignment
0x7f8e63507281: note: pointer points here
 ff ff ff  bf ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ff ff ff ff ff
              ^ 
DES_bs.c:557:2: runtime error: load of misaligned address 0x7f8e635072a1 for type 'long int', which requires 8 byte alignment
0x7f8e635072a1: note: pointer points here
 ff ff ff  1f 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
              ^ 
DES_bs.c:562:4: runtime error: load of misaligned address 0x7f8e63507241 for type 'long int', which requires 8 byte alignment
0x7f8e63507241: note: pointer points here
 ff ff ff  5f 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00 00
              ^ 
DES_bs.c:567:9: runtime error: load of misaligned address 0x7f8e63507301 for type 'long int', which requires 8 byte alignment
0x7f8e63507301: note: pointer points here
 00 00 00  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  ff ff ff ff ff
              ^ 
PASS

And for some reason, mscash2 format as a CPU format and as mscash2-opencl format on the Intel "GPU" (but not POCL) fail with --enable-ubsan, while they pass self-test in a regular build:

$ ./john --test --format=mscash2
Will run 8 OpenMP threads
NOTE: This is a debug build, speed will be lower than normal
Benchmarking: mscash2, MS Cache Hash 2 (DCC2) [PBKDF2-SHA1 256/256 AVX2 8x]... (8xOMP) FAILED (cmp_all(10))
$ ./john --test=0 --format=mscash2-opencl --device=1
Testing: mscash2-opencl, MS Cache Hash 2 (DCC2) [PBKDF2-SHA1 OpenCL]... Device 1: Intel(R) UHD Graphics 620 [0x5917]
FAILED (cmp_all(1))

(And, IMHO, the Device info sholdn't be intermangled with the --test output.)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported sanitizer output with ./john --test=0 --format=-opencl and inspect DES_bs.c at lines 552-567. Then run the mscash2 and mscash2-opencl self-tests with --enable-ubsan, including the Intel device, and compare them with a regular build; done means the sanitizer run no longer reports the warnings or the affected formats no longer fail unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.