diff options
author | Dan Williams <dan.j.williams@intel.com> | 2007-02-13 11:11:34 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-02-14 10:21:22 -0500 |
commit | dfc544c7216b276c1e9c0c753299692df4068c44 (patch) | |
tree | 3f8b30ea058ad49a4a54b76fa193bde988ac6f1a /arch/arm/kernel/traps.c | |
parent | 6df26700c0884cb3cce2b9fa4795888f86ca4d8f (diff) |
[ARM] 4183/1: do_undefinstr: read svc undefined instructions with svc privileges
do_undefinstr currently does not expect undefined instructions in kernel
code, since it always uses get_user() to read the instruction.
Dereference the 'pc' pointer directly in the SVC case.
Per Nicolas Pitre's note, kernel code is never in thumb mode.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/traps.c')
-rw-r--r-- | arch/arm/kernel/traps.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 329609b84d3b..24095601359b 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -282,7 +282,10 @@ asmlinkage void do_undefinstr(struct pt_regs *regs) | |||
282 | regs->ARM_pc -= correction; | 282 | regs->ARM_pc -= correction; |
283 | 283 | ||
284 | pc = (void __user *)instruction_pointer(regs); | 284 | pc = (void __user *)instruction_pointer(regs); |
285 | if (thumb_mode(regs)) { | 285 | |
286 | if (processor_mode(regs) == SVC_MODE) { | ||
287 | instr = *(u32 *) pc; | ||
288 | } else if (thumb_mode(regs)) { | ||
286 | get_user(instr, (u16 __user *)pc); | 289 | get_user(instr, (u16 __user *)pc); |
287 | } else { | 290 | } else { |
288 | get_user(instr, (u32 __user *)pc); | 291 | get_user(instr, (u32 __user *)pc); |