Roll src/third_party/WebKit 0c3f21f:4f9ce20 (svn 202223:202224)
[chromium-blink-merge.git] / docs / ipc_fuzzer.md
blob0ab9ce9f150dc161883015e6d245286ebb0c15de
1 # IPC Fuzzer
3 A chromium IPC fuzzer is under development by aedla and tsepez. The fuzzer lives
4 under `src/tools/ipc_fuzzer/` and is running on ClusterFuzz. A previous version
5 of the fuzzer was a simple bitflipper, which caught around 10 bugs. A new
6 version is doing smarter mutations and generational fuzzing. To do so, each
7 `ParamTraits<Type>` needs a corresponding `FuzzTraits<Type>`. Feel free to
8 contribute.
10 [TOC]
12 ## Working with the fuzzer
14 ### Build instructions
16 *   add `enable_ipc_fuzzer=1` to `GYP_DEFINES`
17 *   build `ipc_fuzzer_all` target
18 *   component builds are currently broken, sorry
19 *   Debug builds are broken; only Release mode works.
21 ### Replaying ipcdumps
23 *   `tools/ipc_fuzzer/scripts/play_testcase.py path/to/testcase.ipcdump`
24 *   more help: `tools/ipc_fuzzer/scripts/play_testcase.py -h`
26 ### Listing messages in ipcdump
28 *   `out/<Build>/ipc_message_util --dump path/to/testcase.ipcdump`
30 ### Updating fuzzers in ClusterFuzz
32 *   `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
36 ### Contributing FuzzTraits
38 *   add them to `tools/ipc_fuzzer/fuzzer/fuzzer.cc`
39 *   thanks!
41 ## Components
43 ### ipcdump logger
45 *   add `enable_ipc_fuzzer=1` to `GYP_DEFINES`
46 *   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`
52 ### ipcdump replay
54 Lives under `ipc_fuzzer/replay`. The renderer is replaced with
55 `ipc_fuzzer_replay` using `--renderer-cmd-prefix`. This is done automatically
56 with the `ipc_fuzzer/play_testcase.py` convenience script.
58 ### ipcdump mutator / generator
60 Lives under `ipc_fuzzer/fuzzer`. This is the code that runs on ClusterFuzz. It
61 uses `FuzzTraits<Type>` to mutate ipcdumps or generate them out of thin air.
63 ## Problems, questions, suggestions
65 Send them to mbarbella@chromium.org.