lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180726145008.ccmeklqx4ofb4456@black.fi.intel.com>
Date:   Thu, 26 Jul 2018 17:50:08 +0300
From:   "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To:     Dmitry Malkin <d.malkin@...l-time-systems.com>
Cc:     linux-x86_64@...r.kernel.org, linux-kernel@...r.kernel.org,
        Ingo Molnar <mingo@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        "H. Peter Anvin" <hpa@...or.com>, x86@...nel.org
Subject: Re: 4.17.x won't boot due to "x86/boot/compressed/64: Handle 5-level
 paging boot if kernel is above 4G"

On Thu, Jul 26, 2018 at 08:10:42AM +0000, Dmitry Malkin wrote:
> 
> 
> On 07/25/2018 11:21 PM, Kirill A. Shutemov wrote:
> > On Wed, Jul 25, 2018 at 05:26:02PM +0000, Dmitry Malkin wrote:
> > > there may be some other reasons which may cause undefined behavior (reboot
> > > for example):
> > > 
> > > in arch/x86/boot/compressed/pgtable_64.c in function paging_prepare():
> > > 
> > > 1. structure "paging_config" allocated on stack without setting default
> > > value for flag "l5_required":
> > > > > struct paging_config paging_config = {};
> > > l5_required is set only if CONFIG_X86_5LEVEL is defined
> > Hm? C99 initializer zeros the structure.
> https://elixir.bootlin.com/linux/latest/source/Makefile#L366
> Here I only see std=gnu89.

gnu89 support C99-style initializers. The syntax above would clear fields
that not initialized explicitly, in this case all of them.

> > > 2. reading from memory which may be reserved in case of EFI systems:
> > > > >     ebda_start = *(unsigned short *)0x40e << 4;
> > > > >     bios_start = *(unsigned short *)0x413 << 10;
> > > Also, on EFI system without CSM it will results in all zeros. Which will
> > > place trampoline_start to 0x9d000. And it also may be reserved memory. In
> > > fact I have such system and it is causes instant reboot (when code starts
> > > copying to "trampoline_start").
> > Could you show dmesg from such system?
> Sure, here it is (please note than not both pages are reserved but only
> second one: 0x9e000-0x9ffff):

Well. That's bad.

I don't see much options but parse e820 in decompression code. I hoped to
avoid this.

Let me see what I can do there.

-- 
 Kirill A. Shutemov

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ