diff options
author | naivekun <[email protected]> | 2023-03-17 02:54:10 +0800 |
---|---|---|
committer | GitHub <[email protected]> | 2023-03-16 11:54:10 -0700 |
commit | 60cfd3bbc22cd51a2e7e9c8341d9909cdb5dac85 (patch) | |
tree | c9b78d5aaa858c0382eb3a1233faeb2d055931f0 /module/os/linux/zfs/qat_compress.c | |
parent | 480d809703c55f54f2ea8b69d22ea36346cfd5e2 (diff) |
QAT: Fix uninitialized seed in QAT compression
CpaDcRqResults have to be initialized with checksum=1 for adler32.
Otherwise when error CPA_DC_OVERFLOW occurred, the next compress
operation will continue on previously part-compressed data, and write
invalid checksum data. When zfs decompress the compressed data, a
invalid checksum will occurred and lead to #14463
Reviewed-by: Tino Reichardt <[email protected]>
Reviewed-by: Weigang Li <[email protected]>
Reviewed-by: Chengfei Zhu <[email protected]>
Signed-off-by: naivekun <[email protected]>
Closes #14632
Closes #14463
Diffstat (limited to 'module/os/linux/zfs/qat_compress.c')
-rw-r--r-- | module/os/linux/zfs/qat_compress.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/os/linux/zfs/qat_compress.c b/module/os/linux/zfs/qat_compress.c index 7088f6bd1..07d5d34da 100644 --- a/module/os/linux/zfs/qat_compress.c +++ b/module/os/linux/zfs/qat_compress.c @@ -247,7 +247,7 @@ qat_compress_impl(qat_compress_dir_t dir, char *src, int src_len, Cpa8U *buffer_meta_src = NULL; Cpa8U *buffer_meta_dst = NULL; Cpa32U buffer_meta_size = 0; - CpaDcRqResults dc_results; + CpaDcRqResults dc_results = {.checksum = 1}; CpaStatus status = CPA_STATUS_FAIL; Cpa32U hdr_sz = 0; Cpa32U compressed_sz; |