From a134ea52b3c8f69d67450be6263676725f03c6ef Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Thu, 30 Aug 2018 21:31:05 +0200 Subject: [PATCH] Fixed a race condition in status view leading to out-of-bound reads --- deps/OpenCL-Headers/CL | 2 +- docs/changes.txt | 1 + src/opencl.c | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/deps/OpenCL-Headers/CL b/deps/OpenCL-Headers/CL index 42e7afe06..bf0f43b76 160000 --- a/deps/OpenCL-Headers/CL +++ b/deps/OpenCL-Headers/CL @@ -1 +1 @@ -Subproject commit 42e7afe066a67107c2236b86c9864a472f8eead8 +Subproject commit bf0f43b76f4556c3d5717f8ba8a01216b27f4af7 diff --git a/docs/changes.txt b/docs/changes.txt index fd140375c..49b98cd91 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -22,6 +22,7 @@ - Fixed the ciphertext max length in Ansible Vault parser - Fixed detection of unique ESSID in WPA-PMKID-* parser - Fixed speed/delay problem when quitting while the outfile folder is being scanned +- Fixed a race condition in status view leading to out-of-bound reads * changes v4.2.0 -> v4.2.1 diff --git a/src/opencl.c b/src/opencl.c index 0a7189a6c..8c1e598c5 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -2267,6 +2267,8 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co fast_iteration = 1; } + hc_thread_mutex_lock (status_ctx->mux_display); + device_param->innerloop_pos = innerloop_pos; device_param->innerloop_left = innerloop_left; @@ -2274,6 +2276,8 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co device_param->outerloop_multi = (double) innerloop_cnt / (double) (innerloop_pos + innerloop_left); + hc_thread_mutex_unlock (status_ctx->mux_display); + if (hashes->salts_shown[salt_pos] == 1) { status_ctx->words_progress_done[salt_pos] += (u64) pws_cnt * innerloop_left;