aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2013-07-01 16:55:20 +0100
committerMatt Fleming <matt.fleming@intel.com>2013-07-01 17:02:04 +0100
commit9d4ab9d6ae3149465368e19334bf8f162cc36051 (patch)
tree7606d7e41805f71bdb26ba8c3059e22df009d67a
parentce810cd593e5110b507f7cc6c3f739f865b60949 (diff)
downloadsyslinux-9d4ab9d6ae3149465368e19334bf8f162cc36051.tar.gz
syslinux-9d4ab9d6ae3149465368e19334bf8f162cc36051.tar.xz
syslinux-9d4ab9d6ae3149465368e19334bf8f162cc36051.zip
load_linux: validate sanity of 'initrd_addr_max'syslinux-5.11-pre5
Some kernel headers have bogus 'initrd_addr_max' fields. This field should never be zero. Set it to the old upper limit if unspecified. Failure to set a non-zero value for the field results in a bogus 'memlimit' value, thereby unnecessarily reserving part of the memmap. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r--com32/lib/syslinux/load_linux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c
index af3751ef..7638e6f6 100644
--- a/com32/lib/syslinux/load_linux.c
+++ b/com32/lib/syslinux/load_linux.c
@@ -254,7 +254,7 @@ int syslinux_boot_linux(void *kernel_buf, size_t kernel_size,
if (!hdr.setup_sects)
hdr.setup_sects = 4;
- if (hdr.version < 0x0203)
+ if (hdr.version < 0x0203 || !hdr.initrd_addr_max)
hdr.initrd_addr_max = 0x37ffffff;
if (!memlimit && memlimit - 1 > hdr.initrd_addr_max)