Merge tag 'powerpc-5.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[sfrench/cifs-2.6.git] / arch / powerpc / oprofile / backtrace.c
index 6ffcb80cf844bfde5b16b8c5b04313d1c65e7d30..6f347fa29f41ef179f3e65f0f0499040962107ff 100644 (file)
@@ -28,15 +28,12 @@ static unsigned int user_getsp32(unsigned int sp, int is_first)
        unsigned int stack_frame[2];
        void __user *p = compat_ptr(sp);
 
-       if (!access_ok(p, sizeof(stack_frame)))
-               return 0;
-
        /*
         * The most likely reason for this is that we returned -EFAULT,
         * which means that we've done all that we can do from
         * interrupt context.
         */
-       if (__copy_from_user_inatomic(stack_frame, p, sizeof(stack_frame)))
+       if (probe_user_read(stack_frame, (void __user *)p, sizeof(stack_frame)))
                return 0;
 
        if (!is_first)
@@ -54,11 +51,7 @@ static unsigned long user_getsp64(unsigned long sp, int is_first)
 {
        unsigned long stack_frame[3];
 
-       if (!access_ok((void __user *)sp, sizeof(stack_frame)))
-               return 0;
-
-       if (__copy_from_user_inatomic(stack_frame, (void __user *)sp,
-                                       sizeof(stack_frame)))
+       if (probe_user_read(stack_frame, (void __user *)sp, sizeof(stack_frame)))
                return 0;
 
        if (!is_first)
@@ -103,7 +96,6 @@ void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth)
                        first_frame = 0;
                }
        } else {
-               pagefault_disable();
 #ifdef CONFIG_PPC64
                if (!is_32bit_task()) {
                        while (depth--) {
@@ -112,7 +104,6 @@ void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth)
                                        break;
                                first_frame = 0;
                        }
-                       pagefault_enable();
                        return;
                }
 #endif
@@ -123,6 +114,5 @@ void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth)
                                break;
                        first_frame = 0;
                }
-               pagefault_enable();
        }
 }