Skip to contentSkip to conversation

blsuki: Fix grub_errno leakage in blsuki_is_default_entry()

PATCH Avnish Chouhan 2 participants 2 messages Nov 10, 2025 – Nov 11, 2025 1 message not in the archive

lore
Share & tools
lore

Avnish Chouhan

author Reviewed-by
#1 lore raw
In reply to a message not in the archive
Quoted 12 lines · On 2025-11-10 19:06, [email protected] wrote:

Message: 3
Date: Mon, 10 Nov 2025 15:38:13 +0800
From: Michael Chang <[email protected]>
To: The development of GNU GRUB <[email protected]>
Subject: [PATCH] blsuki: Fix grub_errno leakage in
blsuki_is_default_entry()
Message-ID: <[email protected]>

The grub_strtol() call in blsuki_is_default_entry() can set grub_errno to GRUB_ERR_BAD_NUMBER if the input string cannot be converted into any valid digits.

Quoted 8 lines

This errno value is currently left uncleared, which can lead to unexpected behavior in subsequent logic that tests the result of a function by checking grub_errno.

Clear grub_errno and return false when GRUB_ERR_BAD_NUMBER is set, as this specific error should be ignored in this context.

Regards,
Avnish Chouhan

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw
Quoted 17 lines · Avnish Chouhan
Quoted 16 lines · On 2025-11-10 19:06, [email protected] wrote:

Message: 3
Date: Mon, 10 Nov 2025 15:38:13 +0800
From: Michael Chang <[email protected]>
To: The development of GNU GRUB <[email protected]>
Subject: [PATCH] blsuki: Fix grub_errno leakage in
blsuki_is_default_entry()
Message-ID: <[email protected]>

The grub_strtol() call in blsuki_is_default_entry() can set grub_errno to GRUB_ERR_BAD_NUMBER if the input string cannot be converted into any valid digits.

This errno value is currently left uncleared, which can lead to unexpected behavior in subsequent logic that tests the result of a function by checking grub_errno.

Quoted 6 lines
Quoted 4 lines

Clear grub_errno and return false when GRUB_ERR_BAD_NUMBER is set, as this specific error should be ignored in this context.

Thanks a lot for the review. I'll add your Reviewed-by tag in next version.

Thanks,
Michael

Quoted 3 lines

Regards,
Avnish Chouhan

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel