{
  "slug": "dm-integrity",
  "term": "dm-integrity",
  "aliases": [],
  "definition": "dm-integrity is a Linux device-mapper target that stores per-block integrity tags and can generate and verify them when configured with an internal hash.",
  "note": "An upper layer supplying the tags is responsible for checking them; an internal CRC or HMAC has a different threat model. [dm-integrity-source] In authenticated dm-crypt configurations, dm-crypt generates and checks the tags while dm-integrity provides their storage. This does not make every dm-integrity configuration authenticated or encrypted. [dm-crypt-source] Bitmap mode can miss corruption coincident with a crash because dirty-region tags are regenerated. [integritysetup-source] Recovery mode bypasses checking rather than verifying a read-only view. [dm-integrity-source] Journal MAC checks journal addressing; internal-hash replay checks block tags. Superblock read verification requires the configured journal MAC and persisted fixed-HMAC flag, outside recovery mode; a CRC is not adversarial authentication. [integrity-code]",
  "status": "shipping",
  "advantages": [],
  "limitations": [
    {
      "text": "Journaled mode couples data and tag updates; direct mode can leave mismatches after a crash. This is not application-level transaction atomicity.",
      "citationIds": [
        "dm-integrity-source"
      ]
    },
    {
      "text": "Internal hashing does not itself authenticate the superblock. The Linux v6.12 recalculation guard distinguishes data keys, journal keys and the fixed-HMAC format; the legacy override bypasses this guard. Recalculation is not authentication of earlier contents.",
      "citationIds": [
        "integrity-code",
        "integrity-fix"
      ]
    }
  ],
  "related": [
    "checksum",
    "dm-verity",
    "fs-verity",
    "crash-consistency",
    "dm-crypt",
    "authenticated-encryption",
    "dm-integrity-recovery-mode",
    "replay-attack",
    "rollback-protection",
    "hmac",
    "cryptographic-nonce"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "dm-integrity-source",
      "title": "Linux v6.12 documentation: dm-integrity, integrity-tag ownership and journal/direct modes",
      "url": "https://docs.kernel.org/6.12/admin-guide/device-mapper/dm-integrity.html",
      "accessed": "2026-10-15"
    },
    {
      "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/#linux-verity",
      "accessed": "2026-10-15"
    },
    {
      "id": "dm-crypt-source",
      "title": "Linux v6.12: dm-crypt, encryption target, integrity metadata and allow_discards",
      "url": "https://docs.kernel.org/6.12/admin-guide/device-mapper/dm-crypt.html",
      "accessed": "2026-10-15"
    },
    {
      "id": "integritysetup-source",
      "title": "cryptsetup v2.8.1: integritysetup, bitmap mode, recalculation, recovery and legacy options",
      "url": "https://raw.githubusercontent.com/mbroz/cryptsetup/v2.8.1/man/integritysetup.8.adoc",
      "accessed": "2026-10-15"
    },
    {
      "id": "integrity-code",
      "title": "Linux v6.12 dm-integrity.c: block checks, journal section MAC, superblock verification and recalculation guard",
      "url": "https://github.com/torvalds/linux/blob/v6.12/drivers/md/dm-integrity.c",
      "accessed": "2026-10-15"
    },
    {
      "id": "integrity-fix",
      "title": "cryptsetup merge request 128 (2021): HMAC recalculation fix and separate journal/superblock authentication",
      "url": "https://gitlab.com/cryptsetup/cryptsetup/-/merge_requests/128",
      "accessed": "2026-10-15"
    },
    {
      "id": "hesela-recovery",
      "title": "Hesela: Recovery can stop checking the evidence",
      "url": "https://hesela.com/analyses/checksums-identity-and-lost-writes/#integrity-recovery",
      "accessed": "2026-10-15"
    },
    {
      "id": "hesela-journal",
      "title": "Hesela: The journal needs its own protection boundary",
      "url": "https://hesela.com/analyses/checksums-identity-and-lost-writes/#journal-authentication",
      "accessed": "2026-10-15"
    }
  ],
  "updated": "2026-10-21"
}
