Re: [PATCH v2 0/1] loader/efi/chainloader: Enhance error message of chainloader

2025-05-07 Thread Ross Philipson via Grub-devel
On 5/7/25 9:21 AM, khaliid caliy wrote: This patch addresses some undescriptive error messages that grub chainloader command returns when issue encountered, specifically during the loading of the uefi image or starting the image. As per uefi UEFI specification (2.11) boot service functions `Star

Re: [PATCH v2] fs/ntfs: Check at->attr_cur after calling next_attribute()

2025-03-26 Thread Ross Philipson via Grub-devel
On 3/20/25 3:54 PM, Andrew Hamilton wrote: A regression was introduced recently as a part of the series of filesystem related patches to address some CVEs found in GRUB. This issue may cause either an infinite loop at startup when accessing certain valid NTFS file systems, or may cause a crash d

Re: [RFC] Rust in GRUB

2025-03-21 Thread Ross Philipson via Grub-devel
On 3/21/25 5:19 PM, Andrew Hamilton wrote: Hello, Personally, I really like this idea. I second that. One of the areas I think (I am not a Rust programmer) Rust could really help GRUB is in the many large and imposing parsing routines in modules. From what I have read and heard, Rust could i

Re: [PATCH] tss2: restore buffer offset on tpm2_submit_command retry

2025-03-06 Thread Ross Philipson via Grub-devel
On 3/6/25 11:46 AM, Yann Diorcet wrote: When tpm2_submit_command_real is called for a retry, the content of out buffer can already be set with previous grub_tcg2_submit_command call's reply. Restore previous offset allowing the next tpm2_submit_command_real calls to succeed. This solves the issu

Re: [PATCH 1/1] lib: Fix clang Build - Remove Duplicate Typedef in TSS

2025-03-03 Thread Ross Philipson via Grub-devel
On 3/2/25 8:54 AM, Andrew Hamilton wrote: tss2_structs.h contains a duplicate typedef as follows: typedef TPMS_SCHEME_HASH_t TPMS_SCHEME_KDF2_t; This causes a build failure when compiling with clang. Remove the duplicate typedef which allows successfully building GRUB with clang. Signed-off-by:

Re: [PATCH 3/3] blsuki: Add uki command to load Unified Kernel Image entries

2025-02-27 Thread Ross Philipson via Grub-devel
On 2/14/25 8:40 AM, Alec Brown wrote: A Unified Kernel Image is a single UEFI PE file that combines a UEFI boot stub, a Linux kernel image, an initrd, and further resources. The uki command will locate where the uki file is and create a GRUB menu entry to load it. I chatted with Alec yesterday

Re: [PATCH 3/3] blsuki: Add uki command to load Unified Kernel Image entries

2025-02-24 Thread Ross Philipson via Grub-devel
On 2/14/25 8:40 AM, Alec Brown wrote: A Unified Kernel Image is a single UEFI PE file that combines a UEFI boot stub, a Linux kernel image, an initrd, and further resources. The uki command will locate where the uki file is and create a GRUB menu entry to load it. Signed-off-by: Alec Brown ---

Re: [PATCH 2/3] blsuki: Check for mounted /boot in emu

2025-02-24 Thread Ross Philipson via Grub-devel
On 2/14/25 8:40 AM, Alec Brown wrote: Irritatingly, BLS defines paths relatives to the mountpoint of the filesystem which contains its snippets, not / or any other fixed location. So grub2-emu needs to know whether /boot is a separate filesysem from / and conditionally prepend a path. Signed-of

Re: [PATCH 1/3] blsuki: Add blscfg command to parse Boot Loader Specification snippets

2025-02-24 Thread Ross Philipson via Grub-devel
On 2/14/25 8:40 AM, Alec Brown wrote: The BootLoaderSpec (BLS) defines a scheme where different bootloaders can share a format for boot items and a configuration directory that accepts these common configurations as drop-in files. I have looked over this patch carefully (esp. the parsing routin

Re: [PATCH 1/1] gdb: typo hueristic

2025-01-16 Thread Ross Philipson via Grub-devel
On 1/16/25 4:25 AM, Heinrich Schuchardt wrote: %s/hueristic/heuristic/ Signed-off-by: Heinrich Schuchardt --- grub-core/gdb_helper.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/gdb_helper.py.in b/grub-core/gdb_helper.py.in index 5ed9eab0f..a2cab416a 1006

Re: [PATCH] commands/file: Fix null dereference in the knetbsd tests

2025-01-14 Thread Ross Philipson via Grub-devel
On 1/5/25 12:24 AM, Glenn Washburn wrote: From: Lukas Fink The pointer returned by grub_elf_file() is not checked to verify it is not null before use. A null pointer may be returned when the given file does not have a valid ELF header. Indeed or for a number of other reasons. Also other place

Re: [PATCH] nx: Rename GRUB_DL_ALIGN to DL_ALIGN

2024-10-16 Thread Ross Philipson via Grub-devel
On 10/16/24 6:04 AM, Daniel Kiper wrote: Rename has been skipped by mistake in the original commit. Fixes: 94649c026 (nx: Set page permissions for loaded modules) Signed-off-by: Daniel Kiper Reviewed-by: Ross Philipson --- grub-core/kern/dl.c | 2 +- 1 file changed, 1 insertion(+), 1 d

Re: [PATCH] acpi: Fix out of bounds access in grub_acpi_xsdt_find_table()

2024-10-16 Thread Ross Philipson via Grub-devel
On 10/15/24 10:20 PM, Benjamin Herrenschmidt wrote: The calculation of the size of the table was incorrect (copy/pasta from grub_acpi_rsdt_find_table() I assume...). The entries are 64-bit long. Yup that is correct for XSDT entries, the are 64b each. Reviewed-by: Ross Philipson This causes

Re: [PATCH v1 37/37] chainloader: Use grub_efi_...() memory helpers where reasonable.

2024-10-07 Thread Ross Philipson via Grub-devel
On 10/7/24 11:21 AM, Leo Sandoval wrote: From: Peter Jones This uses grub_efi_allocate_pool(), grub_efi_free_pool(), and grub_efi_free_pages() instead of open-coded efi_call_N() calls, so we get more reasonable type checking. While the idea of putting wrappers around the EFI pool allocation c

Re: [PATCH v1 25/37] grub.texi: Make our info pages say "grub2" where appropriate.

2024-10-07 Thread Ross Philipson via Grub-devel
On 10/7/24 11:20 AM, Leo Sandoval wrote: From: Peter Jones This needs to be hooked up to --program-transform=, but I haven't had time. Can you explain/expand on this? It is not clear (to me) what that means. Is something missing from this patch? Thanks Ross Signed-off-by: Peter Jones -

Re: [PATCH v2 09/17] commands: Pass "\x[[:hex:]][[:hex:]]" straight through unmolested.

2024-10-07 Thread Ross Philipson via Grub-devel
On 10/7/24 11:18 AM, Leo Sandoval wrote: From: Peter Jones Don't munge raw spaces when we're doing our cmdline escaping (#923374) Signed-off-by: Peter Jones --- grub-core/commands/wildcard.c | 16 - grub-core/lib/cmdline.c | 25 ++-- grub-core/script/exec

Re: [PATCH] lvm: allocate metadata buffer from raw contents

2024-10-07 Thread Ross Philipson via Grub-devel
On 10/3/24 8:40 PM, Michael Chang via Grub-devel wrote: On Thu, Oct 03, 2024 at 10:30:15AM GMT, ross.philip...@oracle.com wrote: On 10/3/24 12:23 AM, Michael Chang via Grub-devel wrote: Previously, the buffer for LVM metadata parsing was set to twice the size of the metadata area, which caused

Re: [PATCH] lvm: allocate metadata buffer from raw contents

2024-10-03 Thread Ross Philipson via Grub-devel
On 10/3/24 12:23 AM, Michael Chang via Grub-devel wrote: Previously, the buffer for LVM metadata parsing was set to twice the size of the metadata area, which caused excessive memory use. This patch changes the allocation to read the actual raw metadata blocks directly from the metadata area. In

Re: small mkconfig patch

2024-09-25 Thread Ross Philipson via Grub-devel
On 9/25/24 11:45 AM, gabriel.barros wrote: Hi. With most every project using .conf nowadays, i happened to waste some time when I had to install grub without my automation scripts yesterday. I think this would help new users coming from the new-conf world. --- util/grub-mkconfig.in

Re: [PATCH v3 7/8] mmap: Add grub_mmap_get_lowest() and grub_mmap_get_highest()

2024-09-23 Thread Ross Philipson via Grub-devel
On 9/22/24 10:17 AM, Sergii Dmytruk wrote: From: Daniel Kiper The functions find the lowest and highest values with regard to the passed in limit. Passing a low limit of 0 or a high limit of ~0 calculates lowest and highest available RAM addresses respectively. Signed-off-by: Daniel Kiper Si

Re: [PATCH v3 6/8] i386/memory: Define GRUB_PAGE_MASK and GRUB_PAGE_{UP,DOWN} macros

2024-09-23 Thread Ross Philipson via Grub-devel
On 9/22/24 10:17 AM, Sergii Dmytruk wrote: From: Krystian Hebel GRUB_PAGE_MASK is intentionally signed to make use of sign extension. Subsequent patches will use them. Signed-off-by: Krystian Hebel Signed-off-by: Sergii Dmytruk Reviewed-by: Ross Philipson --- include/grub/i386/memory

Re: [PATCH v3 5/8] i386/memory: Rename PAGE_SIZE to GRUB_PAGE_SIZE and make it global

2024-09-23 Thread Ross Philipson via Grub-devel
On 9/22/24 10:17 AM, Sergii Dmytruk wrote: From: Daniel Kiper Subsequent patches will use that constant. Signed-off-by: Daniel Kiper Signed-off-by: Sergii Dmytruk Reviewed-by: Ross Philipson --- grub-core/loader/i386/xen.c | 35 +-- include/grub/i386/m

Re: [PATCH v3 4/8] i386/memory: Rename PAGE_SHIFT to GRUB_PAGE_SHIFT

2024-09-23 Thread Ross Philipson via Grub-devel
On 9/22/24 10:17 AM, Sergii Dmytruk wrote: From: Daniel Kiper This fixes naming inconsistency that goes against coding style as well as helps to avoid potential conflicts and confusion. Signed-off-by: Daniel Kiper Signed-off-by: Sergii Dmytruk Reviewed-by: Ross Philipson --- grub-core

Re: [PATCH v2 7/8] mmap: Add grub_mmap_get_lowest() and grub_mmap_get_highest()

2024-09-20 Thread Ross Philipson via Grub-devel
On 9/19/24 3:02 PM, Sergii Dmytruk wrote: From: Daniel Kiper The functions calculate lowest and highest available RAM addresses respectively. It seems that the functions do a bit more than this. They find the lowest and highest values wrt to the limit you pass in. In the case of passing a l

Re: [PATCH v2 8/8] i386: Add CRx, MMIO, MSR and extend CPUID definitions

2024-09-20 Thread Ross Philipson via Grub-devel
On 9/19/24 3:02 PM, Sergii Dmytruk wrote: From: Ross Philipson I can't really give an R-b on this once since it originated with me. I think it looks fine though perhaps adding something of a commit message might be desirable, maybe just listing what was added here. Thanks Ross Signed-of

Re: [PATCH v2 3/8] i386/msr: Extract and improve MSR support detection code

2024-09-20 Thread Ross Philipson via Grub-devel
On 9/19/24 3:02 PM, Sergii Dmytruk wrote: From: Daniel Kiper Currently rdmsr and wrmsr commands have own MSR support detection code. This code is the same. So, it is duplicated. Additionally, this code cannot be reused by others. Hence, extract this code to a function and make it public. By the

Re: [PATCH v2 2/8] i386/msr: Rename grub_msr_read() and grub_msr_write()

2024-09-20 Thread Ross Philipson via Grub-devel
On 9/19/24 3:02 PM, Sergii Dmytruk wrote: From: Daniel Kiper Use more obvious names which match corresponding instructions: * grub_msr_read() => grub_rdmsr() * grub_msr_write() => grub_wrmsr() Signed-off-by: Daniel Kiper Signed-off-by: Sergii Dmytruk Reviewed-by: Ross Philipson ---

Re: [PATCH v2 1/8] i386/msr: Merge rdmsr.h and wrmsr.h into msr.h

2024-09-20 Thread Ross Philipson via Grub-devel
On 9/19/24 3:02 PM, Sergii Dmytruk wrote: From: Daniel Kiper It does not make sense to have separate headers for individual static functions. Additionally, we have to add some constants with MSR addresses in subsequent patches. So, make one common place to store them. Signed-off-by: Daniel Kip

Re: [PATCH 07/24] mmap: Add grub_mmap_get_lowest() and grub_mmap_get_highest()

2024-09-19 Thread Ross Philipson via Grub-devel
Regards, Sergii On Tue, Sep 17, 2024 at 11:06:51AM -0700, Ross Philipson via Grub-devel wrote: On 8/26/24 5:44 AM, Sergii Dmytruk wrote: From: Daniel Kiper The functions calculate lowest and highest available RAM addresses respectively. Both functions are needed to calculate PMR boundaries

Re: [PATCH 10/24] include/grub: Introduce Secure Launch Resource Table (SLRT)

2024-09-17 Thread Ross Philipson via Grub-devel
On 8/26/24 5:44 AM, Sergii Dmytruk wrote: From: Ross Philipson Provide definitions of structures and basic functions for constructing and parsing of SLRT. I looked this all over and it is inline with the layout of the tables (ABI) of the most recent SLRT (both in the v11 release code and the

Re: [PATCH 11/24] i386/slaunch: Add basic platform support for secure launch

2024-09-17 Thread Ross Philipson via Grub-devel
On 8/26/24 5:44 AM, Sergii Dmytruk wrote: From: Ross Philipson Some of the commands declared in header files will be implemented in the follow-up commits. Oh and in the split out patch, can you fix the commit message to just indicate this is generic x86 bits? Ross Signed-off-by: Ross Ph

Re: [PATCH 11/24] i386/slaunch: Add basic platform support for secure launch

2024-09-17 Thread Ross Philipson via Grub-devel
On 8/26/24 5:44 AM, Sergii Dmytruk wrote: From: Ross Philipson Some of the commands declared in header files will be implemented in the follow-up commits. In addition to submitting the first seven patches standalone, if you split this patch up and remove the slaunch.h changes, you can then

Re: [PATCH 07/24] mmap: Add grub_mmap_get_lowest() and grub_mmap_get_highest()

2024-09-17 Thread Ross Philipson via Grub-devel
On 8/26/24 5:44 AM, Sergii Dmytruk wrote: From: Daniel Kiper The functions calculate lowest and highest available RAM addresses respectively. Both functions are needed to calculate PMR boundaries for Intel TXT secure launcher introduced by subsequent patches. After discussing this we think t

Re: [PATCH 04/24] i386/memory: Rename PAGE_SHIFT to GRUB_PAGE_SHIFT

2024-09-16 Thread Ross Philipson via Grub-devel
On 8/26/24 5:44 AM, Sergii Dmytruk wrote: From: Daniel Kiper ...to avoid potential conflicts and confusion. Please fix these commit messages to be complete and not use the ellipsis to reference the short description. Thanks Ross Signed-off-by: Daniel Kiper --- grub-core/lib/i386/xen/

Re: [PATCH 03/24] i386/msr: Extract and improve MSR support detection code

2024-09-16 Thread Ross Philipson via Grub-devel
On 8/26/24 5:44 AM, Sergii Dmytruk wrote: From: Daniel Kiper Currently rdmsr and wrmsr commands have own MSR support detection code. This code is the same. So, it is duplicated. Additionally, this code cannot be reused by others. Hence, extract this code to a function and make it public. By the

Re: [PATCH 02/24] i386/msr: Rename grub_msr_read() and grub_msr_write()

2024-09-16 Thread Ross Philipson via Grub-devel
On 8/26/24 5:44 AM, Sergii Dmytruk wrote: From: Daniel Kiper ... to grub_rdmsr() and grub_wrmsr() respectively. New names are more obvious than older ones. This patch needs its commit message fixed to remove the ellipsis and just make it a complete sentence. Also since you are not the auth