[PATCH] ARM: alignment: advance IT state after emulating Thumb instruction

Linus Walleij linus.walleij at linaro.org
Thu Jun 30 04:54:29 PDT 2022


On Tue, Jun 28, 2022 at 5:13 PM Ard Biesheuvel <ardb at kernel.org> wrote:

> 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 at vger.kernel.org>
> Signed-off-by: Ard Biesheuvel <ardb at kernel.org>

A genuine piece of art to track this down. Thanks!
Reviewed-by: Linus Walleij <linus.walleij at linaro.org>

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list