Skip to content

test: add synthetic NTFS record fixtures, sanitizers, and parser fuzzing - #1

Merged
daniyusk merged 2 commits into
mainfrom
test/ntfs-parser-hardening
Aug 27, 2026
Merged

daniyusk merged 2 commits into
mainfrom
test/ntfs-parser-hardening

Conversation

@daniyusk

Copy link
Copy Markdown
Owner

Summary

Adds synthetic NTFS test fixtures, parser hardening, ASan/UBSan CI integration, and an opt-in libFuzzer target for MftRecordParser.

Changes

  • Synthetic fixtures infrastructure (tests/NtfsFixtures.hpp, tests/NtfsFixtures.cpp):
    • Valid and truncated FILE records.
    • Valid and corrupt update sequence array (USA) fixups.
    • Resident and non-resident data attributes.
    • Positive, negative, and sparse data runs with arithmetic encoding.
    • Malformed attribute offsets and sizes.
    • UTF-16 records with unpaired surrogates.
    • Sanitized filename collision fixtures.
  • Parser regressions and hardening:
    • Added arithmetic overflow protection (checked_add) in src/MftRecord.cpp.
    • Added invalid UTF-16 surrogate handling with U+FFFD replacement in src/Utf.cpp.
    • Regression suite covering bounds, truncation, overflow, and corruption (tests/MftRecordParserTests.cpp).
  • Sanitizers and fuzzing:
    • CMake options JUSTGIVEMYDISK_ENABLE_SANITIZERS and JUSTGIVEMYDISK_BUILD_FUZZER (disabled by default in normal builds).
    • GitHub Actions CI workflow running CTest under ASan + UBSan and bounded libFuzzer smoke execution (.github/workflows/ntfs-parser-hardening.yml).
    • Target MftRecordParserFuzz exercising raw byte input and mutated structured record skeletons (tests/fuzz/MftRecordParserFuzz.cpp).

@daniyusk
daniyusk marked this pull request as ready for review August 27, 2026 08:02
@daniyusk
daniyusk merged commit 03a661f into main Aug 27, 2026
2 checks passed
@daniyusk
daniyusk deleted the test/ntfs-parser-hardening branch August 27, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant