From: Kevin O'Connor Date: Sat, 18 Apr 2009 21:01:02 +0000 (-0400) Subject: Try to prevent mapping option roms over flash. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=64cf2fba21df4c294fdc337aa6c603ccb51faf4a;p=seabios.git Try to prevent mapping option roms over flash. Don't map an option rom in last 4MiB of ram or at its max. --- diff --git a/src/optionroms.c b/src/optionroms.c index 841cae2..def3feb 100644 --- a/src/optionroms.c +++ b/src/optionroms.c @@ -214,7 +214,9 @@ map_optionrom(u16 bdf, u32 vendev) if (!sz || sz == 0xffffffff) goto fail; - if (orig < 16*1024*1024) { + if (orig == sz || (u32)(orig + 4*1024*1024) < 20*1024*1024) { + // Don't try to map to a pci addresses at its max, in the last + // 4MiB of ram, or the first 16MiB of ram. dprintf(6, "Preset rom address doesn't look valid\n"); goto fail; }