[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200624075712.GB5853@willie-the-truck>
Date: Wed, 24 Jun 2020 08:57:12 +0100
From: Will Deacon <will@...nel.org>
To: Kees Cook <keescook@...omium.org>
Cc: Catalin Marinas <catalin.marinas@....com>,
Mark Rutland <mark.rutland@....com>,
Ard Biesheuvel <ardb@...nel.org>,
Peter Collingbourne <pcc@...gle.com>,
James Morse <james.morse@....com>,
Borislav Petkov <bp@...e.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Russell King <linux@...linux.org.uk>,
Masahiro Yamada <masahiroy@...nel.org>,
Arvind Sankar <nivedita@...m.mit.edu>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Nathan Chancellor <natechancellor@...il.com>,
Arnd Bergmann <arnd@...db.de>, x86@...nel.org,
clang-built-linux@...glegroups.com, linux-arch@...r.kernel.org,
linux-efi@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 9/9] arm64/build: Warn on orphan section placement
On Tue, Jun 23, 2020 at 06:49:40PM -0700, Kees Cook wrote:
> We don't want to depend on the linker's orphan section placement
> heuristics as these can vary between linkers, and may change between
> versions. All sections need to be explicitly named in the linker
> script.
>
> Avoid .eh_frame* by making sure both -fno-asychronous-unwind-tables and
> -fno-unwind-tables are present in both CFLAGS and AFLAGS. Remove one
> last instance of .eh_frame by removing the needless Call Frame Information
> annotations from arch/arm64/kernel/smccc-call.S.
>
> Add .plt, .data.rel.ro, .igot.*, and .iplt to discards as they are not
> actually used. While .got.plt is also not used, it must be included
> otherwise ld.bfd will fail to link with the error:
>
> aarch64-linux-gnu-ld: discarded output section: `.got.plt'
>
> However, as it'd be better to validate that it stays effectively empty,
> add an assert.
>
> Explicitly include debug sections when they're present.
>
> Fix a case of needless quotes in __section(), which Clang doesn't like.
>
> Finally, enable orphan section warnings.
>
> Thanks to Ard Biesheuvel for many hints on correct ways to handle
> mysterious sections. :)
Sorry to be a pain, but this patch is doing 3 or 4 independent things at
once. Please could you split it up a bit?
e.g.
- Removal of cfi directives from smccc macro
- Removal of quotes around section name for clang
- Avoid generating .eh_frame
- Ensure all sections are accounted for in linker script and warn on orphans
That way it's a bit easier to manage, we can revert/backport bits later if
necessary and you get more patches in the kernel ;)
You can also add my Ack on all the patches:
Acked-by: Will Deacon <will@...nel.org>
Will
Powered by blists - more mailing lists