public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] use probe_kernel_address in Dwarf2 unwinder
@ 2006-11-29 11:14 Jan Beulich
  2006-11-29 13:15 ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2006-11-29 11:14 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

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

Signed-off-by: Jan Beulich <jbeulich@novell.com>

--- linux-2.6.19-rc6/kernel/unwind.c	2006-11-29 10:04:11.000000000 +0100
+++ 2.6.19-rc6-unwind-probe_kernel_address/kernel/unwind.c	2006-11-29 10:22:16.000000000 +0100
@@ -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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] use probe_kernel_address in Dwarf2 unwinder
  2006-11-29 11:14 [PATCH] use probe_kernel_address in Dwarf2 unwinder Jan Beulich
@ 2006-11-29 13:15 ` Andi Kleen
  2006-11-29 14:02   ` Jan Beulich
  0 siblings, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2006-11-29 13:15 UTC (permalink / raw)
  To: Jan Beulich; +Cc: linux-kernel

On Wednesday 29 November 2006 12:14, Jan Beulich wrote:
> Use probe_kernel_address() instead of __get_user() in Dwarf2 unwinder.

I had already done this here. Thanks.

-Andi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] use probe_kernel_address in Dwarf2 unwinder
  2006-11-29 13:15 ` Andi Kleen
@ 2006-11-29 14:02   ` Jan Beulich
  2006-11-29 14:16     ` Andi Kleen
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2006-11-29 14:02 UTC (permalink / raw)
  To: Andi Kleen; +Cc: linux-kernel

>>> Andi Kleen <ak@suse.de> 29.11.06 14:15 >>>
>On Wednesday 29 November 2006 12:14, Jan Beulich wrote:
>> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] use probe_kernel_address in Dwarf2 unwinder
  2006-11-29 14:02   ` Jan Beulich
@ 2006-11-29 14:16     ` Andi Kleen
  0 siblings, 0 replies; 4+ messages in thread
From: Andi Kleen @ 2006-11-29 14:16 UTC (permalink / raw)
  To: Jan Beulich; +Cc: linux-kernel

On Wednesday 29 November 2006 15:02, Jan Beulich wrote:
> >>> Andi Kleen <ak@suse.de> 29.11.06 14:15 >>>
> >On Wednesday 29 November 2006 12:14, Jan Beulich wrote:
> >> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-11-29 14:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-29 11:14 [PATCH] use probe_kernel_address in Dwarf2 unwinder Jan Beulich
2006-11-29 13:15 ` Andi Kleen
2006-11-29 14:02   ` Jan Beulich
2006-11-29 14:16     ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox