-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ViDeZZo fork mode bug on vbox #18
Comments
@blabla-my thank you very much, please add our discord server for better communication if you are still interested https://discord.gg/9tuPhCtr |
@blabla-my by any chance, do you update the patch for vbox 7.0.20? Could you please share? |
Thanks! However the invitation url is expired, I cannot join it now. The url in readme is also expired. |
sure, I will post my patch in a new issue lately. |
Thank you for your reminder. url updated: https://discord.gg/dxdvHvrK8D |
Environment
Vbox version: 7.0.20 downloaded from https://download.virtualbox.org/virtualbox/7.0.20/VirtualBox-7.0.20.tar.bz2
ViDeZZo: docker container
Problem
A lot of segmentation fault while fuzzing with VIDEZZO_FORK=1, reported by UBSAN
The pc value 0x7ffff733b06e point to PGMPhysRead() in VBoxVMM.so. According to gdb, the machine code here is :
GDB shows address 0x7ffff733b06e cannot be accessed.
Root Cause
In fork mode, ViDeZZo will fork a child to execute input.
In the parent process, VBoxVMM.so is mapped as follow:
However, in the child process, VBoxVMM.so is mapped as follow. We can see that 7ffff78a8000-7ffff7c1e000 disappears in the child process memory map. The segmentation fault is due to accessing this missing region.
I don't really know why this region is not inherited by the child. I guess while vbox loads VBoxVMM.so, it will invoke madvice() to make this region MADV_DONTFORK. (https://man7.org/linux/man-pages/man2/madvise.2.html).
Solution
As a workaround, I invoke madvice to set this region MADV_DOFORK in VBoxViDeZZo.cpp::LLVMFuzzerInitialize. Therefore, the segmentation fault disappears. The patch is below:
The text was updated successfully, but these errors were encountered: