diff --git a/docs/changes.txt b/docs/changes.txt index aa8a34c1d..48d578c74 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -48,6 +48,7 @@ - Fixed both false negative and false positive results in -m 3000 in -a 3 (affecting only NVIDIA GPU) - Fixed buffer overflow in -m 1800 in -O mode which is optimized to handle only password candidates up to length 15 - Fixed buffer overflow in -m 4710 in -P mode and only in single hash mode if salt length is larger than 32 bytes +- Fixed hardware management sysfs readings in status screen (typically ROCm controlled GPUs) - Fixed include guards in several header files - 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 diff --git a/src/hwmon.c b/src/hwmon.c index 3289a6793..e93cd77bc 100644 --- a/src/hwmon.c +++ b/src/hwmon.c @@ -351,7 +351,7 @@ static int hm_SYSFS_get_pp_dpm_pcie (hashcat_ctx_t *hashcat_ctx, const int backe char *path; - hc_asprintf (&path, "%s/pp_dpm_pcie", syspath); + hc_asprintf (&path, "%s/current_link_width", syspath); hcfree (syspath); @@ -380,14 +380,9 @@ static int hm_SYSFS_get_pp_dpm_pcie (hashcat_ctx_t *hashcat_ctx, const int backe if (len < 2) continue; - if (ptr[len - 2] != '*') continue; - - int profile = 0; - float speed = 0; + int rc = sscanf (ptr, "%d", &lanes); - int rc = sscanf (ptr, "%d: %fGB, x%d *", &profile, &speed, &lanes); - - if (rc == 3) break; + if (rc == 1) break; } hc_fclose (&fp); @@ -2559,8 +2554,6 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) { if (true) { - int hm_adapters_id = 0; - for (int backend_devices_idx = 0; backend_devices_idx < backend_ctx->backend_devices_cnt; backend_devices_idx++) { hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx]; @@ -2572,18 +2565,16 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) if (device_param->is_opencl == true) { - if ((device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - - hm_adapters_sysfs[hm_adapters_id].sysfs = backend_devices_idx; // ???? + const u32 device_id = device_param->device_id; - hm_adapters_sysfs[hm_adapters_id].buslanes_get_supported = true; - hm_adapters_sysfs[hm_adapters_id].corespeed_get_supported = true; - hm_adapters_sysfs[hm_adapters_id].fanspeed_get_supported = true; - hm_adapters_sysfs[hm_adapters_id].fanpolicy_get_supported = true; - hm_adapters_sysfs[hm_adapters_id].memoryspeed_get_supported = true; - hm_adapters_sysfs[hm_adapters_id].temperature_get_supported = true; + if ((device_param->opencl_device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - hm_adapters_id++; + hm_adapters_sysfs[device_id].buslanes_get_supported = true; + hm_adapters_sysfs[device_id].corespeed_get_supported = true; + hm_adapters_sysfs[device_id].fanspeed_get_supported = true; + hm_adapters_sysfs[device_id].fanpolicy_get_supported = true; + hm_adapters_sysfs[device_id].memoryspeed_get_supported = true; + hm_adapters_sysfs[device_id].temperature_get_supported = true; } } } @@ -2664,7 +2655,7 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx) if (device_param->opencl_device_vendor_id == VENDOR_ID_AMD) { hwmon_ctx->hm_device[backend_devices_idx].adl = hm_adapters_adl[device_id].adl; - hwmon_ctx->hm_device[backend_devices_idx].sysfs = hm_adapters_sysfs[device_id].sysfs; + hwmon_ctx->hm_device[backend_devices_idx].sysfs = hm_adapters_sysfs[device_id].sysfs; // not used hwmon_ctx->hm_device[backend_devices_idx].nvapi = 0; hwmon_ctx->hm_device[backend_devices_idx].nvml = 0; hwmon_ctx->hm_device[backend_devices_idx].od_version = 0; @@ -2789,7 +2780,6 @@ void hwmon_ctx_destroy (hashcat_ctx_t *hashcat_ctx) if (hwmon_ctx->hm_sysfs) { - sysfs_close (hashcat_ctx); }