{
  "slug": "dm-verity",
  "term": "dm-verity",
  "aliases": [],
  "definition": "dm-verity is a Linux device-mapper target that verifies a read-only block mapping against a trusted cryptographic root hash.",
  "note": "The root hash must come from a trusted source; ordinary block checking does not authenticate that source. Optional forward-error correction can recover some damaged data, but recovered bytes must still pass hash verification. [dm-verity-source]\n\nThe device-mapper status character V reports that checks performed so far succeeded; it does not establish that every block was read. C reports detected corruption. Monitoring must retain the mapping options, because ignore_corruption permits access despite a detected mismatch, while check_at_most_once limits data verification to the first read and does not protect against subsequent online changes. [dm-verity-source]\n\nWith ignore_zero_blocks, ranges identified by the expected zero-block digest return zeros without verification of the underlying data. Successful reads do not certify those backing bytes. [dm-verity-source]\n\nA hash block holds as many digests as fit, so SHA-256 with 4,096-byte blocks gives 128 per block, and 32,768 data blocks need 256 + 2 + 1 = 259 hash blocks, 0.79% of the data. Blocks whose hash block was already verified are checked without walking the tree again. [dm-verity-source] [vtcode]\n\nA study of hash trees on fast storage measured a writable binary tree losing about 60% of write-heavy throughput at 16 MB and 75% at 4 TB, while reads stayed cheap because the hash cache hit rate exceeded 99%. [burke]",
  "status": "shipping",
  "advantages": [
    {
      "text": "Read-only block verification can authenticate accessed data against a trusted root without reading the whole volume in advance.",
      "citationIds": [
        "dm-verity-source"
      ]
    },
    {
      "text": "A pkcs7 signature of the root hash can be checked against a kernel keyring when the kernel is built with that option.",
      "citationIds": [
        "dm-verity-source"
      ]
    }
  ],
  "limitations": [
    {
      "text": "ignore_corruption permits reads after detected corruption; check_at_most_once reduces protection against online changes.",
      "citationIds": [
        "dm-verity-source"
      ]
    },
    {
      "text": "The kernel ignores the on-disk header, so user space has to verify it or pass the parameters on a verified command line.",
      "citationIds": [
        "dm-verity-source"
      ]
    }
  ],
  "related": [
    "merkle-tree",
    "fs-verity",
    "dm-integrity",
    "rollback-protection",
    "dynamic-merkle-tree",
    "hash-collision",
    "erofs",
    "squashfs"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "dm-verity-source",
      "title": "Linux v6.12 documentation: dm-verity, parameters, failure policies and hash-tree format",
      "url": "https://docs.kernel.org/6.12/admin-guide/device-mapper/verity.html",
      "accessed": "2026-10-18"
    },
    {
      "id": "hesela-integrity",
      "title": "Hesela: Why a valid checksum can still return the wrong data",
      "url": "https://hesela.com/analyses/checksums-identity-and-lost-writes/#verity-read-coverage",
      "accessed": "2026-10-18"
    },
    {
      "id": "vtcode",
      "title": "Linux v6.12 drivers/md/dm-verity-target.c: tree levels, verification order, corruption modes.",
      "url": "https://github.com/torvalds/linux/blob/v6.12/drivers/md/dm-verity-target.c",
      "accessed": "2026-10-16"
    },
    {
      "id": "burke",
      "title": "Burke, Sheatsley, King, Hines, Swift, McDaniel. On Scalable Integrity Checking for Secure Cloud Disks. USENIX FAST 2025 (arXiv 2405.03830).",
      "url": "https://arxiv.org/pdf/2405.03830",
      "accessed": "2026-10-16"
    }
  ],
  "updated": "2026-10-22",
  "provenance": [
    "The kernel documentation and code are project material for v6.12; newer kernels may differ.",
    "The hash-tree cost study is a university paper that measured a writable binary tree in its own block-device driver on fast local storage, not the kernel target, so it shows hash-tree cost under writes rather than dm-verity cost on a read-only system.",
    "The 60% and 75% losses are for a write-heavy example with a 1% read ratio against an encryption-only baseline; no independent measurement of the kernel target read overhead was found.",
    "Arithmetic from the documentation example: 4,096 / 32 = 128 digests per block; 32,768 / 128 = 256, then 2, then 1, so 259 hash blocks, 0.79% of the data."
  ]
}
