[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220405070404.017836188@linuxfoundation.org>
Date: Tue, 5 Apr 2022 09:20:41 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Ard Biesheuvel <ardb@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
"Steven Rostedt (Google)" <rostedt@...dmis.org>,
Linus Walleij <linus.walleij@...aro.org>,
Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.16 0328/1017] ARM: ftrace: ensure that ADR takes the Thumb bit into account
From: Ard Biesheuvel <ardb@...nel.org>
[ Upstream commit dd88b03ff0c84f4bcbe1419b93a4bed429fed3be ]
Using ADR to take the address of 'ftrace_stub' via a local label
produces an address that has the Thumb bit cleared, which means the
subsequent comparison is guaranteed to fail. Instead, use the badr
macro, which forces the Thumb bit to be set.
Fixes: a3ba87a61499 ("ARM: 6316/1: ftrace: add Thumb-2 support")
Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
Reviewed-by: Steven Rostedt (Google) <rostedt@...dmis.org>
Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
arch/arm/kernel/entry-ftrace.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/kernel/entry-ftrace.S b/arch/arm/kernel/entry-ftrace.S
index a74289ebc803..f4886fb6e9ba 100644
--- a/arch/arm/kernel/entry-ftrace.S
+++ b/arch/arm/kernel/entry-ftrace.S
@@ -40,7 +40,7 @@
mcount_enter
ldr r0, =ftrace_trace_function
ldr r2, [r0]
- adr r0, .Lftrace_stub
+ badr r0, .Lftrace_stub
cmp r0, r2
bne 1f
--
2.34.1
Powered by blists - more mailing lists