Some tips about how to use syzkaller
how to unpack corpus
How to setup build env before submit a patch
Note: in this part you need to download and install a lot devel packages,
syzkaller, kernel source code. Please leave at least 5G space for it.
When you want to write testcase for syzkaller, taking one of my patch as example, you may feel confused about how to wirte the .go files. The answer is the .go and .const files are generated automatically, not by hand. Only the .txt files are your work.
Here I will introduce how to setup a build env (I use fedora as example, ubuntu would be much easier) to generate this files before submit your patch.
- install golang and download the source code
Add your test cases. In my patch I updated sys/linux/vnet.txt and sys/linux/socket_netlink_route.txt. You can follow the syzkaller doc, like sign Google CLA, fork the code to your github, checout a new branch based on your repo, and write your test cases etc.
Install build dependencies. After you finish your patch. You need to install the build dependencies now. On ubuntu, it would be very easy, just run
make install_prerequisites. With Fedora, you need
Download kernel sourcecode. This is used for generate the .const files
generate the .const and go files
If all good, then you can
$ git push $your_repo $branch [--force] and create
Author Hangbin Liu
LastMod 2019-06-28 (fc2192f)