John the Ripper probably needing an additional build flag

There’s a 1.9.0.jumbo1-10 version of JohnTheRipper in the extra repository that seems to be lacking a build flag required for usage on AMD cards. What do I do with it?

I was trying to test my new AMD GPU in multiple ways and one of the ideas was john when I noticed the following issue:

lld: error: undefined hidden symbol: sha1_mblock
❯ john --session=x.rar --format=opencl x.rar.hash
Device ■■■■■■■■■■■■ gfx1100 [AMD Radeon RX 7900 XTX]
Using default input encoding: UTF-8
Loaded 1 password hash (rar-opencl, RAR3 [SHA1 OpenCL AES])
Will run 16 OpenMP threads
Options used: -I /usr/share/john/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=522 -D__SIZEOF_HOST_SIZE_T__=8 -DDEV_VER_MAJOR=3602 -DDEV_VER_MINOR=0 -D_OPENCL_COMPILER -DPLAINTEXT_LENGTH=22 -DHASH_LOOPS=0x4000 /usr/share/john/kernels/rar_kernel.cl
Build log: warning: argument unused during compilation: '-I /usr/share/john/kernels' [-Wunused-command-line-argument]
1 warning generated.
lld: error: undefined hidden symbol: sha1_mblock
>>> referenced by /tmp/comgr-08f06f/input/linked.bc.o:(RarHashLoop)
>>> referenced by /tmp/comgr-08f06f/input/linked.bc.o:(RarHashLoop)
Error: Creating the executable from LLVM IRs failed.

Error building kernel /usr/share/john/kernels/rar_kernel.cl. DEVICE_INFO=522
0: OpenCL CL_BUILD_PROGRAM_FAILURE (-11) error in opencl_common.c:1386 - clBuildProgram

Similar thing happens when only running tests and results in the same point of failure:

lld: error: undefined hidden symbol: preproc ... hmac_sha1
❯ john --test --format=opencl
Device ■■■■■■■■■■■■ gfx1100 [AMD Radeon RX 7900 XTX]
Benchmarking: sha1crypt-opencl, (NetBSD) [PBKDF1-SHA1 OpenCL]... Options used: -I /usr/share/john/kernels -cl-mad-enable -D__GPU__ -DDEVICE_INFO=522 -D__SIZEOF_HOST_SIZE_T__=8 -DDEV_VER_MAJOR=3602 -DDEV_VER_MINOR=0 -D_OPENCL_COMPILER -DHASH_LOOPS=1024 -DOUTLEN=20 -DPLAINTEXT_LENGTH=64 -DV_WIDTH=1 /usr/share/john/kernels/pbkdf1_hmac_sha1_kernel.cl
Build log: warning: argument unused during compilation: '-I /usr/share/john/kernels' [-Wunused-command-line-argument]
1 warning generated.
lld: error: undefined hidden symbol: preproc
>>> referenced by /tmp/comgr-bc0355/input/linked.bc.o:(pbkdf1_init)
>>> referenced by /tmp/comgr-bc0355/input/linked.bc.o:(pbkdf1_init)

lld: error: undefined hidden symbol: hmac_sha1
>>> referenced by /tmp/comgr-bc0355/input/linked.bc.o:(pbkdf1_init)
>>> referenced by /tmp/comgr-bc0355/input/linked.bc.o:(pbkdf1_init)
>>> referenced by /tmp/comgr-bc0355/input/linked.bc.o:(pbkdf1_final)
>>> referenced 1 more times
Error: Creating the executable from LLVM IRs failed.

Error building kernel /usr/share/john/kernels/pbkdf1_hmac_sha1_kernel.cl. DEVICE_INFO=522
0: OpenCL CL_BUILD_PROGRAM_FAILURE (-11) error in opencl_common.c:1386 - clBuildProgram

After going through the john’s issue tracker this comment made me believe the building step is missing a -cl-std=CL1.2 flag (even though the issue suggests NVIDIA/CUDA and I’m on AMD/ROCM).

  1. How do I test that?
  2. Assuming the missing flag is the issue… Should that be solved here somehow or do I take it with the app’s author (who’s mentioned in the package description as a packager)?

And for more knowledgable people who actually know John The Ripper tool - maybe the issue lies elsewhere and this can help you guesstimate where:

john --list=build-info && john --list=opencl-devices
❯ john --list=build-info
Version: 1.9.0-jumbo-1
Build: linux-gnu 64-bit x86_64 AVX AC MPI + OMP
SIMD: AVX, interleaving: MD4:3 MD5:3 SHA1:1 SHA256:1 SHA512:1
System-wide exec: /usr/lib/john
System-wide home: /usr/share/john
Private home: ~/.john
CPU tests: AVX
CPU fallback binary: john-non-avx
$JOHN is /usr/share/john/
Format interface version: 14
Max. number of reported tunable costs: 4
Rec file version: REC4
Charset file version: CHR3
CHARSET_MIN: 1 (0x01)
CHARSET_MAX: 255 (0xff)
CHARSET_LENGTH: 24
SALT_HASH_SIZE: 1048576
SINGLE_IDX_MAX: 2147483648
SINGLE_BUF_MAX: 4294967295
Effective limit: Number of salts vs. SingleMaxBufferSize
Max. Markov mode level: 400
Max. Markov mode password length: 30
gcc version: 13.2.1
GNU libc version: 2.38 (loaded: 2.39)
OpenCL headers version: 1.2
Crypto library: OpenSSL
OpenSSL library version: 030200000      (loaded: 030200010)
OpenSSL 3.2.0 23 Nov 2023       (loaded: OpenSSL 3.2.1 30 Jan 2024)
GMP library version: 6.3.0
File locking: fcntl()
fseek(): fseek
ftell(): ftell
fopen(): fopen
memmem(): System's

❯ john --list=opencl-devices
Platform #0 name: AMD Accelerated Parallel Processing, version: OpenCL 2.1 AMD-APP.dbg (3602.0)
    Device #0 (1) name:     gfx1100
    Board name:             AMD Radeon RX 7900 XTX
    Device vendor:          Advanced Micro Devices, Inc.
    Device type:            GPU (LE)
    Device version:         OpenCL 2.0 
    Driver version:         3602.0 (HSA1.1,LC) - AMDGPU-Pro  
    Native vector widths:   char 4, short 2, int 1, long 1
    Preferred vector width: char 4, short 2, int 1, long 1
    Global Memory:          24560 MB
    Global Memory Cache:    32 KB
    Local Memory:           64 KB (Local)
    Constant Buffer size:   20876 MB
    Max memory alloc. size: 20876 MB
    Max clock (MHz):        2431
    Profiling timer res.:   1 ns
    Max Work Group Size:    256
    Parallel compute cores: 48
    Stream processors:      3072  (48 x 64)
    Speed index:            7468032
    SIMD width:             32
    Wavefront width:        32
    PCI device topology:    03:00.0

P.s. I don’t care about cracking the file’s password - I just noticed an issue when trying to test how many tasks per second the app can perform on GPU. It’s an archive with my old resume, no law is being broken.

Edit PKGBUILD yourself and build it. You can find it in Packages · GitLab

Only if you test it on Arch.

1 Like

I found what seems to be the correct PKGBUILD - will have some fun with that - thank you!

I’m lost now. I thought Manjaro has its own extra repository - is it using exactly the same as Arch?

The author of that PKGBUILD is the guy behind john itself - am I right into thinking I should probably move this to their GitHub?

It does.

No. While Manjaro is based on Arch and most packages are inherited from Arch like john, we also have our own packages and customizations.

No.

I don’t think Jakub Klinkovský is the developer, he’s an Arch Package Maintainer.

Probably not. As you pointed out, it’s a potential packaging issue.

Indeed. Please see Arch bug reporting guidelines. DO NOT submit a bug report mentioning Manjaro.

1 Like

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.