Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 04 Apr 2012 12:37:43 +0100
From: Michael Pappas <pappasm@...man.ac.uk>
To: john-dev@...ts.openwall.com
Subject: Path initialization error (was: OpenCL runtime errors)

On 04/04/2012 11:22 AM, Michael Pappas wrote:
>
>
> Running through the shell will return a different error:
>
> bash-4.1$ john -t --format=cryptmd5-opencl
> OpenCL Platforms: 1
> OpenCL Platform: <<<NVIDIA CUDA>>> 1 device(s), using device: 
> <<<GeForce 9300M GS>>>
> pathname = $JOHN/
> pathname (expanded) =
> Options used: -I
> Compilation log: Error in processing command line: Don't understand 
> command line argument "sm_11"!
> OpenCL error (CL_INVALID_PROGRAM_EXECUTABLE) in file 
> (opencl_cryptmd5_fmt.c) at line (235) - (Error while creating kernel)
>
> It seems like get_path() thinks that $JOHN is not set, expanding it to 
> the empty string. Exporting didn't help either. I'll keep looking into 
> it, but even if it's fixed, I think we'll fall back to the original 
> error (the one returned on gdb).
>

I narrowed down the problem to path_init(). The problem seems to be 
caused by the way I am executing john. I have added some debug output in 
order to highlight the effect:

bash-4.1$ john -t --format=cryptmd5-opencl
argv[0] = john
john_home_path: (null)
john_home_path: (null)
john_home_path: (null)
john_home_path: (null)
john_home_path: (null)
...

bash-4.1$ ./john -t --format=cryptmd5-opencl
argv[0] = ./john
john_home_path: ./
john_home_path: ./john.conf
john_home_path: ./dumb16.conf
john_home_path: ./dumb32.conf
john_home_path: ./dynamic.conf
...

There seems like path_init() won't handle cases where the argv[0] 
contains no slash (see path.c from line 65 and on).

The error does not occur when I am executing on gdb because gdb is 
expanding argv[0] to contain the full path name.

Using realpath() seems to solve the problem, but I'm not sure this would 
be portable. Any ideas?

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ