The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] objtool: Fix NULL printf() '%s' argument
Date: Wed, 26 Mar 2025 15:10:14 +1100	[thread overview]
Message-ID: <20250326151014.6a006c93@canb.auug.org.au> (raw)
In-Reply-To: <a814ed8b08fb410be29498a20a5fbbb26e907ecf.1742952512.git.jpoimboe@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]

Hi Josh,

On Tue, 25 Mar 2025 18:30:37 -0700 Josh Poimboeuf <jpoimboe@kernel.org> wrote:
>
> It's probably not the best idea to pass a string pointer to printf()
> right after confirming said pointer is NULL.  Fix the typo and use
> argv[i] instead.
> 
> Fixes: c5995abe1547 ("objtool: Improve error handling")
> Closes: https://lore.kernel.org/20250326103854.309e3c60@canb.auug.org.au
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
> ---
>  tools/objtool/builtin-check.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
> index 2bdff910430e..e364ab6345d3 100644
> --- a/tools/objtool/builtin-check.c
> +++ b/tools/objtool/builtin-check.c
> @@ -238,7 +238,7 @@ static void save_argv(int argc, const char **argv)
>  	for (int i = 0; i < argc; i++) {
>  		orig_argv[i] = strdup(argv[i]);
>  		if (!orig_argv[i]) {
> -			WARN_GLIBC("strdup(%s)", orig_argv[i]);
> +			WARN_GLIBC("strdup(%s)", argv[i]);
>  			exit(1);
>  		}
>  	};
> -- 
> 2.48.1
> 

Thanks.  I have applied this to the merge of the tip tree (which
include the tip-fixes tree) in linux-next today.  It fixes the build
failure for me.  I will apply it to the merge of the tip-fixes tree
tomorrow unless it has already been applied by then.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2025-03-26  4:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-26  1:30 [PATCH] objtool: Fix NULL printf() '%s' argument Josh Poimboeuf
2025-03-26  4:10 ` Stephen Rothwell [this message]
2025-03-26  7:26   ` Ingo Molnar
2025-03-26 13:13     ` Stephen Rothwell
2025-03-26  7:31 ` [tip: objtool/urgent] objtool: Fix NULL printf() '%s' argument in builtin-check.c:save_argv() tip-bot2 for Josh Poimboeuf
2025-03-27 11:06 ` tip-bot2 for Josh Poimboeuf
2025-03-28 13:48 ` tip-bot2 for Josh Poimboeuf

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=20250326151014.6a006c93@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --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