summaryrefslogtreecommitdiff
path: root/arch/x86/boot/compressed/vmlinux.lds.S
diff options
context:
space:
mode:
authorArvind Sankar <nivedita@alum.mit.edu>2020-07-31 16:07:51 -0700
committerIngo Molnar <mingo@kernel.org>2020-08-14 12:52:35 +0200
commit527afc212231ea9d585b7709c0ab73263ecf0c85 (patch)
tree6dd5a9b2c29276756522a69b3f15fde39eac4fb0 /arch/x86/boot/compressed/vmlinux.lds.S
parent3f086189cd3641d212949ff044d8e4486c93d55e (diff)
downloadlinux-next-527afc212231ea9d585b7709c0ab73263ecf0c85.tar.gz
linux-next-527afc212231ea9d585b7709c0ab73263ecf0c85.zip
x86/boot: Check that there are no run-time relocations
Add a linker script check that there are no run-time relocations, and remove the old one that tries to check via looking for specially-named sections in the object files. Drop the tests for -fPIE compiler option and -pie linker option, as they are available in all supported gcc and binutils versions (as well as clang and lld). Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu> Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Tested-by: Nick Desaulniers <ndesaulniers@google.com> Tested-by: Sedat Dilek <sedat.dilek@gmail.com> Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Fangrui Song <maskray@google.com> Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com> Link: https://lore.kernel.org/r/20200731230820.1742553-8-keescook@chromium.org
Diffstat (limited to 'arch/x86/boot/compressed/vmlinux.lds.S')
-rw-r--r--arch/x86/boot/compressed/vmlinux.lds.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/boot/compressed/vmlinux.lds.S b/arch/x86/boot/compressed/vmlinux.lds.S
index a4a4a59a2628..29df99b6cc64 100644
--- a/arch/x86/boot/compressed/vmlinux.lds.S
+++ b/arch/x86/boot/compressed/vmlinux.lds.S
@@ -42,6 +42,12 @@ SECTIONS
*(.rodata.*)
_erodata = . ;
}
+ .rel.dyn : {
+ *(.rel.*)
+ }
+ .rela.dyn : {
+ *(.rela.*)
+ }
.got : {
*(.got)
}
@@ -85,3 +91,5 @@ ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0x18, "Unexpected GOT/PLT en
#else
ASSERT(SIZEOF(.got.plt) == 0 || SIZEOF(.got.plt) == 0xc, "Unexpected GOT/PLT entries detected!")
#endif
+
+ASSERT(SIZEOF(.rel.dyn) == 0 && SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations detected!")