From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752684AbbCYApH (ORCPT ); Tue, 24 Mar 2015 20:45:07 -0400 Received: from cantor2.suse.de ([195.135.220.15]:33932 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751928AbbCYApC (ORCPT ); Tue, 24 Mar 2015 20:45:02 -0400 Date: Wed, 25 Mar 2015 01:44:58 +0100 From: David Sterba To: Krzysztof Kolasa Cc: tom.yeon@windriver.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Subject: Re: lz4: fix system halted at boot kernel x86_64 compressed lz4 Message-ID: <20150325004458.GA20767@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Krzysztof Kolasa , tom.yeon@windriver.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org References: <55114A1D.7030508@winsoft.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55114A1D.7030508@winsoft.pl> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.