Skip to content

Commit

Permalink
[PATCH] x86-64: Use probe_kernel_address in arch/x86_64/*
Browse files Browse the repository at this point in the history
Instead of open coded __get_user

Signed-off-by: Andi Kleen <ak@suse.de>
  • Loading branch information
Andi Kleen authored and Andi Kleen committed Dec 7, 2006
1 parent 2fff0a4 commit ab2bf0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion arch/x86_64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
#include <linux/kprobes.h>
#include <linux/kexec.h>
#include <linux/unwind.h>
#include <linux/uaccess.h>

#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/atomic.h>
#include <asm/debugreg.h>
Expand Down
10 changes: 5 additions & 5 deletions arch/x86_64/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#include <linux/compiler.h>
#include <linux/module.h>
#include <linux/kprobes.h>
#include <linux/uaccess.h>

#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/pgalloc.h>
#include <asm/smp.h>
#include <asm/tlbflush.h>
Expand Down Expand Up @@ -96,7 +96,7 @@ void bust_spinlocks(int yes)
static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr,
unsigned long error_code)
{
unsigned char __user *instr;
unsigned char *instr;
int scan_more = 1;
int prefetch = 0;
unsigned char *max_instr;
Expand All @@ -116,7 +116,7 @@ static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr,
unsigned char instr_hi;
unsigned char instr_lo;

if (__get_user(opcode, (char __user *)instr))
if (probe_kernel_address(instr, opcode))
break;

instr_hi = opcode & 0xf0;
Expand Down Expand Up @@ -154,7 +154,7 @@ static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr,
case 0x00:
/* Prefetch instruction is 0x0F0D or 0x0F18 */
scan_more = 0;
if (__get_user(opcode, (char __user *)instr))
if (probe_kernel_address(instr, opcode))
break;
prefetch = (instr_lo == 0xF) &&
(opcode == 0x0D || opcode == 0x18);
Expand All @@ -170,7 +170,7 @@ static noinline int is_prefetch(struct pt_regs *regs, unsigned long addr,
static int bad_address(void *p)
{
unsigned long dummy;
return __get_user(dummy, (unsigned long __user *)p);
return probe_kernel_address((unsigned long *)p, dummy);
}

void dump_pagetable(unsigned long address)
Expand Down

0 comments on commit ab2bf0c

Please sign in to comment.