public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>
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 <skhan@linuxfoundation.org>
Subject: Re: [PATCH] ACPICA: Fix sprintf() INT_MAX -Wformat-truncation= warn
Date: Wed, 16 Nov 2022 12:53:14 -0700	[thread overview]
Message-ID: <f47aee52-b826-9f84-3731-ca829064e70e@linuxfoundation.org> (raw)
In-Reply-To: <CAJZ5v0jsSmfMAdtTfhGxD7LP0WoCT8sSeCJ6BRY3ncRuj4yTmQ@mail.gmail.com>

On 11/16/22 12:05, Rafael J. Wysocki wrote:
> On Wed, Nov 16, 2022 at 4:23 PM Shuah Khan <skhan@linuxfoundation.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


      reply	other threads:[~2022-11-16 19:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-16 15:22 [PATCH] ACPICA: Fix sprintf() INT_MAX -Wformat-truncation= warn Shuah Khan
2022-11-16 19:05 ` Rafael J. Wysocki
2022-11-16 19:53   ` Shuah Khan [this message]

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=f47aee52-b826-9f84-3731-ca829064e70e@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=devel@acpica.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rafael@kernel.org \
    --cc=robert.moore@intel.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