From: Anton Blanchard Date: Mon, 13 Oct 2014 09:27:15 +0000 (+1100) Subject: powerpc: Use probe_kernel_address in show_instructions X-Git-Tag: firefly_0821_release~176^2~2621^2~74 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7b051f665c32db3339ac9b6d9806ef508d09647f;p=firefly-linux-kernel-4.4.55.git powerpc: Use probe_kernel_address in show_instructions We really don't want to take a pagefault in show_instructions, so use probe_kernel_address instead of __get_user. Signed-off-by: Anton Blanchard Signed-off-by: Michael Ellerman --- diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 91e132b495bf..8c2691e445bd 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -37,9 +37,9 @@ #include #include #include +#include #include -#include #include #include #include @@ -921,12 +921,8 @@ static void show_instructions(struct pt_regs *regs) pc = (unsigned long)phys_to_virt(pc); #endif - /* We use __get_user here *only* to avoid an OOPS on a - * bad address because the pc *should* only be a - * kernel address. - */ if (!__kernel_text_address(pc) || - __get_user(instr, (unsigned int __user *)pc)) { + probe_kernel_address((unsigned int __user *)pc, instr)) { printk(KERN_CONT "XXXXXXXX "); } else { if (regs->nip == pc)