Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/boot/vmlinux.lds.S: Ensure bzImage ends with SecureBoot trailer

Since commit 3e86e4d74c04 ("kbuild: keep .modinfo section in
vmlinux.unstripped") the .modinfo section which has SHF_ALLOC ends up
in bzImage after the SecureBoot trailer. This breaks SecureBoot because
the bootloader can no longer find the SecureBoot trailer with kernel's
signature at the expected location in bzImage. To fix the bug,
move discarded sections before the ELF_DETAILS macro and discard
the .modinfo section which is not needed by the decompressor.

Fixes: 3e86e4d74c04 ("kbuild: keep .modinfo section in vmlinux.unstripped")
Cc: stable@vger.kernel.org
Suggested-by: Vasily Gorbik <gor@linux.ibm.com>
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Tested-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>

authored by

Alexander Egorenkov and committed by
Heiko Carstens
ddc6cbef 3317785a

+9 -8
+9 -8
arch/s390/boot/vmlinux.lds.S
··· 137 137 } 138 138 _end = .; 139 139 140 + /* Sections to be discarded */ 141 + /DISCARD/ : { 142 + COMMON_DISCARDS 143 + *(.eh_frame) 144 + *(*__ksymtab*) 145 + *(___kcrctab*) 146 + *(.modinfo) 147 + } 148 + 140 149 DWARF_DEBUG 141 150 ELF_DETAILS 142 151 ··· 170 161 *(.rela.*) *(.rela_*) 171 162 } 172 163 ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!") 173 - 174 - /* Sections to be discarded */ 175 - /DISCARD/ : { 176 - COMMON_DISCARDS 177 - *(.eh_frame) 178 - *(*__ksymtab*) 179 - *(___kcrctab*) 180 - } 181 164 }