zfs/cmd/zdb
Kent Ross 7ecaa07580
make zdb_decompress_block check decompression reliably
This function decompresses to two buffers and then compares them to
check whether the (opaque) decompression process filled the whole
buffer. Previously it began with lbuf uninitialized and lbuf2 filled
with pseudorandom data. This neither guarantees that any bytes not
written by the compressor would be different, nor seems incredibly
sound otherwise!

After these changes, instead of filling one buffer with generated
pseudorandom data we overwrite each buffer with completely different
data. This should remove the possibility of low-probability failures,
as well as make the process simpler and cheaper.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Kent Ross <k@mad.cash>
Closes #15733
2024-01-09 09:13:52 -08:00
..
Makefile.am zdb: add decryption support 2023-03-02 13:39:09 -08:00
zdb.c make zdb_decompress_block check decompression reliably 2024-01-09 09:13:52 -08:00
zdb.h Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
zdb_il.c zdb: Dump encrypted write and clone ZIL records 2023-12-06 12:39:12 -08:00