]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64: kern_addr_valid regression
authorbob picco <bob.picco@oracle.com>
Fri, 10 Mar 2017 19:31:19 +0000 (14:31 -0500)
committerAllen Pais <allen.pais@oracle.com>
Mon, 15 May 2017 10:50:39 +0000 (16:20 +0530)
Orabug: 25860542

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: Allen Pais <allen.pais@oracle.com>
arch/sparc/mm/init_64.c

index 4c1eabe86fb4bc36a6508a1a5dc6780dbbac6479..329eed4f10af491d872882c0e93c7fa350d8ad04 100644 (file)
@@ -1825,7 +1825,7 @@ bool kern_addr_valid(unsigned long addr)
        if ((long)addr < 0L) {
                unsigned long pa = __pa(addr);
 
-               if ((addr >> max_phys_bits) != 0UL)
+               if ((pa >> max_phys_bits) != 0UL)
                        return false;
 
                return pfn_valid(pa >> PAGE_SHIFT);