[PATCH v2] arm64: mops: Do not dereference src reg for a set operation
Kristina Martšenko
kristina.martsenko at arm.com
Wed Mar 26 10:32:00 PDT 2025
On 26/03/2025 11:04, Keir Fraser wrote:
> The source register is not used for SET* and reading it can result in
> a UBSAN out-of-bounds array access error, specifically when the MOPS
> exception is taken from a SET* sequence with XZR (reg 31) as the
> source. Architecturally this is the only case where a src/dst/size
> field in the ESR can be reported as 31.
>
> Prior to 2de451a329cf662b the code in do_el0_mops() was benign as the
> use of pt_regs_read_reg() prevented the out-of-bounds access.
>
> Fixes: 2de451a329cf662b ("KVM: arm64: Add handler for MOPS exceptions")
> Cc: Kristina Martsenko <kristina.martsenko at arm.com>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Mark Rutland <mark.rutland at arm.com>
> Cc: Will Deacon <will at kernel.org>
> Cc: stable at vger.kernel.org
> Reviewed-by: Marc Zyngier <maz at kernel.org>
> Signed-off-by: Keir Fraser <keirf at google.com>
FWIW,
Reviewed-by: Kristina Martšenko <kristina.martsenko at arm.com>
Thanks,
Kristina
More information about the linux-arm-kernel
mailing list