Skip to content

Commit

Permalink
[ARM] 4183/1: do_undefinstr: read svc undefined instructions with svc…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Dan Williams authored and Russell King committed Feb 14, 2007
1 parent 6df2670 commit dfc544c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/arm/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit dfc544c

Please sign in to comment.