diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2007-07-13 10:02:42 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-07-13 12:40:01 -0400 |
commit | 5e0373b8e449b0c72495a6d8401c53f678b71988 (patch) | |
tree | a78f743ba84a62fcde92c9aff614aed69c382cc6 /arch | |
parent | e70dfc10b99ebffa1f464b1b9290df2589284f70 (diff) |
[MIPS] Add some __user tags
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/kernel/branch.c | 5 | ||||
-rw-r--r-- | arch/mips/kernel/traps.c | 2 | ||||
-rw-r--r-- | arch/mips/math-emu/dsemul.c | 12 |
3 files changed, 10 insertions, 9 deletions
diff --git a/arch/mips/kernel/branch.c b/arch/mips/kernel/branch.c index 76fd3f22c766..6b5df8bfab85 100644 --- a/arch/mips/kernel/branch.c +++ b/arch/mips/kernel/branch.c | |||
@@ -22,7 +22,8 @@ | |||
22 | */ | 22 | */ |
23 | int __compute_return_epc(struct pt_regs *regs) | 23 | int __compute_return_epc(struct pt_regs *regs) |
24 | { | 24 | { |
25 | unsigned int *addr, bit, fcr31, dspcontrol; | 25 | unsigned int __user *addr; |
26 | unsigned int bit, fcr31, dspcontrol; | ||
26 | long epc; | 27 | long epc; |
27 | union mips_instruction insn; | 28 | union mips_instruction insn; |
28 | 29 | ||
@@ -33,7 +34,7 @@ int __compute_return_epc(struct pt_regs *regs) | |||
33 | /* | 34 | /* |
34 | * Read the instruction | 35 | * Read the instruction |
35 | */ | 36 | */ |
36 | addr = (unsigned int *) epc; | 37 | addr = (unsigned int __user *) epc; |
37 | if (__get_user(insn.word, addr)) { | 38 | if (__get_user(insn.word, addr)) { |
38 | force_sig(SIGSEGV, current); | 39 | force_sig(SIGSEGV, current); |
39 | return -EFAULT; | 40 | return -EFAULT; |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 5e9fa83c4ef0..6f3e5c1424d3 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -131,7 +131,7 @@ static void show_stacktrace(struct task_struct *task, struct pt_regs *regs) | |||
131 | const int field = 2 * sizeof(unsigned long); | 131 | const int field = 2 * sizeof(unsigned long); |
132 | long stackdata; | 132 | long stackdata; |
133 | int i; | 133 | int i; |
134 | unsigned long *sp = (unsigned long *)regs->regs[29]; | 134 | unsigned long __user *sp = (unsigned long __user *)regs->regs[29]; |
135 | 135 | ||
136 | printk("Stack :"); | 136 | printk("Stack :"); |
137 | i = 0; | 137 | i = 0; |
diff --git a/arch/mips/math-emu/dsemul.c b/arch/mips/math-emu/dsemul.c index ea6ba7248489..653e325849e4 100644 --- a/arch/mips/math-emu/dsemul.c +++ b/arch/mips/math-emu/dsemul.c | |||
@@ -54,8 +54,7 @@ struct emuframe { | |||
54 | int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc) | 54 | int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc) |
55 | { | 55 | { |
56 | extern asmlinkage void handle_dsemulret(void); | 56 | extern asmlinkage void handle_dsemulret(void); |
57 | mips_instruction *dsemul_insns; | 57 | struct emuframe __user *fr; |
58 | struct emuframe *fr; | ||
59 | int err; | 58 | int err; |
60 | 59 | ||
61 | if (ir == 0) { /* a nop is easy */ | 60 | if (ir == 0) { /* a nop is easy */ |
@@ -87,8 +86,8 @@ int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc) | |||
87 | */ | 86 | */ |
88 | 87 | ||
89 | /* Ensure that the two instructions are in the same cache line */ | 88 | /* Ensure that the two instructions are in the same cache line */ |
90 | dsemul_insns = (mips_instruction *) ((regs->regs[29] - sizeof(struct emuframe)) & ~0x7); | 89 | fr = (struct emuframe __user *) |
91 | fr = (struct emuframe *) dsemul_insns; | 90 | ((regs->regs[29] - sizeof(struct emuframe)) & ~0x7); |
92 | 91 | ||
93 | /* Verify that the stack pointer is not competely insane */ | 92 | /* Verify that the stack pointer is not competely insane */ |
94 | if (unlikely(!access_ok(VERIFY_WRITE, fr, sizeof(struct emuframe)))) | 93 | if (unlikely(!access_ok(VERIFY_WRITE, fr, sizeof(struct emuframe)))) |
@@ -113,12 +112,13 @@ int mips_dsemul(struct pt_regs *regs, mips_instruction ir, unsigned long cpc) | |||
113 | 112 | ||
114 | int do_dsemulret(struct pt_regs *xcp) | 113 | int do_dsemulret(struct pt_regs *xcp) |
115 | { | 114 | { |
116 | struct emuframe *fr; | 115 | struct emuframe __user *fr; |
117 | unsigned long epc; | 116 | unsigned long epc; |
118 | u32 insn, cookie; | 117 | u32 insn, cookie; |
119 | int err = 0; | 118 | int err = 0; |
120 | 119 | ||
121 | fr = (struct emuframe *) (xcp->cp0_epc - sizeof(mips_instruction)); | 120 | fr = (struct emuframe __user *) |
121 | (xcp->cp0_epc - sizeof(mips_instruction)); | ||
122 | 122 | ||
123 | /* | 123 | /* |
124 | * If we can't even access the area, something is very wrong, but we'll | 124 | * If we can't even access the area, something is very wrong, but we'll |