blob: 7cf3c96dcdb02c0c015d8c2798a81f74412ece3b [file] [log] [blame] [view]
andybonsad92aa32015-08-31 02:27:441# IPC Fuzzer
andybons3322f762015-08-24 21:37:092
qyearsleyc0dc6f42016-12-02 22:13:393A Chromium IPC fuzzer is under development by aedla and tsepez. The fuzzer lives
andybonsad92aa32015-08-31 02:27:444under `src/tools/ipc_fuzzer/` and is running on ClusterFuzz. A previous version
5of the fuzzer was a simple bitflipper, which caught around 10 bugs. A new
6version is doing smarter mutations and generational fuzzing. To do so, each
7`ParamTraits<Type>` needs a corresponding `FuzzTraits<Type>`. Feel free to
8contribute.
andybons3322f762015-08-24 21:37:099
andybonsad92aa32015-08-31 02:27:4410[TOC]
andybons3322f762015-08-24 21:37:0911
andybonsad92aa32015-08-31 02:27:4412## Working with the fuzzer
andybons3322f762015-08-24 21:37:0913
andybonsad92aa32015-08-31 02:27:4414### Build instructions
andybons3322f762015-08-24 21:37:0915
ochangcc11d0e2016-04-26 19:58:2616* Run `gn args` and add `enable_ipc_fuzzer = true` to your args.gn. If you use
17 GYP, add `enable_ipc_fuzzer=1` to `GYP_DEFINES`.
andybonsad92aa32015-08-31 02:27:4418* build `ipc_fuzzer_all` target
19* component builds are currently broken, sorry
20* Debug builds are broken; only Release mode works.
andybons3322f762015-08-24 21:37:0921
andybonsad92aa32015-08-31 02:27:4422### Replaying ipcdumps
andybons3322f762015-08-24 21:37:0923
andybonsad92aa32015-08-31 02:27:4424* `tools/ipc_fuzzer/scripts/play_testcase.py path/to/testcase.ipcdump`
25* more help: `tools/ipc_fuzzer/scripts/play_testcase.py -h`
andybons3322f762015-08-24 21:37:0926
andybonsad92aa32015-08-31 02:27:4427### Listing messages in ipcdump
andybons3322f762015-08-24 21:37:0928
andybonsad92aa32015-08-31 02:27:4429* `out/<Build>/ipc_message_util --dump path/to/testcase.ipcdump`
andybons3322f762015-08-24 21:37:0930
andybonsad92aa32015-08-31 02:27:4431### Updating fuzzers in ClusterFuzz
andybons3322f762015-08-24 21:37:0932
andybonsad92aa32015-08-31 02:27:4433* `tools/ipc_fuzzer/scripts/cf_package_builder.py`
34* upload `ipc_fuzzer_mut.zip` and `ipc_fuzzer_gen.zip` under build directory
35 to ClusterFuzz
andybons3322f762015-08-24 21:37:0936
andybonsad92aa32015-08-31 02:27:4437### Contributing FuzzTraits
andybons3322f762015-08-24 21:37:0938
andybonsad92aa32015-08-31 02:27:4439* add them to `tools/ipc_fuzzer/fuzzer/fuzzer.cc`
40* thanks!
andybons3322f762015-08-24 21:37:0941
andybonsad92aa32015-08-31 02:27:4442## Components
andybons3322f762015-08-24 21:37:0943
andybonsad92aa32015-08-31 02:27:4444### ipcdump logger
andybons3322f762015-08-24 21:37:0945
andybonsad92aa32015-08-31 02:27:4446* add `enable_ipc_fuzzer=1` to `GYP_DEFINES`
47* build `chrome` and `ipc_message_dump` targets
48* run chrome with
49 `--no-sandbox --ipc-dump-directory=/path/to/ipcdump/directory`
50* ipcdumps will be created in this directory for each renderer using the
51 format `_pid_.ipcdump`
andybons3322f762015-08-24 21:37:0952
andybonsad92aa32015-08-31 02:27:4453### ipcdump replay
andybons3322f762015-08-24 21:37:0954
andybonsad92aa32015-08-31 02:27:4455Lives under `ipc_fuzzer/replay`. The renderer is replaced with
56`ipc_fuzzer_replay` using `--renderer-cmd-prefix`. This is done automatically
57with the `ipc_fuzzer/play_testcase.py` convenience script.
58
59### ipcdump mutator / generator
60
61Lives under `ipc_fuzzer/fuzzer`. This is the code that runs on ClusterFuzz. It
62uses `FuzzTraits<Type>` to mutate ipcdumps or generate them out of thin air.
63
64## Problems, questions, suggestions
65
66Send them to mbarbella@chromium.org.