[lkml]   [2020]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH 0/9] Enable orphan section warning

A recent bug was solved for builds linked with ld.lld, and tracking
it down took way longer than it needed to (a year). Ultimately, it
boiled down to differences between ld.bfd and ld.lld's handling of
orphan sections. Similarly, the recent FGKASLR series brough up orphan
section handling too[2]. In both cases, it would have been nice if the
linker was running with --orphan-handling=warn so that surprise sections
wouldn't silently get mapped into the kernel image at locations up to
the whim of the linker's orphan handling logic. Instead, all desired
sections should be explicitly identified in the linker script (to be
either kept or discarded) with any orphans throwing a warning. The
powerpc architecture actually already does this, so this series seeks
to extend this coverage to x86, arm64, and arm.

This series depends on tip/x86/boot (where recent .eh_frame fixes[3]
landed), and has a minor conflict[4] with the ARM tree (related to
the earlier mentioned bug). As it uses refactorings in the asm-generic
linker script, and makes changes to kbuild, I think the cleanest place
for this series to land would also be through -tip. Once again (like
my READ_IMPLIES_EXEC series), I'm looking to get maintainer Acks so
this can go all together with the least disruption. Splitting it up by
architecture seems needlessly difficult.




H.J. Lu (1):

Kees Cook (8):
scripts/ Delay orphan handling warnings until final
link Add .gnu.version* to DISCARDS
x86/build: Warn on orphan section placement
x86/boot: Warn on orphan section placement
arm64/build: Use common DISCARDS in linker script
arm64/build: Warn on orphan section placement
arm/build: Warn on orphan section placement
arm/boot: Warn on orphan section placement

arch/arm/Makefile | 4 ++++
arch/arm/boot/compressed/Makefile | 2 ++
arch/arm/boot/compressed/ | 17 ++++++--------
.../arm/{kernel => include/asm}/ | 22 ++++++++++++++-----
arch/arm/kernel/ | 5 ++---
arch/arm/kernel/ | 5 ++---
arch/arm64/Makefile | 4 ++++
arch/arm64/kernel/ | 13 +++++------
arch/x86/Makefile | 4 ++++
arch/x86/boot/compressed/Makefile | 3 ++-
arch/x86/boot/compressed/ | 13 +++++++++++
arch/x86/kernel/ | 7 ++++++
include/asm-generic/ | 11 ++++++++--
scripts/ | 6 +++++
14 files changed, 85 insertions(+), 31 deletions(-)
rename arch/arm/{kernel => include/asm}/ (92%)


 \ /
  Last update: 2020-02-28 01:24    [W:0.133 / U:1.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site