s390/boot: add secure boot trailer
authorPeter Oberparleiter <oberpar@linux.ibm.com>
Fri, 16 Sep 2022 13:01:36 +0000 (15:01 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 26 Oct 2022 12:47:31 +0000 (14:47 +0200)
This patch enhances the kernel image adding a trailer as required for
secure boot by future firmware versions.

Cc: <stable@vger.kernel.org> # 5.2+
Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/boot/vmlinux.lds.S

index af5c686..fa9d33b 100644 (file)
@@ -102,8 +102,17 @@ SECTIONS
                _compressed_start = .;
                *(.vmlinux.bin.compressed)
                _compressed_end = .;
-               FILL(0xff);
-               . = ALIGN(4096);
+       }
+
+#define SB_TRAILER_SIZE 32
+       /* Trailer needed for Secure Boot */
+       . += SB_TRAILER_SIZE; /* make sure .sb.trailer does not overwrite the previous section */
+       . = ALIGN(4096) - SB_TRAILER_SIZE;
+       .sb.trailer : {
+               QUAD(0)
+               QUAD(0)
+               QUAD(0)
+               QUAD(0x000000207a49504c)
        }
        _end = .;