Re: [PATCH] loader/efi/linux.c: unload previous linux before updating kernel size

2025-06-23 Thread Daniel Kiper
On Wed, Jun 18, 2025 at 11:38:14AM -0400, Adriano Cordova wrote: > Unload previous linux before updating the global variable kernel_size, > otherwise the previous linux gets deallocated with the kernel_size of > the linux that is being currently loaded. > > Signed-off-by: Adriano Cordova Reviewed

Re: [PATCH] loader/i386/pc/linux: Fix resource leak

2025-06-23 Thread sudhakar
On 2025-06-23 23:16, Lidong Chen via Grub-devel wrote: In grub_cmd_initrd(), memory is allocated for variable initrd_ctx before calling grub_relocator_alloc_chunk_align_safe(). When the function call fails, initrd_ctx should be freed before exiting grub_cmd_initrd(). Fixes: CID 473852 Signed-of

Re: [PATCH] normal/charset: Fix underflow and overflow in loop init

2025-06-23 Thread sudhakar
On 2025-06-19 00:54, Lidong Chen via Grub-devel wrote: In bidi_line_wrap(), "kk - 1" in the for loop init, "i = kk - 1", underflows when 'kk' (unsigned int) is 0. Assigning the result of 'kk - 1' to signed int 'i' may cause overflow. To address both issues, cast 'kk' to a signed type before subtr

Re: [PATCH] Revert "lzma: Make sure we don't dereference past array"

2025-06-23 Thread Daniel Kiper via Grub-devel
On Mon, Jun 23, 2025 at 05:42:32PM +, Lidong Chen wrote: > Commit 40e261b89b71 ensures that the variable len is at least 2. > As a result, GetLenToPosState(len) never returns a value greater > than or equal to kNumLenToPosStates, making the changes introduced > in the commit 16c0dbf4bc6a unreac

Re: [PATCH 1/2] gnulib: Bring back the fix for resolving unused variable

2025-06-23 Thread Daniel Kiper via Grub-devel
On Wed, Jun 18, 2025 at 07:12:15PM +, Lidong Chen wrote: > This patch resolved a minor issue spotted by Coverity: > a983d36bd917 gnulib/regexec: Resolve unused variable > > But, it was removed by the gnulib update: > 2b7902459803 Update gnulib version and drop most gnulib patches > > It cau

Re: [PATCH 1/1] tests: Correct netboot and file_filter test failure

2025-06-23 Thread Daniel Kiper via Grub-devel
On Sat, Jun 21, 2025 at 10:50:38AM -0500, Andrew Hamilton wrote: > Correct a test failure in netboot_test and file_filter_test > caused by an issue cleaning up the tmp directory created > for netboot. Netboot creates a subdirectory in the tmp > folder that causes the rmdir to fail - so cleanup the

Re: [PATCH 1/1] tests: Correct netboot and file_filter test failure

2025-06-23 Thread Leo Sandoval via Grub-devel
On Sat, Jun 21, 2025 at 9:52 AM Andrew Hamilton wrote: > Correct a test failure in netboot_test and file_filter_test > caused by an issue cleaning up the tmp directory created > for netboot. Netboot creates a subdirectory in the tmp > folder that causes the rmdir to fail - so cleanup the > subdir

[PATCH] loader/i386/pc/linux: Fix resource leak

2025-06-23 Thread Lidong Chen via Grub-devel
In grub_cmd_initrd(), memory is allocated for variable initrd_ctx before calling grub_relocator_alloc_chunk_align_safe(). When the function call fails, initrd_ctx should be freed before exiting grub_cmd_initrd(). Fixes: CID 473852 Signed-off-by: Lidong Chen --- grub-core/loader/i386/pc/linux.c

[PATCH] Revert "lzma: Make sure we don't dereference past array"

2025-06-23 Thread Lidong Chen via Grub-devel
Commit 40e261b89b71 ensures that the variable len is at least 2. As a result, GetLenToPosState(len) never returns a value greater than or equal to kNumLenToPosStates, making the changes introduced in the commit 16c0dbf4bc6a unreachable and no longer necessary. This reverts commit 16c0dbf4bc6a953c4

Re: [PATCH] normal/charset: Fix underflow and overflow in loop init

2025-06-23 Thread Daniel Kiper via Grub-devel
On Wed, Jun 18, 2025 at 07:24:23PM +, Lidong Chen wrote: > In bidi_line_wrap(), "kk - 1" in the for loop init, "i = kk - 1", > underflows when 'kk' (unsigned int) is 0. Assigning the result of > 'kk - 1' to signed int 'i' may cause overflow. To address both > issues, cast 'kk' to a signed type

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

2025-06-23 Thread Frediano Ziglio via Grub-devel
On Mon, Jun 23, 2025 at 2:46 PM Ross Lagerwall wrote: > > On Mon, Jun 23, 2025 at 12:33 PM 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-b

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

2025-06-23 Thread Ross Lagerwall via Grub-devel
On Mon, Jun 23, 2025 at 12:33 PM 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: Frediano Ziglio > --- > grub-core/loader/efi/linux.c | 9 + >

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

2025-06-23 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 --- grub-core/loader/efi/linux.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/grub-core/loader/efi/linu