From bfd3c57308c91de6e39e06fe1be4d05dfffa867d Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 10 Oct 2017 14:41:33 +0200 Subject: [PATCH] Fixed a calculation error in get_power() leading to errors of type "BUG pw_add()!!" --- docs/changes.txt | 13 +++++++------ src/dispatch.c | 6 +++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 3afbad882..d4dfff3c0 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -23,28 +23,29 @@ ## Bugs ## +- Fixed a buffer overflow in mangle_dupechar_last function +- Fixed a calculation error in get_power() leading to errors of type "BUG pw_add()!!" - Fixed a memory problem that occured when the OpenCL folder was not found and e.g. the shared and session folder were the same - Fixed a missing barrier() call in the RACF OpenCL kernel - Fixed a missing salt length value in benchmark mode for SIP -- Fixed an invalid progress value in status view if words from the base wordlist get rejected because of length -- Fixed an invalid optimization code in kernel 7700 depending on the input hash, causing the kernel to loop forever +- Fixed an integer overflow in hash buffer size calculation - Fixed an integer overflow in innerloop_step and innerloop_cnt variables - Fixed an integer overflow in masks not skipped when loaded from file -- Fixed an integer overflow in hash buffer size calculation +- Fixed an invalid optimization code in kernel 7700 depending on the input hash, causing the kernel to loop forever +- Fixed an invalid progress value in status view if words from the base wordlist get rejected because of length - Fixed a parser error for mode -m 9820 = MS Office <= 2003 $3, SHA1 + RC4, collider #2 - Fixed a parser error in multiple modes not checking for return code, resulting in negative memory index writes - Fixed a problem with changed current working directory, for instance by using --restore together with --remove - Fixed a problem with the conversion to the $HEX[] format: convert/hexify also all passwords of the format $HEX[] -- Fixed the dictstat lookup if nanoseconds are used in timestamps for the cached files - Fixed the calculation of device_name_chksum; should be done for each iteration +- Fixed the dictstat lookup if nanoseconds are used in timestamps for the cached files - Fixed the estimated time value whenever the value is very large and overflows +- Fixed the output of --show when used together with the collider modes -m 9710, 9810 or 10410 - Fixed the parsing of command line options. It doesn't show two times the same error about an invalid option anymore - Fixed the parsing of DCC2 hashes by allowing the "#" character within the user name - Fixed the parsing of descrypt hashes if the hashes do have non-standard characters within the salt -- Fixed the output of --show when used together with the collider modes -m 9710, 9810 or 10410 - Fixed the use of --veracrypt-pim option. It was completely ignored without showing an error - Fixed the version number used in the restore file header -- Fixed overflow in mangle_dupechar_last function ## ## Improvements diff --git a/src/dispatch.c b/src/dispatch.c index 6344e13a0..63b35687c 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -69,7 +69,11 @@ static u32 get_power (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param) const u64 work = MAX (words_left_device, device_param->hardware_power); - return work; + // we need to make sure the value is not larger than the regular kernel_power + + const u64 work_final = MIN (work, device_param->kernel_power); + + return work_final; } return device_param->kernel_power;