diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2012-06-29 15:43:20 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2012-06-29 15:43:20 -0700 |
commit | 91937bd1012d913569db7f5a6b6d211e08b9e2f4 (patch) | |
tree | 40988e16475ec480fd1b984688d3f3096c821ac6 | |
parent | 6366a25a6b6243b0819056a74653e92ef918c89a (diff) | |
download | syslinux-91937bd1012d913569db7f5a6b6d211e08b9e2f4.tar.gz syslinux-91937bd1012d913569db7f5a6b6d211e08b9e2f4.tar.xz syslinux-91937bd1012d913569db7f5a6b6d211e08b9e2f4.zip |
setup_data: check to make sure kernel version >= 0x0209
Versions before 2.09 had no setup_data support.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r-- | com32/lib/syslinux/load_linux.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/com32/lib/syslinux/load_linux.c b/com32/lib/syslinux/load_linux.c index 86fc07f8..622c2ab2 100644 --- a/com32/lib/syslinux/load_linux.c +++ b/com32/lib/syslinux/load_linux.c @@ -38,6 +38,7 @@ #include <inttypes.h> #include <string.h> #include <minmax.h> +#include <errno.h> #include <suffix_number.h> #include <syslinux/align.h> #include <syslinux/linux.h> @@ -461,6 +462,12 @@ int syslinux_boot_linux(void *kernel_buf, size_t kernel_size, addr_t best_addr = 0; size_t size = sdp->hdr.len + sizeof(sdp->hdr); + if (hdr.version < 0x0209) { + /* Setup data not supported */ + errno = ENXIO; /* Kind of arbitrary... */ + goto bail; + } + if (!sdp->data || !sdp->hdr.len) continue; |