Skip to contentSkip to conversation

use probe_kernel_address in Dwarf2 unwinder

PATCH In review Jan Beulich 2 participants 4 messages Nov 29, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 use probe_kernel_address in Dwarf2 unwinder

Use probe_kernel_address() instead of __get_user() in Dwarf2 unwinder.

kernel/unwind.c +9 -9
@@ -14,8 +14,8 @@
 #include <linux/bootmem.h>
 #include <linux/sort.h>
 #include <linux/stop_machine.h>
+#include <linux/uaccess.h>
 #include <asm/sections.h>
-#include <asm/uaccess.h>
 #include <asm/unaligned.h>
 
 extern char __start_unwind[], __end_unwind[];
@@ -550,7 +550,7 @@ static unsigned long read_pointer(const 
 		return 0;
 	}
 	if ((ptrType & DW_EH_PE_indirect)
-	    && __get_user(value, (unsigned long *)value))
+	    && probe_kernel_address((unsigned long *)value, value))
 		return 0;
 	*pLoc = ptr.p8;
 
@@ -981,18 +981,18 @@ int unwind(struct unwind_frame_info *fra
 		        & (sizeof(unsigned long) - 1))) {
 			unsigned long link;
 
-			if (!__get_user(link,
-			                (unsigned long *)(UNW_FP(frame)
-			                                  + FRAME_LINK_OFFSET))
+			if (!probe_kernel_address((unsigned long *)(UNW_FP(frame)
+			                                            + FRAME_LINK_OFFSET),
+			                          link)
 # if FRAME_RETADDR_OFFSET < 0
 			   && link > bottom && link < UNW_FP(frame)
 # else
 			   && link > UNW_FP(frame) && link < bottom
 # endif
 			   && !(link & (sizeof(link) - 1))
-			   && !__get_user(UNW_PC(frame),
-			                  (unsigned long *)(UNW_FP(frame)
-			                                    + FRAME_RETADDR_OFFSET))) {
+			   && !probe_kernel_address((unsigned long *)(UNW_FP(frame)
+			                                              + FRAME_RETADDR_OFFSET))
+			                            UNW_PC(frame)) {
 				UNW_SP(frame) = UNW_FP(frame) + FRAME_RETADDR_OFFSET
 # if FRAME_RETADDR_OFFSET < 0
 					-
@@ -1103,7 +1103,7 @@ int unwind(struct unwind_frame_info *fra
 					return -EIO;
 				switch(reg_info[i].width) {
 #define CASE(n)     case sizeof(u##n): \
-					__get_user(FRAME_REG(i, u##n), (u##n *)addr); \
+					probe_kernel_address((u##n *)addr, FRAME_REG(i, u##n)); \
 					break
 				CASES;
 #undef CASE
#1 lore raw
Quoted 1 line · Jan Beulich

Use probe_kernel_address() instead of __get_user() in Dwarf2 unwinder.

I had already done this here. Thanks.

-Andi

#2 lore raw
Quoted 5 lines
Quoted 1 line
Quoted 1 line

Andi Kleen <[email protected]> 29.11.06 14:15 >>>

Quoted 1 line · Jan Beulich

Use probe_kernel_address() instead of __get_user() in Dwarf2 unwinder.

I had already done this here. Thanks.

I had checked firstfloor and only found similar changes to arch/x86-64/.

Jan

#3 lore raw
Quoted 7 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line

Andi Kleen <[email protected]> 29.11.06 14:15 >>>

Quoted 1 line · Jan Beulich

Use probe_kernel_address() instead of __get_user() in Dwarf2 unwinder.

I had already done this here. Thanks.

I had checked firstfloor and only found similar changes to arch/x86-64/.

Sorry I hadn't pushed the changes out yet (did it last night)

-Andi