public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.4] arm64 module: set plt* section addresses to 0x0
@ 2021-03-01 21:23 Shaoying Xu
  2021-03-04 13:48 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Shaoying Xu @ 2021-03-01 21:23 UTC (permalink / raw)
  To: stable; +Cc: shaoyi, fllinden

commit f5c6d0fcf90ce07ee0d686d465b19b247ebd5ed7 upstream.

These plt* and .text.ftrace_trampoline sections specified for arm64 have
non-zero addressses. Non-zero section addresses in a relocatable ELF would
confuse GDB when it tries to compute the section offsets and it ends up
printing wrong symbol addresses. Therefore, set them to zero, which mirrors
the change in commit 5d8591bc0fba ("module: set ksymtab/kcrctab* section
addresses to 0x0").

Reported-by: Frank van der Linden <fllinden@amazon.com>
Signed-off-by: Shaoying Xu <shaoyi@amazon.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20210216183234.GA23876@amazon.com
Signed-off-by: Will Deacon <will@kernel.org>
[shaoyi@amazon.com: made same changes in arch/arm64/kernel/module.lds for 5.4]
Signed-off-by: Shaoying Xu <shaoyi@amazon.com>
---
arch/arm64/include/asm/module.lds.h was renamed from arch/arm64/kernel/module.lds
by commit 596b0474d3d9 ("kbuild: preprocess module linker script") since v5.10.
Therefore, made same changes in arch/arm64/kernel/module.lds for 5.4. 

 arch/arm64/kernel/module.lds | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kernel/module.lds b/arch/arm64/kernel/module.lds
index 22e36a21c113..09a0eef71d12 100644
--- a/arch/arm64/kernel/module.lds
+++ b/arch/arm64/kernel/module.lds
@@ -1,5 +1,5 @@
 SECTIONS {
-	.plt (NOLOAD) : { BYTE(0) }
-	.init.plt (NOLOAD) : { BYTE(0) }
-	.text.ftrace_trampoline (NOLOAD) : { BYTE(0) }
+	.plt 0 (NOLOAD) : { BYTE(0) }
+	.init.plt 0 (NOLOAD) : { BYTE(0) }
+	.text.ftrace_trampoline 0 (NOLOAD) : { BYTE(0) }
 }
-- 
2.16.6


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

* Re: [PATCH 5.4] arm64 module: set plt* section addresses to 0x0
  2021-03-01 21:23 [PATCH 5.4] arm64 module: set plt* section addresses to 0x0 Shaoying Xu
@ 2021-03-04 13:48 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-03-04 13:48 UTC (permalink / raw)
  To: Shaoying Xu; +Cc: stable, fllinden

On Mon, Mar 01, 2021 at 09:23:46PM +0000, Shaoying Xu wrote:
> commit f5c6d0fcf90ce07ee0d686d465b19b247ebd5ed7 upstream.
> 
> These plt* and .text.ftrace_trampoline sections specified for arm64 have
> non-zero addressses. Non-zero section addresses in a relocatable ELF would
> confuse GDB when it tries to compute the section offsets and it ends up
> printing wrong symbol addresses. Therefore, set them to zero, which mirrors
> the change in commit 5d8591bc0fba ("module: set ksymtab/kcrctab* section
> addresses to 0x0").
> 
> Reported-by: Frank van der Linden <fllinden@amazon.com>
> Signed-off-by: Shaoying Xu <shaoyi@amazon.com>
> Cc: <stable@vger.kernel.org>
> Link: https://lore.kernel.org/r/20210216183234.GA23876@amazon.com
> Signed-off-by: Will Deacon <will@kernel.org>
> [shaoyi@amazon.com: made same changes in arch/arm64/kernel/module.lds for 5.4]
> Signed-off-by: Shaoying Xu <shaoyi@amazon.com>
> ---
> arch/arm64/include/asm/module.lds.h was renamed from arch/arm64/kernel/module.lds
> by commit 596b0474d3d9 ("kbuild: preprocess module linker script") since v5.10.
> Therefore, made same changes in arch/arm64/kernel/module.lds for 5.4.

Now queued up, thanks.

greg k-h

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

end of thread, other threads:[~2021-03-04 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-01 21:23 [PATCH 5.4] arm64 module: set plt* section addresses to 0x0 Shaoying Xu
2021-03-04 13:48 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox