From ce70880ae710f930d895ac30e0df025cc005eb19 Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Fri, 6 Sep 2024 10:07:23 +0200 Subject: executor: sys/linux: arm64: implement SYZOS_API_MEMWRITE The new API call will be used to write values to guest memory specified by base+offset. Writing to e.g. MMIO registers for VGIC (or any other MMIO ranges) may result in new coverage. --- sys/linux/test/syz_kvm_setup_cpu_arm64-memwrite | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sys/linux/test/syz_kvm_setup_cpu_arm64-memwrite (limited to 'sys/linux/test') diff --git a/sys/linux/test/syz_kvm_setup_cpu_arm64-memwrite b/sys/linux/test/syz_kvm_setup_cpu_arm64-memwrite new file mode 100644 index 000000000..00b866dd2 --- /dev/null +++ b/sys/linux/test/syz_kvm_setup_cpu_arm64-memwrite @@ -0,0 +1,14 @@ +# +# requires: arch=arm64 +# +r0 = openat$kvm(0, &AUTO='/dev/kvm\x00', 0x0, 0x0) +r1 = ioctl$KVM_CREATE_VM(r0, AUTO, 0x0) +r2 = ioctl$KVM_CREATE_VCPU(r1, AUTO, 0x0) +r3 = ioctl$KVM_GET_VCPU_MMAP_SIZE(r0, AUTO) +r4 = mmap$KVM_VCPU(&(0x7f0000009000/0x1000)=nil, r3, 0x3, 0x1, r2, 0x0) +# Emulate a uexit with the memwrite API command: write 0 at address ARM64_ADDR_UEXIT. +# +syz_kvm_setup_cpu$arm64(r1, r2, &(0x7f0000e8a000/0x18000), &AUTO=[{0x0, &AUTO=[@memwrite={AUTO, AUTO, {0xdddd0000, 0x100, 0x0, 0x8}}], AUTO}], 0x1, 0x0, 0x0, 0x0) +# Run till uexit. +# +ioctl$KVM_RUN(r2, AUTO, 0x0) -- cgit mrf-deployment