[PATCH v3 5/6] loader/efi/linux: Use sizeof instead of constant

2025-06-25 Thread Frediano Ziglio via Grub-devel
This is more consistent with the above code using sizeof (grub_efi_char16_t). Signed-off-by: Frediano Ziglio --- grub-core/loader/efi/linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/linux.c index 3b5c4ed17..9df49

[PATCH v4 1/6] loader/efi/linux: Remove useless assignment

2025-06-25 Thread Frediano Ziglio via Grub-devel
If the following allocation fails this would leave "load_options" NULL while "load_options_size" not valid. If the allocation succeed "load_options_size" is overwritten. Signed-off-by: Frediano Ziglio Reviewed-by: Daniel Kiper --- grub-core/loader/efi/linux.c | 3 +-- 1 file changed, 1 insertio

Re: [PATCH v3] Create a Containerfiles with required grub packages for development

2025-06-25 Thread Daniel Kiper
On Tue, Jun 24, 2025 at 01:32:24PM -0600, Leo Sandoval via Grub-devel wrote: > Containers bring the ability to have ready-to-use environments and in > this case complete Fedora and Debian container files are described > containing all required packages for building and testing grub2. The project n

[PATCH v4 3/6] loader/efi/linux: Do not pass excessive size for source string

2025-06-25 Thread Frediano Ziglio via Grub-devel
The size passed to grub_utf8_to_utf16 for the source string is used as a limit for the string if NUL character is not encountered however len, which is strlen(src)*2+2 is surely greater than strlen(src). Pass the exact correct length. Signed-off-by: Frediano Ziglio --- Changes since v3: - pass ex

[PATCH v4 5/6] loader/efi/linux: Use sizeof instead of constant

2025-06-25 Thread Frediano Ziglio via Grub-devel
This is more consistent with the above code using sizeof (grub_efi_char16_t). Signed-off-by: Frediano Ziglio Reviewed-by: Daniel Kiper --- grub-core/loader/efi/linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grub-core/loader/efi/linux.c b/grub-core/loader/efi/lin

[PATCH v4 0/6] Adjustments for EFI "linux" command and

2025-06-25 Thread Frediano Ziglio via Grub-devel
The series started from the issue that LoadOptions, if providing just command line arguments should be NUL-terminated. But this carried some updates to adjust the code properly. Changes since v3: - use proper length converting args string; - added Reviewed-by comments. Frediano Ziglio (6): load

[PATCH v4 4/6] loader/efi/linux: Use proper type for "len" variable

2025-06-25 Thread Frediano Ziglio via Grub-devel
Although the length should not exceed 2^31 grub_size_t is more suitable for that variable. "len" is used to compute the size of buffers which in C is a size_t, not a int. It is used for GRUB_EFI_BYTES_TO_PAGES which expects unsigned values. It is assigned to load_options_size which is unsigned, not

[PATCH v4 2/6] include/grub/charset.h: Update documentation

2025-06-25 Thread Frediano Ziglio via Grub-devel
(grub_size_t) -1 is never returned, the function always return a not negative values. This is important for overflows considerations. Signed-off-by: Frediano Ziglio Reviewed-by: Daniel Kiper --- include/grub/charset.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include

[PATCH v4 6/6] loader/efi/linux: Correctly terminate LoadOptions field

2025-06-25 Thread Frediano Ziglio via Grub-devel
If a simple string for arguments are passed it should be NUL terminated. This is true for other code but not for "linux" command. Signed-off-by: Frediano Ziglio --- Changes since v1 - remove useless assignment. Changes since v2 - split changes; - correct spacing. --- grub-core/loader/efi/linux.

Re: [PATCH v3 6/6] loader/efi/linux: Correctly terminate LoadOptions field

2025-06-25 Thread Frediano Ziglio via Grub-devel
On Wed, Jun 25, 2025 at 1:41 PM Daniel Kiper wrote: > > In general patches #1, #2, #4 and #5 make sense for me. So, you can add > my RB there... > > On Wed, Jun 25, 2025 at 07:42:27AM +0100, Frediano Ziglio via Grub-devel > wrote: > > If a simple string for arguments are passed it should be NUL >

Re: [PATCH v3 3/6] loader/efi/linux: Do not pass excessive size for source string

2025-06-25 Thread Frediano Ziglio via Grub-devel
On Wed, Jun 25, 2025 at 1:27 PM Daniel Kiper wrote: > > On Wed, Jun 25, 2025 at 07:42:24AM +0100, Frediano Ziglio via Grub-devel > wrote: > > The size passed to grub_utf8_to_utf16 for the source string is > > used as a limit for the string if NUL character is not encountered > > however len, whic

Re: [PATCH v3 6/6] loader/efi/linux: Correctly terminate LoadOptions field

2025-06-25 Thread Daniel Kiper
In general patches #1, #2, #4 and #5 make sense for me. So, you can add my RB there... On Wed, Jun 25, 2025 at 07:42:27AM +0100, Frediano Ziglio via Grub-devel wrote: > If a simple string for arguments are passed it should be NUL > terminated. This is true for other code but not for "linux" > comm

Re: [PATCH v3 3/6] loader/efi/linux: Do not pass excessive size for source string

2025-06-25 Thread Daniel Kiper
On Wed, Jun 25, 2025 at 07:42:24AM +0100, Frediano Ziglio via Grub-devel wrote: > The size passed to grub_utf8_to_utf16 for the source string is > used as a limit for the string if NUL character is not encountered > however len, which is strlen(src)*2+2 is surely greater than > strlen(src). > Pass

Re: [PATCH 0/2] build: Fixes to Building from dist Archive

2025-06-25 Thread Daniel Kiper
On Tue, Jun 24, 2025 at 01:27:35PM -0400, Mike Gilbert wrote: > On Tue, Jun 10, 2025 at 11:15 PM Andrew Hamilton wrote: > > > > Fix several issues with attempting to create and build from the > > GRUB 'dist' archive. > > > > 1. extra_deps.lst is now automatically generated so remove this > > from

Re: [PATCH v2] loader/efi/linux: Correctly terminate LoadOptions field

2025-06-25 Thread Frediano Ziglio via Grub-devel
On Tue, Jun 24, 2025 at 4:48 PM Daniel Kiper wrote: > > On Tue, Jun 24, 2025 at 09:01:14AM +0100, Frediano Ziglio via Grub-devel > wrote: > > If a simple string for arguments are passed it should be NUL > > terminated. This is true for other code but not for "linux" > > command. > > Signed-off-by

[PATCH v3 6/6] loader/efi/linux: Correctly terminate LoadOptions field

2025-06-25 Thread Frediano Ziglio via Grub-devel
If a simple string for arguments are passed it should be NUL terminated. This is true for other code but not for "linux" command. Signed-off-by: Frediano Ziglio --- Changes since v1 - remove useless assignment. Changes since v2 - split changes; - correct spacing. --- grub-core/loader/efi/linux.