lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 9 Mar 2024 09:41:43 -0800
From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>
To: Armin Wolf <W_Armin@....de>, hdegoede@...hat.com,
 ilpo.jarvinen@...ux.intel.com
Cc: rafael@...nel.org, lenb@...nel.org, mario.limonciello@....com,
 linux-acpi@...r.kernel.org, platform-driver-x86@...r.kernel.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 2/2] platform/x86: wmi: Avoid returning AE_OK upon
 unknown error


On 3/8/24 1:05 PM, Armin Wolf wrote:
> If an error code other than EINVAL, ENODEV or ETIME is returned
> by ec_read()/ec_write(), then AE_OK is wrongly returned.
>
> Fix this by only returning AE_OK if the return code is 0, and
> return AE_ERROR otherwise.
>
> Tested on a Dell Inspiron 3505 and a Asus Prime B650-Plus.
>
> Reviewed-by: Hans de Goede <hdegoede@...hat.com>
> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
> Signed-off-by: Armin Wolf <W_Armin@....de>
> ---
>  drivers/platform/x86/wmi.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
> index d9bf6d452b3a..84d1ccf6bc14 100644
> --- a/drivers/platform/x86/wmi.c
> +++ b/drivers/platform/x86/wmi.c
> @@ -1218,8 +1218,10 @@ acpi_wmi_ec_space_handler(u32 function, acpi_physical_address address,
>  		return AE_NOT_FOUND;
>  	case -ETIME:
>  		return AE_TIME;
> -	default:
> +	case 0:
>  		return AE_OK;
> +	default:
> +		return AE_ERROR;
>  	}

After checking the callers of acpi_wmi_ec_space_handler() it looks like there is no benefit in returning different ACPI status per error values. It is not being used. why no just return for result < 0 AE_ERROR and return for other cases?
>  }
>
> --
> 2.39.2
>
>
-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ