Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1102959rwb; Wed, 16 Nov 2022 12:06:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf5vq9BnuZbqLZyZssJeUqhbJi2KfJ10SSJLLePJpFMrBRHHIF2yKJTYsBbRiiymNw9LeE9i X-Received: by 2002:a05:6402:2943:b0:461:c3c9:38e6 with SMTP id ed3-20020a056402294300b00461c3c938e6mr20792202edb.350.1668629184157; Wed, 16 Nov 2022 12:06:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668629184; cv=none; d=google.com; s=arc-20160816; b=T0Igi8gaNjiOpFV020ITpfqkc3ExeF3Npb9a1eE+gkXcvKLaNC5h1HFDFyXGEiyRMP UHfrhnRkaM8S/JtxMOY2AR9YsbHvGurtl6gCfhbuRbhhKzEgVET01VqV3dC0TGQv1SC0 QgpM/CcdQz7uCWKEscPMirSW6ZJMWg/z3hMs5eFNYO9+GbOnkW8lnjrY5ZTQ0jTsmw8m J80uIhXLsgmHATT/An8y4YjrNTYjqW4cpDIOGT2mV3f/mcOiQevqCFIIcEA2ZFpCoXiD 8pZBh7nrT+4weCOGXRtrjo/VkId50zqsUl0Tw7U3UpOsijSbwrTz2AcMbGqkwKNgSJ3e PU2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=eCykNX32gvCxKdIcReGDOnFwaVXOtSeXbWqUs4fkq6E=; b=R7ZgSqZg0nzI3YrHXYPEcR8mOStJA96r8wYuRfp+UH5Muu2EHI9TCNi24D+s8Bd6gk go2pvlVQKJm+oHkmFGrvcSwX4bA9gjqOqN4xuls884H5j9T2fgUH8MA9urhsYvCp1KNU qzGzGv2c+89WTFKiFzyCiO7Uv2hX5yq93kHxCi4wqY3FM9K+5VUyXDHyV17vHXuTVeh6 owh8SAbiomNhVDLwFWpc5/HJhyLOSeWbT6IVrC/R9BvF3CAs/OC48p+ftWk2lyPg4I3r YdGq/d8gy1EHIlkUcdSI1gl/I3nordzxaPLBUMtZHKqzGiaaEH/FqPBzawDIGKMZMv+9 eaNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=cC8uPmk8; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh31-20020a1709076e9f00b007adadfc97c7si16706647ejc.918.2022.11.16.12.06.00; Wed, 16 Nov 2022 12:06:24 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=cC8uPmk8; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234348AbiKPTxU (ORCPT + 91 others); Wed, 16 Nov 2022 14:53:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234268AbiKPTxR (ORCPT ); Wed, 16 Nov 2022 14:53:17 -0500 Received: from mail-il1-x136.google.com (mail-il1-x136.google.com [IPv6:2607:f8b0:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5F274C267 for ; Wed, 16 Nov 2022 11:53:16 -0800 (PST) Received: by mail-il1-x136.google.com with SMTP id o13so9710709ilq.6 for ; Wed, 16 Nov 2022 11:53:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=eCykNX32gvCxKdIcReGDOnFwaVXOtSeXbWqUs4fkq6E=; b=cC8uPmk8VC/AN8Vh/LyKBcf+7l+ri7qJKhhTBNBHj50TctH2FsIbmebyJST+1Ps1SP otiEiZOB0QzhUAwwYs2lQadVWFmYgqHkJCHswqPI8/YdRw1G875PWcDYl/+52SqyF65J Nhiy9tkBR8DoILUOhQAhAiKvWc6wP31FmWf7Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eCykNX32gvCxKdIcReGDOnFwaVXOtSeXbWqUs4fkq6E=; b=utcQUjFlbNwGNygAPAYjXQdCNawW5cb9cBEQkY3ebBHlNjdMf7zUd0lTgqJYGafRCj 36lt8HqFkNktkTBMB/4n3E/Ef5eEURYDye3St72SN35KqUNyGcfcL6xeNpADa0Fp6d7a 0QZfuq1fH+jyKbl5fEZsfbs8a5zZt9tsNeA7YkIdwkz45FzX/iujEGBZ2+ZBxhO9sbLo p16IV2x4UujL2EuZ3YWWjZ3JsGC2lc/Xt3hDC8XttuK6SlC6s1ElM8/3fbtcvnYzZZHa /XV9weirTJVLhrpEIalL2GPCHH/dSRC31F7wV+mG75xlAdSIPL8PSYZoPGLwOONhjSfa b32w== X-Gm-Message-State: ANoB5pmRQ1wYsYNfiXybxR1awxuNrOUtUYoli5+BdolQeK3OCt/L85Zs YF9ditjzIrf9bQTusrg7oqhcUQ== X-Received: by 2002:a92:b74a:0:b0:2f9:4402:9c77 with SMTP id c10-20020a92b74a000000b002f944029c77mr11703851ilm.145.1668628395981; Wed, 16 Nov 2022 11:53:15 -0800 (PST) Received: from [192.168.1.128] ([38.15.45.1]) by smtp.gmail.com with ESMTPSA id a8-20020a92ce48000000b002ffa449535asm6567466ilr.74.2022.11.16.11.53.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Nov 2022 11:53:15 -0800 (PST) Message-ID: Date: Wed, 16 Nov 2022 12:53:14 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] ACPICA: Fix sprintf() INT_MAX -Wformat-truncation= warn Content-Language: en-US To: "Rafael J. Wysocki" Cc: robert.moore@intel.com, rafael.j.wysocki@intel.com, lenb@kernel.org, linux-acpi@vger.kernel.org, devel@acpica.org, linux-kernel@vger.kernel.org, Shuah Khan References: <20221116152258.28772-1-skhan@linuxfoundation.org> From: Shuah Khan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 11/16/22 12:05, Rafael J. Wysocki wrote: > On Wed, Nov 16, 2022 at 4:23 PM Shuah Khan wrote: >> >> utprint module is included in tools/acpidump and when acpidump is built, >> the following warning occurs. >> >> CC tools/acpidump/utprint.o >> /usr/include/x86_64-linux-gnu/bits/stdio2.h: In function ‘sprintf’: >> ../../../../../drivers/acpi/acpica/utprint.c:602:18: warning: specified bound 4294901760 exceeds ‘INT_MAX’ [-Wformat-truncation=] >> 602 | length = vsnprintf(string, ACPI_UINT32_MAX-ACPI_UINT16_MAX, >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 603 | format, args); >> | ~~~~~~~~~~~~~ >> >> Fix sprintf() to use ACPI_UINT32_MAX/2 to get rid of the truncate problem. >> This change is inline other sprintf() implementations. >> >> If using ACPI_UINT32_MAX is necessary in the kernel, acpidump might require >> special case to get rid of this truncate problem. > > As ACPICA material, this should be submitted to the upstream project > on GitHub and honestly I'm not sure if it is going to be resolved this > way there. Thank you for your review. I will send this ACPICA upstream project. thanks, -- Shuah