]> git.baikalelectronics.ru Git - kernel.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 18:59:17 +0000 (20:59 +0200)
commit0d4f6329eda170da00b0a51890f1013c9ae9cb7e
treea8c1eb829a03bd6c608489e6fca88b48b8589260
parent86f1efae9c5c5f2757ae4b458618fa9839b74dd5
ARM: 9214/1: alignment: advance IT state after emulating Thumb instruction

commit 76a7ba9c46ceffc77127314c773db198f72e378f 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