Skip to content
 编辑

Adding new OS support

Adding new OS support

Here are the common parts of syzkaller to edit in order to make syzkaller support a new OS kernel. However, there may be some specific changes that will be required for a given kernel (for example, gathering coverage from a given kernel, or some errors that might pop up and give a hint about what to tweak).

syz-executor

For each OS, there is this file executor/executor_GOOS.h where GOOS is the OS name. This file contains two important functions:

These two functions, are called in executor/executor.cc, which is mainly responsible for executing the syscalls programs, and managing the threads in which the programs run.

executor_GOOS.h also contains functions related to that operating system such as functions that allow it to gather coverage information, detect bitness, etc. (Example: executor_linux.h ).

The intended function will be called according to the target kernel as defined by the macros in the executor/executor.cc file.

Build files pkg/

Report files pkg/report/

Creating a file that reports build errors for the targeted kernel under pkg/report/. There is a file per each of the supported OSes by Syzkaller where the name pattern is GOOS.go.

Editing pkg/host/

Creating a file under sys/GOOS/

Creating a file init.go for the targeted kernel under sys/GOOS/that included the function initTarget that initializes the target and the different supported architectures.

Editing sys/syz-extract

Adding the new kernel name with already existing supported kernels to the file sys/syz-extract/extract.go.

Editing sys/targets

Adding the new kernel name with already existing supported kernels to the file targets.go which is located undersys/targets.

Editing vm/qemu

Adding the new kernel name with already existing supported kernels to the file qemo.go which is located under vm/qemu.

Syzkaller description & pseudo-syscalls

Check descriptions, and pseudo-syscalls.