forked from Minki/linux
e16b31bf47
The exception handling code fails to clear the IT state, potentially leading to incorrect execution of the fixup if the size of the IT block is more than one. Let fixup_exception do the IT sanitizing if a fixup has been found, and restore CPSR from the stack when returning from a data abort. Cc: Will Deacon <will.deacon@arm.com> Cc: stable@vger.kernel.org Reviewed-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
22 lines
451 B
C
22 lines
451 B
C
/*
|
|
* linux/arch/arm/mm/extable.c
|
|
*/
|
|
#include <linux/module.h>
|
|
#include <linux/uaccess.h>
|
|
|
|
int fixup_exception(struct pt_regs *regs)
|
|
{
|
|
const struct exception_table_entry *fixup;
|
|
|
|
fixup = search_exception_tables(instruction_pointer(regs));
|
|
if (fixup) {
|
|
regs->ARM_pc = fixup->fixup;
|
|
#ifdef CONFIG_THUMB2_KERNEL
|
|
/* Clear the IT state to avoid nasty surprises in the fixup */
|
|
regs->ARM_cpsr &= ~PSR_IT_MASK;
|
|
#endif
|
|
}
|
|
|
|
return fixup != NULL;
|
|
}
|