Repository navigation
74 lines (71 loc) · 2.83 KB
/
Copy pathfuzz.yml
File metadata and controls
74 lines (71 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: fuzz
# Nightly libFuzzer run on the remote-facing decode surface (OSTIF audit
# T-13, G-001): the framed wire protocol `sc serve` parses from untrusted
# peers, its body decoders, canonical object decoding, pack/index decoding,
# bucket WAL metadata, HTTP openings, and the pin and token file parsers.
# One matrix job per target. Runs on a
# schedule, never as a PR gate — nightly + sanitizers don't belong in the
# merge path. A crash uploads its reproducer input as an artifact.
on:
schedule:
# Nightly, before the 06:23 audit run.
- cron: "17 3 * * *"
# Build + short run when the fuzz surface itself changes, so a broken
# harness is caught in the PR that breaks it (not a required check).
pull_request:
paths:
- "fuzz/**"
- ".github/workflows/fuzz.yml"
workflow_dispatch:
permissions:
contents: read
jobs:
fuzz:
name: cargo fuzz (${{ matrix.target }})
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
target:
- wire_decode
- pack_decode
- pack_stream
- walfmt_decode
- http_opening
- text_files
include:
# libFuzzer's default max_len (4096 on an empty corpus) cannot reach
# the 8 KiB opening cap.
- target: http_opening
args: -max_len=8192
env:
# The repo-root rust-toolchain.toml pins stable 1.96.1 and overrides the
# installed rustup default; libFuzzer needs nightly, and this env var
# outranks the toolchain file.
RUSTUP_TOOLCHAIN: nightly
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# dtolnay/rust-toolchain encodes the toolchain in the tag the SHA pins
# (there is no `toolchain` input at these commits) — this is the
# `nightly` tag's commit.
- uses: dtolnay/rust-toolchain@4fd1da8b0805d2d2e936788875a7d65dbd677dc2 # nightly
- uses: Swatinem/rust-cache@eedcf2fb1c22f010a0eb66b92f378c110977f266 # v2
with:
workspaces: fuzz
- name: install cargo-fuzz
run: cargo install cargo-fuzz --locked
- name: build fuzz target
run: cargo fuzz build ${{ matrix.target }}
- name: fuzz for 10 minutes
# rss_limit above MAX_OBJECT_SIZE-sized legitimate allocations so the
# documented frame-length pre-allocation (ADR-0039 deferred item)
# doesn't false-positive; a real runaway still trips it.
run: cargo fuzz run ${{ matrix.target }} -- -max_total_time=600 -rss_limit_mb=4096 ${{ matrix.args }}
- name: upload crash reproducers
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: fuzz-artifacts-${{ matrix.target }}
path: fuzz/artifacts/
if-no-files-found: ignore