Skip to content

Commit 2010ab0

Browse files
tmlemanlgirdwood
authored andcommitted
workflows: fuzzer: generate and use the IPC dictionary
Generate the IPC3 / IPC4 libFuzzer dictionary on the fly from the in-tree headers and pass it to fuzz.sh through the new -d option, so the CI fuzzing job benefits from dictionary-guided mutation without committing a generated file to the tree. The dictionary is written to $RUNNER_TEMP, which is provisioned and cleaned up by the runner and lives outside the checkout, so nothing is committed. The generation step is best-effort (continue-on-error): if the generator ever breaks, the job still fuzzes without the dictionary rather than failing, and fuzz.sh -d tolerates the missing file. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent 7d244bf commit 2010ab0

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

.github/workflows/ipc_fuzzer.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ jobs:
7575
west init -l
7676
west update --narrow --fetch-opt=--filter=tree:0
7777
78+
- name: generate IPC dictionary
79+
# A generator failure (e.g. after a header rename) must not break
80+
# fuzzing: the step is best-effort and fuzz.sh runs without the
81+
# dictionary when the file is missing or empty (see -d below).
82+
continue-on-error: true
83+
run: |
84+
cd workspace
85+
python3 sof/scripts/gen_fuzz_ipc${{ matrix.IPC }}_dict.py \
86+
-o "$RUNNER_TEMP/ipc${{ matrix.IPC }}.dict"
87+
7888
- name: build and run fuzzer for a few minutes
7989
run: |
8090
cd workspace
@@ -83,7 +93,8 @@ jobs:
8393
duration="${{inputs.fuzzing_duration_s}}"
8494
duration="${duration:-301}" # pull_request has not 'inputs.' :-(
8595
# Note libFuzzer makes a difference between -jobs and -workers (capped at nproc/2)
86-
sof/scripts/fuzz.sh -i '${{ matrix.IPC }}' -o fuzz-stdout.txt -t "$duration" -j"$(nproc)"
96+
sof/scripts/fuzz.sh -i '${{ matrix.IPC }}' -o fuzz-stdout.txt -t "$duration" \
97+
-j"$(nproc)" -d "$RUNNER_TEMP/ipc${{ matrix.IPC }}.dict"
8798
8899
- name: Upload stdout
89100
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)