diff options
author | Andrei Vagin <avagin@gmail.com> | 2020-12-09 21:45:56 -0800 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2021-01-29 19:00:57 -0800 |
commit | 44e0a0eac98792013014e475165187932075f045 (patch) | |
tree | d4a1da3d5aa24e8bb28e3ea916d9a1d116ea1187 /images | |
parent | 0fa534f1164f2bf6cf50a37d4dce584b6fc8ec07 (diff) |
Add syzkaller docker image
Diffstat (limited to 'images')
-rw-r--r-- | images/syzkaller/Dockerfile | 9 | ||||
-rw-r--r-- | images/syzkaller/README.md | 34 | ||||
-rw-r--r-- | images/syzkaller/default-gvisor-config.cfg | 15 |
3 files changed, 58 insertions, 0 deletions
diff --git a/images/syzkaller/Dockerfile b/images/syzkaller/Dockerfile new file mode 100644 index 000000000..df6680f40 --- /dev/null +++ b/images/syzkaller/Dockerfile @@ -0,0 +1,9 @@ +FROM gcr.io/syzkaller/env + +RUN apt update && apt install -y git vim strace gdb procps + +WORKDIR /syzkaller/gopath/src/github.com/google/syzkaller + +RUN git init . && git remote add origin https://github.com/google/syzkaller && git fetch origin && git checkout origin/master && make + +ENTRYPOINT ./bin/syz-manager --config /tmp/syzkaller/syzkaller.cfg diff --git a/images/syzkaller/README.md b/images/syzkaller/README.md new file mode 100644 index 000000000..60aa61d12 --- /dev/null +++ b/images/syzkaller/README.md @@ -0,0 +1,34 @@ +syzkaller is an unsupervised coverage-guided kernel fuzzer. + +* [Github](https://github.com/google/syzkaller) +* [gVisor dashboard](https://syzkaller.appspot.com/gvisor) + +# How to run syzkaller. + +* Build the syzkaller docker image +``` +make load-syzkaller +``` +* Build runsc and place it in /tmp/syzkaller. +``` + make RUNTIME_DIR=/tmp/syzkaller refresh +``` +* Copy the syzkaller config in /tmp/syzkaller +``` +cp images/syzkaller/default-gvisor-config.cfg /tmp/syzkaller/syzkaller.cfg +``` +* Run syzkaller +``` +docker run --privileged -it --rm -v /tmp/syzkaller:/tmp/syzkaller gvisor.dev/images/syzkaller:latest +``` + +# How to run a syz repro. + +* Repeate all steps except the last one from the previous section. + +* Save a syzkaller repro in /tmp/syzkaller/repro + +* Run syz-repro +``` +docker run --privileged -it --rm -v /tmp/syzkaller:/tmp/syzkaller --entrypoint="" gvisor.dev/images/syzkaller:latest ./bin/syz-repro -config /tmp/syzkaller/syzkaller.cfg /tmp/syzkaller/repro +``` diff --git a/images/syzkaller/default-gvisor-config.cfg b/images/syzkaller/default-gvisor-config.cfg new file mode 100644 index 000000000..c69641c21 --- /dev/null +++ b/images/syzkaller/default-gvisor-config.cfg @@ -0,0 +1,15 @@ +{ + "name": "gvisor", + "target": "linux/amd64", + "http": ":80", + "workdir": "/tmp/syzkaller/workdir/", + "image": "/tmp/syzkaller/runsc", + "syzkaller": "/syzkaller/gopath/src/github.com/google/syzkaller", + "cover": false, + "procs": 1, + "type": "gvisor", + "vm": { + "count": 1, + "runsc_args": "--debug --network none --platform ptrace --vfs2 --fuse -net-raw -watchdog-action=panic" + } +} |