]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 8064/1: fix v7-M signal return
authorRabin Vincent <rabin@rab.in>
Sat, 24 May 2014 16:38:01 +0000 (17:38 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 25 May 2014 22:44:27 +0000 (23:44 +0100)
commit6e2367afd2e93457a0b7071bcf85914c6530b877
tree1b7396010f4ddc8dc31e57cd05a5e6601493076f
parent34fa7233f41bec7c95e502b36eb0e25d3aa55fbe
ARM: 8064/1: fix v7-M signal return

According to the ARM ARM, the behaviour is UNPREDICTABLE if the PC read
from the exception return stack is not half word aligned.  See the
pseudo code for ExceptionReturn() and PopStack().

The signal handler's address has the bit 0 set, and setup_return()
directly writes this to regs->ARM_pc.  Current hardware happens to
discard this bit, but QEMU's emulation doesn't and this makes processes
crash.  Mask out bit 0 before the exception return in order to get
predictable behaviour.

Fixes: 141aef457241 ("ARM: ARMv7-M: Add support for exception handling")
Cc: stable@kernel.org
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Rabin Vincent <rabin@rab.in>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/kernel/entry-header.S