blsuki: Fix grub_errno leakage in blsuki_is_default_entry()
Avnish Chouhan
Reviewed-byQuoted 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: Fixgrub_errnoleakage in
blsuki_is_default_entry()
Message-ID: <[email protected]>The
grub_strtol()call inblsuki_is_default_entry()can setgrub_errnotoGRUB_ERR_BAD_NUMBERif 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_errnoand return false whenGRUB_ERR_BAD_NUMBERis set, as this specific error should be ignored in this context.Signed-off-by Michael Chang <[email protected]>
Regards,
Avnish Chouhan
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
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: Fixgrub_errnoleakage in
blsuki_is_default_entry()
Message-ID: <[email protected]>The
grub_strtol()call inblsuki_is_default_entry()can setgrub_errnotoGRUB_ERR_BAD_NUMBERif 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_errnoand return false whenGRUB_ERR_BAD_NUMBERis set, as this specific error should be ignored in this context.Signed-off-by Michael Chang <[email protected]>Reviewed-by Avnish Chouhan <[email protected]>
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