Skip unsupported bootmap signature entries instead of aborting the boot process

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJc0qSAAAoJEC7Z13T+cC21ywMP/jzfL6ChzVScAv9N5+oBkGKQ
 AX7dJrLgc6sV5UcwWtAZ7A9icZ6rjz8m/oENi33wvfhoF3t+oNQwln76znhZBJq+
 LYknB6/xInspt0jbaF8jVhQMQDbFW4Olc4LVLn5/PB4u9nTb/1XFk1d7dRwO/uDC
 B1IhCsX4initEDBtgcp/NfiGblN7as4XEyScnEV2wOukb31zVbxRjYS9VjSViHSy
 uCnj7NhN65qi8RRNAbPW9SnF+y1aVfZFcs/0k7fgWwT9MxwP+alfu4OGMeT/zvdc
 JYox6s49teFrBym2H3b55cmFm0XRO8SfSqRoryKRtMCHzVFFR6dretbI/dG+KQQK
 u09+quncLhDOiuvHEDMGM1zl/KIgg4ZEsC4h8e8ZWJ8AgcI9TJuCs6zO74TWRXjt
 t7T/24BT5EfjIaOjSkWWpqlrdF3DPPwD8bp5+gjJKDUFRySUzbrcj0yeTmhIoigv
 Um38jkYR+SXVttP/+49XpkLk9s6dC7w8gsg2QCDSiZontKf3Qc7lFdUmQaMOmOEL
 /j6OpH1OaiHXcM4k34cnm2sgS2RUP3oMapPdadaLvbx/tl+PUfAjFDXjKRasQQBL
 cS7nCSU4VDxr5OlmsmA0YJ7WKxmt0YmbU77IN8cKccyycBqpJTU7q9d7hxqHQeQo
 oyvBR1ZXhdl/IjuPV/qX
 =vp4O
 -----END PGP SIGNATURE-----

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()
This commit is contained in:
Cornelia Huck 2019-05-17 07:58:45 +02:00
commit 1e3f9c69a4
5 changed files with 25 additions and 8 deletions

Binary file not shown.

View File

@ -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++;

View File

@ -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_EXEC 0x01
#define ZIPL_COMP_ENTRY_LOAD 0x02
#define ZIPL_COMP_ENTRY_SIGNATURE 0x03
typedef struct XEckdMbr {
uint8_t magic[4]; /* == "xIPL" */
@ -117,8 +118,9 @@ typedef struct BootMapScriptEntry {
BootMapPointer blkptr;
uint8_t pad[7];
uint8_t type; /* == BOOT_SCRIPT_* */
#define BOOT_SCRIPT_EXEC 0x01
#define BOOT_SCRIPT_LOAD 0x02
#define BOOT_SCRIPT_EXEC 0x01
#define BOOT_SCRIPT_LOAD 0x02
#define BOOT_SCRIPT_SIGNATURE 0x03
union {
uint64_t load_address;
uint64_t load_psw;

View File

@ -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';

View File

@ -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;
}
}