Skip to content

syzkaller - Coverage-Guided Kernel Fuzzer Cheatsheet

syzkaller - Coverage-Guided Kernel Fuzzer Cheatsheet

syzkaller is Google’s unsupervised, coverage-guided kernel fuzzer. It generates sequences of syscalls described by a declarative language (syzlang), executes them inside VMs, uses kernel coverage (KCOV) to steer mutation toward unexplored code, and detects crashes via kernel sanitizers. It runs continuously without human input and has found thousands of Linux kernel bugs — the syzbot continuous-fuzzing system is built on it. It also supports other kernels including BSDs, Fuchsia, and Windows.

Fuzzing crashes kernels by design. Always run inside disposable VMs, never on a machine you care about.

Prerequisites

RequirementNote
Go toolchainTo build syzkaller
Kernel sourceBuilt with KCOV, KASAN, and debug info
VM supportQEMU/KVM, GCE, or physical boards
Disk imageA minimal rootfs for the guest

Building

git clone https://github.com/google/syzkaller
cd syzkaller && make
BinaryRole
syz-managerOrchestrates VMs, corpus, and reporting
syz-fuzzerRuns inside the guest, generates programs
syz-executorExecutes syscall programs in the guest
syz-reproMinimizes a crash into a reproducer
syz-prog2cConverts a syz program to C

Required Kernel Config

OptionPurpose
CONFIG_KCOV=yCoverage feedback (essential)
CONFIG_KASAN=yMemory-error detection
CONFIG_DEBUG_INFO=ySymbolized reports
CONFIG_KASAN_INLINE=yFaster KASAN
CONFIG_FAULT_INJECTION=yExplore error paths
CONFIG_DEBUG_KMEMLEAK=yLeak detection (optional)

Without KCOV the fuzzer is blind — coverage feedback is what makes it effective rather than random.

Manager Configuration

{
  "target": "linux/amd64",
  "http": "127.0.0.1:56741",
  "workdir": "/home/user/syzkaller/workdir",
  "kernel_obj": "/home/user/linux",
  "image": "/home/user/image/bullseye.img",
  "sshkey": "/home/user/image/bullseye.id_rsa",
  "syzkaller": "/home/user/syzkaller",
  "procs": 8,
  "type": "qemu",
  "vm": { "count": 4, "kernel": "/home/user/linux/arch/x86/boot/bzImage", "cpu": 2, "mem": 2048 }
}
./bin/syz-manager -config my.cfg
FieldPurpose
targetOS/arch under test
kernel_objKernel build dir (for symbolization)
image / sshkeyGuest rootfs and access
procsParallel fuzzing processes per VM
vm.countNumber of concurrent VMs
httpWeb dashboard address

The Web Dashboard

ViewShows
CrashesUnique crash titles + counts
CorpusPrograms contributing coverage
CoverageWhich kernel files/lines are reached
StatsExec rate, VM health

Coverage is the number to watch: if it plateaus, the fuzzer has exhausted what your syscall descriptions can reach.

syzlang (Syscall Descriptions)

# Simplified example: describe a syscall's argument structure
open(file ptr[in, filename], flags flags[open_flags], mode flags[open_mode]) fd
read(fd fd, buf buffer[out], count len[buf])

Good descriptions are what let the fuzzer build valid-enough programs to reach deep code. Extending sys/linux/*.txt for an under-tested subsystem is often the highest-value contribution.

Reproducing Crashes

CommandPurpose
AutomaticThe manager runs syz-repro on new crashes
syz-repro -config my.cfg crash.logManually minimize
syz-prog2c -prog repro.syzEmit a standalone C reproducer
C reproducerWhat you attach to a bug report

syzkaller vs Other Fuzzers

AspectsyzkallerAFL++libFuzzer
TargetOS kernels (syscalls)Userspace binariesIn-process libraries
InputSyscall programsFiles/stdinByte buffers
FeedbackKCOVEdge coverageSanitizerCoverage
Best forKernel bug huntingGeneral binary fuzzingLibrary APIs

For userspace targets use AFL++ or honggfuzz; syzkaller is purpose-built for the kernel syscall boundary.

Resources