Commit c76bf835 authored by Radim Krčmář's avatar Radim Krčmář Committed by Greg Kroah-Hartman
Browse files

RISC-V: KVM: fix stack overrun when loading vlenb



commit 79976620 upstream.

The userspace load can put up to 2048 bits into an xlen bit stack
buffer.  We want only xlen bits, so check the size beforehand.

Fixes: 2fa29037 ("RISC-V: KVM: add 'vlenb' Vector CSR")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarRadim Krčmář <rkrcmar@ventanamicro.com>
Reviewed-by: default avatarNutty Liu <liujingqi@lanxincomputing.com>
Reviewed-by: default avatarDaniel Henrique Barboza <dbarboza@ventanamicro.com>
Link: https://lore.kernel.org/r/20250805104418.196023-4-rkrcmar@ventanamicro.com


Signed-off-by: default avatarAnup Patel <anup@brainfault.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 67a05679
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment