Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1599509

Re: [PATCH] s390/decompressor: fix initrd corruption caused by bss clear

From Heiko Carstens <heiko.carstens@de.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] s390/decompressor: fix initrd corruption caused by bss clear
Date 2017-03-13 16:30 +0100
Message-ID <tkA53-2tH-3@gated-at.bofh.it> (permalink)
References <tkzVo-2n4-29@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <joy.latten@canonical.com>
> Reviewed-by: Vineetha HariPai <vineetha.hari.pai@canonical.com>
> Signed-off-by: Marcelo Henrique Cerri <marcelo.cerri@canonical.com>
> ---
>  arch/s390/boot/compressed/misc.c | 35 +++++++++++++++++++----------------
>  1 file changed, 19 insertions(+), 16 deletions(-)

Indeed. I just checked that we currently have 32 bytes within the bss
section of the compressed kernel image, where clearing it would corrupt the
initrd if would be placed directly behind the image.
I will look into the patch tomorrow.

Thanks,
Heiko

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] s390/decompressor: fix initrd corruption caused by bss clear Marcelo Henrique Cerri <marcelo.cerri@canonical.com> - 2017-03-13 16:20 +0100
  Re: [PATCH] s390/decompressor: fix initrd corruption caused by bss  clear Heiko Carstens <heiko.carstens@de.ibm.com> - 2017-03-13 16:30 +0100
  Re: [PATCH] s390/decompressor: fix initrd corruption caused by bss  clear Heiko Carstens <heiko.carstens@de.ibm.com> - 2017-03-15 09:50 +0100

csiph-web