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: <20240322091857.GM8211@craftyguy.net>
Date: Fri, 22 Mar 2024 09:18:57 -0700
From: Clayton Craft <clayton@...ftyguy.net>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Hans de Goede <hdegoede@...hat.com>, x86@...nel.org,
 linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org,
 Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
 Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
 regressions@...ts.linux.dev
Subject: Re: x86_64 32-bit EFI mixed mode boot broken

On Fri, 22 Mar 2024 13:52:05 +0100 Ard Biesheuvel <ardb@...nel.org> wrote:
> That depends on the bootloader. One of the changes around that time is
> the introduction of this Kconfig symbol: before that, the EFI handover
> protocol was always supported but now it can be compiled out. So the
> safe choice is to enable it.

I am using systemd-boot, and based on my understanding of its source it seems to
only use handover on old kernels that don't support LINUX_INITRD_MEDIA_GUID.
> 
> However, while looking more deeply into this, I noticed that we are
> running quite low own stack space. Mixed mode is different because it
> calls into the boot services using the decompressor's boot stack,
> rather than using the one that was provided by firmware at entry.
> (Note that the UEFI spec mandates 128k of stack space)
> 
> In my case, I bisected the regression to
> 
> commit 5c4feadb0011983bbc4587bc61056c7b379d9969 (HEAD)
> Author: Ard Biesheuvel <ardb@...nel.org>
> Date:   Mon Aug 7 18:27:16 2023 +0200
> 
>     x86/decompressor: Move global symbol references to C code
> 
> which moves the boot stack into a different memory region. Formerly,
> we'd end up at the far end of the heap when overrunning the stack but
> now, we end up crashing. Of course, overwriting the heap can cause
> problems of its own, so we'll need to bump this in any case.
> 
> Could you give this a try please?
> 
> 
> --- a/arch/x86/include/asm/boot.h
> +++ b/arch/x86/include/asm/boot.h
> @@ -38,7 +38,7 @@
>  #endif
> 
>  #ifdef CONFIG_X86_64
> -# define BOOT_STACK_SIZE       0x4000
> +# define BOOT_STACK_SIZE       0x10000
> 
>  /*
>   * Used by decompressor's startup_32() to allocate page tables for identity

Just gave this a try, on 6.1.82, and the system still reboots after selecting
the kernel in the bootloader. So it seems like my problem is different.

As I mentioned initially, I bisected my failure to e2ab9eab32. Does that give
any hint about what might be the problem?

-Clayton

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ