]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction
authorArd Biesheuvel <ardb@kernel.org>
Thu, 30 Jun 2022 15:46:54 +0000 (16:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 21 Jul 2022 19:20:00 +0000 (21:20 +0200)
commitdb6e8c30154f390348b5bd6e8028461b90c0876e
tree8b580ff562ec567414a051a903984216214ca9e3
parentf851e4f40253f4f8b57cbee503806f2a7c16f7ce
ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction

commit e5c46fde75e43c15a29b40e5fc5641727f97ae47 upstream.

After emulating a misaligned load or store issued in Thumb mode, we have
to advance the IT state by hand, or it will get out of sync with the
actual instruction stream, which means we'll end up applying the wrong
condition code to subsequent instructions. This might corrupt the
program state rather catastrophically.

So borrow the it_advance() helper from the probing code, and use it on
CPSR if the emulated instruction is Thumb.

Cc: <stable@vger.kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/include/asm/ptrace.h
arch/arm/mm/alignment.c
arch/arm/probes/decode.h