mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1952] segfault in hmac-sha256 self test (clang, 64bit Linux avx) #1301
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1301
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @frank-dittrich on GitHub (Dec 11, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1952
Originally assigned to: @frank-dittrich on GitHub.
@magnumripper commented on GitHub (Dec 13, 2015):
I too got this. I saw another problem: The valid function is too promiscuos and the strcpy in split() may end up boffing. Several possble fixes but we shoud probably do it in valid().My problems are possibly fixed by
8ab71ca1and/or97eee58@magnumripper commented on GitHub (Dec 16, 2015):
@frank-dittrich you should run this with ASan and see what is says. I can't reproduce.
@frank-dittrich commented on GitHub (Dec 16, 2015):
With ASan enabled, I can't reproduce.
Will try with --enable-ubsan next.
But with --test=0 for all formats, I get an ASan error for vdi:
https://github.com/magnumripper/JohnTheRipper/issues/1956
@frank-dittrich commented on GitHub (Dec 17, 2015):
Without ASan, but with UbSan, I get the segfault.
@magnumripper commented on GitHub (Dec 17, 2015):
Dry running it from the info: The memcpy destination
_wis a correctly sized stack array. It could be named_w.winstead because it's a union but it should be fine as-is and no compiler is complaining.The source is passed from hmac-sha256 format. If it's incorrectly sized, ASan should see it. I tried both OMP and non-OMP build (although with gcc) and no problem seen. So I suspect this is a clang bug.
@jfoug commented on GitHub (Jan 5, 2016):
Please see if the error is seen after applying
bcc9c47@frank-dittrich commented on GitHub (Jan 5, 2016):
Segfault still occurs:
@frank-dittrich commented on GitHub (Jan 5, 2016):
May be I'll find the time to test a more recent distribution with another clang version within the next days.
@frank-dittrich commented on GitHub (Jan 5, 2016):
I tried to find out how many times the code in question is processed until the segfault occurs.
Turns out --test=0 is not deterministic.
With GCC (non-openmp), that code is executed between 9037 and 12129 times per --test=0 run, when repeating the same test with exactly the same binary.
(I do expect a varying number of times for --test=1 on my laptop, due to throttling etc., but not for --test=0.)
IMHO, this should not happen for --test=0.
With clang, the segfault occurs during the 3rd time that code is processed.
@frank-dittrich commented on GitHub (Jan 10, 2016):
With clang 3.7.0 (Fedora 23), still just claiming gcc 4.2.1 compatibility (just like clang 3.5.0), I cannot reproduce this bug.
@frank-dittrich commented on GitHub (Jan 15, 2016):
May be I just wasn't doing exactly the same test with clang 3.7.0, because I installed Fedora 23 on my Hashwell system which has AVX2.
When I try to disable AVX2 like this
or
I can still not reproduce that bug.
OTOH, when I use
on the same AVX system where the bug occurs when not using
CFLAGS="-mno-avx2", the bug is gone.When I use
on my AVX system, the segfault occurs.
@kholia commented on GitHub (Mar 8, 2017):
I couldn't build current JtR jumbo with,
I am running Fedora 24 with Clang 3.8.1 on a Skylake AVX2 system.
I get errors like,
So, I manually patched the Makefile to enable AVX only (not AVX2) and the build succeeded. I changed "DJOHN_AVX2" to "DJOHN_AVX" and "-mavx2" to "-mavx" in the Makefile.
../run/john --test=0 --format=hmac-sha256no longer crashes. Hence I am closing the bug.@magnumripper commented on GitHub (Mar 8, 2017):
Just for reference, whenever disabling functionality like this you also need the
--disable-native-testsoption to configure.@kholia commented on GitHub (Mar 8, 2017):
Thanks, good to know!