From: Andi Kleen Date: Wed, 11 Jan 2006 21:43:39 +0000 (+0100) Subject: [PATCH] x86_64: Fix off by one in acpi table mapping X-Git-Tag: v2.6.16-rc1~355 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a4a76cc1057de0dc96ee481590347aa8c5b9ffb;p=linux-2.6 [PATCH] x86_64: Fix off by one in acpi table mapping And fix the test to include the size Noticed by Vivek Goyal Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 447fa9e33f..2111529dea 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c @@ -108,7 +108,7 @@ char *__acpi_map_table(unsigned long phys_addr, unsigned long size) if (!phys_addr || !size) return NULL; - if (phys_addr < (end_pfn_map << PAGE_SHIFT)) + if (phys_addr+size <= (end_pfn_map << PAGE_SHIFT) + PAGE_SIZE) return __va(phys_addr); return NULL;