Skip to contentSkip to conversation

sparc64: kern_addr_valid regression

PATCH In review Bob Picco 2 participants 2 messages Mar 10, 2017 – Mar 28, 2017 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

Bob Picco

author
#0 lore raw

PATCH 1/1 sparc64: kern_addr_valid regression

From: bob picco <[email protected]>

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
.

---
 arch/sparc/mm/init_64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/sparc/mm/init_64.c +1 -1
index 5d2f91511c60..47ecac5106d3 100644
@@ -1495,7 +1495,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);
Signature · 1 line
2.11.0
maintainer
#1 lore raw

From: Bob Picco <[email protected]>
Date: Fri, 10 Mar 2017 14:31:19 -0500

Quoted 7 lines

From: bob picco <[email protected]>

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.

Quoted 6 lines

I believe the defect came in here:
[bpicco@zareason linus.git]$ git describe --contains bb4e6e85daa52 v3.18-rc1~87^2~4
.

Applied and queued up for -stable, thanks Bob.