Re: [PATCHv2] hurd: Use part: qualifier

2022-05-26 Thread Daniel Kiper
On Thu, May 26, 2022 at 12:58:21AM +0200, Samuel Thibault wrote: > When using userland drivers such as rumpdisk, we'd rather make ext2fs use > parted-based libstore partitioning support. That can be used for kernelland > drivers as well, so we can just make grub always use the part: qualifier to >

Re: [PATCH v3 3/5] cryptodisk: Add options to cryptomount to support keyfiles

2022-05-26 Thread Daniel Kiper
On Fri, May 20, 2022 at 02:32:17PM -0500, Glenn Washburn wrote: > From: John Lane > > Add the options --key-file, --keyfile-offset, and --keyfile-size to > cryptomount and code to put read the requested key file data and pass > via the cargs struct. Note, key file data is for all intents and purpo

Re: [RFC PATCH v3 1/5] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-26 Thread Daniel Kiper
On Fri, May 20, 2022 at 10:37:37AM -0400, Mathieu Desnoyers wrote: > The current implementation of the 10_linux script implements its menu > items sorting in bash with a quadratic algorithm, calling "sed", "sort", > "head", and "grep" to compare versions between individual lines, which > is annoyin

Re: [RFC PATCH v3 0/5] grub-mkconfig: Fix quadratic algorithm for sorting menu items

2022-05-26 Thread Daniel Kiper
On Fri, May 20, 2022 at 12:08:05PM -0400, Mathieu Desnoyers wrote: > Sorry, the subject prefix for this patch series should have been [RFC PATCH > v4 n/5]. Next time you can drop RFC from the subject. Daniel ___ Grub-devel mailing list Grub-devel@gnu.

Re: [PATCH v3] efidisk: pass buffers with higher alignment

2022-05-26 Thread Daniel Kiper
Hey, On Thu, May 19, 2022 at 09:36:41AM +0200, Stefan Agner wrote: > On 2022-05-18 10:59, Stefan Agner wrote: > > Some devices report a IoAlign value of 2, however seem to require a > > buffer with higher alignment. > > After releasing Home Assistant OS 8.0 publicly, some systems still > refuse to

Re: [RFC PATCH v3 1/5] grub-mkconfig linux: Fix quadratic algorithm for sorting menu items

2022-05-26 Thread Mathieu Desnoyers
- On May 26, 2022, at 11:13 AM, Daniel Kiper dki...@net-space.pl wrote: > On Fri, May 20, 2022 at 10:37:37AM -0400, Mathieu Desnoyers wrote: >> The current implementation of the 10_linux script implements its menu >> items sorting in bash with a quadratic algorithm, calling "sed", "sort", >> "

Re: [PATCH v3 3/5] cryptodisk: Add options to cryptomount to support keyfiles

2022-05-26 Thread Glenn Washburn
On Thu, 26 May 2022 16:24:13 +0200 Daniel Kiper wrote: > On Fri, May 20, 2022 at 02:32:17PM -0500, Glenn Washburn wrote: > > From: John Lane > > > > Add the options --key-file, --keyfile-offset, and --keyfile-size to > > cryptomount and code to put read the requested key file data and pass > > v

[PATCH 0/6] Fix coverity bugs and add checks for elf values in grub-core

2022-05-26 Thread Alec Brown
Coverity identified several untrusted loop bounds and untrusted allocation size bugs in grub-core/loader/i386/bsdXX.c and grub-core/loader/multiboot_elfXX.c. Upon review of these bugs, I found that specific checks weren't being made to various elf header values based on the elf manual page. The fir

[PATCH 5/6] util/grub-module-verifierXX.c: Add e_shoff check in get_shdr()

2022-05-26 Thread Alec Brown
In util/grub-module-verifierXX.c, the function get_shdr() is used to obtain the section header at a given index but isn't checking that there is an offset for the section header table. To validate that there is, we can check that e_shoff isn't 0. Signed-off-by: Alec Brown --- util/grub-module-ve

[PATCH 6/6] util/grub-module-verifierXX.c: Changed get_shnum() return type

2022-05-26 Thread Alec Brown
In util/grub-module-verifierXX.c, the function get_shnum() returns the variable shnum, which is of the type Elf_Word. In the function, shnum can be obtained by the e_shnum member of an Elf_Ehdr or the sh_size member of an Elf_Shdr. The sh_size member can either be grub_uint32_t or grub_uint64_t, de

[PATCH 4/6] elf: Validate number of elf program header table entries

2022-05-26 Thread Alec Brown
In bsdXX.c and multiboot_elfXX.c, e_phnum is used to obtain the number of program header table entries, but it wasn't being checked if the value was there. According to the elf(5) manual page, "If the number of entries in the program header table is larger than or equal to PN_XNUM (0x), this m

[PATCH 1/6] grub-core/loader/i386/bsdXX.c: Avoid downcasting (char *) to (Elf_Shdr *)

2022-05-26 Thread Alec Brown
In bsdXX.c, a couple of untrusted loop bound and untrusted allocation size bugs were flagged by Coverity in the functions grub_openbsd_find_ramdisk() and grub_freebsd_load_elfmodule(). These bugs were flagged by coverity because the variable shdr was downcasting from a char pointer to an Elf_Shdr p

[PATCH 2/6] elf: Validate number of elf section header table entries

2022-05-26 Thread Alec Brown
In bsdXX.c and multiboot_elfXX.c, e_shnum is used to obtain the number of section header table entries, but it wasn't being checked if the value was there. According to the elf(5) manual page, "If the number of entries in the section header table is larger than or equal to SHN_LORESERVE (0xff00),

[PATCH 3/6] elf: Validate elf section header table index for section name string table

2022-05-26 Thread Alec Brown
In multiboot_elfXX.c, e_shstrndx is used to obtain the section header table index of the section name string table, but it wasn't being checked if the value was there. According to the elf(5) manual page, "If the index of section name string table section is larger than or equal to SHN_LORESERVE (

Re: [RFC PATCH v3 5/5] Cleanup: grub-mkconfig_lib: remove unused version comparison functions

2022-05-26 Thread Robbie Harwood
Mathieu Desnoyers writes: > There are no users left of version_find_latest(), version_test_gt(), and > version_test_numeric(). Remove those unused helper functions. Using > those helper functions is what caused the quadratic sorting performance > issues in the first place, so removing them is a n

Re: [RFC PATCH v3 5/5] Cleanup: grub-mkconfig_lib: remove unused version comparison functions

2022-05-26 Thread Michael Chang via Grub-devel
On Thu, May 26, 2022 at 05:07:11PM -0400, Robbie Harwood wrote: > Mathieu Desnoyers writes: > > > There are no users left of version_find_latest(), version_test_gt(), and > > version_test_numeric(). Remove those unused helper functions. Using > > those helper functions is what caused the quadrati