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] [day] [month] [year] [list]
Message-ID: <CAJZ5v0jQwp6dkqaAo+bxzmQJe_3+UDX8_7e0r0=fr1gY59iWZA@mail.gmail.com>
Date: Mon, 24 Nov 2025 20:48:22 +0100
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: david.laight.linux@...il.com
Cc: linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org, 
	"Rafael J. Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH 13/44] drivers/acpi: use min() instead of min_t()

On Wed, Nov 19, 2025 at 11:42 PM <david.laight.linux@...il.com> wrote:
>
> From: David Laight <david.laight.linux@...il.com>
>
> min_t(unsigned int, a, b) casts an 'unsigned long' to 'unsigned int'.
> Use min(a, b) instead as it promotes any 'unsigned int' to 'unsigned long'
> and so cannot discard significant bits.
>
> In this case the 'unsigned long' value is small enough that the result
> is ok.
>
> Detected by an extra check added to min_t().
>
> Signed-off-by: David Laight <david.laight.linux@...il.com>
> ---
>  drivers/acpi/property.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index 43d5e457814e..e427ab24cde7 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -1280,7 +1280,7 @@ static int acpi_data_prop_read(const struct acpi_device_data *data,
>                 ret = acpi_copy_property_array_uint(items, (u64 *)val, nval);
>                 break;
>         case DEV_PROP_STRING:
> -               nval = min_t(u32, nval, obj->package.count);
> +               nval = min(nval, obj->package.count);
>                 if (nval == 0)
>                         return -ENODATA;
>
> --

Applied as 6.19 material with adjusted subject, thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ