]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm: Fix bug in gup_hugepd()
authorDavid Gibson <david@gibson.dropbear.id.au>
Mon, 23 Nov 2009 20:03:40 +0000 (20:03 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 27 Nov 2009 03:24:30 +0000 (14:24 +1100)
commit9e271845ad0eed9baa55b143ab97126d47771732
tree7cbb8f5e4b2be480b9a0bd37fa57a0ebf6981ab7
parente9e9c9cce1229fa4f8266aa3b50cd03ebe643baf
powerpc/mm: Fix bug in gup_hugepd()

Commit 9ccf63f7db3bf9fef3c4212b3ba04968f5bd2b37 introduced a new
get_user_pages() path for hugepages on powerpc.  Unfortunately, there
is a bug in it's loop logic, which can cause it to overrun the end of
the intended region.  This came about by copying the logic from the
normal page path, which assumes the address and end parameters have
been pagesize aligned at the top-level.  Since they're not *hugepage*
size aligned, the simplistic logic could step over the end of the gup
region without triggering the loop end condition.

This patch fixes the bug by using the technique that the normal page
path uses in levels above the lowest to truncate the ending address to
something we know we'll match with.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/mm/hugetlbpage.c