From 59459d0e5b5a16038ec86ce4269dfbdb0dd9f063 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Sat, 1 May 2021 17:27:33 +0200 Subject: [PATCH] Fixed memory leak causing problems in sessions with many iterations. for instance, --benchmark-all or large mask files --- docs/changes.txt | 1 + include/types.h | 4 ---- src/backend.c | 2 ++ 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 132f69b2b..395fcb53e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -47,6 +47,7 @@ - Fixed incorrect maximum password length support for -m 400 in optimized mode (reduced from 55 to 39) - Fixed internal access on module option attribute OPTS_TYPE_SUGGEST_KG with the result that it was unused - Fixed invalid handling of outfile folder entries for -m 22000 +- Fixed memory leak causing problems in sessions with many iterations. for instance, --benchmark-all or large mask files - Fixed out-of-boundary reads in case user activates -S for fast but pure hashes in -a 1 or -a 3 mode - Fixed password reassembling for cracked hashes on host for slow hashes in optimized mode that are longer than 32 characters - Fixed race condition in potfile check during removal of empty hashes diff --git a/include/types.h b/include/types.h index 49b26fd35..45645d46f 100644 --- a/include/types.h +++ b/include/types.h @@ -1417,8 +1417,6 @@ typedef struct hc_device_param CUdeviceptr cuda_d_pws_amp_buf; CUdeviceptr cuda_d_pws_comp_buf; CUdeviceptr cuda_d_pws_idx; - CUdeviceptr cuda_d_words_buf_l; - CUdeviceptr cuda_d_words_buf_r; CUdeviceptr cuda_d_rules; CUdeviceptr cuda_d_rules_c; CUdeviceptr cuda_d_combs; @@ -1503,8 +1501,6 @@ typedef struct hc_device_param cl_mem opencl_d_pws_amp_buf; cl_mem opencl_d_pws_comp_buf; cl_mem opencl_d_pws_idx; - cl_mem opencl_d_words_buf_l; - cl_mem opencl_d_words_buf_r; cl_mem opencl_d_rules; cl_mem opencl_d_rules_c; cl_mem opencl_d_combs; diff --git a/src/backend.c b/src/backend.c index 515ec7ca8..1db020bbb 100644 --- a/src/backend.c +++ b/src/backend.c @@ -11143,6 +11143,7 @@ void backend_session_destroy (hashcat_ctx_t *hashcat_ctx) if (device_param->cuda_module) hc_cuModuleUnload (hashcat_ctx, device_param->cuda_module); if (device_param->cuda_module_mp) hc_cuModuleUnload (hashcat_ctx, device_param->cuda_module_mp); if (device_param->cuda_module_amp) hc_cuModuleUnload (hashcat_ctx, device_param->cuda_module_amp); + if (device_param->cuda_module_shared) hc_cuModuleUnload (hashcat_ctx, device_param->cuda_module_shared); if (device_param->cuda_context) hc_cuCtxDestroy (hashcat_ctx, device_param->cuda_context); @@ -11280,6 +11281,7 @@ void backend_session_destroy (hashcat_ctx_t *hashcat_ctx) if (device_param->opencl_program) hc_clReleaseProgram (hashcat_ctx, device_param->opencl_program); if (device_param->opencl_program_mp) hc_clReleaseProgram (hashcat_ctx, device_param->opencl_program_mp); if (device_param->opencl_program_amp) hc_clReleaseProgram (hashcat_ctx, device_param->opencl_program_amp); + if (device_param->opencl_program_shared) hc_clReleaseProgram (hashcat_ctx, device_param->opencl_program_shared); if (device_param->opencl_command_queue) hc_clReleaseCommandQueue (hashcat_ctx, device_param->opencl_command_queue);