Fuzzing Crash: Overflow in file_corruption

Open
#12,603 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
58/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
databases

Research direction

Start with encodings/datetime-parts/src/canonical.rs, especially decode_to_temporal and combine_parts around the reported overflow at line 159. Reproduce it with the supplied crash artifact using the file_corruption fuzz target and the listed cargo command. Done means the corrupted input no longer causes an overflow crash while decoding.

Written by the indexing model from the issue text.

Description

bug fuzzer

Target crashed at encodings/datetime-parts/src/canonical.rs:159:decode_to_temporal:

attempt to multiply with overflow
Stack trace
stack backtrace:
   1: core::panicking::panic_fmt
             at /rustc/8eb778d04094d3af4b26580cab327e0413eb1e02/library/core/src/panicking.rs:80:14
   2: core::panicking::panic_const::panic_const_mul_overflow
             at /rustc/8eb778d04094d3af4b26580cab327e0413eb1e02/library/core/src/panicking.rs:175:17
   3: {closure#0}<i32, &[i32], &[i32]>
             at ./encodings/datetime-parts/src/canonical.rs:159:13
   4: chunk<vortex_compute::lane_kernels::source::LaneZip<vortex_compute::lane_kernels::source::LaneZip<&[i32], &[i32]>, &[i32]>, i64, vortex_datetime_parts::canonical::combine_parts::{closure_env#0}<i32, &[i32], &[i32]>>
             at ./vortex-compute/src/lane_kernels/map_into.rs:196:59
   5: map_into<vortex_compute::lane_kernels::source::LaneZip<vortex_compute::lane_kernels::source::LaneZip<&[i32], &[i32]>, &[i32]>, i64, vortex_datetime_parts::canonical::combine_parts::{closure_env#0}<i32, &[i32], &[i32]>>
   6: combine_parts<i32, &[i32], &[i32]>
             at ./encodings/datetime-parts/src/canonical.rs:156:59
   7: decode_to_temporal
             at ./encodings/datetime-parts/src/canonical.rs:93:74
   8: execute
             at ./encodings/datetime-parts/src/array/mod.rs:170:13
   9: execute_encoding<vortex_datetime_parts::array::DateTimeParts>
             at ./vortex-array/src/array/mod.rs:287:5
  10: execute_encoding_unchecked
             at ./vortex-array/src/array/erased.rs:757:9
  11: execute_until<vortex_array::canonical::AnyCanonical>
             at ./vortex-array/src/executor/mod.rs:457:40
  12: execute
             at ./vortex-array/src/canonical.rs:576:28
  13: execute<vortex_array::canonical::Canonical>
             at ./vortex-array/src/executor/mod.rs:111:9
  14: execute
             at ./vortex-array/src/canonical.rs:785:21
  15: execute<vortex_array::canonical::RecursiveCanonical>
             at ./vortex-array/src/executor/mod.rs:111:9
  16: read_corrupted
             at ./fuzz/fuzz_targets/file_corruption.rs:22:33
  17: read_corruption_sets
             at ./fuzz/corruption.rs:244:9
  18: run_prepared_corruption
             at ./fuzz/corruption.rs:215:5
  19: rust_fuzzer_test_input
             at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libfuzzer-sys-0.4.13/src/lib.rs:276:60
  20: {closure#0}
             at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libfuzzer-sys-0.4.13/src/lib.rs:62:9
... (22 more frames truncated)

Harness output:

corruption 1176 layout ^= 0x6c
corruption 1327 statistics ^= 0x03
corruption 31 data_segment[0] ^= 0xbb
corruption 1292 statistics ^= 0x2f

To reproduce, download the crash artifact to ~/Downloads and run these
commands from the repository root:

unzip ~/Downloads/file_corruption-crash-artifacts.zip -d fuzz-artifacts
curl -fsSL \
  https://ci.vortex.dev/file_corruption_files.tar.zst | tar --zstd -x
RUST_BACKTRACE=1 cargo +nightly fuzz run -D --sanitizer=none \
  file_corruption \
  fuzz-artifacts/file_corruption/crash-2f7c253874b41fd4170a424304285a4b7750e091 \
  -- -rss_limit_mb=0 --corruption-files=fuzz/corruption_files

Auto-created by fuzzing workflow

Dominant language
Rust
Stars
3.2k
Forks
239
Avg merge
1d 4h
Merged PRs (30d)
684

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vortex-data/vortex

All issues in vortex-data/vortex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.