Skip to content

Commit 9e9200a

Browse files
committed
security: add bounded decoder fuzzing
1 parent 7bffe2a commit 9e9200a

167 files changed

Lines changed: 33679 additions & 30 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/fuzz.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: ASan fuzz + 32-bit corpus/property
2+
3+
on:
4+
pull_request:
5+
schedule:
6+
- cron: "23 4 * * 1"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
asan-fuzz:
14+
name: ASan libFuzzer x86_64 / ${{ matrix.target.name }}
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 15
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
target:
21+
- name: codec_decoders
22+
dictionary: fuzz/dictionaries/binary.dict
23+
- name: columnar_segment
24+
dictionary: fuzz/dictionaries/binary.dict
25+
- name: strict_tuple
26+
dictionary: fuzz/dictionaries/binary.dict
27+
- name: wal_readers
28+
dictionary: fuzz/dictionaries/binary.dict
29+
- name: msgpack_document
30+
dictionary: fuzz/dictionaries/binary.dict
31+
- name: sql_preprocess
32+
dictionary: fuzz/dictionaries/sql.dict
33+
steps:
34+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35+
- uses: dtolnay/rust-toolchain@4fd1da8b0805d2d2e936788875a7d65dbd677dc2
36+
with:
37+
toolchain: nightly
38+
- name: Install cargo-fuzz
39+
run: cargo install cargo-fuzz --locked
40+
- name: Run bounded ASan fuzzing
41+
run: |
42+
cargo fuzz run --sanitizer address --target x86_64-unknown-linux-gnu "${{ matrix.target.name }}" -- \
43+
-max_total_time=60 -runs=0 -max_len=1048576 -timeout=10 \
44+
-rss_limit_mb=2048 -dict="${{ matrix.target.dictionary }}"
45+
- name: Upload crash artifacts
46+
if: always()
47+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
48+
with:
49+
name: fuzz-crashes-x86_64-${{ matrix.target.name }}
50+
path: fuzz/artifacts/${{ matrix.target.name }}
51+
if-no-files-found: ignore
52+
53+
corpus-properties-32:
54+
name: 32-bit i686 deterministic corpus/property (no ASan, no libFuzzer)
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 15
57+
env:
58+
DEBIAN_FRONTEND: noninteractive
59+
NEEDRESTART_MODE: a
60+
steps:
61+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
62+
- name: Install i686 runtime dependencies
63+
run: |
64+
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a dpkg --add-architecture i386
65+
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get update
66+
sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install -y gcc-multilib g++-multilib libc6-dev-i386 libc6-i386 libgcc-s1:i386 libstdc++6:i386
67+
- uses: dtolnay/rust-toolchain@4fd1da8b0805d2d2e936788875a7d65dbd677dc2
68+
with:
69+
toolchain: nightly
70+
targets: i686-unknown-linux-gnu
71+
- name: Run deterministic 32-bit corpus/property checks
72+
run: cargo run --manifest-path fuzz/Cargo.toml --no-default-features --features i686-corpus --bin corpus_properties_32 --target i686-unknown-linux-gnu

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Rust build artifacts
22
/target/
3+
/fuzz/target/
4+
/fuzz/artifacts/
35
/releases/
46

57
# Data directories (fallback default or manual testing)

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)