|
|
9ae3a8 |
From 502442eae625ab550ec2f3b7cb4086f84b6fdb73 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Date: Wed, 18 Sep 2013 09:31:09 +0200
|
|
|
9ae3a8 |
Subject: [PATCH 25/29] pc_sysfw: Fix ISA BIOS init for ridiculously big flash
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1379496669-22778-9-git-send-email-armbru@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 54427
|
|
|
9ae3a8 |
O-Subject: [PATCH 7.0 qemu-kvm 8/8] pc_sysfw: Fix ISA BIOS init for ridiculously big flash
|
|
|
9ae3a8 |
Bugzilla: 1009328
|
|
|
9ae3a8 |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
pc_isa_bios_init() suffers integer overflow for flash larger than
|
|
|
9ae3a8 |
INT_MAX.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
|
|
|
9ae3a8 |
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
|
|
|
9ae3a8 |
Message-id: 1375276272-15988-9-git-send-email-armbru@redhat.com
|
|
|
9ae3a8 |
Signed-off-by: Anthony Liguori <anthony@codemonkey.ws>
|
|
|
9ae3a8 |
(cherry picked from commit 7f87af39dc786a979e7ebba338d0781e366060ed)
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/block/pc_sysfw.c | 5 +----
|
|
|
9ae3a8 |
1 file changed, 1 insertion(+), 4 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/block/pc_sysfw.c | 5 +----
|
|
|
9ae3a8 |
1 files changed, 1 insertions(+), 4 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/block/pc_sysfw.c b/hw/block/pc_sysfw.c
|
|
|
9ae3a8 |
index 2bbedc9..4e3e6b6 100644
|
|
|
9ae3a8 |
--- a/hw/block/pc_sysfw.c
|
|
|
9ae3a8 |
+++ b/hw/block/pc_sysfw.c
|
|
|
9ae3a8 |
@@ -54,10 +54,7 @@ static void pc_isa_bios_init(MemoryRegion *rom_memory,
|
|
|
9ae3a8 |
flash_size = memory_region_size(flash_mem);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* map the last 128KB of the BIOS in ISA space */
|
|
|
9ae3a8 |
- isa_bios_size = flash_size;
|
|
|
9ae3a8 |
- if (isa_bios_size > (128 * 1024)) {
|
|
|
9ae3a8 |
- isa_bios_size = 128 * 1024;
|
|
|
9ae3a8 |
- }
|
|
|
9ae3a8 |
+ isa_bios_size = MIN(flash_size, 128 * 1024);
|
|
|
9ae3a8 |
isa_bios = g_malloc(sizeof(*isa_bios));
|
|
|
9ae3a8 |
memory_region_init_ram(isa_bios, "isa-bios", isa_bios_size);
|
|
|
9ae3a8 |
vmstate_register_ram_global(isa_bios);
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|