On 2025-09-08 15:16, Mikulas Patocka wrote:
Hi
These patches add asynchronous hash support to dm-integrity.
Harald, please test them, I will commit them if they work for you.
Mikulas
Back from vacation ...
Applied your patches to the latest 6.17-rc5. Git complains about an
whitespace issue on patch #7 but other that that applied without issue.
Kernel build and execution of my simple tests show no failures and all
works fine with an phmac-sha256 and phmac-sha512.
A modified version of the cryptsetup testcase
tests/integrity-compat-test
(where I added the phmac) ran without failures:
Integrity mode tests:
[INTEGRITY:blake2s-256:32:512][FORMAT][N/A]
...
[INTEGRITY:hmac(sha256):32:4096][KEYFILE:4096][FORMAT][ACTIVATE][CHECKSUM
OK][REMOVE][OK]
[INTEGRITY:phmac(sha256):32:4096][KEYFILE:80][FORMAT][ACTIVATE][CHECKSUM
OK][REMOVE][OK]
Error detection tests:
[INTEGRITY:J:crc32c:4:512][FORMAT][ACTIVATE][WRITE DATA][CORRUPT
DATA:315392][DETECT ERROR][REMOVE][OK]
...
[INTEGRITY:J:hmac-sha256:32:4096][FORMAT][ACTIVATE][KEYED HASH][WRITE
DATA][CORRUPT DATA:270336][DETECT ERROR][REMOVE][OK]
[INTEGRITY:J:phmac-sha256:32:4096][FORMAT][ACTIVATE][KEYED HASH][WRITE
DATA][CORRUPT DATA:270336][DETECT ERROR][REMOVE][OK]
Integrity mode tests (inline tags):
[INTEGRITY:crc32c:4:4096][FORMAT][ACTIVATE][CHECKSUM OK][REMOVE][OK]
...
[INTEGRITY:hmac(sha256):32:4096][KEYFILE:4096][FORMAT][ACTIVATE][CHECKSUM
OK][REMOVE][OK]
[INTEGRITY:phmac(sha256):32:4096][KEYFILE:80][FORMAT][ACTIVATE][CHECKSUM
OK][REMOVE][OK]
Error detection tests (inline tags):
...
[INTEGRITY:J:hmac-sha256:32:4096][FORMAT][ACTIVATE][KEYED HASH][WRITE
DATA][CORRUPT DATA:4096][DETECT ERROR][REMOVE][OK]
[INTEGRITY:J:phmac-sha256:32:4096][FORMAT][ACTIVATE][KEYED HASH][WRITE
DATA][CORRUPT DATA:4096][DETECT ERROR][REMOVE][OK]
Journal parameters tests:
...
Journal encryption tests:
...
Mode tests:
[MODE TESTS:crc32c:4:512][JOURNALED WRITES][DIRECT WRITES][RECOVERY
MODE][OK]
...
[MODE TESTS:hmac-sha256:32:4096][JOURNALED WRITES][DIRECT
WRITES][RECOVERY MODE][OK]
[MODE TESTS:phmac-sha256:32:4096][JOURNALED WRITES][DIRECT
WRITES][RECOVERY MODE][OK]
Recalculate tags in-kernel:[CHECKSUM OK][OK][CHECKSUM OK][RESET OK]
Recalculate tags in-kernel (inline tags):[CHECKSUM OK][OK][CHECKSUM
OK][RESET OK]
Separate metadata device:[CHECKSUM OK][OK]
Bitmap mode parameters:[OK]
Bitmap error detection tests:
[INTEGRITY:B:crc32c:4:512][FORMAT][ACTIVATE][WRITE DATA][CORRUPT
DATA:315392][DETECT ERROR][REMOVE][OK]
...
[INTEGRITY:B:hmac-sha256:32:4096][FORMAT][ACTIVATE][KEYED HASH][WRITE
DATA][CORRUPT DATA:270336][DETECT ERROR][REMOVE][OK]
[INTEGRITY:B:phmac-sha256:32:4096][FORMAT][ACTIVATE][KEYED HASH][WRITE
DATA][CORRUPT DATA:270336][DETECT ERROR][REMOVE][OK]
Big device:[OK]
Deferred removal of device:[OK]
Fixed HMAC and legacy flags:[OK]
[INTEGRITY BASIC RESIZE NOKEY][FORMAT][ACTIVATE][SHRINK][OK]
...
Early check for active name:[OK]
Thanks for this work :-)