Skip to main content
QUICK REVIEW

[Paper Review] Binary-Compatible Verification of Filesystems with ACL2

Mehta, Mihir Parang, Cook, William R.|arXiv (Cornell University)|Oct 5, 2018
Advanced Data Storage TechnologiesComputer Science15 references7 citations
TL;DR

This paper introduces Bounded Black-Box Crash Testing (B3), a novel black-box approach to verifying file-system crash consistency by exhaustively generating bounded workloads of file operations with crashes after fsync() calls. The method, implemented via tools CRASHMONKEY and ACE, identifies 24 of 26 known crash-consistency bugs and discovers 10 new critical bugs in widely used Linux file systems, including data loss and atomicity violations, even in a formally verified file system, FSCQ.

ABSTRACT

Filesystems are an essential component of most computer systems. Work on the verification of filesystem functionality has been focused on constructing new filesystems in a manner which simplifies the process of verifying them against specifications. This leaves open the question of whether filesystems already in use are correct at the binary level. This paper introduces LoFAT, a model of the FAT32 filesystem which efficiently implements a subset of the POSIX filesystem operations, and HiFAT, a more abstract model of FAT32 which is simpler to reason about. LoFAT is proved to be correct in terms of refinement of HiFAT, and made executable by enabling the state of the model to be written to and read from FAT32 disk images. EqFAT, an equivalence relation for disk images, considers whether two disk images contain the same directory tree modulo reordering of files and implementation-level details regarding cluster allocation. A suite of co-simulation tests uses EqFAT to compare the operation of existing FAT32 implementations to LoFAT and check the correctness of existing implementations of FAT32 such as the mtools suite of programs and the Linux FAT32 implementation. All models and proofs are formalized and mechanically verified in ACL2.

Motivation & Objective

  • To address the lack of proactive crash-consistency testing in widely used Linux file systems like ext4, xfs, btrfs, and F2FS.
  • To identify systematic patterns in crash-consistency bugs reported over the past five years to enable automated, bounded testing.
  • To design and implement a scalable, black-box testing framework that does not require source code modification or formal verification.
  • To discover previously unknown crash-consistency bugs in mature, production-grade file systems, including in a verified file system.

Proposed method

  • B3 bounds the infinite space of possible workloads by restricting the number of file operations, the use of only fsync(), fdatasync(), or sync as persistence points, and the initial state to a new, empty file system.
  • CRASHMONKEY simulates power-loss crashes after each persistence point by replaying I/O operations and capturing crash states, then checks if persisted data survives and remains correct after recovery.
  • ACE automatically generates all valid workloads within user-specified bounds, including file operations with arguments, persistence points, and dependency-preserving sequences.
  • The framework uses fine-grained checks in CRASHMONKEY to validate file and metadata consistency post-recovery without modifying the target file system.
  • The approach is applied to ext4, xfs, btrfs, F2FS, and FSCQ, with tools deployed to test both existing and new bugs.

Experimental results

Research questions

  • RQ1What common patterns underlie crash-consistency bugs in widely used Linux file systems over the past five years?
  • RQ2Can crash-consistency bugs be systematically discovered using bounded, black-box testing with minimal assumptions?
  • RQ3Can automated tools based on this approach find both known and previously undetected crash-consistency bugs in mature file systems?
  • RQ4To what extent can this method detect bugs in formally verified file systems, indicating potential flaws in the verification stack?

Key findings

  • CRASHMONKEY and ACE successfully reproduced 24 out of 26 previously reported crash-consistency bugs across seven kernel versions and three file systems (ext4, xfs, btrfs).
  • The tools discovered 10 new crash-consistency bugs in widely used Linux file systems, including severe issues like broken rename atomicity and data loss after fsync().
  • Seven of the 10 new bugs in btrfs and F2FS had existed in the kernel since 2014, indicating long-standing undetected flaws.
  • The tools also found a data loss bug in FSCQ, a formally verified file system, demonstrating that verification gaps in components can compromise correctness.
  • Five of the 10 new bugs were already patched by developers, with the remaining seven under active fix development.
  • The study revealed that 96% of crash-consistency bugs (25/26) could be triggered by workloads of three or fewer operations on a newly created file system, with crashes occurring immediately after fsync() calls.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.