Fuzzing File Systems via Two-Dimensional Input Space Exploration

Wen Xu, Hyungon Moon, Sanidhya Kashyap, Po-Ning Tseng, Taesoo Kim

Abstract

File systems are critical kernel components whose complexity makes them prone to bugs. Traditional fuzzers struggle with large disk images, context-dependent syscalls, and "OS aging" that hinders reproducibility. This paper presents JANUS, a first-of-its-kind feedback-driven fuzzer that explores a two-dimensional input space: disk image metadata and context-aware system calls. By utilizing a Library OS (LKL) for rapid, clean-slate execution, JANUS discovered 90 bugs in the Linux kernel, including 32 CVEs, while achieving significantly higher code coverage and reproducibility than state-of-the-art tools.

Introduction

File systems are the bedrock of data integrity, yet their implementation is massive and complex—Btrfs alone contains approximately 130,000 lines of code. Fuzzing these systems effectively presents three major challenges:

  1. The "Large Blob" Problem: Disk images are often 100MB or larger. Randomly mutating such large binaries is computationally expensive and statistically unlikely to hit critical metadata structures.
  2. Context-Awareness: System calls are highly dependent on the disk state. Executing a rename() on a non-existent file terminates the execution path prematurely, wasting fuzzing resources.
  3. OS Aging and Reproducibility: Running thousands of syscalls on a single Virtual Machine (VM) instance leads to "dirty" kernel states. Crashes may result from cumulative side effects rather than the final syscall, making bugs nearly impossible to reproduce.

Methodology: Two-Dimensional Exploration

JANUS addresses these challenges by treating file system fuzzing as a two-dimensional exploration problem involving the image dimension (static disk state) and the operation dimension (syscall sequences).

The JANUS architecture showing the feedback loop between the image mutator, syscall fuzzer, and libOS executor.

Metadata-only Mutation

Rather than fuzzing the entire disk image, JANUS uses file-system-specific parsers to identify and mutate only metadata blocks, which typically comprise only ~1% of the image. It also recalculates checksums to ensure the kernel does not reject the mutated image during mounting.

Layout of a file system image highlighting the specific metadata structures targeted for mutation.

Image-Directed Syscall Fuzzing

To maintain context, JANUS probes the mutated image to identify existing files and directories. It uses this information to generate meaningful syscall sequences, such as targeting rmdir() only at actual directories found on the disk.

Library OS (LKL) Executor

JANUS replaces heavy VMs with the Linux Kernel Library (LKL). This allows the kernel to run as a user-space library. JANUS can "reboot" the kernel by forking a new process, providing a clean-slate OS state in roughly 10ms—orders of magnitude faster than traditional VM reboots (~14s) or snapshot reverts (~1.4s).

Evaluation and Results

The researchers evaluated JANUS against eight Linux file systems, including mainstream (ext4, XFS, Btrfs, F2FS) and legacy/specialized (GFS2, HFS+, ReiserFS, VFAT) systems. JANUS was compared against Syzkaller, the industry-standard kernel fuzzer.

Bug Discovery and Coverage

JANUS found 90 unique bugs in the upstream Linux kernel, resulting in 32 assigned CVEs. In head-to-head tests, JANUS achieved vastly superior code coverage, visiting 4.19x more code paths in Btrfs and 2.01x more in ext4 compared to Syzkaller over a 12-hour period.

Stability and Efficiency

A key breakthrough was solving the reproducibility crisis. JANUS reproduced 88–100% of its found crashes because it starts every test case with a fresh kernel state. In contrast, Syzkaller failed to reproduce any crashes found during the same period due to the OS aging issue.

Conclusion

JANUS demonstrates that synergistic exploration of disk images and syscall sequences is essential for effective file system fuzzing. By focusing on metadata and leveraging a Library OS for rapid resets, JANUS significantly improves bug discovery and reproducibility. Future work includes extending support to FUSE drivers and improving automated Proof of Concept (PoC) minimization through advanced taint tracking.

Summary updated

Abstract

File systems, a basic building block of an OS, are too big and too complex to be bug free. Nevertheless, file systems rely on regular stress-testing tools and formal checkers to find bugs, which are limited due to the ever-increasing complexity of both file systems and OSes. Thus, fuzzing, proven to be an effective and a practical approach, becomes a preferable choice, as it does not need much knowledge about a target. However, three main challenges exist in fuzzing file systems: mutating a large image blob that degrades overall performance, generating image-dependent file operations, and reproducing found bugs, which is difficult for existing OS fuzzers. Hence, we present JANUS, the first feedback-driven fuzzer that explores the two-dimensional input space of a file system, i.e., mutating metadata on a large image, while emitting image-directed file operations. In addition, JANUS relies on a library OS rather than on traditional VMs for fuzzing, which enables JANUS to load a fresh copy of the OS, thereby leading to better reproducibility of bugs. We evaluate JANUS on eight file systems and found 90 bugs in the upstream Linux kernel, 62 of which have been acknowledged. Forty-three bugs have been fixed with 32 CVEs assigned. In addition, JANUS achieves higher code coverage on all the file systems after fuzzing 12 hours, when compared with the state-of-the-art fuzzer Syzkaller for fuzzing file systems. JANUS visits 4.19x and 2.01x more code paths in Btrfs and ext4, respectively. Moreover, JANUS is able to reproduce 88-100% of the crashes, while Syzkaller fails on all of them.
BibTeX
@inproceedings{xu2019fuzzing,
  author = {Wen Xu and Hyungon Moon and Sanidhya Kashyap and Po-Ning Tseng and Taesoo Kim},
  title = {{Fuzzing File Systems via Two-Dimensional Input Space Exploration}},
  booktitle = {IEEE Symposium on Security and Privacy},
  year = {2019},
  doi = {10.1109/sp.2019.00035},
}
Figure