Skip to content

Commit

Permalink
lz4: Cherrypick fix for CVE-2021-3520
Browse files Browse the repository at this point in the history
There should be no risk of us accidentally hitting this since
we'd need maliciously malformed data to wind up in the pipeline,
or a very unfortunate random bit flip at exactly the right moment.
Still since we can handle it we should.

Reviewed-by: Igor Kozhukhov <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Adam Moss <[email protected]>
Signed-off-by: Rich Ercolani <[email protected]>
Closes openzfs#12947
  • Loading branch information
rincebrain authored and nicman23 committed Aug 22, 2022
1 parent f16ada3 commit 6022221
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/lz4.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ LZ4_decompress_generic(
const size_t dictSize /* note : = 0 if noDict */
)
{
if (src == NULL) { return -1; }
if ((src == NULL) || (outputSize < 0)) { return -1; }

{ const BYTE* ip = (const BYTE*) src;
const BYTE* const iend = ip + srcSize;
Expand Down

0 comments on commit 6022221

Please sign in to comment.