Research notes / Storage integrity
Why a valid checksum can still return the wrong data
Published · Updated · Literature review, synthetic examples and controlled library observations
A self-consistent record is not necessarily the record you requested. Ask three separate questions: did its bytes change, does it belong here, and is it the version you committed?
Data integrity concerns unintended or unauthorized alteration, destruction or loss. It does not establish that the values were correct when created. A successful check is evidence about its defined coverage, not evidence of a complete integrity policy. [Terminology] [Preserved values versus correctness]
Include the metadata needed to interpret those values. The existing NPY controls below separate numeric payload bytes from interpretation metadata: dtype, shape and storage order. Preserving a payload while changing its interpretation can return a different answer without a payload checksum mismatch.
On this page39 sections
Choose the evidence that can see the failure
More passing checks do not necessarily mean more independent evidence. A byte check, a parser and a restore can all succeed while sharing an untested assumption. This synthesis connects six counterexamples from Hesela's published experiments. It identifies what must be compared, not a universal recipe or a new estimate of storage failure rates.
| Boundary | What still passes | Evidence to add |
|---|---|---|
| Reordered values | FITS pixel order changes while DATASUM and CHECKSUM both pass. Recorded results Astropy 8.0.2. Aligned-word checksum collision, not an estimate of random corruption. | An order-sensitive comparison with a separately retained reference; keyed pixel positions when values, not bytes, are the target. |
| Missing objects | A whole FITS image unit disappears; all surviving units still pass both checks. Recorded results Astropy 8.0.2. A selected whole-unit omission; a count alone cannot detect substitution. | An expected inventory of unit identities. Enumerating only what remains cannot establish completeness. |
| Wrong interpretation | An intact HDF5 raw chunk decodes successfully under a different byte order, but returns different numbers. Recorded results HDF5 1.14.2 and 1.14.6. Deliberate direct-chunk metadata mismatch, not an ordinary copy API defect. | Bind chunk bytes to datatype, coordinate, shape and filter configuration; compare the intended decoded values too. |
| Wrong recovery point | A completed SQLite backup passes integrity_check and matches its source view, but omits an already committed generation. Recorded results SQLite 3.45.1. A historical snapshot is valid when requested; no concurrent writes during copying. | A required recovery generation established outside that source read transaction, checked in the reopened copy. |
| Lossy acceptance test | Changed FITS integers compare equal when both input and output are requested as double precision. Recorded results Astropy 8.0.2 writer; CFITSIO 4.7.0 reader. Selected uncompressed integer images, not every release or numeric conversion. | An exact comparison type that preserves the required distinction, with separate missing-value flags. |
| Changed check coverage | A FITS padding-bit mismatch becomes a passing verdict after image-array access; the file hash is unchanged. Recorded results Astropy 8.0.2. Padding changes, not decoded pixels. Separate CFITSIO controls retain the mismatch. | Record the checked representation and call order. Verify archive bytes before array access when that is the intended coverage. |
The first two cases need different explanations. Swapping aligned FITS words preserves the checksum algebra; removing an entire unit instead removes the object whose check would have run. Both boundaries are consistent with the FITS checksum proposal, introduction and sections 2-3. Treating both as a generic checksum collision would suggest the wrong remedy for an incomplete inventory.
Keep the expectation outside the process being checked. A digest regenerated from changed output does not show equivalence to the input. A required generation read from the same old database snapshot does not establish freshness. Two implementations requested to return the same lossy numeric type can agree after the distinction has already disappeared. Their agreement is not evidence that the original exact values survived.
Specify the intended object set, recovery point, interpretation and value-equivalence rule before testing. Retain the reference, checked representation, reader version, call order and explicit verdicts. Then select controls that exercise those boundaries. A changed whole-file digest may be expected during a legitimate format migration; in that case compare the declared semantic invariants as well. These selected counterexamples establish limits, not probabilities to multiply together.
Serialization: the same value need not have the same bytes
Data serialization represents structured values for storage or transmission. JSON represents a value as text; interchange outside a closed ecosystem requires UTF-8. CBOR instead specifies a binary representation and distinguishes the format's data model from application requirements. Parsing successfully is not the same as meeting those requirements. [JSON] [CBOR]
The selected examples below separate original UTF-8 bytes from decoded values. Whitespace and string escaping can change the former without changing the latter; array order changes the value. Each pair is parsed with JavaScript's JSON.parse and compared with Node's isDeepStrictEqual. This is not a canonicalizer or a general semantic comparator. [Syntax]
| JSON text pair | Equal values? | Equal UTF-8 bytes? |
|---|---|---|
{"n":1}{ "n": 1 } | Yes | No |
"a""\u0061" | Yes | No |
[1,2][2,1] | No | No |
A round trip also depends on the language mapping. Python's JSON encoder converts supported non-string dictionary keys to strings; successful decoding need not restore the original dictionary. Define which types and values must survive. [Python mapping]
Numeric decoding can also change the comparison. JSON.parse maps the distinct integer texts 9007199254740992 and 9007199254740993 to the same Number; Python json.loads with its default integer conversion keeps them distinct. RFC 8259 section 6 warns about precision interoperability. Treat this as a decoder-specific comparison, not evidence that the original numbers or bytes were equal. [JSON numbers] [Python decoding]
When a digest identifies a serialization, preserve the exact bytes or specify a shared representation contract. Protocol Buffers explicitly warns that its deterministic serialization is not canonical across schema, build or library changes. This does not rule out protocol-defined deterministic profiles such as those described for CBOR. Neither approach, by itself, proves freshness or durable storage. [Protocol Buffers] [Deterministic CBOR]
Executable examples and regression tests use selected inputs, not a storage benchmark or corruption-rate sample.
Protocol Buffers: preserve more than a parsed value
Protocol Buffers represents messages as numbered fields. Wire types describe payload layout, not every declared schema type. A top-level message is not self-delimiting: an archive of multiple messages needs an external framing convention, even though some fields inside each message carry lengths. Preserve the schema and framing rules needed to interpret the bytes. [Wire format] [Message boundaries]
Choose the preservation target before converting representations. Implicit presence can erase the distinction between an absent basic field and an explicitly set default; explicit presence retains it. Proto3 binary readers preserve unknown fields on reserialization, but conversion to JSON or copying fields individually can discard them. A newly added field can be binary-safe yet rejected by an older ProtoJSON reader; ignoring that field avoids rejection without retaining it. [Presence] [Unknown fields] [JSON compatibility]
Check the tag before the payload
The tag integer is (field_number << 3) | wire_type, then encoded as an unsigned varint. These examples calculate only the tag, not the value or a complete message. The wire type still does not identify the full schema type. [Encoding rule]
| Field number | Wire type | Tag bytes (hex) |
|---|---|---|
| 5 | 1 | 29 |
| 17 | 2 | 8a 01 |
| 35 | 2 | 9a 02 |
Source cross-check: section 5.6, printed page 45 of the 2022 survey by Viotti and Kinderkhedia associates field 5/wire type 1 with 2a, and field 17/wire type 2 with 9a 02. The encoding rule gives 29 and 8a 01; 9a 02 belongs to field 35/wire type 2. The table follows the official rule, correcting these two examples, not reproducing the survey's broader compatibility experiments. [Survey] [Rule]
The tag calculation reuses the integer encoder; tests include the one-byte boundary, maximum field number and invalid inputs. This is exact arithmetic, not a native serializer comparison.
Neither unknown-field retention nor deterministic serialization guarantees the original bytes. Recovery checks should name the required values, field presence and byte identity separately. These are implications of the documented format contracts, not new native measurements or a claim that every schema change is compatible. [Serialization limits]
CBOR: name the encoding profile before hashing
CBOR does not assign every value a single byte representation. RFC 8949 distinguishes core deterministic ordering of encoded keys from length-first ordering. Preferred serialization alone is insufficient; indefinite lengths and numeric or tag alternatives also matter. [Encoding rules]
Consider the selected map with integer keys 100 and -1, both mapped to null. Their encoded keys are 1864 and 20. Bytewise comparison places 100 first; length-first comparison places -1 first. The complete examples are:
- Core ordering:
a21864f620f6. - Length-first ordering:
a220f61864f6.
The cbor2 API documents its canonical sorting key using encoded length and bytes. Therefore, an option named canonical should not be assumed to select the core ordering. Check the documented profile and implementation version. [cbor2 API]
For a content-addressed manifest, record which profile produced its identifier. This is a storage-design inference. The selected-key example and tests compare fixed encodings, not a general CBOR encoder, decoder survey or durability experiment.
Recovering JSON records does not prove a complete log
JSON text sequences can recover past malformed elements. A trailing whitespace check prevents accepting a potentially truncated scalar: <RS>12<RS> must not be accepted as 12. RS denotes byte 0x1E here, not printed angle-bracket text. This is a specification example, not an observed crash. [RFC 7464]
| Format | Record boundary | Important distinction |
|---|---|---|
| JSON text sequence | RS, JSON text, LF | Multiline values are possible. [RFC] |
| NDJSON | One JSON text followed by LF or CRLF | No literal CR/LF within the text; empty-line handling is a documented parser policy. [Specification] |
| JSON Lines | One value per line | Blank lines are invalid; the last terminator is recommended, not required. [Format] |
A valid final number in a JSON Lines file without a terminator cannot, by syntax alone, distinguish an intended shorter number from a truncated longer number. This is an engineering inference from the permitted ending, not a parser defect. [Ending rule]
Provisional output is not acceptance: an incremental parser can emit a value before later bytes make the sequence element invalid. RFC 7464 warns that incremental and whole-element parsers can therefore expose different results from the same malformed input. Treating an early callback as a validated record can cross that boundary. The engineering implication is to delay irreversible application effects until the chosen validation boundary and retain parse-error evidence when skipping damaged elements. This is a specification warning, not a measured defect in a named parser. [RFC 7464, sections 2.3 and 3]
Recovery acceptance: require an independently trusted expected record set or terminal checkpoint, plus the application's ordering and identity rules. A decoder reaching another record is not that evidence. This checklist does not claim durable writes or complete recovery for either framing convention.
Choose the integer format before decoding
A variable-length integer is not a universal wire format. Protobuf orders seven-bit groups from least significant to most significant; SQLite reverses that significance and gives its ninth byte eight payload bits. The same integer can therefore have different bytes. [Protobuf] [SQLite file format]
| Value and declared type | Hex bytes | Bytes |
|---|---|---|
| Protobuf unsigned 150 | 96 01 | 2 |
| SQLite varint 150 | 81 16 | 2 |
| Protobuf int64 -1 | ff ff ff ff ff ff ff ff ff 01 | 10 |
| Protobuf sint64 -1 / Avro long -1 | 01 | 1 |
| Avro long -64 | 7f | 1 |
| Avro long 64 | 80 01 | 2 |
ZigZag first maps signed values near zero to small unsigned values. Avro binary integers use this mapping; its writer schema remains necessary. In Protobuf, choosing sint64 instead of int64 changes both the representation and interpretation. [Avro 1.12.0] [Signed fields]
SQLite's varint rule does not describe every integer column payload: record serial types select fixed-width integer bodies or special zero-byte constants. [Record format]
As an exact arithmetic check, bytes 96 01 decode to 150 with the Protobuf grouping but 2817 with SQLite grouping. A digest of those bytes cannot select the intended interpretation. Preserve the field type and format alongside the bytes. The worked examples and boundary tests are small specification illustrations, not complete codecs or native-decoder measurements.
Stream VByte: separate controls, separate guarantees
Stream VByte stores control bytes separately from integer data, making upcoming controls directly accessible. Unlike Masked VByte, which accelerates an unchanged VByte format, this is a different representation. The paper evaluates single-threaded decoding of in-memory posting lists, including differential reconstruction; those results are not disk throughput or a universal speedup. [Stream VByte, sections 3-5]
| Each value | Stream VByte bytes | Base-128 bytes |
|---|---|---|
127 | 5 | 4 |
128 | 5 | 8 |
2^32 - 1 | 17 | 20 |
The native probe checks 136 generated ordinary-format cases against pinned revision 089549994faf. Its retained results show that the smallest representation depends on the values, even for equal-length arrays. This is a byte-layout and round-trip check, not a reproduction of the speed benchmark.
More importantly, changing the final byte of 00 01 02 03 04 to 05 still passes the library's size validator, but changes the last decoded value from 4 to 5. That validator checks count and widths, not content integrity. The unpadded decoder removes a readable-padding requirement, not the requirement for a valid stream. Preserve the count and codec identity, validate framing, and separately verify the intended content. [Pinned API] [Size validator]
Choose the rules before hashing JSON
JSON Canonicalization Scheme (JCS) specifies a shared representation. Its UTF-16 property ordering and UTF-8 output are different steps. It preserves array order and does not apply Unicode normalization. [RFC 8785, sections 3.1-3.2.4]
| Probe | Results and interpretation |
|---|---|
| Property ordering | U+10000, U+E000U+E000, U+10000UTF-16 order (first) differs from scalar-value order (second). |
| Unicode string bytes | 22c3a9222265cc8122Different JSON UTF-8 bytes, even though NFC forms agree. |
| Array element order | [1,2][2,1]Object-property sorting does not reorder array elements. |
| Index-like object keys | 10, 22, 10UTF-16 key order (first) is lost when an ordinary object enumerates array-index keys (second). |
Sorting keys and rebuilding an ordinary JavaScript object is not enough: array-index keys are enumerated numerically, so "2" precedes "10" again when that object is stringified. JCS requires the opposite order for these names. The final row tests this trap; it is not a replacement serializer. [ECMAScript property enumeration]
The string row compares U+00E9 with U+0065 followed by U+0301; the hexadecimal values include the JSON quotation marks. Their NFC forms agree, but their original strings differ. Applying normalization first would be an additional application transformation, not a JCS step. [Unicode normalization]
Validate input before losing information. I-JSON forbids duplicate object names; ordinary JSON.parse retains only the last value in the tested duplicate. It also accepts an escaped lone surrogate. Neither acceptance establishes JCS validity. [Input constraints] [JavaScript parsing]
Separate profile rules from application requirements
I-JSON narrows JSON interoperability choices. Its requirements have different strengths: [RFC 7493, sections 2 and 4.1]
- Required
- UTF-8; no unpaired surrogates or noncharacters; unique object names after escape decoding.
- Recommended
- Stay within binary64 range and precision; represent higher-precision values as strings with agreed semantics.
- Allowed
- Any JSON value at the root. Objects or arrays improve compatibility with older receivers.
The numeric recommendation is SHOULD NOT, not a universal rejection requirement. The integer example above shows why an application may need a stricter input contract before precision is lost.
JCS adds serialization rules but does not restore an original numeric spelling: RFC 8785's worked example explicitly includes rounding. Nor does it normalize Unicode strings. For signed input, profile checks, application checks and signature verification remain separate steps before use. [RFC 8785, sections 3.1-3.2 and 5]
These executable probes and controls test selected runtime behavior, not a full canonicalizer. Use a reviewed implementation for the agreed profile; a matching digest still needs a trusted reference and an application freshness policy.
A newer interface does not imply universal protection
Gupta and colleagues' FAST 2026 paper separates Linux's userspace protection-information interface from experimental filesystem-managed PI in Btrfs and XFS. The userspace interface is limited to direct I/O; the conclusion treats filesystem upstreaming as future work. Its Linux 6.15 evaluation used one machine and SSD configuration, not a field population. The reported SSD-lifetime improvement is estimated from write volume, not measured time to failure. [FAST 2026, sections 5.2, 6.1, 6.2.4 and 8]
For deployment, identify which layer creates the protection information, which checks are enabled, and what data or metadata falls outside them.
An observed distinction, not just a thought experiment
The FAST 2008 NetApp study separated checksum mismatches, identity discrepancies and parity inconsistencies. Its file-system identity checks could catch errors missed by block checksums; the RAID scrub did not have the same identity context. The study covered 1.53 million drives over 41 months from January 2004, using customer support logs. Participation and drive removal limited observation. It establishes historical evidence for different detection classes, not a contemporary SSD failure rate. [2, sections 2-3]
Our existing field-study review covers the reported counts. Here we examine what a successful check actually establishes.
When the expected generation is a finite counter, its ordering also needs a history bound: see ordering storage generations across counter wrap for an exhaustive example and source-backed comparison rules.
Five records, three checks
The device-command counterpart is covered in write completion versus read-back verification.
This is Hesela's deterministic synthetic demonstration, not a hardware test. We request address 40, generation 2, with payload current. Each sealed record contains an address, a generation, a payload and a SHA-256 digest over their JSON array. The expected address and generation are held separately from the returned record.
Computed at build time. Checks are cumulative: each column adds a requirement. The final column is the fixture's known truth, not something the verifier can infer.
| Returned record | Checksum | + Expected address | + Expected generation | Intended payload? |
|---|---|---|---|---|
| Correct record | Pass | Pass | Pass | Yes |
| Changed bytes after sealing | Reject | Reject | Reject | No |
| Intact record from address 41 | Pass | Reject | Reject | No |
| Intact old generation at address 40 | Pass | Pass | Reject | No |
| Wrong payload sealed at the producer | Pass | Pass | Pass | No |
The relocated and old records carry valid digests; neither case needs a hash collision. The last row moves the fault before sealing: even all three checks pass when the producer supplies the wrong payload with the expected identifiers. A stale external generation would also let the old record pass. The trusted expectation is an explicit assumption, not a solution to keeping that expectation durable.
No device rates or confidence intervals can be inferred from five deliberately selected fixtures. This code does not implement SCSI or NVMe protection information, authenticate against an attacker, emulate caches, or model concurrent transactions.
Executable Node.js model and regression tests are published with an auditable JSON result. The table and exports are generated from the same functions; no device is read or written.
Consistency can preserve the wrong answer
Krioukov and colleagues used model checking of simplified parity-based storage, concentrating on single injected errors. Their term parity pollution describes bad data influencing redundancy calculations. Their results depend on where checks run: a user-read check does not automatically protect a separate maintenance path. Their identity and version mechanisms also have different coverage. This is a design analysis, not a benchmark of today's arrays. [1, sections 3-4]
Original: A = 7, B = 11, P = A XOR B = 12
Fault: observed A = 6; original P can still recover A = 7
Blind rewrite: P = 6 XOR 11 = 13; recovery now returns 6
These are dimensionless byte values, not measurements. After the blind rewrite, the equation balances but the original A is no longer recoverable from B and the new P alone. The example deliberately assumes a policy that trusts the observed data. It is not a claim that every scrub does this, and it is not advice to disable scrubbing.
Detection, repair and validation remain separate operations. Compare our scrubbing review and RAID write-hole model; an interrupted update is a different fault from accepting a complete but incorrect record.
Identical evidence can require opposite repairs
A mismatch can establish inconsistency without identifying the stale member. Version mirroring compares a data block's generation with a copy held in parity metadata. In the FAST 2008 model, identity must be checked before version ordering: a misdirected block can carry a misleadingly high version. A one-bit stamp can signal disagreement but does not identify the correct repair. [1, section 4.6]
The location of the check also matters for I/O cost. Comparing versions on every user read would require the parity block as well. The paper instead combines logical-identity checks on user reads with version checks during scrubbing and parity calculations, retaining an extra parity read for its additive-parity path. This is a design trade-off, not a measured overhead for current arrays. [1, section 4.6]
Hesela's synthetic counterexample has three one-byte data members and one XOR parity member. Only member 0 changes; peers stay at 0x33 and 0x44. Each history loses exactly one member write. Stamps wrap modulo two, and SHA-256 covers each stored record, including its address and stamp. This is finite arithmetic, not device measurements.
| State | A: data write lost | B: parity write lost |
|---|---|---|
| Initial data 0 | 0x11, stamp 1 | 0x22, stamp 0 |
| Initial parity | 0x66, stamp 1 | 0x55, stamp 0 |
| Intended data 0 | 0x22, stamp 0 | 0x11, stamp 1 |
| Stored data 0 | 0x11, stamp 1 | 0x11, stamp 1 |
| Stored parity | 0x55, stamp 0 | 0x55, stamp 0 |
| Correct repair | Restore data 0 to 0x22 | Replace parity with 0x66 |
Reconstructing data gives 0x55 XOR 0x33 XOR 0x44 = 0x22, correct only for A. Recomputing parity gives 0x11 XOR 0x33 XOR 0x44 = 0x66, correct only for B. Both choices make the stripe consistent. All final stored records and their valid local checksums are identical before repair; no hash collision is involved. A repair rule seeing only those records cannot choose correctly for both histories.
The exhaustive check covers 240 ordered unequal payload pairs in 0..15, or 480 constructed histories with fixed peers. These counts are not failure probabilities. Wider counters distinguish these particular one-step histories; that is not a proof for arbitrary reuse, multiple faults or any vendor implementation. Compare finite-counter ordering.
The practical inference is to preserve the distinction between a detected mismatch and a justified repair. Independent expected state, a trusted parent or retained history may disambiguate the result; this example excludes them. Refusing to choose is a valid outcome. This is not advice to disable scrubbing or a reproduction of the paper's complete model checker.
Reproduce the exact traces with the Node.js model, JSON evidence and separate Python checker; the method and observer assumptions document what the repair rule can and cannot see.
Checksum, cryptographic hash and collision are different questions
A checksum is a value used to check data. A cryptographic hash adds attack-resistance goals; it can also serve as a checksum. Btrfs, for example, offers CRC32C and SHA-256 as different checksum choices. The word checksum alone does not specify the algorithm or its guarantees. [4]
A collision requires distinct inputs with the same digest. Searching for any pair differs from replacing a particular original with a second preimage. Neither explains the old-record example above: the digest matches the old bytes because they belong together. [5]
Nor is a bare digest an authenticity mechanism. If an attacker can replace both the data and its expected digest, recomputing the hash will still pass. The reference needs independent trust. HMAC uses a shared secret for authentication; it does not encrypt the data. RFC 2104 is cited for that construction, not for its historical algorithm recommendations. [6]
A CRC's undetected-error behavior depends on its polynomial, message length and fault model. Do not turn digest width into a universal storage-loss probability. Collision search, accidental corruption and a device's annual failure rate describe different events. [7]
For concrete bit patterns and an exact small-code length comparison, see CRC-32 vs CRC-32C: which bit errors escape detection?.
For an actual additive-checksum collision, see the FITS archive experiment: exchanging two aligned pixels preserves both embedded checksums, while an independent file digest detects the changed bytes.
Fletcher-4: all four sums can agree on different bytes
A 256-bit stored result does not by itself establish a 2-256 undetected-error probability. In our bounded native-function experiment, five changed 32-bit words, comprising six changed bits, preserve all four Fletcher-4 sums. The original reference stays fixed; SHA-256 of the input bytes changes. This is a constructed collision, not a stale record passing under its own checksum. [Pinned implementation]
Each input below contains five unsigned 32-bit words (20 bytes). Values are computed by the extracted OpenZFS zfs-2.3.4 scalar function and checked against recurrence and closed-form integer oracles. These are algorithm fixtures, not ZFS allocation units or sampled disk faults.
| Input | 32-bit words | Four sums |
|---|---|---|
| Original reference | 0, 4, 0, 4, 0 | 8, 24, 52, 96 |
| Six-bit change | 1, 0, 6, 0, 1 | 8, 24, 52, 96 |
| One-bit control | 1, 4, 0, 4, 0 | 9, 29, 67, 131 |
The signed difference is [1, -4, 6, -4, 1]. Its sums weighted by position polynomials of degrees zero through three are zero. Those are the four accumulator weight degrees, so the changes cancel over the integers: this collision needs no overflow. Equal surrounding words preserve the cancellation, as the retained 512-byte and 128-KiB examples confirm. [Recurrence and linearity, pp. 1-2]
Controls matter: all 160 single-bit positions in this 20-byte baseline are detected by both tested function variants (native and byte-swapped). That finite sweep is not a minimum-distance proof. Nine designed configurations are not a corruption-rate sample; repeating them does not increase the number of independent experiments.
Two different meanings of overflow
For 32,768 words all equal to 232 - 1, Somers's 2013 note prints C/D counts of 682 and 5,593,429. Our exact unbounded sums divided by 264, rounded down, give 1,365 and 11,186,858, matching the pinned source comment. In the modular recurrence, D adds the already-reduced C, so its actual wrapping-addition count differs. [p. 2] [Source arithmetic]
| Sum | Unbounded quotient | Wrapping additions |
|---|---|---|
| A | 0 | 0 |
| B | 0 | 0 |
| C | 1,365 | 1,365 |
| D | 11,186,858 | 15,555 |
The historical no-overflow claim for A and B is scoped to 128 KiB; it is not a bound for arbitrary modern blocks. This arithmetic check neither reproduces nor refutes the paper's full probability analysis.
Scope: only pinned scalar functions were executed. No mounted pool, SIMD path, scrub, compression, send stream or repair was tested. The witness does not estimate hardware-error frequency, identify a new vulnerability or demonstrate a cryptographic-hash collision.
Our engineering inference is to distinguish byte identity, object identity and freshness, and to keep an independently protected reference when archive identity matters. Do not disable integrity checking on this basis. OpenZFS records the algorithm per block; changing a dataset's checksum property affects later writes, not an automatic rewrite of old blocks. [OpenZFS checksum policy]
Reproduce with Python 3.10+ and a C compiler, without a pool or network: source and license bundle, exact results, source provenance and file hashes. Run python3 study.py and python3 -m unittest -v from the extracted directory. Checksum words are decimal strings in JSON to avoid rounding 64-bit integers.
HMAC authenticates bytes, not the expected version
A shared-key HMAC differs from an unkeyed digest. It authenticates the bytes selected by a protocol, without hiding them. Anyone holding the shared key can generate tags, so a match does not uniquely identify a writer. [6] Context binding and freshness are additional protocol decisions.
Bellare, Canetti and Krawczyk's 1996 paper defines a successful forgery using a message outside the set previously authenticated for the adversary. Replaying an existing message/tag pair is not that event. Its analysis connects MAC security to explicit cryptographic assumptions; it is not a storage freshness test. [Original MAC model, section 2.1] Our storage inference is that record acceptance needs a separate, independently trusted version policy.
This deterministic demonstration uses Node's HMAC-SHA-256 implementation, checked against RFC 4231 test cases 1 through 6. These include a 131-byte key and a 128-bit truncated-output check; the storage fixtures themselves retain full 256-bit tags. The eight storage records below are original synthetic fixtures, not RFC vectors, device observations or a security proof. The published key is test-only. [HMAC test vectors]
Record coverage authenticates a fixed JSON tuple: domain label, address, generation and payload, encoded as UTF-8. Payload-only coverage uses a distinct label and omits both numeric fields. The separate trusted expectation is address 40, generation 2, except for the explicitly stale-expectation row. The last column (+ State) requires both a valid tag and matching returned address/generation.
| Returned case | Input | Tag | + State |
|---|---|---|---|
| Current record | Full tuple | Pass | Pass |
| Payload edited; original tag | Full tuple | Reject | Reject |
| Address edited; original tag | Full tuple | Reject | Reject |
| Valid record for another address | Full tuple | Pass | Reject |
| Valid old generation | Full tuple | Pass | Reject |
| Old generation; stale expectation | Full tuple | Pass | Pass |
| Payload-only tag; address relabeled | Payload only | Pass | Pass |
| Current record; different verifier key | Full tuple | Reject | Reject |
The valid other-address and old-generation records pass HMAC but fail the independent expectation. Rolling that expectation back admits the old record again. In the payload-only row, relabeling address 41 as 40 passes both displayed checks: comparing an unauthenticated address does not bind the payload to that address. These outcomes follow from the fixture's chosen coverage and state, not a broken HMAC.
Hesela's inference: identify the authenticated encoding, context-binding mechanism and independently protected version policy before interpreting a valid tag. Authenticated fields are one possible binding mechanism; these fixtures do not model context-specific keys, secure key storage, concurrent updates or crash-safe freshness state. The illustrative verifier is not a production storage format.
Executable demonstration, tests and RFC vectors, and complete JSON records. The table and export use the same function. See the rollback discussion for a separate version-floor policy.
A role label does not separate the fields
Including address and generation is insufficient if their byte representation is ambiguous. Concatenating 4, 12 and current produces the same 412current suffix as 41, 2 and current. Prefixing both with the same domain label does not change that equality. Under the same key, identical inputs necessarily produce identical HMACs. This is an encoding ambiguity, not a cryptographic collision.
| Encoding | Comparison |
|---|---|
| Label plus concatenated fields | Same bytes; same tag |
| Fixed JSON tuple | Different bytes; different tags |
RFC 5116 section 3.3 requires unambiguous construction of multi-field AEAD inputs. We apply that framing principle here to HMAC; this example is not AEAD encryption. [Input construction] Domain separation identifies a role, while framing preserves boundaries within it.
The example serializes the label, address, generation and payload array with ECMAScript JSON.stringify, then encodes it as UTF-8 without optional whitespace. Numeric coordinates range from zero to 9007199254740991; negative zero denotes zero. Payloads are printable ASCII, including properly escaped quotes and backslashes. This restricted encoding is not a general JSON canonicalizer, a format for arbitrary binary blocks or a full-width 64-bit address format.
A message authentication code cannot decide which field interpretation or version a caller intended. Keep expected identity and freshness state independently trustworthy across restart and recovery; copying the generation from the returned record defeats that comparison. The earlier stale-expectation row illustrates this limit without modeling crashes.
Download the encoding supplement beside hmac-context.mjs and run node hmac-field-encoding.mjs. The JSON result contains exact UTF-8 input strings, hex bytes and tags; the supplement tests check escaping, numeric limits and exact reproduction. These two selected records are synthetic controls, not observed failure frequencies.
HDF5: inspect which chunks were actually protected
A declared checksum and a zero filter mask do not establish coverage. In our HDF5 1.14.6 fixture, explicitly skipping filters on partial edge chunks left fletcher32=True and a reported mask of zero, yet a decoded read returned a changed value. The ordinary edge policy rejected the same one-bit mutation. Edge skipping is a documented option, disabled by default, not a finding that normal h5py defaults omit checksums. [HDF5 edge policy]
We created values 100 through 111 as little-endian uint32, in eight-element chunks. Every case explicitly enabled Fletcher32. A full decoded chunk is 32 bytes; its filtered representation here adds four checksum bytes. After closing the file, we flipped the low bit of the first stored payload byte in the selected chunk. Every read reopened a fresh memory-backed file, and intact controls returned the expected array.
Seven designed cases, each repeated three times on one build. This table shows the first repetition; all three agreed.
| Changed chunk / policy | Mask | Stored bytes | Read result |
|---|---|---|---|
| Default policy, full chunk | 0 | 36 | Read error |
| Default policy, partial edge | 0 | 36 | Read error |
| Skip-edge option, full chunk | 0 | 36 | Read error |
| Skip-edge option, partial edge | 0 | 32 | Changed values |
| Edge grown to full before mutation | 0 | 36 | Read error |
| Direct writer skips checksum | 1 | 32 | Changed values |
| Reader disables error detection | 0 | 36 | Changed values |
Partial means that the chunk crosses the dataset's extent, not that the application wrote only part of a full chunk. In the pinned implementation, the partial-edge path can omit the pipeline separately from the per-chunk mask. A mask of zero is therefore insufficient in this configuration. [HDF5 1.14.6 source]
Direct chunk I/O is a different exception: its caller supplies encoded bytes and a mask whose bits identify omitted pipeline positions, not filter IDs. Raw chunk reads also bypass the filters; retrieving raw bytes successfully is not validation. A reader can separately disable error detection through its transfer properties. [Direct chunk API] [Reader policy]
Adding protection later preserves the state then present
Three further sequences changed 108 to 109 in the unfiltered edge, then grew the array from 12 to 16 values. The now-full chunk occupied 36 bytes and passed a decoded read, still containing 109. A new bit flip then caused an error. Later checksum protection did not recover the original value. An unallocated fill-value region is separate again: our control returned twelve zeros without storing either chunk's payload.
Detection and rejection are separate
With edge skipping off and error detection enabled, an explicitly installed callback returning H5Z_CB_CONT observed a Fletcher32 failure but allowed changed values through. A rejecting callback and the ordinary no-callback policy both failed the read. Eight clean/damaged policy combinations, repeated three times, distinguish detection from acceptance. [Callback API] [Pinned filter pipeline]
Even changing the next read to strict settings may reuse an earlier unchecked decoded chunk. See the cache-state experiment for the same-dataset and fresh-reader controls.
For an archival acceptance workflow, record filter order, allocation, chunk geometry, edge policy, masks, reader policy and cache history. Separate salvage from validation; read the intended coverage in a clean, rejecting context, and compare identity, generation and application completeness with independent expectations. This is an engineering inference from the controls, not a general HDF5 certification tool.
Code, complete observations, CSV and reproduction instructions preserve all values, errors, settings and source hashes. The experiment uses h5py 3.15.0 / HDF5 1.14.6 / NumPy 2.3.3 on Linux x86_64, serial one-dimensional fixed-width data and a memory-backed driver. It measures neither production corruption rates nor physical storage faults, SWMR behavior, power-loss durability or other library versions.
A checksum can validate numbers after precision was lost
Lossy encoding and later corruption are different events. In a diagnostic HDF5 pipeline, a successful checksum-protected read returned 13 changed integers out of 16, including four new fill values. No stored byte was damaged in that case: the checksum covered the representation after scale-offset encoding. This is not a checksum collision.
The ordinary h5py API rejects combining scale-offset with Fletcher32, even for automatic integer precision. Keep that guard. Our low-level property-list experiment deliberately separates write order from read verification; it is not a production configuration recommendation. [API guard]
Five selected controls from 26 deterministic configurations on h5py 3.15.0 / HDF5 1.14.6. Input: int32 values 1000 through 1015 in one 16-element chunk, fill value zero.
| Write configuration | Read or creation | Changed / 16 | New fill / 16 |
|---|---|---|---|
| Automatic integer + checksum | Read succeeds | 0 | 0 |
| Two-bit integer + checksum | Read succeeds | 13 | 4 |
| Same order, damaged checksum | Read error | Not returned | Not returned |
| Checksum before two-bit filter | Read error | Not returned | Not returned |
| High-level API, both requested | Creation rejected | Not returned | Not returned |
Two-bit encoding then Fletcher32 returned [1000, 1001, 1002, 0] four times. Filter IDs were 6 then 3 and the chunk mask was zero. Flipping one checksum byte made the fresh read fail, so the accepted changes were not explained by a disabled check. Reading traverses the pipeline in reverse: it verifies the encoded representation before reconstructing values. [Pipeline source]
Near the fill value, the precision shortcut is incomplete
With floating-point scaleoffset=2 and fill zero, the fully written value 0.009 came back as zero. The absolute change, 0.009, exceeds the 0.005 half-step implied by the pinned h5py docstring's unqualified formula. The HDF5 implementation recognizes a fill neighborhood using abs(value - fill) < 10**(-D) in its active floating-point fill path. The HDF Group explicitly warns about near-zero data with default fill zero; this is documented behavior, not a new vulnerability claim. [Precision API] [Pinned implementation] [Official warning]
Selected unitless float64 inputs, D=2. Error is the observed absolute difference, displayed to three significant figures; exact input and output encodings remain in JSON.
| Input | Declared fill | Output | Absolute change |
|---|---|---|---|
| 0.004 | 0 | 0 | 0.00400 |
| 0.006 | 0 | 0 | 0.00600 |
| 0.009 | 0 | 0 | 0.00900 |
| 0.009 | -999 | 0.01 | 0.00100 |
| -998.991 | -999 | -999 | 0.00900 |
Moving fill to -999 preserved a nonzero result for 0.009, but values near -999 then acquired the same problem. A float32 control and one-element chunks also retained the near-zero effect. A different input, 0.019, returned about 0.021 in the zero-fill fixture: this filter is not a promise of rounding every value to exactly two displayed decimal places.
Choose an acceptance criterion before optimizing size
For integers, scale-offset zero selects a lossless bit count; for floats, zero does not mean lossless. Our automatic-integer control preserved every byte. NaN and infinities have no preservation guarantee with this filter; gzip plus Fletcher32 preserved the special-value fixtures. A readable file can therefore change a downstream distinction between a measurement and a missing-value marker. [Dataset contract]
Delaunay, Courtois and Gouillon distinguish absolute and relative error criteria and compare methods using analytical arrays and mission-related data. Their Decimal Rounding and Digit Rounding studies are not validation of this built-in filter or our fill example. Decimal places and significant digits are different controls; their published compression ratios and timings do not transfer to this experiment. [2019 paper, sections 3-6]
Validate reopened data against the application's numerical tolerance, nonfinite classification and missingness policy using its real dtype, chunk layout and value range. An explicit validity mask may separate missingness, but that design is not evaluated here. Do not infer prevalence, a hardware defect or a cross-version guarantee from these chosen fixtures.
All 26 configurations and field definitions, executable runner and reproduction instructions preserve the original observation time, software versions, hashes, errors and byte encodings. The earlier coverage CSV is unchanged.
A partial write can change unselected values
Write selection and numerical-change scope can differ. In our HDF5 1.14.2 experiment, 30 writes selecting only index 0 changed the other three values in its four-element scale-offset chunk by approximately +0.1. All native calls succeeded; no stored bytes were deliberately damaged. This extends the first-write study above to repeated updates.
The dimensionless float64 input was [1.001, 2.001, 3.001, 4.001], with decimal scale factor 2. We wrote 1.004, 1.007, 1.001 to index 0, repeating that cycle ten times. Each partial write used a one-element hyperslab, followed by writer close and a fresh read. The selected element returned to its starting value.
Eight deliberately selected configurations and 240 post-operation readbacks, not independent population samples. Deltas compare the final state with the first decoded baseline and are rounded to three decimal places; downloads preserve exact binary64 values. The read-only control performs no writes, and the full-write control intentionally selects all four values.
| Configuration | Index 1 | Index 2 | Index 3 |
|---|---|---|---|
| Scale-offset, partial write, chunk 4 | +0.100 | +0.100 | +0.100 |
| Scale-offset, partial write, chunk 2 | +0.100 | 0 | 0 |
| Scale-offset, partial write, chunk 1 | 0 | 0 | 0 |
| Gzip + Fletcher32, partial write | 0 | 0 | 0 |
| Unfiltered, partial write | 0 | 0 | 0 |
| Scale-offset, same minimum | 0 | 0 | 0 |
| Scale-offset, read-only reopen | 0 | 0 | 0 |
| Scale-offset, full original-value write | 0 | 0 | 0 |
The pinned scale-offset code recomputes a chunk minimum and rounds scaled residuals. Moving that minimum can round the other values again: the first unselected neighbor follows 2.001 → 2.004 → 2.007 → 2.011 through one cycle. Dirty-chunk flushing applies the filter pipeline to the chunk. The two-element-chunk control localizes the observed drift to index 1. [Encoding] [Chunk flush]
A separately implemented C client using ordinary sec2-backed files reproduced all 992 decoded values across 248 states, including baselines, from the Python/core-image client. This removes dependence on that wrapper and memory-file driver, but both clients use the same HDF5 1.14.2 binary. It is not independent peer review, cross-version replication or a power-loss test. [Evidence and limits]
Validate the affected lossy chunk, not only the selected element. Compare unselected values with an authoritative reference after reopening. A per-encoding precision setting alone does not bound accumulated error over an arbitrary update history. The full-write control supplies original values; it does not show that rewriting already quantized reads is lossless. Tiny chunks isolated this fixture, but their space and performance costs were not measured.
The gzip/Fletcher32 row is a preservation control, not a corruption-detection experiment. Lossy cases did not enable Fletcher32 or bypass the h5py guard. No NaN/Inf, concurrency, other codec, physical fault or field frequency was tested. Method and field definitions / Complete reproduction bundle / Exact observations.
Moving an integer cast can change the answer
A conversion can lose values before the checksum begins protecting them. Reading through dset.astype("i2")[:] uses HDF5 conversion; dset[:].astype("i2") converts the returned array in NumPy. h5py documents a possible speed advantage for the first path, not a promise of identical out-of-range results. [h5py API]
Signed int64 to int16, little-endian target. The seven designed inputs below produced the same results on both tested stacks: HDF5 1.14.6 / h5py 3.15.0 / NumPy 2.3.3 and HDF5 1.14.2 / h5py 3.10.0 / NumPy 1.26.4. This is a value-preservation test, not a speed benchmark.
| Input integer | HDF5 cast | NumPy cast |
|---|---|---|
| -40000 | -32768 | 25536 |
| -32768 | -32768 | -32768 |
| -1 | -1 | -1 |
| 0 | 0 | 0 |
| 32767 | 32767 | 32767 |
| 32768 | 32767 | -32768 |
| 40000 | 32767 | -25536 |
HDF5 clamped this narrowing case to the int16 limits; NumPy wrapped it. read_direct into an int16 array agreed with the HDF5 path. Writing with a narrow HDF5 dtype stored the clamped result, while casting in NumPy before writing stored the wrapped result. Both files passed fresh Fletcher32-protected reads. No lossy filter, skipped filter or permissive callback was involved. The ordinary HDF5 range macros explain this narrowing path. [Pinned implementation]
A separate signed-to-uint16 case changed the possible missing-value sentinel -1 to 0 through HDF5 and 65535 through NumPy. Neither output automatically retains its application meaning. NumPy's default casting="unsafe" allows conversion; its dtype-level casting="safe" rejected even our in-range int64-to-int16 control. [NumPy policy]
Validate source values before choosing the faster path
The downloadable checked_integer_cast checks exact integer bounds before casting. It accepted the in-range and widening controls and rejected out-of-range cases. Apply it before a write: checking the already narrowed array cannot recover the discarded values. Range checks do not establish units, identity, uniqueness or missingness semantics.
Do not generalize this to "HDF5 always clamps." In the separate fileless same-width sign-change matrix, opposite byte orders selected a byte-swap path and returned modular values on both builds. The public trace records all 72 cases per build and the selected converter. This is a bounded implementation observation, not an upstream-confirmed new defect or a claim about every HDF5 release.
The first stack covered 36 file sequences and 108 intact files; the second covered 12 sequences and 36 intact files. All later one-bit damage controls were rejected. These chosen repetitions establish repeatability, not population frequencies or checksum collision probabilities. Both stacks ran on one Linux x86_64 host; no hardware fault or crash was tested.
Exact observations, code and reproduction instructions preserve the original and review traces separately. This extends the checksum-boundary question in the FAST 2008 study, but does not reproduce its fleet experiment or imply that its reported errors came from numerical conversion.
Unchanged compressed chunks can return changed strings
Checking only raw dataset chunks can miss a changed variable-length payload. We flipped one bit in the second string's global-heap object. A fresh HDF5 read returned the altered string without error; the gzip-filtered chunk remained byte-for-byte identical, with filter mask zero. This is a coverage gap, not a checksum collision.
Variable-length elements store descriptors pointing to separate global-heap objects. The file-format description supplies the addresses and object indexes used by our restricted fixture parser. Dataset filters do not process these heaps. [Heap layout] [Filter scope]
Nine designed cases, repeated three times; one repetition shown. Each file contains the same three ASCII strings in one complete chunk. All intact controls match the independently specified input.
| Case | Raw chunk unchanged? | Fresh decoded read |
|---|---|---|
| VLEN + gzip: intact | Yes | Original strings |
| VLEN + gzip: heap bit | Yes | Changed string |
| VLEN + gzip: chunk trailer bit | No | Read error |
| VLEN, unfiltered: intact | Yes | Original strings |
| VLEN, unfiltered: heap bit | Yes | Changed string |
| Fixed + Fletcher32: intact | Yes | Original strings |
| Fixed + Fletcher32: payload bit | No | Read error |
| Fixed, unfiltered: intact | Yes | Original strings |
| Fixed, unfiltered: payload bit | No | Changed string |
The compressed-chunk control changes one bit in its zlib trailer and fails the read. The fixed-width Fletcher32 control changes a payload bit and also fails. The corresponding unfiltered fixed-width file returns the changed string. These controls distinguish a working check over chunk bytes from coverage of a different object.
There was no Fletcher32-protected VLEN dataset. Ordinary fletcher32=True creation for variable-length strings raised ValueError with not suitable for filters on this build. The runner records that rejection and never silently falls back. The accepted VLEN gzip dataset uses deflate, not Fletcher32; the fixed-width control is the one with Fletcher32. [Filter API]
Every mutation changes exactly one byte by XOR with 1 after the file closes. The parser follows the descriptor, checks the original object's bytes against the input, and verifies that the payload is outside the raw chunk. Reads reopen fresh memory-backed files with default policy, so this does not depend on permissive reads or stale cached values. Exact payload hex, offsets, filter IDs, masks and before/after digests are retained.
For immutable archives, a whole-file digest compared with an independently preserved trusted value detects all these mutations. A digest over raw chunks alone misses the two heap cases. A content manifest can instead bind record identity, lengths and expected bytes, but it needs its own provenance and update protocol. Neither approach automatically authenticates the origin, proves freshness or repairs corruption. This is an engineering consequence of the measured coverage boundary.
Observations and reproduction package: 27 designed observations, not a sampled corruption rate. Scope is h5py 3.15.0 / HDF5 1.14.6, native file format, ASCII strings and a memory-backed driver. No device, crash or cross-version behavior was tested. Fixed-width substitutions require byte-length checks to avoid truncation; changing representation is not a free integrity upgrade. [String constraints] See also the size-accounting experiment.
Intact raw chunks can decode to the wrong numbers
A passing byte check does not validate the destination interpretation.In two tested HDF5 builds, unchanged chunks retained their Fletcher32 trailers yet returned different values after raw transfer into a different datatype or filter pipeline. Moving intact chunks between coordinates or choosing an older fixture also passed. No checksum collision was needed.
The direct-chunk API bypasses ordinary datatype conversion and filtering. Its mask describes skipped positions in the destination pipeline, not filter identifiers. The application is responsible for compatible encoded bytes. This is a documented low-level contract, not a newly discovered HDF5 defect. [Direct-chunk API]
Controlled native observations: 10 configurations, two repetitions on each of HDF5 1.14.2 and 1.14.6, yielding 40 case runs. Each file contains a 2-by-4 integer array in two full chunks. Source chunks contain 16 payload bytes plus a four-byte checksum trailer. Writers close before fresh raw and decoded reader processes run.
| Transfer | Decoded read | Intended values? |
|---|---|---|
| Identical raw copy | Success | Yes |
| Exchange row coordinates | Success | No |
| Copy older fixture | Success | No |
| Change byte order | Success | No |
| Change signedness | Success | No |
| Declare an unapplied shuffle | Success | No |
| Explicitly skip shuffle | Success | Yes |
| Decode/re-encode byte order | Success | Yes |
| Decode/re-encode with shuffle | Success | Yes |
| Flip one payload bit | Rejected | No array returned |
The subtle case declares shuffle followed by Fletcher32 at the destination, although the source bytes were never shuffled. Reading first checks the intact trailer and then wrongly unshuffles the payload. The first value changes from 16909060 to 874791940. The second row becomes [1751606885, 0, 0, 0]. These zeros are transformation output, not missing-source fill values. [Checksum implementation] [Shuffle implementation]
The explicit mask-1 control skips shuffle but leaves Fletcher32 active. It preserves the intended array. Every successful configuration was then subjected to a one-bit mutation: all 36 additional reads rejected it. Thus disabled checks do not explain the unchanged-byte cases. Decode/re-encode controls preserve these fixed-width values; they do not establish safety for arbitrary narrowing conversions or lossy filters.
Our archival acceptance recommendation: bind payload hashes to the expected object, generation, chunk coordinates, geometry, complete datatype, ordered filters and parameters, and per-chunk mask. Compare decoded values through the intended consumer after closing the writer. A trusted whole-file reference can bind metadata too; a newly copied file does not automatically provide that independent reference. This is an engineering inference, not a general HDF5 validator.
The related lesson in Parity Lost and Parity Regained is that checks must be available on the path that reuses data. Its RAID model can detect a wrong block on a later user read yet lose recoverability after unchecked data has entered a parity calculation. Our HDF5 experiment tests a different boundary: successful byte verification followed by incompatible interpretation. Neither result makes every successful read an application-level acceptance test. The RAID result is a model-checking finding, not a measurement of HDF5 or a reproduction by Hesela. [1, sections 4.3 and 4.7]
Two software builds on one host are not independent hardware samples. The older fixture is a deliberate source selection, not a physical lost write. These tests exclude VLEN, partial edges, MPI, SWMR, power loss and performance. Related boundaries: chunk decoding and caching and external-source completeness.
Complete reproduction bundle | Generated results | Claim-to-source map | Artifact hashes
Reading the same bytes in another order
Byte order, also called endianness, assigns significance to bytes within a multibyte value. The table fixes the width at 16 bits and the type as unsigned. Big-endian reads 01 02 as 1 x 256 + 2 = 258; little-endian reads the same bytes as 1 + 2 x 256 = 513. Width, signedness and alignment are separate format choices. [Binary layout]
| Operation | Bytes | Interpretation | Integer |
|---|---|---|---|
| Original | 01 02 | big-endian | 258 |
| Reinterpret only | 01 02 | little-endian | 513 |
| Swap bytes only | 02 01 | big-endian | 513 |
| Swap bytes and interpretation | 02 01 | little-endian | 258 |
A NumPy dtype view can change interpretation without changing bytes; byteswap() changes bytes without changing the dtype. Changing both preserves the value in this example. [Byte-swapping] A digest covering only those two payload bytes cannot detect a change in their interpretation. Equal-byte patterns such as 00 00 also hide a wrong-order read; use distinct-byte controls when checking a decoder.
Within an NPY file, byte order and C/Fortran element traversal are different properties. NPY 1.0's header-length field is little-endian even when the payload dtype is big-endian. Read each field's format instead of assigning one byte order to the entire container. [NPY layout]
A scalar is not a record of the stored byte order. Extracting an element from a plain unsigned 16-bit NumPy array returns a native-order scalar while leaving the array unchanged. A big-endian array containing 01 02 and a little-endian array containing 02 01 both yield 258; their extracted scalars have the same native representation. For a simple dtype, byteorder can report = even when an explicit order was supplied, if it matches the host. Inspect the array dtype and raw payload bytes together. [Scalar extraction] [Native byte order]
The NumPy scalar checks compare fixed-byte and fixed-value controls under both explicit orders, preserve the original array, and report the NumPy version and host order. Run them in a Python environment with NumPy installed; expected native bytes follow that host's order. These checks cover plain unsigned 16-bit values, not structured or object dtypes.
Executable arithmetic and regression tests cover all 65,536 two-byte unsigned inputs against positional arithmetic and Python struct. These are representation checks, not storage-failure observations or a replacement for validating an application's schema.
NPY: intact payload bytes can mean different coordinates
A controlled NumPy 2.5.4 read changed coordinate assignment while preserving every numeric payload byte, shape, dtype and sum. The NPY header tells the reader how to interpret those bytes. A checksum that excludes the header cannot bind that interpretation. [NPY layout]
In-memory strides are not an extra NPY header field. Harris and colleagues' NumPy review describes how dtype, shape and strides interpret an in-memory buffer. NPY instead records dtype, shape and C/Fortran order alongside contiguous array data; it does not preserve arbitrary view strides. Distinguish those two representations when designing a checksum or a round-trip test. [Array model] [On-disk layout]
Changing only fortran_order left the 24-byte numeric suffix, 2-by-3 shape, signed 32-bit dtype and sum 21 intact, but [[1,2,3],[4,5,6]] became [[1,3,5],[2,4,6]]. The complete-file reference SHA-256 changed. This is a coverage gap, not a hash collision or a parser defect. Hashing the decoded array in a declared canonical order would be a different check.
| Fixture | Load | Raw suffix hash matches? | Full-file hash matches? | Expected array? |
|---|---|---|---|---|
| Unchanged control | Accepted | Yes | Yes | Yes |
| Change storage order | Accepted | Yes | No | No |
| Change shape | Accepted | Yes | No | No |
| Change byte order | Accepted | Yes | No | No |
| Declare fewer elements | Accepted | Yes | No | No |
| Flip one payload bit | Accepted | No | No | No |
| Remove one payload byte | Rejected | No | No | No array returned |
| Append a second array | Accepted | No | No | Yes |
The raw suffix means all bytes after the first NPY header. For the two-array stream it includes a second record, not just the first array's numbers. The first load returns the expected array but leaves 132 bytes; a second load reads the appended array. Successive records are supported, so trailing bytes require an explicit one-record or sequence policy. [Save API]
Some information never reaches the file
A separate write supplied {"unit":"ms"} as additional dtype.metadata. Saving emitted a UserWarning and produced exactly the same NPY bytes as the no-metadata control. This is warning-bearing omission before hashing, not later corruption. NumPy does not assign unit semantics to that application metadata. [Pinned writer implementation] [Metadata documentation]
The documented format has a separate fidelity limit: it does not fully preserve arbitrary ndarray subclasses. The ordinary non-pickled array path reconstructs a regular array; successful numeric recovery does not promise to restore a custom object's behavior or extra attributes. This is a documented design boundary, not another fixture in our experiment. [Format limitations]
Opening NPZ is not reading every member
NPZ stores NPY members in ZIP and loads arrays lazily. All three two-member fixtures opened, listed both keys and returned the intact first array. In the selected-read path, accessing the damaged second array exposed its CRC error. [Lazy-loading API]
| Fixture | Read second array | First ZIP CRC/header failure from testzip() |
|---|---|---|
| Intact NPZ | Accepted | None |
| Damage unread member | Rejected | second.npy |
| Repackage changed header | Accepted | None |
Repackaging the changed-order NPY generated valid new ZIP CRCs and a readable array with changed coordinates. CRC validation covers the new bytes, not the producer's intended meaning. These fixtures use distinct member names; the separate ZIP duplicate-entry problem is not the cause here.
Engineering inference: bind the complete representation to independently trusted expected identity, preserve required units and axes explicitly, read each required member and validate the decoded schema. Saltzer, Reed and Clark's careful-file-transfer argument distinguishes application acceptance from intermediate checks; it does not make lower-layer checks useless. Applying that distinction to scientific meaning is our inference, not a NumPy result from the 1984 paper. [Design argument]
Package acceptance also needs a complete inventory. BagIt 1.0 distinguishes completeness, including coverage of every payload file by every payload manifest, from validity, which additionally requires matching checksums. A list containing only correct hashes can still omit a required file. This comparison does not make an NPZ archive or our reproduction ZIP a conforming BagIt bag. [RFC 8493, section 3] Checksums alone do not establish the sender's authenticity; the expected inventory and release identity must come from a trusted source.
Scope: 12 designed configurations, two agreeing captures, NumPy 2.5.4 / CPython 3.12.3, little-endian Linux and in-memory BytesIO reads with allow_pickle=False. No real-file/mmap, object dtype, compressed NPZ, crash, physical-media or failure-rate claim. A file digest cannot restore information omitted by the writer.
Reproduction package, generated observations, method and limits and artifact hashes. Format definitions: NPY and NPZ.
Avro: preserve the reader policy, not only its fingerprint
An unchanged Avro object-container file can produce different application values under reader schemas sharing a parsing fingerprint. Our constructed file stores only id=7. The reader supplies an absent status field: default zero returns zero, default minus one returns minus one, and no default causes a schema-resolution error. The complete file, including its writer schema, stays identical. Apache Avro 1.12.2 and fastavro 1.13.1 agree on these outcomes.
Nine deliberately constructed configurations, each read by two libraries, give 18 observations per capture. Two retained captures agree. Repetition checks determinism, not a failure-rate population or independent peer review. The table is generated from those observations, including a second file that actually stores status=42.
| Reader policy | Field absent | Field stores 42 |
|---|---|---|
| Default 0 | 0 | 42 |
| Default -1 | -1 | 42 |
| No default | Schema-resolution error | 42 |
All three readers share their parsing canonical form, 64-bit Rabin fingerprint and SHA-256 parsing fingerprint. This is not a hash collision: canonicalization omits defaults before hashing. The full saved schema files have distinct digests. A longer hash of the same stripped representation cannot restore omitted information. Defaults supply missing fields; they do not replace the present value in our control. [Avro specification] [Apache reader] [fastavro reader]
A separate three-byte raw datum encodes integer 1000000. Supplying a timestamp-millis writer schema yields 1000 seconds after the Unix epoch; timestamp-micros yields one second. This changes the supplied writer schema for raw bytes, not the embedded schema of an unchanged container. Both libraries agree on these decoded instants. [Timestamp conversions]
The timestamp schemas have equal fingerprints within each library, but not across these two implementations: Apache Avro 1.12.2 emits {"type":"long"}, while fastavro 1.13.1 emits "long". The evidence preserves this version-specific canonicalization difference, not a universal interoperability claim. [Apache canonicalizer] [fastavro canonicalizer]
Representation matters. An object-container header carries the full writer schema; raw binary has no self-contained schema wrapper. Single-object encoding carries a marker and eight-byte schema fingerprint, so schema lookup remains a dependency. This last distinction is specification review only: no registry or transport implementation was tested. [Encoding formats]
Recovery inference: preserve full writer and intended reader schemas, logical conversions and implementation versions, then check expected application values. Historical reconstruction and intentional schema migration are different targets; a changed default can be correct for a migration. This experiment does not label schema evolution as corruption. A full-schema digest also needs an independently trusted reference and does not capture arbitrary application transformations.
Use the reproduction package, generated JSON summary and method and evidence guide. The package retains raw files, full schemas, both captures, code, tests and pinned sources. No hardware failure, power-loss durability or field rate is measured. Relate the intended interpretation to the backup manifest and restore acceptance criteria.
A Merkle root needs an identity and a trusted version too
A Merkle tree combines child hashes into a root. In Dynamo's original 2007 design, per-key-range trees help locate divergent replicas while transferring less data. Locating disagreement does not itself choose the authoritative version or reconstruct missing bytes. This is a historical design example, not a claim about every current Amazon storage service. [8, section 4.7]
Inclusion verification checks an entry against a particular root under specified encoding and tree rules. RFC 9162's construction distinguishes leaves from internal nodes with different hash prefixes and uses tree size and leaf index during verification. Its consistency proof is a separate append-only claim between tree snapshots. These details are not a universal Merkle format. [9, section 2.1]
The intended root must be trusted. Accepting a root supplied with untrusted data only checks their agreement; a valid old root can describe an old version. A proof does not by itself establish freshness or continued availability. RFC 9162 signs tree-head metadata including root, size and timestamp, adding context beyond a naked digest. Our five-record demonstration does not implement Merkle proofs or authentication. [9, sections 4.9-4.12]
Two trees, one root, no broken hash
Suppose a naive binary tree hashes a leaf as H(data) and a parent as H(leftHash || rightHash). Let A and B be two entries, and create one replacement entry C = H(A) || H(B). The two-entry tree and the one-entry tree now have the same root: both evaluate H(H(A) || H(B)). The outer hash receives identical bytes. This is ambiguous tree encoding, not a collision between distinct SHA-256 inputs.
Our executable example uses UTF-8 bytes for left and right. The constructed entry C is 64 raw bytes, not the 128 characters of their hexadecimal representation. The table is generated from the same code as the downloadable result.
| Check | Result |
|---|---|
| Naive root equality | Equal |
| Leaf/node-prefixed root equality | Different |
| Trusted expected count of 2 accepts the 1-entry replacement | No |
Domain separation marks the input's role. RFC 9162 uses a leading byte 0x00 for leaves and 0x01 for internal nodes. Those distinct inputs remove this structural identity; they do not replace the hash's cryptographic assumptions. [9, section 2.1.1]
The replacement also changes the leaf count. An independently trusted expected count rejects this particular substitution even in the naive example. This is not an exploit against CT, dm-verity or Dynamo, and the script is not a general proof verifier. Its result is a reason to review encoding and authenticated metadata together.
Run the example with node merkle-domain-separation.mjs; inspect the complete input and root hex values. Keep raw bytes and hex display strings separate when reproducing it.
Domain tags do not fix duplicate-last padding
There is a second, separate ambiguity. A tree that duplicates the final node of every odd-sized level can give the same root to ABC and ABCC, even with leaf prefix 0x00 and internal-node prefix 0x01. Both expand into the same tagged expression. No distinct-input SHA-256 collision is needed. Bitcoin Core v28.0 documents the historical repeated-subtree variant and checks equal sibling hashes before inserting padding at each level. This is a construction example, not a claim of a new product vulnerability. [Merkle construction source]
Our separate SHA-256 model uses one-byte ASCII entries and role prefixes. It is not Bitcoin's transaction encoding or double-SHA256 implementation. The ABCDEF / ABCDEFEF pair has no equal adjacent entries, but its repeated EF subtree creates equal sibling hashes one level higher. Checking only equal leaf pairs misses that case.
| Original / candidate | Tagged duplicate-last roots | RFC-shaped roots | Trusted root + count accepts |
|---|---|---|---|
| ABC / ABCC | Equal | Different | No |
| ABCDEF / ABCDEFEF | Equal | Different | No |
| ABCDE / ABCDEE | Equal | Different | No |
| ABC / ABD | Different | Different | No |
| ABC / ACB | Different | Different | No |
| AA / AA | Equal | Equal | Yes |
RFC 9162's split rule uses the largest power of two below the list length instead of duplicate-last padding. It distinguishes the three changed-count pairs here. [9, section 2.1.1] The experiment also checks every A/B list of lengths 1-10: 2046 lists and 4092 comparisons with a recursive symbolic oracle. These finite checks are not a cryptographic security proof or a measured failure probability.
Storage implication: bind the tree construction, expected entry count and root to a trusted manifest. A candidate-supplied count is not an independent reference. Do not blindly reject repeated blocks: AA is valid in our unchanged-content control. Bitcoin's version-scoped validation separately rejects a mutation flag after root agreement; that transaction policy is not a universal rule for storage chunks. [Validation source] Count binding also does not establish freshness or availability.
Reproduce offline with the model, tests, complete generated results, capture and source hashes and method and limits. This is synthetic computation, not a storage-device experiment.
Valid inclusion is not a shared history
Crosby and Wallach's USENIX Security 2009 history-tree design separates membership auditing from incremental auditing between commitments. A verified entry in one committed log does not establish consistency with an earlier log. Their protocol also requires auditors to reconcile commitments obtained from different clients or auditors, or use a common public commitment, to expose divergent views. [History-tree security model, sections 2.1-2.2]
Engineering consequence: record which trusted commitment was checked, against which earlier state, and whether other observers' commitments were compared. Root, count and inclusion checks answer different questions from a shared-history audit. This source synthesis is not an implementation or benchmark of that protocol.
Tree maintenance can dominate a cheap comparison
Dynamo's SOSP 2007 paper describes an operational cost beyond exchanging roots: membership changes moved key-range boundaries and forced tree recalculation. Its later fixed-partition strategy separated partitioning from placement and allowed whole partition files to move. [8, sections 4.7 and 6.2]
For a storage evaluation, measure tree construction and maintenance as well as comparison traffic. This is our engineering inference, not a new benchmark: a compact proof or root says nothing about the I/O already spent preparing it.
Three Linux integrity mechanisms, three different contracts
Linux v6.12 documents these separately. Start with the protected unit and the authority for accepting it, not the similarity of their names.
Version-scoped comparison, not a deployment recommendation.
| Mechanism | Protected unit | Trust boundary |
|---|---|---|
| dm-verity | Read-only block-device mapping | Verify blocks against an independently trusted root hash. [10] |
| fs-verity | Immutable contents of selected files on a writable filesystem | Authenticate the file digest and enforce which files may be used. [11] |
| dm-integrity | Writable block data with integrity tags | Tag storage, checking and crash behavior depend on mode and the upper layer. [12] |
For dm-verity, ignore_corruption allows reads despite detected corruption. check_at_most_once reduces repeated checking and excludes online tampering from its stated protection. Optional FEC can recover some corruption, but recovered bytes are still hash-verified. A setting that changes failure handling changes the contract, not just speed. [10]
For fs-verity, file contents are immutable, but owner, mode, timestamps and names are not authenticated by it. The file digest includes a descriptor with size and hashing parameters; it is neither a plain whole-file hash nor just the Merkle root. Crucially, fs.verity.require_signatures=1 requires signatures for verity files, not verity for every file. A separate access policy must close that gap. [11]
For dm-integrity, journaled mode keeps data/tag updates atomic together; direct mode can leave mismatched pairs after a crash. Internal CRC checks target accidental corruption; an HMAC can authenticate without encrypting. Tags supplied by an upper layer require that layer to verify them. Pair atomicity is not an application transaction or evidence that a valid old pair is current. [12]
Which bytes did verity actually check?
fsverity measure retrieves the digest that the kernel enforces. Linux v6.12 copies the stored file digest to userspace; it does not traverse the file's data. A successful measurement can therefore coexist with corruption in a block that has not been read. Authentication of that digest and successful access to every byte are separate questions. [27]
| Operation | Evidence obtained | Remaining check |
|---|---|---|
fsverity measure | Kernel-enforced file digest and algorithm | No complete data read; authenticate the expected identity. [27] |
fsverity digest | Digest computed from file bytes using selected parameters | Does not enable verity or establish a trusted expected value. [28] |
| Read a verity-enabled file | Requested data checked before use, or already-verified cached data | Unread ranges and a fresh physical-media read are not established. [29] |
dump_metadata | Exported tree, descriptor or signature bytes | The export API does not promise authentication against the measured digest. [11] |
For a meaningful digest/measure comparison, use the same hash algorithm, block size and salt. The userspace computation does not discover the enabled file's parameters automatically. Neither output is interchangeable with sha256sum: fs-verity identifies a descriptor, not just a flat byte stream. Enabling verity builds protection over the supplied content; it is not evidence of that content's origin. [28] [11]
Verification occurs as data enters the page cache, including data subsequently accessed through a memory mapping. Cached verified data may be reused; cached verified hash blocks also shorten tree traversal. Consequently, even a successful complete logical read does not prove a fresh read of every physical block. Corrupt data reads fail with EIO, or SIGBUS for mapped access. Direct I/O is not a bypass for this cache distinction: Linux v6.12 falls back to buffered I/O for verity files. [29] [11]
For dm-verity, status V means that checks performed so far have succeeded; it is not a whole-volume scan certificate. The option check_at_most_once deliberately limits data verification to the first read. This differs from reusing already-verified data still in the page cache. Record the options alongside the status. [10]
ignore_zero_blocks is another coverage exception: dm-verity returns zeros for ranges whose expected digest identifies a zero block, without verifying the underlying data for those ranges. Successful logical reads therefore cannot certify that the backing storage contains zeros. [10]
For an application review, record the expected digest and its trusted source, algorithm and tree parameters, the operation performed, ranges read, errors and cache assumptions. Measure and consume the same opened file, rather than measuring a path and later reopening a potentially replaced name. This is an application-level consequence of file-scoped verification; it does not supply a freshness policy or demonstrate that a storage device passed a physical scan.
Same Merkle root, different fs-verity digest
The distinction is observable with the reference tool. Hesela ran 40 native fsverity digest computations using fsverity-utils v1.6: ten cases for each combination of SHA-256/SHA-512 and 1024/4096-byte blocks. Two complete runs returned identical observation rows. This is a userspace experiment on synthetic files, not a kernel-enforcement or hardware test.
| Pair | File sizes, bytes | Merkle roots | File digests |
|---|---|---|---|
| A / A plus zero | 1 / 2 | Equal | Different |
| A / A padded to a block | 1 / 4,096 | Equal | Different |
| Multi-level file / its top hash block | 528,401 / 4,096 | Equal | Different |
| Salt 00 / salt 0000 | 1 / 1 | Equal | Different |
| Equal contents, different names | 1 / 1 | Equal | Equal |
Zero-padding makes the short files hash identical block bytes. A larger file and its top hash block also share a root when that block is used as a smaller file's complete contents. The descriptor binds file length, separating both cases. Salts 00 and 0000 pad to the same hash input prefix, but their lengths remain distinct in the descriptor. These are encoding ambiguities resolved by fs-verity, not cryptographic hash collisions or a vulnerability. [11] Native implementation.
An empty file still has a descriptor digest
All four empty-file observations exported zero tree bytes and an all-zero root. Their file digests were neither that root nor the ordinary SHA-256/SHA-512 hash of empty input. Within each algorithm, selecting 1024-byte rather than 4096-byte blocks changed the digest: the descriptor binds that parameter even when there are no data blocks. This matches the documented empty-file rule, not an error sentinel or a missing digest. [11]
The changed-byte control produced a different root; equal bytes under another filename retained the same digest. Authenticate the complete digest, with matching parameters, then apply separate name and freshness policy. Do not substitute an isolated root or a plain file hash.
Download the method and limits, native runner, 40 observations with full descriptors and standalone evidence tests. The runner independently hashes each descriptor and checks the native digest. No signing, enable/measure ioctl, corruption injection, failure frequency or confidence interval is claimed.
A Merkle tree need not be binary
Linux v6.12 derives dm-verity's fanout from the hash-block and digest sizes. With 4096-byte hash blocks and 32-byte SHA-256 digests, each block holds 128 child digests. A 1 TiB data area with 4096-byte data blocks has 268,435,456 blocks and four hash-block levels, not the 28 levels of a balanced binary tree. This is a structural calculation, not a speedup measurement. [30]
| Data capacity | Data blocks | Hash levels | Total hash blocks |
|---|---|---|---|
| 512 KiB | 128 | 1 | 1 |
| 516 KiB | 129 | 2 | 3 |
| 1 GiB | 262,144 | 3 | 2,065 |
| 1 TiB | 268,435,456 | 4 | 2,113,665 |
Method: repeatedly divide the preceding block count by 128, rounding up, until one hash block remains; sum those counts. The header, salt, FEC and storage padding are outside this table. Each level hashes a block, and cache hits can avoid traversal: neither the level count nor total hash storage equals physical reads or elapsed time. Calculated JSON and standalone calculation code make the arithmetic inspectable. [30]
Encryption is not authentication
dm-crypt is the kernel encryption target; LUKS describes encryption metadata and key management. Neither name alone specifies the data-integrity contract. In particular, XTS-AES provides confidentiality without authenticating the stored data or its source. [14] [15] [16]
| Mechanism | What it adds | What it does not establish |
|---|---|---|
| XTS-AES | Confidentiality for storage data units | Authentication or freshness [16] |
| Internal CRC | Accidental-corruption checking | Resistance to a writer who can replace data and tags [12] |
| Internal HMAC | Keyed authentication | Encryption merely from using a keyed tag [12] |
| Authenticated encryption | Confidentiality and authentication | Replay rejection without a separate freshness mechanism [17] |
The cryptsetup v2.8.1 manual describes an optional LUKS2 authenticated stack: dm-crypt over dm-integrity, with extra space for tags and journaling. It labels authenticated modes experimental and does not support discard in that configuration. This is not a blanket statement about standalone dm-integrity. [15]
Broz, Patocka and Matyas explicitly exclude replay protection from their 2018 design: an older valid storage image remains a problem without separately trusted state. We use that threat-model boundary, not the paper's historical performance measurements. The synthetic examples above do not implement encryption. [18, section 2.4]
In that design, authenticated associated data includes the sector number and IV, binding the verification to a location. This does not make an old, valid sector at that same location current. Identity binding and freshness still differ. [18, sections 2.4 and 5.3]
Nonce reuse is not ciphertext replay
For AES-GCM, encrypting different plaintexts with one key and the same nonce compromises confidentiality and authentication. RFC 5116 warns that VM rollback can cause nonce reuse. Repeating decryption of an existing ciphertext is a different operation. Snapshot recovery must therefore consider encryption state, not only saved bytes. [17, sections 5.1.1 and 8]
XTS sector-number tweaks follow a different mode's rules. Do not transfer GCM nonce requirements to XTS or treat location binding as replay protection. [18, sections 2.4 and 3.3]
Confidentiality also does not promise hidden allocation patterns. Linux v6.12 dm-crypt ignores discard by default; enabling allow_discards can reveal used-space or filesystem information if discarded ranges remain identifiable. This does not mean plaintext was recovered. Compare discard and reclamation boundaries. [14]
A LUKS header backup and a passphrase valid when that backup was taken can recover the corresponding volume key even after its live keyslot is removed. Include recovery copies in key-management reviews. [19]
These are documented boundaries, not a tested deployment recipe. We have not benchmarked or fault-injected an encrypted block-device stack.
Filesystem encryption and the execution backend
fscrypt encrypts selected directory trees, unlike block-level dm-crypt. Linux v6.12 protects contents and names, not all metadata, and offers no authenticated-encryption mode. Its offline-tampering limitation is explicit. [fscrypt]
A key name does not describe the whole policy
An fscrypt policy combines a key reference with encryption modes, flags and, for v2, a data-unit-size setting. The v2 key identifier is a public 16-byte HKDF-derived value. The kernel derives it from the supplied master key; it is not a caller-chosen label or a file authenticator. Two policies can reference the same key while choosing different formats. [Policy fields] [Key derivation]
Linux v6.12 compares the complete policy, not just its key identifier. The following outcomes concern FS_IOC_SET_ENCRYPTION_POLICY after its access and filesystem checks, not a universal errno ordering. [Policy implementation]
- An unencrypted, nonempty directory:
ENOTEMPTY. - An already encrypted regular file or directory with the same policy: success verifies the existing setting.
- An already encrypted regular file or directory with a different policy:
EEXIST, not in-place re-encryption.
New regular files, directories and symlinks inherit the parent's policy; special files are excluded. With the required keys and access checks satisfied, a policy-incompatible rename or hard link into an encrypted directory fails with EXDEV. A same-filesystem rename into an unencrypted directory preserves encryption. A copy-and-delete move creates a new file under the destination policy, which may be unencrypted. Deleting a plaintext source is not secure erasure. [Policy enforcement and access semantics]
A failed policy read does not mean plaintext
The original FS_IOC_GET_ENCRYPTION_POLICY cannot return a v2 policy: an encrypted v2 file produces EINVAL. The extended FS_IOC_GET_ENCRYPTION_POLICY_EX supports both versions, with policy_size initialized to the available policy-buffer size. EOVERFLOW means a recognized policy does not fit; it is not the ENODATA result for an unencrypted file. The historical v1 version code is 0, while v2 is 2. Inspect the returned version and complete policy, not just a key name. [Policy retrieval] [Version codes]
What did the removal call actually remove?
For v2-policy keys, FS_IOC_REMOVE_ENCRYPTION_KEY removes the caller's claim. Interpret the return value together with removal_status_flags; the abbreviated flag names below share the FSCRYPT_KEY_REMOVAL_STATUS_FLAG_ prefix. [fscrypt]
0withOTHER_USERS: other claims retain the key. A clearFILES_BUSYbit does not establish that all files are closed.0withFILES_BUSY: in-use files retain per-file keys.-1witherrno=ENOKEY: the key may be absent, or the caller may lack a claim while another user retains one.
FS_IOC_GET_ENCRYPTION_KEY_STATUS distinguishes ABSENT, PRESENT and INCOMPLETELY_REMOVED. Its scope is the filesystem keyring, not legacy process keyrings or every copy of key material. Freed plaintext caches need not be wiped. [fscrypt]
The pinned implementation also returns EFAULT if copying the result back fails after a removal action. An error does not imply rollback; a later status observation is not an atomic history of the call. [Linux v6.12 keyring]
Inline encryption answers a different question: where storage requests are encrypted. Linux's optional software fallback means that using blk-crypto does not prove hardware execution. With identical inputs and parameters, correct implementations preserve the same ciphertext. A hardware keyslot is an execution resource, not a LUKS password slot or a new authentication guarantee. [Inline encryption] [LUKS]
fs-verity instead verifies immutable file contents; authenticating its digest needs a trust policy. On ext4 and F2FS it can coexist with encryption, checking plaintext after decryption. [fs-verity]
A different evidence boundary appears in Wei et al.'s FAST 2011 study: they wrote identifiable patterns, applied sanitization and inspected raw flash. For encrypted drive E, that method could not establish key destruction. This was a historical device study, not a test of fscrypt or a current SSD failure-rate estimate. Read the sanitization analysis before equating a keyring result with cryptographic erase. [Wei et al., sections 3.1, 3.2.1 and 3.2.4]
Review implication: record the protected data, exposed metadata, verification policy, execution backend and key-removal outcome separately. This is a version-scoped documentation review, not a device experiment or a procedure for changing live keys.
A saved LUKS header outlives a live password change
Changing the live passphrase is not revocation of every saved route to the volume key. A keyslot protects key material; a header backup preserves an earlier key-access state. The upstream backup warning and key-dump documentation describe this boundary. This is documented behavior, not a newly discovered cryptographic vulnerability. [Backup] [Volume key]
Hesela ran cryptsetup 2.7.0 on disposable regular files: LUKS1 and LUKS2, two repetitions per format, nine states and three credential fixtures per state (108 password checks). Every successful check was followed by native volume-key recovery and a SHA-256 comparison. The table combines cases only where both formats and repetitions agree.
| Header tested | Old credential | New credential | Wrong credential | Recovered key |
|---|---|---|---|---|
| Original header | Accepted | Rejected | Rejected | Original image key |
| Saved header, before change | Accepted | Rejected | Rejected | Original image key |
| Live header, after passphrase change | Rejected | Accepted | Rejected | Original image key |
| Saved header, after passphrase change | Accepted | Rejected | Rejected | Original image key |
| Live header, after erasing all keyslots | Rejected | Rejected | Rejected | None |
| Saved header, after erasing live keyslots | Accepted | Rejected | Rejected | Original image key |
| Original image, after restoring saved header | Accepted | Rejected | Rejected | Original image key |
| Independent image, before header restore | Accepted | Rejected | Rejected | Independent image key |
| Independent image, after foreign header restore | Accepted | Rejected | Rejected | Original image key |
In the single-slot fixture, the live passphrase change rejected the old credential but recovered the same volume key with the new one. Erasing all live keyslots rejected every supplied credential there; the saved header still recovered the original key. Restoring that saved header made the old credential work again, not the newer one. This connects three separate operations: credential replacement, keyslot erasure and header restoration. [Change] [Erase] [Restore]
A successful password check is not payload identification
For the negative identity control, we independently formatted a second file with the same geometry and credential but a different volume key. Restoring the first file's header to it succeeded. The password test then passed and recovered the first file's key, not the second file's original key. Compatible header geometry and a valid password therefore did not identify the intended data key. No encrypted payload was decrypted in this experiment.
The restoration manual requires compatible key size and data offset and warns that the saved keyslots replace the current ones. Treat a header backup as a security-sensitive recovery dependency tied to the correct volume and key history, not a generic repair file. Independently validate restored data against trusted expectations; a password check cannot replace a restore test. [Restore]
Changing one slot does not revoke duplicate credentials
A separate controlled sequence placed the same old credential in slots 0 and 1, replaced only slot 0, then removed slot 1. Two formats, two repetitions, four states, three credentials and three search scopes produced 144 checks. The explicit-slot tests distinguish where a credential works from whether an unrestricted password check succeeds. [Add] [Change] [Remove]
| State | Old credential | New credential | Wrong credential |
|---|---|---|---|
| Initial slot 0 | Slot 0 | None | None |
| Old credential added to slot 1 | Slot 0, 1 | None | None |
| Slot 0 changed to new credential | Slot 1 | Slot 0 | None |
| Slot 1 removed | None | Slot 0 | None |
After slot 0 changed, the old credential failed there but still worked through slot 1. Only after removing slot 1 did the unrestricted test reject the old credential. Every accepted credential recovered the same volume key within that image's sequence. This is separate from the saved header path above: checking one slot is not checking every live slot, and checking the live header is not checking every saved header.
The recovery hash was obtained by automatic native key recovery after each accepted slot-specific or unrestricted test. This experiment did not create a mapping or read an encrypted payload. The deliberately selected cases demonstrate a mechanism, not the prevalence of duplicate credentials.
Duplicate-slot observations | Generated slot table | Duplicate-slot probe and generator | Duplicate-slot regression tests. The probe also needs the companion probe.py linked below.
Why this is not proof of SSD sanitization
Wei and colleagues' FAST 2011 study wrote recognizable patterns and inspected raw flash after sanitization. Its Table 1 marks encrypted drive E's key deletion as unverified. That historical measurement limit matters: observing unreadable ciphertext did not establish that every key copy was gone. [FAST 2011, sections 2.1 and 3.1-3.2]
Our header and slot tests establish retained key access, not removal of physical remnants. A deletion review must account for live slots, saved headers and other usable key copies. An inaccessible live header alone cannot certify SSD sanitization. Do not destroy recovery material until the retention and recovery requirements for the intended volume have been resolved.
Reproduction and limits
The installed package was Ubuntu 2:2.7.0-1ubuntu4.2, with aes-xts-plain64, 256 total key bits and 512-byte sectors. Public dummy credentials and PBKDF2 with 1,000 iterations keep this bounded probe cheap; these are not production security settings. It creates its own temporary files and accepts no device path.
This is a header/key-access experiment, not a mounted-device, filesystem, power-loss, reencryption or media-sanitization test. The final MiB of each image remained unchanged; we did not claim a full-payload check. Rejected passwords returned code 2; an erased header with no usable keyslot returned code 1. Both are failures, but not the same diagnostic. Random keys mean replay hashes differ; the relationships, not fixed hash values, are the oracle.
Raw observations and commands | Derived table | Native probe | Regression tests | Table generator | Method and sources
UBIFS: authenticated does not mean current
UBIFS authentication detects offline modification, but its threat model excludes full-flash rollback and rollback of individual index commits. Authentic old state can remain acceptable. [UBIFS threat model]
The Linux v6.16 mount documentation separates chk_data_crc from auth_key= and auth_hash_name=. Supplying the key option makes authentication mandatory; the key must be present as a logon key in the kernel keyring. Enabling data-node CRC checks alone does not select that authentication configuration. [Mount options]
In the pinned implementation, authentication requires a recognized hash name and a successful key lookup; a revoked key is rejected. Authentication nodes contain an HMAC of an accumulated hash. These are configuration and coverage checks, not an external record of which filesystem generation is current. [Linux v6.16 implementation]
Secure deletion is a different question. Reardon, Capkun and Basin's DNEFS paper implemented the research extension UBIFSec: per-data-node encryption keys were purged using atomic key-area replacement followed by synchronous erasure of old physical copies. That protocol is not a stock UBIFS authentication option. Its wear analysis used simulation; throughput and battery tests used a Nexus One running a modified Linux 2.6.35.7 stack. Those results do not characterize present-day UBIFS performance. [USENIX Security 2012, sections 4.2-4.3]
The paper also names a bad-block case: a key-storage block can remain readable after erasure fails. Our inference is that retiring such a block is not proof of sanitization. A deletion claim needs an explicit policy for residual readable keys, not just a successful logical replacement. [Section 3.2, purging]
Operational inference: document authentication settings, the independently trusted freshness policy, and the deletion/key-retention protocol separately. This is a source review, not a UBIFS mount, attack reproduction or secure-deletion test.
The journal needs its own protection boundary
In Linux v6.12, journal_mac checks journal sector numbers. It can use CRC for accidental damage or keyed HMAC for malicious modification. With internal_hash, journal replay already checks the block tags. That does not establish superblock authentication. [12]
The pinned implementation makes the distinction explicit: integrity_sector_checksum() covers logical sector and block data; section_mac() covers journal entry sector numbers, not every payload byte. Fixed-HMAC format binds both checks to a volume salt; only the journal MAC additionally includes its section number. sync_rw_sb() checks the superblock on reads only with a configured journal_mac and the on-disk fixed-HMAC flag, outside recovery mode. A keyed algorithm is needed for adversarial authentication. [21]
The cryptsetup v2.8.1 manual identifies --integrity-legacy-hmac as a weaker historical calculation without superblock protection. Recalculation has a separate, conditional safety gate: see the source-checked guard table below, not a blanket ban on every keyed configuration. [20]
This is a source audit, not a migration recipe or device test. The kernel documentation warns that layout-dependent arguments cannot generally be changed by reloading a target. The userspace manual also labels journal-encryption options testing-only. Preserve the on-disk format and investigate the actual stack before treating a configuration name as a security guarantee. [12] [20]
Recovery can stop checking the evidence
Readable is not verified. In Linux v6.12, dm-integrity's recovery mode skips journal replay and tag checks, and rejects writes through that mapping. It is not ordinary verified read-only access, nor proof that another path cannot change the underlying device. [12]
Bitmap mode makes a different trade-off: after a crash it regenerates tags for dirty regions. This avoids the journal's second data write, but corruption coincident with the crash can escape detection. A shorter write path changes the evidence retained for recovery; it is not a free performance switch. [20]
Recalculation creates tags for the bytes now present. The cryptsetup v2.8.1 manual describes initialization as its main purpose and warns that protection is incomplete until it finishes. Resetting recalculation starts again from the beginning. Hesela's inference: a later passing check cannot independently establish that the pre-recalculation bytes were correct. [20]
Authenticate the recovery metadata too
The 2021 cryptsetup fix explains the historical weakness: an unprotected recalculation offset could cause altered data to receive new tags. Data HMAC and journal/superblock HMAC have different jobs and independent keys. The compatibility override restores behavior that the maintainers explicitly call insecure; it is not an integrity repair. [22]
Linux v6.12's fix_hmac binds journal section identity, includes a device salt and extends journal_mac protection to the superblock. That still does not supply an external freshness authority. [12]
Computed from a source-scoped restatement of dm_integrity_disable_recalculate(). Data HMAC is present and legacy_recalculate is false in every displayed row. [21]
| Fixed HMAC format | Journal HMAC key | Guard result |
|---|---|---|
| No | Absent | Blocks recalculation |
| No | Present | Blocks recalculation |
| Yes | Absent | Blocks recalculation |
| Yes | Present | Does not block recalculation |
The function allows the explicit legacy override. Without it, an older format blocks either keyed configuration; the fixed format blocks a data key without a journal key. Passing this guard is not successful activation, authorized recovery, or proof of authenticity. The same source skips superblock MAC verification in recovery mode. [21]
The executable guard model enumerates sixteen Boolean cases; the table selects four. A recorded comparison matches all sixteen to the compiled source predicate, using a reproducible harness. The model does not run device-mapper, reproduce a tampering exploit or model power loss. Its input validation is a JavaScript interface check, not kernel behavior.
What to preserve in a recovery review
Broz, Patocka and Matyas' 2018 paper separates tag storage from cryptographic verification and explains why data and tag updates need coordinated recovery. It excludes replay protection and evaluates a historical prototype, not these later compatibility fixes. Its journal results therefore cannot certify a current configuration or predict a universal throughput penalty. [18, sections 2.4, 4.4, 5 and 6]
Our review checklist: retain the original data and metadata evidence before changing tags; record kernel and tool versions, mode, verification owner, format flags and recalculation progress. Record whether a read was verified, bypassed or read after tags were regenerated. Compare with an independently trusted copy where available. Keep keys and key-bearing device-mapper tables out of published logs. These are evidence-handling distinctions, not a validated forensic procedure or instructions to alter a live volume.
A trusted root still needs a version policy
A replay attack reuses previously valid data in an unauthorized context. RFC 4949 describes repeated transmissions; the storage counterpart can return an older authenticated block without forging a tag. Legitimate journal replay after a crash is a different operation. [23] [18, section 2.4] [12]
Rollback protection enforces a version or freshness boundary. Android Verified Boot's documented locked-state policy rejects image rollback indexes below protected stored minimums. The comparison accepts equality; it does not identify the exact newest image. In the unlocked state, index checking is not required. This boot policy does not promise freshness for arbitrary mutable user data. [24] [25, Rollback Protection and Recommended Bootflow]
An index floor is not an exact-version check
Four synthetic index vectors, evaluated at build time: every image index must meet its corresponding stored minimum. Passing this comparison alone does not establish image authenticity or bootability. [25] [26]
| Case | Stored floor | Image index | Index check only |
|---|---|---|---|
| Below the floor | 10 | 9 | Reject |
| Equal to the floor | 10 | 10 | Pass |
| Above the floor | 10 | 11 | Pass |
| One location too old | 10, 10 | 11, 9 | Reject |
Timing matters too. For Android-style A/B fallback, the AVB guidance advances stored indexes only from a slot marked successful. Raising the floor before confirming the new slot could exclude the old recovery path. This is an update-policy constraint, not proof that the running image is newest. [25, Updating Stored Rollback Indexes]
Hesela's architectural inference: an older image with the same index is not rejected by that comparison alone. A valid signature, journal-section number or volume salt is not an independently maintained current-version policy. An authenticated counter inside the same restorable snapshot can roll back with it. Identify the accepted object and version, where that expectation is protected, and how authorized restore is distinguished from adversarial rollback. This reasoning assumes an attacker can restore older storage state but cannot forge authentication tags; it is not a demonstrated exploit of a deployed system.
Burke and colleagues' FAST 2025 paper studies Dynamic Merkle Trees for writable cloud disks. Its threat model trusts VM memory and keeps the current root outside the attacker's control. Its prototype uses BDUS; the evaluation includes synthetic workloads, an Alibaba trace and Filebench. The EC2 testbed did not provide the confidential-VM isolation assumed by the security model. These are performance experiments under an explicit trust assumption, not evidence that signatures alone prevent rollback. [13, sections 3 and 7]
The paper explores workload-adaptive tree shape, with extra pointer and counter storage. We have not reproduced its performance results and do not transfer its speedups to stock Linux verity. In particular, a binary-tree illustration is not a universal format: dm-verity packs hashes according to block and digest sizes. Record the actual construction, caching policy and workload before comparing costs. [13, sections 6-7] [10]
Where does protection begin?
Before interpreting success, establish which checks ran. Our PI escape-tag experiment executes a pinned Linux verifier and distinguishes acceptance from checksum evaluation.
Linux's data-integrity documentation describes metadata attached to I/O, potentially generated by the block layer for an unaware filesystem. It distinguishes device/controller protection from a longer protected path. Consequently, support for PI does not by itself prove coverage back to the application buffer. Record the actual generation point, verification points, transformations and configuration of your deployed stack. The documentation contains historical design discussion; it is not a current support matrix for every driver. [3, sections 1-3 and 5]
For a review or incident report, retain these independently:
- The requested object, address and committed generation, with the authority that supplied them.
- The returned identifiers and checksum result, including which bytes and metadata were covered.
- The layer at which integrity metadata was created and where it was checked.
- The inputs used for reconstruction and how the result was validated before rewriting.
- The acknowledgement and persistence contract; a successful content check is not evidence that a pending write survived power loss.
For object APIs, compare ETags, multipart checksums and conditional writes: validating bytes and deciding which writer may update an object are different checks.
Structured entries: lost write, misdirected write, parity pollution, protection information and end-to-end data protection.
Primary sources and limits
- Krioukov et al. Parity Lost and Parity Regained. FAST 2008, sections 3-4.
- Bairavasundaram et al. An Analysis of Data Corruption in the Storage Stack. FAST 2008, sections 2-3 and 6.
- Linux kernel documentation: Data Integrity, protection boundaries and automatic metadata generation.
- Btrfs documentation: Checksumming, algorithm choices and verification boundary
- NIST CSRC glossary: cryptographic hash function and security properties
- RFC 2104: HMAC, sections 1-2 (construction, not current algorithm selection advice)
- RFC 3385: iSCSI CRC/Checksum Considerations, sections 1-2 and 10 (historical error-model analysis)
- DeCandia et al. Dynamo: Amazon's Highly Available Key-value Store. SOSP 2007, sections 4.7 and 6.2.
- RFC 9162: Certificate Transparency Version 2.0, sections 2.1 and 4.9-4.12
- Linux v6.12 documentation: dm-verity, parameters, failure policies and hash-tree format
- Linux v6.12 documentation: fs-verity, descriptor, metadata exclusions and built-in signature limits
- Linux v6.12 documentation: dm-integrity, integrity-tag ownership and journal/direct modes
- Burke et al. On Scalable Integrity Checking for Secure Cloud Disks. FAST 2025, pp. 391-405; sections 3, 6 and 7.
- Linux v6.12: dm-crypt, encryption target, integrity metadata and allow_discards
- cryptsetup v2.8.1: LUKS extension and experimental authenticated disk encryption
- NIST SP 800-38E (2010): XTS-AES confidentiality and authentication boundary, section 3
- RFC 5116: AEAD scope, nonce requirements, input framing and VM rollback, sections 1.2, 2, 3.1, 3.3, 5.1.1 and 8
- Broz, Patocka and Matyas: Practical cryptographic data integrity protection with full disk encryption (extended version), 2018, sections 2.4, 3.3, 4.4, 5 and 6
- cryptsetup-luksHeaderBackup(8): header backups and retained decryption access
- 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
- RFC 4949: Internet Security Glossary, Version 2 (2007), replay attack; informational glossary, not an Internet Standard
- Android Open Source Project: Use Verified Boot, Rollback protection
- Android Verified Boot README at 5ac0c3a: Rollback Protection and Recommended Bootflow
- Android Verified Boot: image-index comparison in avb_slot_verify.c at 5ac0c3a
- Linux v6.12 measure.c: FS_IOC_MEASURE_VERITY copies the enforced digest
- fsverity-utils v1.6 manual: measure, digest, enable and dump_metadata contracts
- Linux v6.12 verify.c: verification of data and cached hash blocks
- Linux v6.12 dm-verity-target.c: fanout, levels and hash-block allocation
- HDF Group: H5Pset_chunk_opts, partial-edge filtering policy
- HDF5 1.14.6: H5Dchunk.c, edge filtering and chunk-cache paths
- h5py DatasetID: direct chunk reads/writes and filter-mask semantics
- HDF Group: error-detection policy and filter-failure callbacks
- HDF5 1.14.6: H5Z_pipeline and callback continuation
- HDF Group: H5Pset_filter, variable-length heap exclusion
- HDF5 file format: global heaps and variable-length element descriptors
- h5py 3.15 dataset filters and Fletcher32
- h5py 3.15 strings: representations and truncation
- h5py 3.15.0 create_dataset: scale-offset precision and Fletcher32 restriction
- h5py 3.15.0 filters.py: high-level scale-offset/Fletcher32 guard
- HDF5 1.14.6 H5Zscaleoffset.c: fill recognition and encoding
- HDF Group dataset guide: scale-offset floating-point suggestions
- h5py 3.15.0 dataset guide: scale-offset, special values and Fletcher32
- Delaunay, Courtois and Gouillon (2019): Evaluation of lossless and lossy algorithms for scientific datasets, GMD 12, 4099-4113; sections 3-6; DOI 10.5194/gmd-12-4099-2019
- h5py 3.15.0: Dataset.astype, read_direct and Fletcher32
- NumPy 2.3: ndarray.astype casting policies
- HDF5 1.14.6: native integer conversion range macros
- cryptsetup v2.7.0: header backup and retained access
- cryptsetup v2.7.0: passphrase replacement
- cryptsetup v2.7.0: header replacement and compatibility checks
- cryptsetup v2.7.0: volume-key recovery and exposure
- cryptsetup v2.7.0: test-passphrase and key options
- cryptsetup v2.7.0: erase all keyslots
- cryptsetup v2.7.0: adding a credential-protected slot
- cryptsetup v2.7.0: removing a selected keyslot
- Wei, Grupp, Spada and Swanson. Reliably Erasing Data from Flash-Based Solid State Drives. FAST 2011, sections 2.1, 3.1-3.2 and Table 1.
- fsverity-utils v1.6: native root construction, padded salt and descriptor binding
- RFC 4231: HMAC-SHA-256 test cases 1 through 6, sections 4.2-4.7
- Bellare, Canetti and Krawczyk. Keying Hash Functions for Message Authentication. June 1996 full version; sections 2.1, 4.2 and 5.2.
- HDF5 1.14.6: direct-chunk API contract and positional filter mask
- HDF5 1.14.6: Fletcher32 buffer verification and trailer removal
- HDF5 1.14.6: shuffle parameter and inverse byte-lane transformation
- Linux v6.12: fscrypt threat model, key removal and encryption modes
- Linux v6.12: inline-encryption contexts, keyslots and optional software fallback
- Linux v6.12 fs/crypto/keyring.c: do_remove_key and fscrypt_ioctl_get_key_status
- Wei, Grupp, Spada and Swanson. Reliably Erasing Data From Flash-Based Solid State Drives. FAST 2011, sections 3.1, 3.2.1 and 3.2.4, Table 1.
- Linux v6.12 fs/crypto/policy.c: complete-policy comparison and setup outcomes
- Linux v6.12 include/uapi/linux/fscrypt.h: policy fields and key-identifier size
- NumPy format documentation: NPY and NPZ layout
- NumPy save API: successive array records
- NumPy 2.5.4 pinned format implementation
- NumPy NpzFile API
- RFC 8493: BagIt 1.0, completeness and validity (section 3), active-attack limits (section 5.4)
- Saltzer, Reed and Clark. End-to-End Arguments in System Design. ACM TOCS 2(4), 1984, pp. 277-288: careful file transfer and performance trade-offs.
- NumPy drop_metadata: np.save and np.savez omit additional dtype metadata
- Harris et al. Array programming with NumPy. Nature 585, 357-362 (2020): array metadata and strides.
- Linux v6.16: UBIFS Authentication Support, threat model and index/journal authentication
- Linux v6.16: UBIFS mount options, data CRC and authentication keys
- Linux v6.16 auth.c: ubifs_init_authentication and authentication-node construction
- Reardon, Capkun and Basin. Data Node Encrypted File System: Efficient Secure Deletion for Flash Memory. USENIX Security 2012, sections 3, 4.2 and 4.3.
- Apache Avro: pinned specification, schema resolution, canonical form and encoding formats
- Apache Avro: pinned Python schema canonicalization
- Apache Avro: pinned Python record resolution and timestamp conversion
- fastavro: pinned canonicalization implementation
- fastavro: pinned native record resolution
- fastavro: pinned timestamp logical conversions
- HDF5 1.14.2: minimum-relative scale-offset encoding
- HDF5 1.14.2: dirty-chunk filter pipeline
- Hesela: partial-update evidence, C replay and limits
- Python struct: byte order, size and alignment
- NumPy: byte-swapping and dtype reinterpretation
- NumPy: native and explicit dtype byte order
- Bitcoin Core v28.0: duplicate-last Merkle construction and pre-padding mutation checks
- Bitcoin Core v28.0: CheckMerkleRoot separates root agreement from mutation rejection
- Crosby and Wallach: Efficient Data Structures for Tamper-Evident Logging. USENIX Security 2009, sections 2.1-2.2
- NIST CSRC glossary: data integrity, with definitions and source attribution.
- RFC 4949: data integrity and correctness integrity (Informational terminology, not an IETF standard).
- Gupta et al. Advancing Data Integrity in Linux. FAST 2026, pp. 643-657; interface scope, prototype evaluation and upstreaming boundary.
- OpenZFS zfs-2.3.4: pinned scalar Fletcher-4 functions and overflow arithmetic.
- Alan Somers. The Fletcher Checksums in ZFS. 12 April 2013, pp. 1-2 (historical scope).
- OpenZFS: Checksums and Their Use in ZFS, per-block algorithm selection.
- RFC 8259: JSON grammar, numbers, strings and UTF-8 exchange, sections 2, 5, 6, 7 and 8.1
- RFC 8949: CBOR data models, deterministic encoding, validity and security, sections 2, 4.2, 5.3 and 10
- Protocol Buffers: Proto Serialization Is Not Canonical
- Python 3.12: json.dumps, supported dictionary keys and round-trip behavior
- RFC 8785: JSON Canonicalization Scheme, sections 3.1-3.2.4 and status
- RFC 7493: I-JSON input constraints and protocol recommendations, sections 2.1-2.3 and 4.1
- Unicode Standard Annex #15: Canonical equivalence and normalization forms
- ECMAScript: JSON.parse and JSON.stringify
- ECMAScript 2025: OrdinaryOwnPropertyKeys
- Protocol Buffers encoding: Base 128 Varints and Signed Integers
- SQLite database file format: B-tree varints and record serial types, sections 1.6 and 2.1
- Apache Avro 1.12.0: Binary Encoding and writer schemas
- Lemire, Kurz and Rupp (2018), Stream VByte: Faster Byte-Oriented Integer Compression, IPL 130, 1-6
- StreamVByte API, revision 089549994faf: count, validation and readable padding
- StreamVByte size validator, revision 089549994faf
- RFC 7464: JSON Text Sequences, sections 2-4
- NDJSON specification 1.0.0, serialization and parsing, sections 3.1-3.3
- JSON Lines: UTF-8, JSON values and line terminators
- cbor2 API: canonical encoding and encode_sortable_key
- Protocol Buffers: Techniques, Streaming Multiple Messages
- Protocol Buffers: Field Presence, implicit and explicit disciplines
- Protocol Buffers: Language Guide (proto3), Unknown Fields
- Protocol Buffers: ProtoJSON Format, JSON Wire-compatible Changes
- Viotti and Kinderkhedia (2022): A Survey of JSON-compatible Binary Serialization Specifications, v2, section 5.6, p. 45
Original sources reviewed 11 October 2026; checksum and Merkle additions reviewed 12 October 2026; Linux verity, encryption boundaries and FAST 2025 review added 15 October 2026; verity read coverage, tree arithmetic, Merkle encoding and maintenance checked 18 October 2026. HDF5 coverage and reader-state evidence checked 19 October 2026. HMAC context fixtures and RFC vectors checked 21 October 2026. NPY/NPZ evidence and primary sources checked 24 October 2026. No original drive traces, third-party figures or paper model-checker implementation are reproduced. The examples illustrate boundaries; they do not establish a probability of data loss or certify a storage product.