aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbob picco <bob.picco@oracle.com>2017-03-10 14:31:19 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-05-03 11:36:34 -0400
commit24870a79dad693214b21558388cb04dad6159aa3 (patch)
tree62e7febd8028e8aa6f8d82a79b24d5439f566aec
parente88a8e0a23c23e09858a4f5caeb106da972e7934 (diff)
sparc64: kern_addr_valid regression
[ Upstream commit adfae8a5d833fa2b46577a8081f350e408851f5b ] I encountered this bug when using /proc/kcore to examine the kernel. Plus a coworker inquired about debugging tools. We computed pa but did not use it during the maximum physical address bits test. Instead we used the identity mapped virtual address which will always fail this test. I believe the defect came in here: [bpicco@zareason linus.git]$ git describe --contains bb4e6e85daa52 v3.18-rc1~87^2~4 . Signed-off-by: Bob Picco <bob.picco@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/sparc/mm/init_64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 37aa537b3ad8..bd7e2aa86c45 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -1495,7 +1495,7 @@ bool kern_addr_valid(unsigned long addr)
1495 if ((long)addr < 0L) { 1495 if ((long)addr < 0L) {
1496 unsigned long pa = __pa(addr); 1496 unsigned long pa = __pa(addr);
1497 1497
1498 if ((addr >> max_phys_bits) != 0UL) 1498 if ((pa >> max_phys_bits) != 0UL)
1499 return false; 1499 return false;
1500 1500
1501 return pfn_valid(pa >> PAGE_SHIFT); 1501 return pfn_valid(pa >> PAGE_SHIFT);