linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: vmlinux.lds: account for spurious empty .igot.plt sections
@ 2020-10-28 13:33 Ard Biesheuvel
  2020-10-28 15:12 ` Will Deacon
  2020-10-28 15:56 ` Kees Cook
  0 siblings, 2 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2020-10-28 13:33 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Kees Cook, catalin.marinas, Nick Desaulniers, Geert Uytterhoeven,
	Jessica Yu, will, Ard Biesheuvel

Now that we started making the linker warn about orphan sections
(input sections that are not explicitly consumed by an output section),
some configurations produce the following warning:

  aarch64-linux-gnu-ld: warning: orphan section `.igot.plt' from
         `arch/arm64/kernel/head.o' being placed in section `.igot.plt'

It could be any file that triggers this - head.o is simply the first
input file in the link - and the resulting .igot.plt section never
actually appears in vmlinux as it turns out to be empty.

So let's add .igot.plt to our collection of input sections to disregard
unless they are empty.

Cc: Jessica Yu <jeyu@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 arch/arm64/kernel/vmlinux.lds.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index 6567d80dd15f..48b222f1c700 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -278,7 +278,7 @@ SECTIONS
 	 * explicitly check instead of blindly discarding.
 	 */
 	.plt : {
-		*(.plt) *(.plt.*) *(.iplt) *(.igot)
+		*(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt)
 	}
 	ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
 
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: vmlinux.lds: account for spurious empty .igot.plt sections
  2020-10-28 13:33 [PATCH] arm64: vmlinux.lds: account for spurious empty .igot.plt sections Ard Biesheuvel
@ 2020-10-28 15:12 ` Will Deacon
  2020-10-28 15:56 ` Kees Cook
  1 sibling, 0 replies; 5+ messages in thread
From: Will Deacon @ 2020-10-28 15:12 UTC (permalink / raw)
  To: Ard Biesheuvel, linux-arm-kernel
  Cc: Kees Cook, Will Deacon, catalin.marinas, Nick Desaulniers,
	Geert Uytterhoeven, Jessica Yu, kernel-team

On Wed, 28 Oct 2020 14:33:32 +0100, Ard Biesheuvel wrote:
> Now that we started making the linker warn about orphan sections
> (input sections that are not explicitly consumed by an output section),
> some configurations produce the following warning:
> 
>   aarch64-linux-gnu-ld: warning: orphan section `.igot.plt' from
>          `arch/arm64/kernel/head.o' being placed in section `.igot.plt'
> 
> [...]

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: vmlinux.lds: account for spurious empty .igot.plt sections
      https://git.kernel.org/arm64/c/5f692a81b4e9

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: vmlinux.lds: account for spurious empty .igot.plt sections
  2020-10-28 13:33 [PATCH] arm64: vmlinux.lds: account for spurious empty .igot.plt sections Ard Biesheuvel
  2020-10-28 15:12 ` Will Deacon
@ 2020-10-28 15:56 ` Kees Cook
  2020-10-28 15:58   ` Ard Biesheuvel
  2020-10-28 17:47   ` Will Deacon
  1 sibling, 2 replies; 5+ messages in thread
From: Kees Cook @ 2020-10-28 15:56 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: catalin.marinas, Nick Desaulniers, Geert Uytterhoeven, Jessica Yu,
	will, linux-arm-kernel

On Wed, Oct 28, 2020 at 02:33:32PM +0100, Ard Biesheuvel wrote:
> Now that we started making the linker warn about orphan sections
> (input sections that are not explicitly consumed by an output section),
> some configurations produce the following warning:
> 
>   aarch64-linux-gnu-ld: warning: orphan section `.igot.plt' from
>          `arch/arm64/kernel/head.o' being placed in section `.igot.plt'
> 
> It could be any file that triggers this - head.o is simply the first
> input file in the link - and the resulting .igot.plt section never
> actually appears in vmlinux as it turns out to be empty.
> 
> So let's add .igot.plt to our collection of input sections to disregard
> unless they are empty.

typo: "non-empty"?

> Cc: Jessica Yu <jeyu@kernel.org>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> Cc: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

Thanks! Any idea what causes this?

Reviewed-by: Kees Cook <keescook@chromium.org>

Though I think Will already snagged the patch :)

-- 
Kees Cook

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: vmlinux.lds: account for spurious empty .igot.plt sections
  2020-10-28 15:56 ` Kees Cook
@ 2020-10-28 15:58   ` Ard Biesheuvel
  2020-10-28 17:47   ` Will Deacon
  1 sibling, 0 replies; 5+ messages in thread
From: Ard Biesheuvel @ 2020-10-28 15:58 UTC (permalink / raw)
  To: Kees Cook
  Cc: Catalin Marinas, Nick Desaulniers, Geert Uytterhoeven, Jessica Yu,
	Will Deacon, Linux ARM

On Wed, 28 Oct 2020 at 16:56, Kees Cook <keescook@chromium.org> wrote:
>
> On Wed, Oct 28, 2020 at 02:33:32PM +0100, Ard Biesheuvel wrote:
> > Now that we started making the linker warn about orphan sections
> > (input sections that are not explicitly consumed by an output section),
> > some configurations produce the following warning:
> >
> >   aarch64-linux-gnu-ld: warning: orphan section `.igot.plt' from
> >          `arch/arm64/kernel/head.o' being placed in section `.igot.plt'
> >
> > It could be any file that triggers this - head.o is simply the first
> > input file in the link - and the resulting .igot.plt section never
> > actually appears in vmlinux as it turns out to be empty.
> >
> > So let's add .igot.plt to our collection of input sections to disregard
> > unless they are empty.
>
> typo: "non-empty"?
>

Indeed.

> > Cc: Jessica Yu <jeyu@kernel.org>
> > Cc: Kees Cook <keescook@chromium.org>
> > Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> > Cc: Nick Desaulniers <ndesaulniers@google.com>
> > Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
>
> Thanks! Any idea what causes this?
>

Not a clue.

> Reviewed-by: Kees Cook <keescook@chromium.org>
>

Thanks,

> Though I think Will already snagged the patch :)
>
> --
> Kees Cook

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] arm64: vmlinux.lds: account for spurious empty .igot.plt sections
  2020-10-28 15:56 ` Kees Cook
  2020-10-28 15:58   ` Ard Biesheuvel
@ 2020-10-28 17:47   ` Will Deacon
  1 sibling, 0 replies; 5+ messages in thread
From: Will Deacon @ 2020-10-28 17:47 UTC (permalink / raw)
  To: Kees Cook
  Cc: catalin.marinas, Nick Desaulniers, Geert Uytterhoeven, Jessica Yu,
	Ard Biesheuvel, linux-arm-kernel

On Wed, Oct 28, 2020 at 08:56:14AM -0700, Kees Cook wrote:
> On Wed, Oct 28, 2020 at 02:33:32PM +0100, Ard Biesheuvel wrote:
> > Now that we started making the linker warn about orphan sections
> > (input sections that are not explicitly consumed by an output section),
> > some configurations produce the following warning:
> > 
> >   aarch64-linux-gnu-ld: warning: orphan section `.igot.plt' from
> >          `arch/arm64/kernel/head.o' being placed in section `.igot.plt'
> > 
> > It could be any file that triggers this - head.o is simply the first
> > input file in the link - and the resulting .igot.plt section never
> > actually appears in vmlinux as it turns out to be empty.
> > 
> > So let's add .igot.plt to our collection of input sections to disregard
> > unless they are empty.
> 
> typo: "non-empty"?
> 
> > Cc: Jessica Yu <jeyu@kernel.org>
> > Cc: Kees Cook <keescook@chromium.org>
> > Cc: Geert Uytterhoeven <geert@linux-m68k.org>
> > Cc: Nick Desaulniers <ndesaulniers@google.com>
> > Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> 
> Thanks! Any idea what causes this?
> 
> Reviewed-by: Kees Cook <keescook@chromium.org>
> 
> Though I think Will already snagged the patch :)

Yeah, sorry -- I was keen to get rid of that annoying warning!

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-10-28 17:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-28 13:33 [PATCH] arm64: vmlinux.lds: account for spurious empty .igot.plt sections Ard Biesheuvel
2020-10-28 15:12 ` Will Deacon
2020-10-28 15:56 ` Kees Cook
2020-10-28 15:58   ` Ard Biesheuvel
2020-10-28 17:47   ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).