Commit ddc6cbef authored by Alexander Egorenkov's avatar Alexander Egorenkov Committed by Heiko Carstens
Browse files

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



Since commit 3e86e4d7 ("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: 3e86e4d7 ("kbuild: keep .modinfo section in vmlinux.unstripped")
Cc: stable@vger.kernel.org
Suggested-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Reviewed-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Tested-by: default avatarVasily Gorbik <gor@linux.ibm.com>
Signed-off-by: default avatarAlexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 3317785a
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -137,6 +137,15 @@ SECTIONS
	}
	_end = .;

	/* Sections to be discarded */
	/DISCARD/ : {
		COMMON_DISCARDS
		*(.eh_frame)
		*(*__ksymtab*)
		*(___kcrctab*)
		*(.modinfo)
	}

	DWARF_DEBUG
	ELF_DETAILS

@@ -161,12 +170,4 @@ SECTIONS
		*(.rela.*) *(.rela_*)
	}
	ASSERT(SIZEOF(.rela.dyn) == 0, "Unexpected run-time relocations (.rela) detected!")

	/* Sections to be discarded */
	/DISCARD/ : {
		COMMON_DISCARDS
		*(.eh_frame)
		*(*__ksymtab*)
		*(___kcrctab*)
	}
}