Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dfc544c7 authored by Dan Williams's avatar Dan Williams Committed by Russell King
Browse files

[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: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 6df26700
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);