On Wed, Feb 24, 2021 at 12:54 PM Kainaat Singh <
savvy....@gmail.com> wrote:
>
> I am trying to understand what syzkaller does to the VM when the kernel crashes.
>
> 1. Does it restart the VM? Else, how is the kernel put back to its original state?
Yes. If qemu is used, then it's not just restarted. The previous qemu
process is killed and a new one is created.
> 2. When there is a crash, does the main thread stop fuzzing until the crash is reproduced? I am running only one VM instance, so how syzkaller is handling this situation.
Overall yes, but it's a bit involved, also depends on "phase" of work.
But, yes, generally it will start reproducing and it takes precedence
over fuzzing.
If you are interested in details, you need to read and understand the code:
https://github.com/google/syzkaller/blob/master/syz-manager/manager.go#L308-L440
You can disable reproduction in the manager config if you want.
> In my case, a vGPU is attached to the VM and sometimes when there is a crash in syz-repro, I can see this and it seems to be running fine after this:
>
> program crashed: no output from test machine
> failed to init instance: failed to create VM: failed to read from qemu: EOF
> qemu-system-x86_64: -device vfio-pci,sysfsdev=/sys/bus/pci/devices/0000:00:02.0/ef8e2751-94bf-4b71-9c1d-432dca83a9ec: vfio ef8e2751-94bf-4b71-9c1d-432dca83a9ec: failed to open /dev/vfio/23: Device or re>
> bisect: crashed, chunk #1 evicted
> bisect: guilty chunks: [<1317>]
> bisect: guilty chunks split: [], <1317>, []
> bisect: chunk split: <1317> => <658>, <659>
>
> I am guessing that the VM is still active and the vGPU is attached to it this is why we get this error.
I don't think this has anything to do with reproduction.
This looks like a bug in qemu or the host kernel that it does not
release the device immediately.
> When there is "no output from test machine" does syzkaller restarts the VM?
Yes.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/syzkaller/d24805f1-3847-440d-a9a2-d9521ca2006en%40googlegroups.com.