Hi Mikulas,
On 8/20/26 23:44, Ben Cressey wrote:
When integrity_metadata handles a discard, it fills a buffer with
DISCARD_FILLER and writes it over the tags, max_blocks blocks at a
time. If the kmalloc fails, the buffer is the on-stack array>
checksums_onstack and max_size is set to HASH_MAX_DIGESTSIZE. So if the
tag size is larger than HASH_MAX_DIGESTSIZE, max_blocks is zero, bi_size
is never decremented and the loop never terminates.
Following up on this explicitly in case it got lost in the noise.
Jo and I reviewed 1/2 and the one-line fix is correct.
2/2 is independent of our change (on-stack fallback with tag_size >
HASH_MAX_DIGESTSIZE) and also looks right to us.
Reviewed-by: Shukai Ni <[email protected]>
Reviewed-by: Jo Van Bulck <[email protected]>