[PATCH 1/9] ARM: fix missed big-endian fix in traps.c

Ben Dooks ben.dooks at codethink.co.uk
Fri Nov 8 13:37:04 EST 2013


Fix the case where the the opcode is fixed from user memory and is not
swapped properly before being analysed.

Signed-off-by: Ben Dooks <ben.dooks at codethink.co.uk>
---
 arch/arm/kernel/traps.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 6125f25..500e68c 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -425,9 +425,10 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
 			instr2 = __mem_to_opcode_thumb16(instr2);
 			instr = __opcode_thumb32_compose(instr, instr2);
 		}
-	} else if (get_user(instr, (u32 __user *)pc)) {
+	} else {
+		if (get_user(instr, (u32 __user *)pc))
+			goto die_sig;
 		instr = __mem_to_opcode_arm(instr);
-		goto die_sig;
 	}
 
 	if (call_undef_hook(regs, instr) == 0)
-- 
1.8.4.rc3




More information about the linux-arm-kernel mailing list