From 5c691bbfcf6fc6d04e6d2dabde886c4859bc2bb0b6df84682e110d4193aea865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 20 Apr 2015 22:38:46 +0000 Subject: [PATCH] Accepting request 298254 from home:a_faerber:branches:Virtualization Update SeaBIOS SMBIOS patch OBS-URL: https://build.opensuse.org/request/show/298254 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=252 --- libcacard.spec | 2 +- qemu-linux-user.changes | 1 - qemu-linux-user.spec | 2 +- qemu-testsuite.changes | 7 +- qemu-testsuite.spec | 2 +- qemu.changes | 7 +- qemu.spec | 2 +- seabios_avoid_smbios_signature_string.patch | 72 +++++++++++++++------ 8 files changed, 70 insertions(+), 25 deletions(-) diff --git a/libcacard.spec b/libcacard.spec index d94f77ff..8395d459 100644 --- a/libcacard.spec +++ b/libcacard.spec @@ -1,7 +1,7 @@ # # spec file for package libcacard # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/qemu-linux-user.changes b/qemu-linux-user.changes index 12c01591..6a8d80cc 100644 --- a/qemu-linux-user.changes +++ b/qemu-linux-user.changes @@ -3,7 +3,6 @@ Wed Apr 15 00:34:53 UTC 2015 - agraf@suse.com - Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.3 - Fix s390x stoc instructions -* Patches added: 0039-s390x-Fix-stoc-direction.patch ------------------------------------------------------------------- diff --git a/qemu-linux-user.spec b/qemu-linux-user.spec index 1be22e7b..2a076a52 100644 --- a/qemu-linux-user.spec +++ b/qemu-linux-user.spec @@ -1,7 +1,7 @@ # # spec file for package qemu-linux-user # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/qemu-testsuite.changes b/qemu-testsuite.changes index 54b1929b..82f75eea 100644 --- a/qemu-testsuite.changes +++ b/qemu-testsuite.changes @@ -1,9 +1,14 @@ +------------------------------------------------------------------- +Mon Apr 20 16:43:58 UTC 2015 - afaerber@suse.de + +- Update seabios_avoid_smbios_signature_string.patch with version + applied upstream + ------------------------------------------------------------------- Wed Apr 15 00:34:50 UTC 2015 - agraf@suse.com - Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.3 - Fix s390x stoc instructions -* Patches added: 0039-s390x-Fix-stoc-direction.patch ------------------------------------------------------------------- diff --git a/qemu-testsuite.spec b/qemu-testsuite.spec index 0f1bf4ae..ef20f43a 100644 --- a/qemu-testsuite.spec +++ b/qemu-testsuite.spec @@ -1,7 +1,7 @@ # # spec file for package qemu-testsuite # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/qemu.changes b/qemu.changes index 54b1929b..82f75eea 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,9 +1,14 @@ +------------------------------------------------------------------- +Mon Apr 20 16:43:58 UTC 2015 - afaerber@suse.de + +- Update seabios_avoid_smbios_signature_string.patch with version + applied upstream + ------------------------------------------------------------------- Wed Apr 15 00:34:50 UTC 2015 - agraf@suse.com - Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.3 - Fix s390x stoc instructions -* Patches added: 0039-s390x-Fix-stoc-direction.patch ------------------------------------------------------------------- diff --git a/qemu.spec b/qemu.spec index 210b1577..ad283fc7 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1,7 +1,7 @@ # # spec file for package qemu # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/seabios_avoid_smbios_signature_string.patch b/seabios_avoid_smbios_signature_string.patch index c1543b0c..d4872875 100644 --- a/seabios_avoid_smbios_signature_string.patch +++ b/seabios_avoid_smbios_signature_string.patch @@ -1,34 +1,70 @@ -From 2e978dc652969f6a7089713d8f726dda23a98205 Mon Sep 17 00:00:00 2001 -From: Bruce Rogers -Date: Fri, 27 Mar 2015 18:03:36 -0600 -Subject: [PATCH] smbios: avoid having an arbitrary _SM_ string located in F - segment +From 9d3c06336ec443b6763c92f929013afcfce70c4a Mon Sep 17 00:00:00 2001 +From: Kevin O'Connor +Date: Thu, 9 Apr 2015 11:57:44 -0400 +Subject: [PATCH] smbios: Use integer signature instead of string signature -The way the SMBIOS table is located is to search the F segment for -the byte sequence _SM_ located at the beginning of a paragragh. -It was found that SeaBIOS has a "_SM_" string contained within -the image which is not part of the SMBIOS table, and it was located -ahead of the actual SMBIOS table, causing obvious problems. +Change the smbios structure to use a 4 byte u32 signature field +instead of a 4 byte character string field. In practice, this allows +the compiler to place the signature in the initialize code segment and +thus makes it less likely the signature would be found in the +f-segment. (If the smbios signature is found in the f-segment it can +confuse some table scans.) -Signed-off-by: Bruce Rogers +Reviewed-by: Bruce Rogers +Tested-by: Bruce Rogers +Signed-off-by: Kevin O'Connor +Signed-off-by: Andreas Färber --- - src/fw/biostables.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) + src/fw/biostables.c | 2 +- + src/fw/smbios.c | 2 +- + src/std/smbios.h | 4 +++- + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/fw/biostables.c b/src/fw/biostables.c -index 50a891b..568f404 100644 +index 50a891b..450aca2 100644 --- a/src/fw/biostables.c +++ b/src/fw/biostables.c -@@ -271,7 +271,8 @@ copy_smbios(void *pos) +@@ -271,7 +271,7 @@ copy_smbios(void *pos) if (SMBiosAddr) return; struct smbios_entry_point *p = pos; - if (memcmp(p->anchor_string, "_SM_", 4)) -+ // avoid storing the _SM_ string - it's problematic! -+ if (memcmp(p->anchor_string, "_SM", 3) || p->anchor_string[3] != '_' ) ++ if (p->signature != SMBIOS_SIGNATURE) return; if (checksum(pos, 0x10) != 0) return; +diff --git a/src/fw/smbios.c b/src/fw/smbios.c +index dba0541..f3b5ad9 100644 +--- a/src/fw/smbios.c ++++ b/src/fw/smbios.c +@@ -37,7 +37,7 @@ smbios_entry_point_setup(u16 max_structure_size, + + struct smbios_entry_point ep; + memset(&ep, 0, sizeof(ep)); +- memcpy(ep.anchor_string, "_SM_", 4); ++ ep.signature = SMBIOS_SIGNATURE; + ep.length = 0x1f; + ep.smbios_major_version = 2; + ep.smbios_minor_version = 4; +diff --git a/src/std/smbios.h b/src/std/smbios.h +index 0513716..4ccf2ea 100644 +--- a/src/std/smbios.h ++++ b/src/std/smbios.h +@@ -3,11 +3,13 @@ + + #include "types.h" // u32 + ++#define SMBIOS_SIGNATURE 0x5f4d535f // "_SM_" ++ + /* SMBIOS entry point -- must be written to a 16-bit aligned address + between 0xf0000 and 0xfffff. + */ + struct smbios_entry_point { +- char anchor_string[4]; ++ u32 signature; + u8 checksum; + u8 length; + u8 smbios_major_version; -- -1.9.0 +2.1.4