Re: [PATCH] RISC-V: KVM: Fix null pointer dereference in kvm_riscv_aia_imsic_rw_attr()
From: patchwork-bot+linux-riscv
Date: Thu Feb 19 2026 - 23:16:41 EST
Hello:
This patch was applied to riscv/linux.git (fixes)
by Anup Patel <anup@xxxxxxxxxxxxxx>:
On Tue, 27 Jan 2026 07:22:19 +0000 you wrote:
> Add a null pointer check for imsic_state before dereferencing it in
> kvm_riscv_aia_imsic_rw_attr(). While the function checks that the
> vcpu exists, it doesn't verify that the vcpu's imsic_state has been
> initialized, leading to a null pointer dereference when accessed.
>
> The crash manifests as:
> Unable to handle kernel paging request at virtual address
> dfffffff00000006
> ...
> kvm_riscv_aia_imsic_rw_attr+0x2d8/0x854 arch/riscv/kvm/aia_imsic.c:958
> aia_set_attr+0x2ee/0x1726 arch/riscv/kvm/aia_device.c:354
> kvm_device_ioctl_attr virt/kvm/kvm_main.c:4744 [inline]
> kvm_device_ioctl+0x296/0x374 virt/kvm/kvm_main.c:4761
> vfs_ioctl fs/ioctl.c:51 [inline]
> ...
>
> [...]
Here is the summary with links:
- RISC-V: KVM: Fix null pointer dereference in kvm_riscv_aia_imsic_rw_attr()
https://git.kernel.org/riscv/c/aeb1d17d1af5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html