Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp340181rwe; Thu, 25 Aug 2022 00:57:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR5+OK/kj94fVXziE/eWZ3pZigZ2u6Qfu/L+FOLx7YeAeVddnnE2BWPLnEzgyy3NVKOLpgzK X-Received: by 2002:a17:906:2bc7:b0:72f:dc70:a3c6 with SMTP id n7-20020a1709062bc700b0072fdc70a3c6mr1622479ejg.645.1661414230779; Thu, 25 Aug 2022 00:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661414230; cv=none; d=google.com; s=arc-20160816; b=GvRFJJw9vIehRMWAkRTUzotq3Uq57ekewXLaEMqt3SzFD37A7dvXWXiEzXsRiLVWzP l40eB3aFDrcyuEUvvonY61oQYzwHm4wIH/NJ8Mvj0ucqu+k2efgBYzTqpXG6mYeLkf3w kskTZKJ7OqIz7ooyDWF3lI0UmwD3IMJ2Y2k+V0lz2gvns2qj+AeGtU/1dBjWLth3jbfa cX3xXwBH9rWupBzC7g0GUw7KjB13fL6BqE21Fig63LM37IuqhiuOXqvu3R0lpKgEoJha Z6V6VA3IWQg7KOCbkuqWFwABR7EubT9GZkOLhUYYnUEWTihdKDAxCLn+FGC/Vf5h4clU vq6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=lsPADIwuzKOCMFK6M4YgS9lTJNBP+zcjWWbReC7RB/A=; b=TZQzxMetaJTfwTDVQoYMhawqvmVBOQ9CxKQiIN8/EKwd3/SXM9zeAAe9A97MZbLPhQ PyM7JPu4odDamBdHV0aNMGl75reV4owwZVGTv6VwTqt6riLGpM7MIYpaAqiZ8/EAi9BI M6BWhnvWTkSlV/WrLUNlLzeH3SJdOi7A+9YgaMuKAEm2PYm6FSZ2ovYUA/nLymMrePhn 6Q6skBTEoWh9jAjRtK+unIrozIGPPaIKIcqZCG8Zn2woeWc6yTJovGLhXYJ3OaqKi4I6 bvvg9C1u1LAwM5FfnuAsJoKI2jINrBFaIsnQBiuABzepVKhg9SKTnYxDSWXJpAt6z3NN Oz4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb24-20020a1709077e9800b00738553043e5si3844097ejc.573.2022.08.25.00.56.44; Thu, 25 Aug 2022 00:57:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238276AbiHYHlN (ORCPT + 99 others); Thu, 25 Aug 2022 03:41:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236411AbiHYHlM (ORCPT ); Thu, 25 Aug 2022 03:41:12 -0400 Received: from mail-yw1-f169.google.com (mail-yw1-f169.google.com [209.85.128.169]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CB919D8DA; Thu, 25 Aug 2022 00:41:11 -0700 (PDT) Received: by mail-yw1-f169.google.com with SMTP id 00721157ae682-334dc616f86so519543337b3.8; Thu, 25 Aug 2022 00:41:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=lsPADIwuzKOCMFK6M4YgS9lTJNBP+zcjWWbReC7RB/A=; b=SVjQsyS7WRA2euAsVhYICssKntu9VAx0murnk8NxrIB+Y7gKyO1HtOvXYaub6Vbgk1 ru4Q1sgm4oWX6LFcY7DoRH+Gu+WVL0qTki+K+IscPQDWFqGip3K5HUcR5id9vgxJ45hH 7CsHCIvzYSvUtlsz7B0J+lotq0MvRcCH0tilUr+hoCdG/b6f9aM8NT5C5wNv/U+qpQiw W7VkSoqNPDcXWsxE3bpePlKSm2I+B0KEOH+sYS7CKzwRa6oTrWHPKu+xt5sbTK1e33KD vQygM3tJZ/72hpJ27bVyOF1s9fC8PPhml4iQbOKKOrcesMCnllmQWwWO1SEGJJVKHyQE a1SA== X-Gm-Message-State: ACgBeo0xIC1vyeH25HLbYOMpGQVtuaBDU9Ay8k1CtEcljzvdPL76HlKN dhoCMmU/xpfL96NDgUrhiLLe53orm/wkmfEd4Xw= X-Received: by 2002:a25:664f:0:b0:66c:d0f4:36cc with SMTP id z15-20020a25664f000000b0066cd0f436ccmr2255530ybm.482.1661413270290; Thu, 25 Aug 2022 00:41:10 -0700 (PDT) MIME-Version: 1.0 References: <20220812130645.14710-1-sbinding@opensource.cirrus.com> <20220825072505.316002-1-ardb@kernel.org> In-Reply-To: <20220825072505.316002-1-ardb@kernel.org> From: "Rafael J. Wysocki" Date: Thu, 25 Aug 2022 09:40:58 +0200 Message-ID: Subject: Re: [PATCH v1] ACPI: Property: Fix type detection of unified integer reading functions To: Ard Biesheuvel , Sakari Ailus Cc: Stefan Binding , "Shevchenko, Andriy" , ACPI Devel Maling List , Linux Kernel Mailing List , patches@opensource.cirrus.com, "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 25, 2022 at 9:25 AM Ard Biesheuvel wrote: > > > 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 > > Acked-by: Ard Biesheuvel > > 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. It is in my queue for -rc3. > 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. Sakari? > > ret = -EOVERFLOW; \ > > break; \ > > > > Also, I must ask: given how broken the original patch is, I suppose no testing whatsoever was done?