1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-26 16:38:35 +00:00

OpenCL Runtime: Workaround ROCm OpenCL driver problem trying to write temporary file into readonly folder by setting TMPDIR environment variable

This commit is contained in:
Jens Steube 2019-06-17 17:35:23 +02:00
parent 5e0eb288c9
commit 62d5d2dfbb
4 changed files with 16 additions and 3 deletions

View File

@ -69,6 +69,7 @@
- OpenCL Runtime: Workaround JiT compiler error on AMDGPU driver compiling WPA-EAPOL-PBKDF2 OpenCL kernel - OpenCL Runtime: Workaround JiT compiler error on AMDGPU driver compiling WPA-EAPOL-PBKDF2 OpenCL kernel
- OpenCL Runtime: Workaround JiT compiler error on ROCM 2.3 driver if the 'inline' keyword is used in function declaration - OpenCL Runtime: Workaround JiT compiler error on ROCM 2.3 driver if the 'inline' keyword is used in function declaration
- OpenCL Runtime: Workaround memory allocation error on AMD driver on Windows leading to CL_MEM_OBJECT_ALLOCATION_FAILURE - OpenCL Runtime: Workaround memory allocation error on AMD driver on Windows leading to CL_MEM_OBJECT_ALLOCATION_FAILURE
- OpenCL Runtime: Workaround ROCm OpenCL driver problem trying to write temporary file into readonly folder by setting TMPDIR
- Startup Screen: Provide an estimate of host memory requirements for the requested attack - Startup Screen: Provide an estimate of host memory requirements for the requested attack
- Tuning Database: Updated hashcat.hctune with new models and refreshed vector width values - Tuning Database: Updated hashcat.hctune with new models and refreshed vector width values
- WPA/WPA2 cracking: In the potfile, replace password with PMK in order to detect already cracked networks across all WPA modes - WPA/WPA2 cracking: In the potfile, replace password with PMK in order to detect already cracked networks across all WPA modes

View File

@ -40,7 +40,7 @@ void naive_escape (char *s, size_t s_max, const char key_char, const char escape
__attribute__ ((format (printf, 2, 3))) int hc_asprintf (char **strp, const char *fmt, ...); __attribute__ ((format (printf, 2, 3))) int hc_asprintf (char **strp, const char *fmt, ...);
void setup_environment_variables (void); void setup_environment_variables (const folder_config_t *folder_config);
void setup_umask (void); void setup_umask (void);
void setup_seeding (const bool rp_gen_seed_chgd, const u32 rp_gen_seed); void setup_seeding (const bool rp_gen_seed_chgd, const u32 rp_gen_seed);

View File

@ -1108,7 +1108,7 @@ int hashcat_session_init (hashcat_ctx_t *hashcat_ctx, const char *install_folder
* To help users a bit * To help users a bit
*/ */
setup_environment_variables (); setup_environment_variables (hashcat_ctx->folder_config);
setup_umask (); setup_umask ();

View File

@ -7,6 +7,7 @@
#include "types.h" #include "types.h"
#include "convert.h" #include "convert.h"
#include "shared.h" #include "shared.h"
#include "memory.h"
#if defined (__CYGWIN__) #if defined (__CYGWIN__)
#include <sys/cygwin.h> #include <sys/cygwin.h>
@ -467,7 +468,7 @@ bool hc_string_is_digit (const char *s)
return true; return true;
} }
void setup_environment_variables () void setup_environment_variables (const folder_config_t *folder_config)
{ {
char *compute = getenv ("COMPUTE"); char *compute = getenv ("COMPUTE");
@ -498,6 +499,17 @@ void setup_environment_variables ()
putenv ((char *) "POCL_KERNEL_CACHE=0"); putenv ((char *) "POCL_KERNEL_CACHE=0");
*/ */
if (getenv ("TMPDIR") == NULL)
{
char *tmpdir = NULL;
hc_asprintf (&tmpdir, "TMPDIR=%s", folder_config->profile_dir);
putenv (tmpdir);
// we can't free tmpdir at this point!
}
if (getenv ("CL_CONFIG_USE_VECTORIZER") == NULL) if (getenv ("CL_CONFIG_USE_VECTORIZER") == NULL)
putenv ((char *) "CL_CONFIG_USE_VECTORIZER=False"); putenv ((char *) "CL_CONFIG_USE_VECTORIZER=False");