[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200305134956.GD2367@duo.ucw.cz>
Date: Thu, 5 Mar 2020 14:49:57 +0100
From: Pavel Machek <pavel@...x.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Dmitry Osipenko <digetx@...il.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>, Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 12/87] arm/ftrace: Fix BE text poking
Hi!
> From: Peter Zijlstra <peterz@...radead.org>
>
> [ Upstream commit be993e44badc448add6a18d6f12b20615692c4c3 ]
>
> The __patch_text() function already applies __opcode_to_mem_*(), so
> when __opcode_to_mem_*() is not the identity (BE*), it is applied
> twice, wrecking the instruction.
>
> Fixes: 42e51f187f86 ("arm/ftrace: Use __patch_text()")
I don't see 42e51f187f86 anywhere. Mainline contains
commit 5a735583b764750726621b0396d03e4782911b77
Author: Peter Zijlstra <peterz@...radead.org>
Date: Tue Oct 15 21:07:35 2019 +0200
arm/ftrace: Use __patch_text()
But that one is not present in 4.19, so perhaps we should not need
this?
Best regards,
Pavel
> Reported-by: Dmitry Osipenko <digetx@...il.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> Signed-off-by: Ingo Molnar <mingo@...nel.org>
> Tested-by: Dmitry Osipenko <digetx@...il.com>
> Signed-off-by: Sasha Levin <sashal@...nel.org>
> ---
> arch/arm/kernel/ftrace.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/kernel/ftrace.c b/arch/arm/kernel/ftrace.c
> index ee673c09aa6c0..dd0215fb6fe23 100644
> --- a/arch/arm/kernel/ftrace.c
> +++ b/arch/arm/kernel/ftrace.c
> @@ -106,13 +106,10 @@ static int ftrace_modify_code(unsigned long pc, unsigned long old,
> {
> unsigned long replaced;
>
> - if (IS_ENABLED(CONFIG_THUMB2_KERNEL)) {
> + if (IS_ENABLED(CONFIG_THUMB2_KERNEL))
> old = __opcode_to_mem_thumb32(old);
> - new = __opcode_to_mem_thumb32(new);
> - } else {
> + else
> old = __opcode_to_mem_arm(old);
> - new = __opcode_to_mem_arm(new);
> - }
>
> if (validate) {
> if (probe_kernel_read(&replaced, (void *)pc, MCOUNT_INSN_SIZE))
> --
> 2.20.1
>
>
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)
Powered by blists - more mailing lists