linux/arch/x86/mm
Andi Kleen e213e87785 x86: Fix ioremap off by one BUG
Jean Delvare's machine triggered this BUG

acpi_os_map_memory phys ffff0000 size 65535
------------[ cut here ]------------
kernel BUG at arch/x86/mm/pat.c:233!

with ACPI in the backtrace.

Adding some debugging output showed that ACPI calls

acpi_os_map_memory phys ffff0000 size 65535

And ioremap/PAT does this check in 32bit, so addr+size wraps and the BUG
in reserve_memtype() triggers incorrectly.

        BUG_ON(start >= end); /* end is exclusive */

But reserve_memtype already uses u64:

int reserve_memtype(u64 start, u64 end,

so the 32bit truncation must happen in the caller. Presumably in ioremap
when it passes this information to reserve_memtype().

This patch does this computation in 64bit.

http://bugzilla.kernel.org/show_bug.cgi?id=11346

Signed-off-by: Andi Kleen <ak@linux.intel.com>
2008-08-15 18:18:38 +02:00
..
Makefile mm: Make generic weak get_user_pages_fast and EXPORT_GPL it 2008-08-12 17:52:53 +10:00
discontig_32.c mm: move bootmem descriptors definition to a single place 2008-07-24 10:47:14 -07:00
dump_pagetables.c x86: add PTE_FLAGS_MASK 2008-07-22 10:43:45 +02:00
extable.c x86: unify extable_{32|64}.c 2008-01-30 13:31:41 +01:00
fault.c Merge branch 'auto-ftrace-next' into tracing/for-linus 2008-07-14 16:11:52 +02:00
gup.c Fix 'get_user_pages_fast()' with non-page-aligned start address 2008-07-28 17:54:21 -07:00
highmem_32.c x86: unexport kmap_atomic_to_page 2008-04-30 23:15:34 +02:00
hugetlbpage.c x86: add hugepagesz option on 64-bit 2008-07-24 10:47:19 -07:00
init_32.c Merge branches 'x86/urgent', 'x86/amd-iommu', 'x86/apic', 'x86/cleanups', 'x86/core', 'x86/cpu', 'x86/fixmap', 'x86/gart', 'x86/kprobes', 'x86/memtest', 'x86/modules', 'x86/nmi', 'x86/pat', 'x86/reboot', 'x86/setup', 'x86/step', 'x86/unify-pci', 'x86/uv', 'x86/xen' and 'xen-64bit' into x86/for-linus 2008-07-21 16:37:17 +02:00
init_64.c x86: use generic show_mem() 2008-07-26 12:00:10 -07:00
ioremap.c x86: Fix ioremap off by one BUG 2008-08-15 18:18:38 +02:00
k8topology_64.c x86: remove end_pfn in 64bit 2008-07-08 13:10:38 +02:00
kmmio.c - fix mmioftrace + rcu merge interaction 2008-05-25 09:51:43 +02:00
memtest.c x86: seperate memtest from init_64.c 2008-07-18 14:10:27 +02:00
mmap.c x86: unify mmap_{32|64}.c 2008-01-30 13:31:10 +01:00
mmio-mod.c x86 mmiotrace: page level is unsigned 2008-05-24 11:27:47 +02:00
numa_64.c mm: move bootmem descriptors definition to a single place 2008-07-24 10:47:14 -07:00
pageattr-test.c x86/cpa: use an undefined PTE bit for testing CPA 2008-07-08 13:16:30 +02:00
pageattr.c Merge branch 'generic-ipi' into generic-ipi-for-linus 2008-07-15 21:55:59 +02:00
pat.c Merge branches 'x86/urgent', 'x86/amd-iommu', 'x86/apic', 'x86/cleanups', 'x86/core', 'x86/cpu', 'x86/fixmap', 'x86/gart', 'x86/kprobes', 'x86/memtest', 'x86/modules', 'x86/nmi', 'x86/pat', 'x86/reboot', 'x86/setup', 'x86/step', 'x86/unify-pci', 'x86/uv', 'x86/xen' and 'xen-64bit' into x86/for-linus 2008-07-21 16:37:17 +02:00
pf_in.c x86 mmiotrace: move files into arch/x86/mm/. 2008-05-24 11:25:37 +02:00
pf_in.h x86 mmiotrace: move files into arch/x86/mm/. 2008-05-24 11:25:37 +02:00
pgtable.c x86: work around gcc 3.4.x bug 2008-08-11 18:44:02 +02:00
pgtable_32.c x86: use generic show_mem() 2008-07-26 12:00:10 -07:00
srat_32.c ACPICA: Update DMAR and SRAT table definitions 2008-07-16 23:27:04 +02:00
srat_64.c x86: reserve SLIT 2008-07-11 10:22:33 +02:00
testmmiotrace.c mmiotrace: code style cleanups 2008-05-24 11:27:28 +02:00