From: Dan Williams Date: Tue, 13 Feb 2007 16:11:34 +0000 (+0100) Subject: [ARM] 4183/1: do_undefinstr: read svc undefined instructions with svc privileges X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dfc544c7216b276c1e9c0c753299692df4068c44;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git [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 Signed-off-by: Russell King --- 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) regs->ARM_pc -= correction; pc = (void __user *)instruction_pointer(regs); - if (thumb_mode(regs)) { + + if (processor_mode(regs) == SVC_MODE) { + instr = *(u32 *) pc; + } else if (thumb_mode(regs)) { get_user(instr, (u16 __user *)pc); } else { get_user(instr, (u32 __user *)pc);