[BUG] RISC-V: KVM: WARNING in mark_page_dirty_in_slot with dirty ring enabled
Jiakai Xu
xujiakai2025 at iscas.ac.cn
Tue Sep 8 02:58:13 PDT 2026
Hi,
I found a crash by fuzzing KVM on RISC-V. The crash is a WARNING
in virt/kvm/kvm_main.c, mark_page_dirty_in_slot().
The kernel is built from the riscv_kvm_queue branch of the kvm-riscv
Linux tree:
https://github.com/kvm-riscv/linux/commits/riscv_kvm_queue/
at commit:
9167580a3495b659656c3e0f689c4b38dacb2fb5
I checked the current upstream tree and this does not appear to
have been fixed yet.
I attempted a fix myself: the idea was to dirty pages against the
explicit faulting vCPU instead of going through the per-CPU "running
vCPU" used by mark_page_dirty_in_slot()/kvm_vcpu_mark_page_dirty().
However, I am not confident about the quality or correctness of that
patch, and the fuzzer did not produce a reproducer program, so I could
not verify whether the crash is actually fixed. For those reasons I
decided not to post it as a proper patch and instead report the bug
here.
I have uploaded the kernel configuration used for the build, the kernel
crash log, and a patch I attempted to generate with the help of AI to
the following gist:
https://gist.github.com/6eanut/d3e017c17f7a5a144da90a6513773b2b
If anyone is interested in investigating or fixing this bug, I would be
happy to provide any additional information or help that may be useful.
Thanks,
Jiakai Xu
More information about the linux-riscv
mailing list