mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2679] CPU fallback might break in some builds. #1733
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#1733
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 16, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2679
f7235fca13broke CPU detection/fallback in certain cases. Jim put the CRC32_Init_tab() in john.c and it may end up containing eg. AVX2 instructions. See https://github.com/magnumripper/JohnTheRipper/issues/2674#issuecomment-322801462@solardiz commented on GitHub (Aug 17, 2017):
Strictly speaking, jumbo's calling
sig_preinit()andpath_init() before CPU fallback is also a bug, until/unless we buildsignals.candpath.cwithout CPU type specific optimizations (like I think/hope we do forjohn.c, or don't we?) We're just "lucky" the compiler doesn't yet use (advanced) SIMD instructions in those functions.I've just verified that none of this is in core, where
CPU_detect_or_fallback()is reached without those external files' function calls. I don't know why we introduced/moved them in jumbo - I am not sure that was sound reasoning, but OTOH I don't rule out that core might have needed to do it for some reason I am unaware of. The core tree's CPU fallback works just fine in the Owl package.@solardiz commented on GitHub (Aug 17, 2017):
We do (or at least can) in core, due to these lines in
Makefile:Owl's
john.specin some cases managesCFLAGS_MAINseparately.@ghost commented on GitHub (Aug 17, 2017):
Jumbo uses
path_expand("$JOHN/" CPU_FALLBACK_BINARY)insideCPU_detect_or_fallback(); so, if you do not do path_init() before it, you do not have $JOHN properly expanded and JTR will fail.BTW: fallback works nicely on Linux (maybe also on Windows, I can't remember). On Linux, I've been packaging/testing it every week or so. Note, only for gcc.
@magnumripper commented on GitHub (Aug 17, 2017):
So we should build signals.o and path.o with same CFLAGS as john.o. This should be really trivial. Reopening for this.
@magnumripper commented on GitHub (Aug 17, 2017):
The move of sig_init (now sig_preinit) was caused by #798 where Frank came up with some pretty ridiculous test cases that I couldn't really rule out as not having any significance.
@magnumripper commented on GitHub (Aug 21, 2017):
It's not quite that trivial. We may build path.o and signals.o using CFLAGS_MAIN but then path.o in turn call memory.o and so on so it's still not 100% safe. Jumbo's early path_init() is for being able to know fallback binary path (basically, define
$JOHN) when using fallback without SYSTEMWIDE (which core John doesn't allow). Maybe instead we could simply use something likedirname(argv[0])and concatenate it with CPU_FALLBACK_BINARY (and a slash inbetween).For sig_preinit() I'm pretty sure just building signals.o with CFLAGS_MAIN is enough though.
@ghost commented on GitHub (Dec 15, 2018):
Bug closed as:
Low Priority - They have a tendency to become high priority if enough of the users complain.
Business Priority - Obsolete hardware and software. Hardware nobody owns, etc.
Fixed - It was fixed.
@magnumripper commented on GitHub (Dec 15, 2018):
I just hope the very recent change to
-O1doesn't break it (but that particular thing shouldn't AFAIK)@magnumripper commented on GitHub (Apr 6, 2020):
Reopening due to #4245. Not sure what's happening but we should build wpapcap2john.o (maybe all symlink binaries) without CPU type specific optimizations - are we not? Does core john? Aren't we falling back before calling the "symlink main"?
Also, I'm assuming building signals.o without CPU type specific optimizations wouldn't result in a performance issue, so we should. We should also implement the simpler "dirname" stuff (actually somethin' like
strrchr(argv[0], '/')) I mentioned above.Finally we could/should add comments to any function below
main()in john.c that needs to be fallback-safe.@solardiz commented on GitHub (May 25, 2024):
We no longer call
sig_preinitbefore CPU fallback, but we still do callpath_init, which I still think is a bug.@solardiz commented on GitHub (May 25, 2024):
See @claudioandre-br's work in #2277 and #2280. The problem is in jumbo we sometimes use
$JOHNfor the fallback path:This was introduced by @magnumripper in
9852e5e88c, And we currently use that functionality in some of our binary builds, right?So it looks like we need to make
path_initsafe to call before fallback, rather than avoid that call.