Commit 1e3f9c69 authored by Cornelia Huck's avatar Cornelia Huck
Browse files

Merge tag 's390-ccw-bios-2019-05-08' into s390-next-staging

Skip unsupported bootmap signature entries instead of aborting the boot process

# gpg: Signature made Wed 08 May 2019 11:42:24 AM CEST
# gpg:                using RSA key 2ED9D774FE702DB5
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [undefined]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [undefined]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]

* tag 's390-ccw-bios-2019-05-08':
  pc-bios/s390: Update firmware image with "Skip bootmap signature entries" fix
  s390-bios: Skip bootmap signature entries
  pc-bios/s390-ccw: Clean up harmless misuse of isdigit()
parents 216bdd27 f7a339a5
Loading
Loading
Loading
Loading
(41.6 KiB)

File changed.

No diff preview for this file type.

+17 −2
Original line number Diff line number Diff line
@@ -254,7 +254,14 @@ static void run_eckd_boot_script(block_number_t bmt_block_nr,
    memset(sec, FREE_SPACE_FILLER, sizeof(sec));
    read_block(block_nr, sec, "Cannot read Boot Map Script");

    for (i = 0; bms->entry[i].type == BOOT_SCRIPT_LOAD; i++) {
    for (i = 0; bms->entry[i].type == BOOT_SCRIPT_LOAD ||
                bms->entry[i].type == BOOT_SCRIPT_SIGNATURE; i++) {

        /* We don't support secure boot yet, so we skip signature entries */
        if (bms->entry[i].type == BOOT_SCRIPT_SIGNATURE) {
            continue;
        }

        address = bms->entry[i].address.load_address;
        block_nr = eckd_block_num(&bms->entry[i].blkptr.xeckd.bptr.chs);

@@ -489,7 +496,15 @@ static void zipl_run(ScsiBlockPtr *pte)

    /* Load image(s) into RAM */
    entry = (ComponentEntry *)(&header[1]);
    while (entry->component_type == ZIPL_COMP_ENTRY_LOAD) {
    while (entry->component_type == ZIPL_COMP_ENTRY_LOAD ||
           entry->component_type == ZIPL_COMP_ENTRY_SIGNATURE) {

        /* We don't support secure boot yet, so we skip signature entries */
        if (entry->component_type == ZIPL_COMP_ENTRY_SIGNATURE) {
            entry++;
            continue;
        }

        zipl_load_segment(entry);

        entry++;
+6 −4
Original line number Diff line number Diff line
@@ -98,8 +98,9 @@ typedef struct ScsiMbr {
#define ZIPL_COMP_HEADER_IPL    0x00
#define ZIPL_COMP_HEADER_DUMP   0x01

#define ZIPL_COMP_ENTRY_LOAD    0x02
#define ZIPL_COMP_ENTRY_EXEC      0x01
#define ZIPL_COMP_ENTRY_LOAD      0x02
#define ZIPL_COMP_ENTRY_SIGNATURE 0x03

typedef struct XEckdMbr {
    uint8_t magic[4];   /* == "xIPL"        */
@@ -119,6 +120,7 @@ typedef struct BootMapScriptEntry {
    uint8_t type;   /* == BOOT_SCRIPT_* */
#define BOOT_SCRIPT_EXEC      0x01
#define BOOT_SCRIPT_LOAD      0x02
#define BOOT_SCRIPT_SIGNATURE 0x03
    union {
        uint64_t load_address;
        uint64_t load_psw;
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ uint64_t atoui(const char *str)
    }

    while (*str) {
        if (!isdigit(*str)) {
        if (!isdigit(*(unsigned char *)str)) {
            break;
        }
        val = val * 10 + *str - '0';
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ static int get_index(void)

    /* Check for erroneous input */
    for (i = 0; i < len; i++) {
        if (!isdigit(buf[i])) {
        if (!isdigit((unsigned char)buf[i])) {
            return -1;
        }
    }