[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f47aee52-b826-9f84-3731-ca829064e70e@linuxfoundation.org>
Date: Wed, 16 Nov 2022 12:53:14 -0700
From: Shuah Khan <skhan@...uxfoundation.org>
To: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: robert.moore@...el.com, rafael.j.wysocki@...el.com,
lenb@...nel.org, linux-acpi@...r.kernel.org, devel@...ica.org,
linux-kernel@...r.kernel.org,
Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] ACPICA: Fix sprintf() INT_MAX -Wformat-truncation= warn
On 11/16/22 12:05, Rafael J. Wysocki wrote:
> On Wed, Nov 16, 2022 at 4:23 PM Shuah Khan <skhan@...uxfoundation.org> 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
Powered by blists - more mailing lists