Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68CDFC47073 for ; Mon, 1 Jan 2024 16:37:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKLHo-0005GN-Bd; Mon, 01 Jan 2024 11:37:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rKLHm-0005GB-Qi for grub-devel@gnu.org; Mon, 01 Jan 2024 11:37:06 -0500 Received: from pb-smtp21.pobox.com ([173.228.157.53]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rKLHk-00044X-W9 for grub-devel@gnu.org; Mon, 01 Jan 2024 11:37:06 -0500 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 76CE826B6E; Mon, 1 Jan 2024 11:37:03 -0500 (EST) (envelope-from drummer@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=message-id :date:mime-version:subject:to:cc:references:from:in-reply-to :content-type:content-transfer-encoding; s=sasl; bh=DTTOtZPTI2ib ZcINgEg2claYVqTdYeu+dWOquu0V9cY=; b=h/C8eyf2M9JaAXg6R5UdlkQFAFth zkGJ0dF5l3DZxzo9TS+Hi5FaQU8AxmIUfKMJLpzD95zITVWOaME2wg0EyD/Sjy8k 6HO6mEsqLlddgj0VUeb36TxgRePUef3AsG0/pth2E9XmcYgbd6Ey8pm8jt3sMUhc HXD1mW5j9Jx75Xw= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 6F6F726B6D; Mon, 1 Jan 2024 11:37:03 -0500 (EST) (envelope-from drummer@pobox.com) Received: from [192.168.1.173] (unknown [96.240.1.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id 0287826B6A; Mon, 1 Jan 2024 11:36:57 -0500 (EST) (envelope-from drummer@pobox.com) Message-ID: Date: Mon, 1 Jan 2024 11:36:55 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Severe bug in grub-2.12-for-windows To: development@efficientek.com Cc: The development of GNU GRUB , Ard Biesheuvel , Daniel Kiper References: <92ef2aea-3848-4e64-94dd-a668bd99c2e5@pobox.com> <20231231211826.34fc5126@crass-HP-ZBook-15-G2> Content-Language: en-US From: Dave Pickens In-Reply-To: <20231231211826.34fc5126@crass-HP-ZBook-15-G2> X-Pobox-Relay-ID: FB5A2406-A8C3-11EE-8142-A19503B9AAD1-16937254!pb-smtp21.pobox.com Received-SPF: pass client-ip=173.228.157.53; envelope-from=drummer@pobox.com; helo=pb-smtp21.pobox.com X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, MIME_HTML_ONLY=0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Content-Type: multipart/mixed; boundary="===============8499639799487522792==" Errors-To: grub-devel-bounces+grub-devel=archiver.kernel.org@gnu.org Sender: grub-devel-bounces+grub-devel=archiver.kernel.org@gnu.org --===============8499639799487522792== Content-Language: en-US Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Glenn,

Some additional info that may give a clue about this issue.

I have attached two additional files:

output.genefi32.txt=C2=A0=C2=A0=C2=A0 output of grub-mkimage for EF= I 32 bit i386-efi

output.genbios.txt=C2=A0=C2=A0=C2=A0=C2=A0 output of grub-mkimage f= or non EFI=C2=A0 i386-pc

I noted that the __stack_chk_guard output entries are quite different in the working EFI 32 bit versus the failing EFI 64 bit output.

In the non EFI output, the __stack_chk_guard entries do not appear at all. I expect this is normal.

Many thanks,

Dave


On 12/31/2023 10:18 PM, Glenn Washburn wrote:
On Sun, 31 Dec 2023 13:10:47=
 -0500
Dave Pickens <drummer@pobox.com> wrote:

Hi,

I am the author of Grub2Win.

In order to generate kernels from a Windows environment, I rely heavily o=
n the Windows version (grub-2.12-for-windows)

In testing, I have discovered that the EFI 64 bit kernel generated by the=
 grub-mkimage.exe module will not boot.
The EFI 32 bit and non EFI i386-pc kernels work well and boot with no pro=
blem.

I have submitted bug report #65072 with details, a screenshot and the scr=
ipt used to generate the kernels.
The text of the bug report is shown below.

Any help from you would be greatly appreciated as I would like to include=
 the 2.12 kernels in my software soon.

Many thanks,

Dave Pickens


*************************************************************************=
*********************


I am testing the newly released version 2.12.

Using grub-mkimage.exe to create a bootable 64 bit EFI kernel.

When the kernel is loaded at boot time it gives message

symbol '_stack_chk_guard' not found
I see in your output that grub-mkimage.exe is relocating the symbol
"_stack_chk_guard", but I'm not sure why. GRUB uses a similarly named
symbol that has two underscores in front, not one. So I'm guessing that
something is eating the first underscore, probably in some name
mangling that only happens on Windows. I see that there are other
double underscore symbols that showup with one underscore. I wonder if
this has to do with the compiler used to build the kernel.img.

Daniel how is that executable built? Compiling on Windows or cross
compiling? What compiler is used?

I don't develop on Windows so I don't know how much more help I'll be
here.

See the attached screenshot.
Then the kernel aborts.

I was extremely careful when generating the kernel to ensure that the mat=
ching libraries were used by the grub-mkimage command.
The libraries and command are all in the same directory, so it is very un=
likely that a mismatch occurred.

This bug renders grub-2.12-for-windows useless.
The kernel will not boot.

I have also attached the Windows .bat script I used to generate the kerne=
ls.

Note: The 32 bit i386-efi and non EFI i386-pc kernels work fine.
The problem is strictly with the 64 bit x86_64-efi kernel.
This I find surprising.

Glenn


--===============8499639799487522792== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KR3J1Yi1kZXZl bCBtYWlsaW5nIGxpc3QKR3J1Yi1kZXZlbEBnbnUub3JnCmh0dHBzOi8vbGlzdHMuZ251Lm9yZy9t YWlsbWFuL2xpc3RpbmZvL2dydWItZGV2ZWwK --===============8499639799487522792==--