Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,42 @@ jobs:
gh_token: ${{ secrets.GITHUB_TOKEN }}
incident_io_alert_token: ${{ secrets.INCIDENT_IO_ALERT_TOKEN }}

# ============================================================================
# Row Encoding Fuzzer
# ============================================================================
row_encode_fuzz:
name: "Row Encoding Fuzz"
uses: ./.github/workflows/run-fuzzer.yml
with:
fuzz_target: row_encode
jobs: 4
secrets:
R2_FUZZ_ACCESS_KEY_ID: ${{ secrets.R2_FUZZ_ACCESS_KEY_ID }}
R2_FUZZ_SECRET_ACCESS_KEY: ${{ secrets.R2_FUZZ_SECRET_ACCESS_KEY }}

report-row-encode-fuzz-failures:
name: "Report Row Encoding Fuzz Failures"
needs: row_encode_fuzz
if: always() && needs.row_encode_fuzz.outputs.crashes_found == 'true'
permissions:
issues: write
contents: read
id-token: write
pull-requests: read
uses: ./.github/workflows/report-fuzz-crash.yml
with:
fuzz_target: row_encode
crash_file: ${{ needs.row_encode_fuzz.outputs.first_crash_name }}
artifact_url: ${{ needs.row_encode_fuzz.outputs.artifact_url }}
artifact_name: row_encode-crash-artifacts
logs_artifact_name: row_encode-logs
branch: ${{ github.ref_name }}
commit: ${{ github.sha }}
secrets:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
gh_token: ${{ secrets.GITHUB_TOKEN }}
incident_io_alert_token: ${{ secrets.INCIDENT_IO_ALERT_TOKEN }}

# ============================================================================
# Compress Roundtrip Fuzzer
# ============================================================================
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ vortex-error = { workspace = true }
vortex-fsst = { workspace = true, features = ["_test-harness"] }
vortex-io = { workspace = true }
vortex-mask = { workspace = true }
vortex-row = { workspace = true }
vortex-runend = { workspace = true, features = ["arbitrary"] }
vortex-session = { workspace = true }
vortex-utils = { workspace = true }
Expand Down Expand Up @@ -104,3 +105,11 @@ name = "compress_gpu"
path = "fuzz_targets/compress_gpu.rs"
test = false
required-features = ["native", "cuda"]

[[bin]]
bench = false
doc = false
name = "row_encode"
path = "fuzz_targets/row_encode.rs"
test = false
required-features = ["native"]
35 changes: 35 additions & 0 deletions fuzz/fuzz_targets/row_encode.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Copyright the Vortex contributors

#![no_main]
#![expect(clippy::unwrap_used)]

use std::str::FromStr;

use libfuzzer_sys::Corpus;
use libfuzzer_sys::fuzz_target;
use tracing::level_filters::LevelFilter;
use vortex_error::vortex_panic;
use vortex_fuzz::FuzzRowEncode;
use vortex_fuzz::run_row_encode;

fuzz_target!(
init: {
let fmt = tracing_subscriber::fmt::format()
.with_ansi(false) // Colour output is messed up in raw logs
.without_time() // We run fuzzer in CI which prepends timestamps
.compact();
let level = std::env::var("RUST_LOG").map(
|v| LevelFilter::from_str(v.as_str()).unwrap()).unwrap_or(LevelFilter::INFO);
tracing_subscriber::fmt()
.event_format(fmt)
.with_max_level(level)
.init();
},
|input: FuzzRowEncode| -> Corpus {
match run_row_encode(input) {
Ok(true) => Corpus::Keep,
Ok(false) => Corpus::Reject,
Err(e) => vortex_panic!("{e}"),
}
});
3 changes: 3 additions & 0 deletions fuzz/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mod array;
pub mod compress;
pub mod error;
pub mod fsst_like;
mod row;

// File module only available for native builds (requires vortex-file which uses tokio)
#[cfg(not(target_arch = "wasm32"))]
Expand All @@ -31,6 +32,8 @@ pub use fsst_like::run_fsst_like_fuzz;
pub use gpu::FuzzCompressGpu;
#[cfg(feature = "cuda")]
pub use gpu::run_compress_gpu;
pub use row::FuzzRowEncode;
pub use row::run_row_encode;

pub const FUZZ_ARRAY_MAX_LEN: usize = 2048;
pub const FUZZ_FILE_ARRAY_MAX_LEN: usize = 16_384;
Expand Down
Loading
Loading