Re: [PATCH] grub-core/disk/cryptodisk.c: Fix unintentional integer overflow

2022-10-14 Thread Darren Kenny
Hi Alec, This looks good, thanks for fixing it. On Thursday, 2022-10-13 at 22:13:44 +01, Alec Brown wrote: > In the function grub_cryptodisk_endecrypt(), a for loop is incrementing the > variable i by (1U << log_sector_size). The variable i is of type grub_size_t > which is a 64-bit unsigned inte

Re: [PATCH v2] tpm: Disable tpm verifier if tpm is not present

2022-10-14 Thread Daniel Kiper
On Fri, Oct 07, 2022 at 01:37:10PM +0800, Michael Chang via Grub-devel wrote: > This helps to prevent out of memory error when reading large files via > disabling > tpm device as verifier has to read all content into memory in one chunk to > measure the hash and extend to tpm. How does this patch

Re: [PATCH v3] templates: introduce GRUB_TOP_LEVEL_* vars

2022-10-14 Thread Daniel Kiper
On Wed, Oct 05, 2022 at 02:22:38AM -0700, Denton Liu wrote: > A user may wish to use an image that is not sorted as the "latest" > version as the top-level entry. For example, in Arch Linux, if a user > has the LTS and regular kernels installed, `/boot/vmlinuz-linux-lts` > gets sorted as the "lates

Re: [PATCH v4 1/1] Add support for grub-emu to kexec Linux menu entries

2022-10-14 Thread Daniel Kiper
On Tue, Oct 04, 2022 at 03:16:48PM -0400, Robbie Harwood wrote: > From: Raymund Will > > The GRUB emulator is used as a debugging utility but it could also be > used as a user-space bootloader if there is support to boot an operating > system. > > The Linux kernel is already able to (re)boot anoth

Re: [PATCH v4 2/6] linux/arm: unify ARM/arm64 vs Xen PE/COFF header handling

2022-10-14 Thread Daniel Kiper
On Thu, Sep 08, 2022 at 03:30:13PM +0200, Ard Biesheuvel wrote: > Xen has its own version of the image header, to account for the > additional PE/COFF header fields. Since we are adding references to > those in the shared EFI loader code, update the common definitions > and drop the Xen specific on

Re: [PATCH v4 1/6] efi: move MS-DOS stub out of generic PE header definition

2022-10-14 Thread Daniel Kiper
On Thu, Sep 15, 2022 at 04:03:36PM +0200, Ard Biesheuvel wrote: > On Thu, 15 Sept 2022 at 14:21, Leif Lindholm > wrote: > > > > On Thu, Sep 08, 2022 at 15:30:12 +0200, Ard Biesheuvel wrote: > > > The PE/COFF spec permits the COFF signature and file header to appear > > > anywhere in the file, and

Re: [PATCH v4 3/6] linux/arm: account for COFF headers appearing at unexpected offsets

2022-10-14 Thread Daniel Kiper
On Thu, Sep 08, 2022 at 03:30:14PM +0200, Ard Biesheuvel wrote: > The way we load the Linux and PE/COFF image headers depends on a fixed > placement of the COFF header at offset 0x40 into the file. This is a > reasonable default, given that this is where Linux emits it today. > However, in order to

Re: [PATCH v4 4/6] efi/efinet: Don't close connections at fini_hw() time

2022-10-14 Thread Daniel Kiper
On Thu, Sep 08, 2022 at 03:30:15PM +0200, Ard Biesheuvel wrote: > When GRUB runs on top of EFI firmware, it only has access to block and > network device abstractions exposed by the firmware, and it is up to the > firmware to quiesce the underlying hardware when exiting boot services > and handing

[PATCH 2/2] configure: Fix building with clang

2022-10-14 Thread Darren Kenny
Building the current code with clang and the latest gnulib fails due to the use of a variable-length-array (vla) warning, which turns in to an error due to the presence of the -Werror during the build. The gnulib team stated that their code should not be built with -Werror. At present, the only w

[PATCH 1/2] gnulib: Provide abort() implementation for gnulib

2022-10-14 Thread Darren Kenny
The recent gnulib updates require an implemention of abort(), but the current macro provided by changeset: cd37d3d3916c gnulib: Drop no-abort.patch to config.h.in does not work with the clang compiler since it doesn't provide a __builtin_trap implementation, so this element of the changeset need

[PATCH 0/2] Fix building with clang

2022-10-14 Thread Darren Kenny
The abiltiy to build with clang was broken in the last release after the upgrade of gnulib. There were two main issues: - The use of __builtin_trap in the abort() macro. This builtin doesn't exist for clang builds After some discussion between Daniel and Vladimir, it was requested that I

[PATCH v2] grub-core/disk/cryptodisk.c: Fix unintentional integer overflow

2022-10-14 Thread Alec Brown
In the function grub_cryptodisk_endecrypt(), a for loop is incrementing the variable i by (1U << log_sector_size). The variable i is of type grub_size_t which is a 64-bit unsigned integer on x86_64 architecture. On the other hand, 1U is a 32-bit unsigned integer. By performing a left shift on a 32-