mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #328] illegal memory access in cracker.c when generating candidate passord on GPU. #69
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#69
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 @sayan1an on GitHub (Jun 10, 2013).
Original GitHub issue: https://github.com/openwall/john/issues/328
crk_timestamp in cracker.c allocated memory based on max_keys_per_crypt. However when generating password on gpu we would like to keep max_keys_per_crypt as low as possible which is much much lower than actual crypt all return value. This causes segmentation fault in crk_process_guess(). The index values in the function are way beyond crk_timestamp allocated range.
@magnumripper commented on GitHub (Aug 27, 2013):
Is this taken care of in bleeding-mask branch, or is there just a work-around in place for now?
@sayan1an commented on GitHub (Aug 28, 2013):
No the problem still persist. However it will only occur if (inital kpc < num_loaded_hashes) && (something gets cracked)
@magnumripper commented on GitHub (Sep 2, 2013):
Perhaps now you can do this:
That should fix it, no?
I could commit this to bleeding-jumbo and it'll be merged to bleeding-mask.
@sayan1an commented on GitHub (Sep 2, 2013):
Yes , this should fix the problem. However one minor modification is needed in mask.c. Commit it please.
@magnumripper commented on GitHub (Sep 2, 2013):
Done in
9a6eb53@sayan1an commented on GitHub (Sep 2, 2013):
We have a different problem now:
sayantan@Eden:~/JohnTheRipper/run$ ./john -format=nt-opencl nt -mask=?l?l?l?l -w:wrdlst
Device 0: Tahiti (AMD Radeon HD 7900 Series)
Local worksize (LWS) 64, Global worksize (GWS) 4194304
Loaded 4 password hashes with no different salts (nt-opencl, NT [MD4 OpenCL (inefficient, development use only)])
mem_alloc(): Cannot allocate memory trying to allocate 22682796039 bytes
4194304 * 676 * sizeof(uint64_t) == 22682796039
@magnumripper commented on GitHub (Sep 2, 2013):
Oh my :) I think we should consult Solar on this. Maybe a totally different solution is needed.
@sayan1an commented on GitHub (Sep 2, 2013):
Possible solution:
if (num_loaded_hashes < (max_kpc * num_internal_keys))
size = num_loaded_hashes;
@magnumripper commented on GitHub (Sep 2, 2013):
OK, so like this?
I'll test it just a little before committing.
@magnumripper commented on GitHub (Sep 2, 2013):
Committed in
5f75e60though I'm not sure this is it. Will crk_process_key() never be called with an index larger than max_keys_per_crypt? Anyway this is still a no-op in bleeding so can't do any bad.@magnumripper commented on GitHub (Sep 2, 2013):
Not working. I get segfaults using a GWS of 32K and num_internal_keys of 1000 with some 10M hashes loaded. One problem was that I compared with size instead of max_kpc and size is already multipled with sizeof(int64) but there are problems after fixing that too.
@magnumripper commented on GitHub (Sep 2, 2013):
Hmm but the segfault happens in raw-md5-opencl crypt_all(). Maybe it's unrelated.
@magnumripper commented on GitHub (Sep 2, 2013):
Tried testing with just 62K hashes and now I got the segfault in crk_process_key(). Obviously we can get an index up to (crk_params.max_keys_per_crypt * num_internal_keys) and the number of loaded hashes seems irrelevant to me.
I think we, you or Solar need to re-work this totally. We obviously can't allocate 32 GB of memory for timestamps which is what happens with a keys_per_crypt of 4M and a multiplier (num_internal_keys) of 1K.
@magnumripper commented on GitHub (Sep 2, 2013):
OK I reverted the last commits. We are now back to code that works fine (multiply size with num_int_keys) but it will not work with a GWS in the millions. Speaking of that, do you really need that high GWS? It seems excessive to me. At a speed of 2GH/s and a num_int_keys of 1000 you should have a GWS of just 400K in order to get under 200 ms. However that would still be 3.2 GB of crk_timestamp so we need to fix that anyway.
@sayan1an commented on GitHub (Sep 3, 2013):
"Hmm but the segfault happens in raw-md5-opencl crypt_all(). Maybe it's unrelated."
Is it in Bleeding-mask or jumbo, because crypt all return is different in them.
@magnumripper commented on GitHub (Sep 3, 2013):
Segfault was in bleeding-mask with 10M hashes loaded. It is unrelated to this issue.
@magnumripper commented on GitHub (Sep 3, 2013):
Maybe we should do this too but that's another issue and need to be done throughout john:
[GH-ISSUE #328] illegal memory access in cracker.c when generating candidate passord on GPU.to [GH-ISSUE #328] illegal memory access in cracker.c when generating candidate passord on GPU.