Re: lz4: fix system halted at boot kernel x86_64 compressed lz4

David Sterba
2015-03-25T00:45:07Z

On Tue, Mar 24, 2015 at 12:27:25PM +0100, Krzysztof Kolasa wrote:
> lz4: fix system halted at boot kernel x86_64 compressed lz4
>
> Decompression process ends with an error when loading kernel:
>
> Decoding failed
> -- System halted

Serious regression detected ...

>
> This condition is probably not needed ( from the last commit d5e7caf) :

The offending patch is on the way to stable trees, so it would be best
to postpone it for now.

> if( ... ||
> (op + COPYLENGTH) > oend)
> goto _output_error
>
> macro LZ4_SECURE_COPY() tests op and does not copy any data
> when op exceeds the value, decompression process is continued.
>
> added by analogy security for the ref:
>
> if ((ref + COPYLENGTH) > oend...
>
> to lz4_uncompress_unknownoutputsize(...)

I did only a quick check, your analysis seems correct. Reviewing the lz4
patches is tedious as the kernel implementations do not match the
upstream one line-by-line besides that I've missed the side effects of
the macro.