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 <igor@dilos.org>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Adam Moss <c@yotes.com>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes openzfs#12947
  • Loading branch information
rincebrain authored and nicman23 committed Aug 22, 2022
1 parent 9499633 commit 573c095
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 573c095

Please sign in to comment.