Sparc miss chance to fix recoverable fault in copy_from_user

From: hyl
Date: Tue Aug 11 2009 - 21:53:13 EST


if kernel code access the invalid address, ie, copy_from_user then tlb
miss handler
finally report error in sunv4_dtlb_errorthen halt. instead of halt,
should call do_sparc64_fault
to fix such fault by search extable.

a dirty fix like this can work( little testing,just boot and test the
copy_from_user).


--- a/arch/sparc/kernel/sun4v_tlb_miss.S
+++ b/arch/sparc/kernel/sun4v_tlb_miss.S
@@ -124,7 +124,7 @@ sun4v_dtlb_load:
mov %g3, %o2 ! PTE
mov HV_MMU_DMMU, %o3 ! flags
ta HV_MMU_MAP_ADDR_TRAP
- brnz,pn %o0, sun4v_dtlb_error
+ brnz,pn %o0, sun4v_dtlb_prot
mov %g2, %o1 ! restore %o1
mov %g1, %o0 ! restore %o0
mov %g5, %o2 ! restore %o2



am i miss understanding the merged sparc/spar64?

this problem found on sparc64, via a simple module just access address 0
via copy_from_user. another simple test is kgdb, issue a cmd:
x 0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/