All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/retpoline: Fix crash printing warning
@ 2022-10-25 15:32 Dan Carpenter
  2022-10-25 18:59 ` Ammar Faizi
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2022-10-25 15:32 UTC (permalink / raw)
  To: Thomas Gleixner, Peter Zijlstra
  Cc: Ingo Molnar, Borislav Petkov, Dave Hansen, x86, H. Peter Anvin,
	Josh Poimboeuf, Alexei Starovoitov, Song Liu, Nadav Amit,
	linux-kernel, kernel-janitors

The first argument of WARN() is a condition, so this will use "addr"
as the format string and possibly crash.

Fixes: 3b6c1747da48 ("x86/retpoline: Add SKL retthunk retpolines")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 arch/x86/kernel/alternative.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 19221d77dc27..b4ac4e58c010 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -418,7 +418,7 @@ static int emit_call_track_retpoline(void *addr, struct insn *insn, int reg, u8
 		break;
 
 	default:
-		WARN("%pS %px %*ph\n", addr, addr, 6, addr);
+		WARN(1, "%pS %px %*ph\n", addr, addr, 6, addr);
 		return -1;
 	}
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/retpoline: Fix crash printing warning
  2022-10-25 15:32 [PATCH] x86/retpoline: Fix crash printing warning Dan Carpenter
@ 2022-10-25 18:59 ` Ammar Faizi
  2022-10-25 19:25   ` Dave Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Ammar Faizi @ 2022-10-25 18:59 UTC (permalink / raw)
  To: Dave Hansen
  Cc: Thomas Gleixner, Peter Zijlstra, Dan Carpenter, Ingo Molnar,
	Borislav Petkov, x86, H. Peter Anvin, Josh Poimboeuf,
	Alexei Starovoitov, Song Liu, Nadav Amit, linux-kernel,
	kernel-janitors

On 10/25/22 10:32 PM, Dan Carpenter wrote:
> The first argument of WARN() is a condition, so this will use "addr"
> as the format string and possibly crash.
> 
> Fixes: 3b6c1747da48 ("x86/retpoline: Add SKL retthunk retpolines")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Hello x86 maintainers,

I found this patch in the tip tree with the following commit message:

https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=x86/core&id=98dcf58159365d753b54d07f85a89d61ee15e036

	x86/retpoline: Fix crash printing warningx86/core

	The first argument of WARN() is a condition, so this will use "addr"
	as the format string and possibly crash.

	Fixes: 3b6c1747da48 ("x86/retpoline: Add SKL retthunk retpolines")
	Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
	Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
	Link: https://lkml.kernel.org/r/Y1gBoUZrRK5N/lCB@kili

When I visited that lkml link, it shows "message ID not found". The
problem seems to be coming from the tool used to pick up the patch.

That message ID contains a URL special char '/'. Thus it should be
URL-encoded like this:

    https://lore.kernel.org/r/Y1gBoUZrRK5N%2FlCB%40kili

Anyway, lkml.kernel.org doesn't work for such a message ID, even with
URL-encoded message ID like this:

    https://lkml.kernel.org/r/Y1gBoUZrRK5N%2FlCB%40kili (not found)

-- 
Ammar Faizi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/retpoline: Fix crash printing warning
  2022-10-25 18:59 ` Ammar Faizi
@ 2022-10-25 19:25   ` Dave Hansen
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Hansen @ 2022-10-25 19:25 UTC (permalink / raw)
  To: Ammar Faizi, Dave Hansen
  Cc: Thomas Gleixner, Peter Zijlstra, Dan Carpenter, Ingo Molnar,
	Borislav Petkov, x86, H. Peter Anvin, Josh Poimboeuf,
	Alexei Starovoitov, Song Liu, Nadav Amit, linux-kernel,
	kernel-janitors

On 10/25/22 11:59, Ammar Faizi wrote:
> When I visited that lkml link, it shows "message ID not found". The
> problem seems to be coming from the tool used to pick up the patch.

Thanks for the heads-up!  That link is indeed generated by tooling.
I'll go fix it up.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-25 19:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-25 15:32 [PATCH] x86/retpoline: Fix crash printing warning Dan Carpenter
2022-10-25 18:59 ` Ammar Faizi
2022-10-25 19:25   ` Dave Hansen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.