Skip to content

Commit

Permalink
powerpc: Use probe_kernel_address in show_instructions
Browse files Browse the repository at this point in the history
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 <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Anton Blanchard authored and Michael Ellerman committed Nov 5, 2014
1 parent dd521d1 commit 7b051f6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions arch/powerpc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
#include <linux/personality.h>
#include <linux/random.h>
#include <linux/hw_breakpoint.h>
#include <linux/uaccess.h>

#include <asm/pgtable.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/processor.h>
#include <asm/mmu.h>
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7b051f6

Please sign in to comment.