diff options
author | Matt Fleming <matt.fleming@intel.com> | 2013-07-01 16:55:20 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2013-07-01 17:02:04 +0100 |
commit | 9d4ab9d6ae3149465368e19334bf8f162cc36051 (patch) | |
tree | 7606d7e41805f71bdb26ba8c3059e22df009d67a /com32 | |
parent | ce810cd593e5110b507f7cc6c3f739f865b60949 (diff) | |
download | syslinux-9d4ab9d6ae3149465368e19334bf8f162cc36051.tar.gz |
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>
Diffstat (limited to 'com32')
-rw-r--r-- | com32/lib/syslinux/load_linux.c | 2 |
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) |