commands/extcmd: Missing check for failed allocation
authorLidong Chen <lidong.chen@oracle.com>
Fri, 22 Nov 2024 06:27:55 +0000 (06:27 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
commitaec56395e6ace5c9ce9027396763f771284bc8b9
tree1551d21efd3260c0d34205d8cb8ef5738b920e0b
parent0747b012c308ce274d08e866a1c6031d7f77684f
commands/extcmd: Missing check for failed allocation

The grub_extcmd_dispatcher() calls grub_arg_list_alloc() to allocate
a grub_arg_list struct but it does not verify the allocation was successful.
In case of failed allocation the NULL state pointer can be accessed in
parse_option() through grub_arg_parse() which may lead to a security issue.

Fixes: CVE-2024-45775
Reported-by: Nils Langius <nils@langius.de>
Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Reviewed-by: Alec Brown <alec.r.brown@oracle.com>
Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name commands-extcmd-Missing-check-for-failed-allocation.patch
grub-core/commands/extcmd.c