User Tools

Site Tools


modify_syzkaller_s_system_call_descriptions

modify syzkaller's system call descriptions

To be able to test system calls, syzkaller needs descriptions of the system calls for each target OS. The descriptions are stored in .txt files inside the sys folder of syzkaller. For FreeBSD the folder is <syzkaller>/sys/freebsd/.

Integrate system call descriptions

Modifications of these files require three steps in order to integrate it into syzkaller.

Step 1: Generate .const files from .txt files.

This requires FreeBSD source files on the host. I copied them to ~/freebsd/usr/src.

make extract TARGETOS=freebsd SOURCEDIR=~/freebsd/usr/src

Step 2: Generate Go code for syzkaller based on the .txt and .const files

This requires clang-format. If not already installed

sudo apt install clang-format

After that, run

make generate

Step 3: Build syzkaller on host and syz-executor on FreeBSD VM

See build_syzkaller

Upload system call modifications

Since syzkaller uses a github repository, contributions are possible by a pull request.

  • Create a fork from syzkaller. Go on https://github.com/google/syzkaller and click on Fork in order to create a syzkaller repository as a clone in your github account.
  • Clone a local copy of this syzkaller fork on the host. Move the existing syzkaller folder, if necessary.
cd ~/gopath/src/github.com
mv syzkaller syzkaller-old
git clone https://github.com/msvoelker/syzkaller
cd syzkaller
  • Add the google repository as remote
git remote add google https://github.com/google/syzkaller.git
  • Create a branch and switch to it
git checkout -b freebsd-sctp
  • Do the modifications on the system call description files and integrate them (see above)
  • create a commit in the local repository
  • Run presubmit
make presubmit
  • If googles syzkaller repository was updated in the meantime, rebase your repository
git checkout master
git fetch google
git rebase google/master
git checkout freebsd-sctp
git rebase master
  • If the last step was necessary, run presubmit again.
  • push changes to the syzkaller repository of your github account (if git reset were necessary add --force option)
git push --set-upstream origin freebsd-sctp
  • Create a pull request: On the page of your syzkaller fork, click on Pull request.
modify_syzkaller_s_system_call_descriptions.txt · Last modified: by msvoelker