From 391b5c4a912a5ffccd2cb09a930b0df05677cf98 Mon Sep 17 00:00:00 2001 From: Takanori Watanabe Date: Sat, 23 Mar 2002 06:44:04 +0000 Subject: Add bios area range check (lower side). --- sys/amd64/amd64/bios.c | 3 ++- sys/i386/i386/bios.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/bios.c b/sys/amd64/amd64/bios.c index bf4b8a3bb5c4..3d4c7e5c4622 100644 --- a/sys/amd64/amd64/bios.c +++ b/sys/amd64/amd64/bios.c @@ -93,7 +93,8 @@ bios32_init(void *junk) ck += cv[i]; } /* If checksum is OK, enable use of the entrypoint */ - if ((ck == 0) && (sdh->entry < (BIOS_START + BIOS_SIZE))) { + if ((ck == 0) && (BIOS_START <= sdh->entry ) && + (sdh->entry < (BIOS_START + BIOS_SIZE))) { bios32_SDCI = BIOS_PADDRTOVADDR(sdh->entry); if (bootverbose) { printf("bios32: Found BIOS32 Service Directory header at %p\n", sdh); diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c index bf4b8a3bb5c4..3d4c7e5c4622 100644 --- a/sys/i386/i386/bios.c +++ b/sys/i386/i386/bios.c @@ -93,7 +93,8 @@ bios32_init(void *junk) ck += cv[i]; } /* If checksum is OK, enable use of the entrypoint */ - if ((ck == 0) && (sdh->entry < (BIOS_START + BIOS_SIZE))) { + if ((ck == 0) && (BIOS_START <= sdh->entry ) && + (sdh->entry < (BIOS_START + BIOS_SIZE))) { bios32_SDCI = BIOS_PADDRTOVADDR(sdh->entry); if (bootverbose) { printf("bios32: Found BIOS32 Service Directory header at %p\n", sdh); -- cgit v1.3