blob: 79331c9410a0c3d45c142607240083f79895a20c [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
Daniel Bratellf73f0df2018-09-24 13:52:4916* Run `gn args` and add `enable_ipc_fuzzer = true` to your args.gn.
andybonsad92aa32015-08-31 02:27:4417* build `ipc_fuzzer_all` target
18* component builds are currently broken, sorry
19* Debug builds are broken; only Release mode works.
andybons3322f762015-08-24 21:37:0920
andybonsad92aa32015-08-31 02:27:4421### Replaying ipcdumps
andybons3322f762015-08-24 21:37:0922
andybonsad92aa32015-08-31 02:27:4423* `tools/ipc_fuzzer/scripts/play_testcase.py path/to/testcase.ipcdump`
24* more help: `tools/ipc_fuzzer/scripts/play_testcase.py -h`
andybons3322f762015-08-24 21:37:0925
andybonsad92aa32015-08-31 02:27:4426### Listing messages in ipcdump
andybons3322f762015-08-24 21:37:0927
andybonsad92aa32015-08-31 02:27:4428* `out/<Build>/ipc_message_util --dump path/to/testcase.ipcdump`
andybons3322f762015-08-24 21:37:0929
andybonsad92aa32015-08-31 02:27:4430### Updating fuzzers in ClusterFuzz
andybons3322f762015-08-24 21:37:0931
andybonsad92aa32015-08-31 02:27:4432* `tools/ipc_fuzzer/scripts/cf_package_builder.py`
33* upload `ipc_fuzzer_mut.zip` and `ipc_fuzzer_gen.zip` under build directory
34 to ClusterFuzz
andybons3322f762015-08-24 21:37:0935
andybonsad92aa32015-08-31 02:27:4436### Contributing FuzzTraits
andybons3322f762015-08-24 21:37:0937
andybonsad92aa32015-08-31 02:27:4438* add them to `tools/ipc_fuzzer/fuzzer/fuzzer.cc`
39* thanks!
andybons3322f762015-08-24 21:37:0940
andybonsad92aa32015-08-31 02:27:4441## Components
andybons3322f762015-08-24 21:37:0942
andybonsad92aa32015-08-31 02:27:4443### ipcdump logger
andybons3322f762015-08-24 21:37:0944
Daniel Bratellf73f0df2018-09-24 13:52:4945* add `enable_ipc_fuzzer = true` to `args.gn`
andybonsad92aa32015-08-31 02:27:4446* build `chrome` and `ipc_message_dump` targets
47* run chrome with
48 `--no-sandbox --ipc-dump-directory=/path/to/ipcdump/directory`
49* ipcdumps will be created in this directory for each renderer using the
50 format `_pid_.ipcdump`
andybons3322f762015-08-24 21:37:0951
andybonsad92aa32015-08-31 02:27:4452### ipcdump replay
andybons3322f762015-08-24 21:37:0953
andybonsad92aa32015-08-31 02:27:4454Lives under `ipc_fuzzer/replay`. The renderer is replaced with
55`ipc_fuzzer_replay` using `--renderer-cmd-prefix`. This is done automatically
56with the `ipc_fuzzer/play_testcase.py` convenience script.
57
58### ipcdump mutator / generator
59
60Lives under `ipc_fuzzer/fuzzer`. This is the code that runs on ClusterFuzz. It
61uses `FuzzTraits<Type>` to mutate ipcdumps or generate them out of thin air.
62
63## Problems, questions, suggestions
64
65Send them to mbarbella@chromium.org.