]> git.ipfire.org Git - people/arne_f/kernel.git/commit
percpu: fix first chunk match in per_cpu_ptr_to_phys()
authorTejun Heo <tj@kernel.org>
Fri, 18 Jun 2010 09:44:31 +0000 (11:44 +0200)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Wed, 16 Jan 2013 21:45:03 +0000 (16:45 -0500)
commit3f52a4057b24ed3a9d628a4594f80f15949e3b12
tree5465a3f4539289b343dbbe2d607b93165238f875
parenta0cf4d370df2e6fdf50f73679f1d6315c13e073a
percpu: fix first chunk match in per_cpu_ptr_to_phys()

commit 9983b6f0cf8263e51bcf4c8a9dc0c1ef175b3c60 upstream.

per_cpu_ptr_to_phys() determines whether the passed in @addr belongs
to the first_chunk or not by just matching the address against the
address range of the base unit (unit0, used by cpu0).  When an adress
from another cpu was passed in, it will always determine that the
address doesn't belong to the first chunk even when it does.  This
makes the function return a bogus physical address which may lead to
crash.

This problem was discovered by Cliff Wickman while investigating a
crash during kdump on a SGI UV system.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Cliff Wickman <cpw@sgi.com>
Tested-by: Cliff Wickman <cpw@sgi.com>
[PG: for 2.6.34, diffstat differs slightly due to a trivial indenting
 difference, and 34 does not have the _maybe_unused annotation to delete]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
mm/percpu.c