linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RESEND PATCH] x86/tools/relocs: add __printf attribute to die()
Date: Fri, 25 Jun 2021 09:17:40 -0700	[thread overview]
Message-ID: <58B9D76E-306C-4CE5-BAAA-E5D38832BE23@zytor.com> (raw)
In-Reply-To: <YNSaMnRDwan+aYT4@kroah.com>

%zu wouldn't DTRT for cross build.

On June 24, 2021 7:44:02 AM PDT, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>On Thu, Jun 24, 2021 at 02:32:43PM +0200, Borislav Petkov wrote:
>> On Thu, Jun 24, 2021 at 01:58:03PM +0200, Greg Kroah-Hartman wrote:
>> > There are a number of printf "mismatches" in the use of die() in
>> > x86/tools/relocs.c.  Fix them up and add the printf attribute to
>the
>> > reloc.h header file to prevent them from ever coming back.
>> > 
>> > Cc: Thomas Gleixner <tglx@linutronix.de>
>> > Cc: Ingo Molnar <mingo@redhat.com>
>> > Cc: Borislav Petkov <bp@alien8.de>
>> > Cc: "H. Peter Anvin" <hpa@zytor.com>
>> > Cc: linux-kernel@vger.kernel.org
>> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> > ---
>> >  arch/x86/tools/relocs.c | 21 +++++++++++----------
>> >  arch/x86/tools/relocs.h |  1 +
>> >  2 files changed, 12 insertions(+), 10 deletions(-)
>> > 
>> > Originally sent back in Feb, but it seems to have been missed:
>> >
>	https://lore.kernel.org/r/20210227095356.603513-1-gregkh@linuxfoundation.org
>> > 
>> > 
>> > diff --git a/arch/x86/tools/relocs.c b/arch/x86/tools/relocs.c
>> > index ce7188cbdae5..c3105a8c6cde 100644
>> > --- a/arch/x86/tools/relocs.c
>> > +++ b/arch/x86/tools/relocs.c
>> > @@ -389,7 +389,8 @@ static void read_ehdr(FILE *fp)
>> >  		Elf_Shdr shdr;
>> >  
>> >  		if (fseek(fp, ehdr.e_shoff, SEEK_SET) < 0)
>> > -			die("Seek to %d failed: %s\n", ehdr.e_shoff, strerror(errno));
>> > +			die("Seek to %d failed: %s\n",
>> > +			    (int)ehdr.e_shoff, strerror(errno));
>> 
>> Instead of casting all those, I think you should use %zu as,
>apparently,
>> we're using unsigned types for Elf{32,64}_Off and Elf{32,64}_Xword,
>etc.
>
>Odd, I thought I tried that and something did not work.  Let me try it
>again...

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

  reply	other threads:[~2021-06-25 16:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24 11:58 [RESEND PATCH] x86/tools/relocs: add __printf attribute to die() Greg Kroah-Hartman
2021-06-24 12:32 ` Borislav Petkov
2021-06-24 14:44   ` Greg Kroah-Hartman
2021-06-25 16:17     ` H. Peter Anvin [this message]
2021-06-25 12:06   ` Greg Kroah-Hartman
2021-06-25 14:12     ` Borislav Petkov
2021-06-25 16:19       ` H. Peter Anvin
2021-06-25 16:53         ` Borislav Petkov
2021-06-25 20:38           ` H. Peter Anvin
2021-06-25 21:07             ` Borislav Petkov
2021-06-27 15:01               ` Greg Kroah-Hartman
2021-06-28 14:25                 ` [PATCH] x86/tools/relocs: Mark die() with the printf function attr format Borislav Petkov
2021-06-28 14:34                   ` Greg Kroah-Hartman
2021-08-23  5:12                   ` [tip: x86/build] " tip-bot2 for Borislav Petkov

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=58B9D76E-306C-4CE5-BAAA-E5D38832BE23@zytor.com \
    --to=hpa@zytor.com \
    --cc=bp@alien8.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).