kern/partition: Add sanity check after grub_strtoul() call
authorLidong Chen <lidong.chen@oracle.com>
Thu, 6 Feb 2025 18:16:56 +0000 (18:16 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
commited888015e6db17a9ce44ec231e01596fa61469ff
tree4a7457911c49456b9a21559a8b0ae130bc549408
parent3c966b068a08d66cd2cf5f5271c24b2edd3a38bc
kern/partition: Add sanity check after grub_strtoul() call

The current code incorrectly assumes that both the input and the values
returned by grub_strtoul() are always valid which can lead to potential
errors. This fix ensures proper validation to prevent any unintended issues.

Fixes: CID 473843
Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name kern-partition-Add-sanity-check-after-grub_strtoul-call.patch
grub-core/kern/partition.c