summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRoland Dreier2008-09-15 12:43:35 +0200
committerBenjamin Herrenschmidt2008-10-07 05:26:18 +0200
commita880e7623397bcb44877b012cd65baa11ad1bbf8 (patch)
treea413d15fbb5145feafed14bfa7e9ed433cf4603f /kernel
parentpowerpc: Ignore generated vmlinux.lds in git (diff)
downloadkernel-qcow2-linux-a880e7623397bcb44877b012cd65baa11ad1bbf8.tar.gz
kernel-qcow2-linux-a880e7623397bcb44877b012cd65baa11ad1bbf8.tar.xz
kernel-qcow2-linux-a880e7623397bcb44877b012cd65baa11ad1bbf8.zip
powerpc: Avoid integer overflow in page_is_ram()
Commit 8b150478 ("ppc: make phys_mem_access_prot() work with pfns instead of addresses") fixed page_is_ram() in arch/ppc to avoid overflow for addresses above 4G on 32-bit kernels. However arch/powerpc's page_is_ram() is missing the same fix -- it computes a physical address by doing pfn << PAGE_SHIFT, which overflows if pfn corresponds to a page above 4G. In particular this causes pages above 4G to be mapped with the wrong caching attribute; for example many ppc440-based SoCs have PCI space above 4G, and mmap()ing MMIO space may end up with a mapping that has caching enabled. Fix this by working with the pfn and avoiding the conversion to physical address that causes the overflow. This patch compares the pfn to max_pfn, which is a semantic change from the old code -- that code compared the physical address to high_memory, which corresponds to max_low_pfn. However, I think that was is another bug, since highmem pages are still RAM. Reported-by: vb <vb@vsbe.com> Signed-off-by: Roland Dreier <rolandd@cisco.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions