mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2094] pbkdf2-hmac-sha1-opencl segfaults #1401
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#1401
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 @magnumripper on GitHub (Mar 17, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2094
Originally assigned to: @magnumripper on GitHub.
eff5a92broke pbkdf2-hmac-sha1-opencl. Segfaults every time during auto-tune (so eg. --test=0 works fine while --test does not). Given the problem I wonder whether you verified performance before/after at all?@magnumripper commented on GitHub (Mar 17, 2016):
Also, please note more formats use the same kernel:
So three formats that use this shared kernel were not adapted at all. They seem to work fine, I just hope we don't have latent problems in them now?
@jfoug commented on GitHub (Mar 18, 2016):
I for the life of me, can not find this. It only happens during auto-tune. The thing is, the format will crack just fine and ST just fine, if LWS/GWS are given. I have found a couple issues, but nothing that was any kind of core, just things which should have been copied over to 'common' coding.
@jfoug commented on GitHub (Mar 18, 2016):
The bug had to do with change to salt. Nothing past split() expected to ever see . chars again. Split removes them and replaces them with '$' chars (which really should have been proper normalization from start).
BUT finding GWS and LWS did not call split (only prepare).
I have added split call after prepare, and am testing all opencl hash types. I do not expect any problems from that addition, but want to check other formats just to be sure.
So there was no 'latent' problems with buffer size changes or anything like that within the CPU<->GPU code. It was simply my lack of understanding how the auto-tune was doing self test work, and possibly an issue all along in that part of the ST work chain.
@jfoug commented on GitHub (Mar 18, 2016):
This is the change I am validating
@magnumripper commented on GitHub (Mar 18, 2016):
Wow, so that was a bug long before
eff5a92yet it never showed up until that commit. Your proposed patch definitely makes sense.@magnumripper commented on GitHub (Mar 18, 2016):
Thanks, will test.
@jfoug commented on GitHub (Mar 18, 2016):
Yup, this issue has been there forever, but until a format came across which 'required' it, nothing bad ever showed up. Now pbkdf2-hmac-sha1* requires split to normalize out all the '.' separators so bam, a strange crash that really was NOT apparent. I kept looking in the code where the CPU/GPU interfaced, thinking that was likely the bad stuff. The thing that bothered me most, was the this format WORKED just fine. It would crack, ST, everything, as long as it did not have to go through the auto-tune code.
@jfoug commented on GitHub (Mar 18, 2016):
NOTE, I also did find a couple minor issues (like binary doing up to 4 limb length binaries). NOTE, I simply added the code to do that. We only use the first binary limb, which is all we really need no matter what. If we have 20 bytes of matched binary, then there is NO REASON at all to get more of it, UNLESS we were going to use that data for a key or something. Since we are simply doing this as a validation that the password is right, then a 1 limb binary is all we need to care about.
@jfoug commented on GitHub (Mar 18, 2016):
That is the correct order for the format methods, correct?
prepare()
split()
salt()
set_salt()
crypt_all()
@frank-dittrich commented on GitHub (Mar 18, 2016):
IIRC, split(), get_salt(), etc. are allowed to assume that all the hashes have passed valid().
@jfoug commented on GitHub (Mar 18, 2016):
I thought split() was called prior to valid(). Nope, you are 100% correct. Let me check my common code to make sure valid is fine.
However, it is NOT valid for the salt() function to be called prior to split and prepare being called.
@jfoug commented on GitHub (Mar 18, 2016):
This is in the common code:
So valid DOES look for both a . and a $. But functions like salt(), binary(), etc do NOT spend time looking for a '.' They assume there never will be one in any data which they are given.
@jfoug commented on GitHub (Mar 18, 2016):
So the 'correct' order of method calls is:
That is the correct order for the format methods, correct?
And during some ST runs, certain things are not done (like cmp_all() ?) or valid(), etc
@frank-dittrich commented on GitHub (Mar 18, 2016):
And, from formats.h:
prepare(), valid(), and split() are the only methods that are allowed to be called before a call to init()