mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #726] rar5 and pbkdf2-hmac-sha256 OpenCL formats segfault #369
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#369
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 (Aug 27, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/726
@ukasz mentions a bug in
4aa53ac(or http://www.openwall.com/lists/john-dev/2013/08/11/6) that seems to be worse now and just (re-) commenting out the clReleaseMemObject for mem_state does not help much anymore. We need to find the real bug. I spent the better parts of this day trying to track it down (using pbkdf2-hmac-sha256-opencl from3774f329because it's simpler than current code) but I just can't nail it.There's got to be a buffer overwrite or something. It's not a driver bug: I see the bug in rar5-opencl and/or pbkdf2-hmac-sha256-opencl with several totally different drivers (AMD, nvidia, Intel) yet some drivers (or situations) don't trigger it.
In some cases, --skip-self-tests reliably hides the bug, in others it does not.
@magnumripper commented on GitHub (Aug 27, 2014):
Valgrind has a hard time keeping up with OpenCL stuff (missing debug info in libraries). Among lots of probably false positives, it outputs some cryptic stuff about overwrites but with an unusable backtrace.
Enabling MEMDBG_ON with MEMDBG_EXTRA_CHECKS in JtR (see memdbg_defines.h) does warn about buffers used (even written to iirc) after free but it only points out where they (I think) were allocated, not where they were molested. Both cases I've seen pointed to
host_crack = mem_calloc(kpc * sizeof(crack_t));which is kinda confusing.Heavily over-allocating buffers, or shrinking max password length, does not help.
@magnumripper commented on GitHub (Aug 27, 2014):
BTW I tried calling clGetMemObjectInfo() on mem_state instead of releasing it, but even THAT caused a segfault. So I reverted to just putting a breakpoint in release_clobj() and trying to look at things from there but gdb does not understand a cl_mem (incomplete type) so I lost faith in that track and gave it up.
@magnumripper commented on GitHub (Sep 13, 2014):
Someone PLEASE spot this bug, or I will die trying 😢
@ghost commented on GitHub (Sep 15, 2014):
My opinion is that something wrong (a buffer overflow) is happening inside passlib_binary/base64_decode.
Not sure how you guys see the error, I can only see it as reported in #739. To fix it, I correct the size of:
The size you guys selected is not good enough.
@magnumripper commented on GitHub (Sep 15, 2014):
Wow, it's always so obvious in hindsight. Thanks!! I guess whatever I thought I saw in rar5 was unrelated.
@magnumripper commented on GitHub (Sep 15, 2014):
Committed in
e771a85