Skip to content

Commit ddc6cbe

Browse files
eaibmzhcahca
authored andcommitted
s390/boot/vmlinux.lds.S: Ensure bzImage ends with SecureBoot trailer
Since commit 3e86e4d ("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: 3e86e4d ("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>
1 parent 3317785 commit ddc6cbe

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

arch/s390/boot/vmlinux.lds.S

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,15 @@ SECTIONS
137137
}
138138
_end = .;
139139

140+
/* Sections to be discarded */
141+
/DISCARD/ : {
142+
COMMON_DISCARDS
143+
*(.eh_frame)
144+
*(*__ksymtab*)
145+
*(___kcrctab*)
146+
*(.modinfo)
147+
}
148+
140149
DWARF_DEBUG
141150
ELF_DETAILS
142151

@@ -161,12 +170,4 @@ SECTIONS
161170
*(.rela.*) *(.rela_*)
162171
}
163172
ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")
164-
165-
/* Sections to be discarded */
166-
/DISCARD/ : {
167-
COMMON_DISCARDS
168-
*(.eh_frame)
169-
*(*__ksymtab*)
170-
*(___kcrctab*)
171-
}
172173
}

0 commit comments

Comments
 (0)