dm-integrity
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.
An upper layer supplying the tags is responsible for checking them; an internal CRC or HMAC has a different threat model. [1] 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. [3] Bitmap mode can miss corruption coincident with a crash because dirty-region tags are regenerated. [4] Recovery mode bypasses checking rather than verifying a read-only view. [1] 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. [5]
Relations
- related
- Checksum, dm-verity, fs-verity, Crash consistency, dm-crypt, Authenticated encryption, dm-integrity recovery mode, Replay attack, Rollback protection, HMAC, Cryptographic nonce
Limitations
- Journaled mode couples data and tag updates; direct mode can leave mismatches after a crash. This is not application-level transaction atomicity. [1]
- 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. [5, 6]
Citations
- Linux v6.12 documentation: dm-integrity, integrity-tag ownership and journal/direct modes
- Linux v6.12: dm-crypt, encryption target, integrity metadata and allow_discards
- cryptsetup v2.8.1: integritysetup, bitmap mode, recalculation, recovery and legacy options
- Linux v6.12 dm-integrity.c: block checks, journal section MAC, superblock verification and recalculation guard
- cryptsetup merge request 128 (2021): HMAC recalculation fix and separate journal/superblock authentication