public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: sbinding@opensource.cirrus.com
Cc: andriy.shevchenko@intel.com, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org, patches@opensource.cirrus.com,
	rafael@kernel.org, sakari.ailus@linux.intel.com,
	Ard Biesheuvel <ardb@kernel.org>
Subject: Re: [PATCH v1] ACPI: Property: Fix type detection of unified integer reading functions
Date: Thu, 25 Aug 2022 09:25:05 +0200	[thread overview]
Message-ID: <20220825072505.316002-1-ardb@kernel.org> (raw)
In-Reply-To: <20220812130645.14710-1-sbinding@opensource.cirrus.com>

> The current code expects the type of the value to be an integer type,
> instead the value passed to the macro is a pointer.
> Ensure the size comparison uses the correct pointer type to choose the
> max value, instead of using the integer type.
> 
> Fixes: 923044133367 ("ACPI: property: Unify integer value reading functions")
> 
> Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>

Acked-by: Ard Biesheuvel <ardb@kernel.org>

Can we get this queued up and sent out please? This is breaking some ACPI arm64
systems, which use device properties for their MAC addresses.

Some grumbling about the original patch below.

> ---
>  drivers/acpi/property.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index 7b3ad8ed2f4e..b1d4a8db89df 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -1043,10 +1043,10 @@ static int acpi_data_prop_read_single(const struct acpi_device_data *data,
>  				break;					\
>  			}						\
>  			if (__items[i].integer.value > _Generic(__val,	\
> -								u8: U8_MAX, \
> -								u16: U16_MAX, \
> -								u32: U32_MAX, \
> -								u64: U64_MAX, \
> +								u8 *: U8_MAX, \
> +								u16 *: U16_MAX, \
> +								u32 *: U32_MAX, \
> +								u64 *: U64_MAX, \
>  								default: 0U)) { \

Why is there a default here? Having one is what hides the fact that the patch was completely broken.

>  				ret = -EOVERFLOW;			\
>  				break;					\
> 

Also, I must ask: given how broken the original patch is, I suppose no testing whatsoever was done? 

Thanks,
Ard.


  parent reply	other threads:[~2022-08-25  7:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12 13:06 [PATCH v1] ACPI: Property: Fix type detection of unified integer reading functions Stefan Binding
2022-08-12 19:42 ` Sakari Ailus
2022-08-12 19:43   ` Sakari Ailus
2022-08-20 11:32     ` Rafael J. Wysocki
2022-08-25  7:25 ` Ard Biesheuvel [this message]
2022-08-25  7:40   ` Rafael J. Wysocki
2022-08-25  7:45   ` Sakari Ailus
2022-08-25  7:47     ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220825072505.316002-1-ardb@kernel.org \
    --to=ardb@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=rafael@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sbinding@opensource.cirrus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox