Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752043AbdCOIli (ORCPT ); Wed, 15 Mar 2017 04:41:38 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46971 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751856AbdCOIle (ORCPT ); Wed, 15 Mar 2017 04:41:34 -0400 Date: Wed, 15 Mar 2017 09:41:27 +0100 From: Heiko Carstens To: Marcelo Henrique Cerri Cc: Martin Schwidefsky , linux-s390@vger.kernel.org, Peter Oberparleiter , Joy Latten , linux-kernel@vger.kernel.org Subject: Re: [PATCH] s390/decompressor: fix initrd corruption caused by bss clear References: <1489418098-1564-1-git-send-email-marcelo.cerri@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1489418098-1564-1-git-send-email-marcelo.cerri@canonical.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 17031508-0040-0000-0000-00000343A2E4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17031508-0041-0000-0000-00002485E784 Message-Id: <20170315084127.GC6039@osiris> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-03-15_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703150069 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1001 Lines: 22 On Mon, Mar 13, 2017 at 12:14:58PM -0300, Marcelo Henrique Cerri wrote: > Reorder the operations in decompress_kernel() to ensure initrd is moved > to a safe location before the bss section is zeroed. > > During decompression bss can overlap with the initrd and this can > corrupt the initrd contents depending on the size of the compressed > kernel (which affects where the initrd is placed by the bootloader) and > the size of the bss section of the decompressor. > > Also use the correct initrd size when checking for overlaps with > parmblock. > > Fixes: 06c0dd72aea3 ([S390] fix boot failures with compressed kernels) > Cc: stable@vger.kernel.org > Reviewed-by: Joy Latten > Reviewed-by: Vineetha HariPai > Signed-off-by: Marcelo Henrique Cerri > --- > arch/s390/boot/compressed/misc.c | 35 +++++++++++++++++++---------------- > 1 file changed, 19 insertions(+), 16 deletions(-) Applied. Thank you!