Bug 2368939 - Double free in grub-core/loader/efi/chainloader.c
Summary: Double free in grub-core/loader/efi/chainloader.c
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: 42
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Nicolas Frayer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-05-28 12:01 UTC by Thomas Frauendorfer
Modified: 2025-06-24 01:05 UTC (History)
5 users (show)

Fixed In Version: grub2-2.12-32.fc42 grub2-2.12-25.fc41
Clone Of:
Environment:
Last Closed: 2025-06-21 01:27:26 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Patch fixing the problem (729 bytes, application/mbox)
2025-05-28 12:02 UTC, Thomas Frauendorfer
no flags Details
Patch v2 (840 bytes, application/mbox)
2025-05-28 15:59 UTC, Thomas Frauendorfer
no flags Details

Description Thomas Frauendorfer 2025-05-28 12:01:02 UTC
The fail path in grub_cmd_chainloader calls grub_free(cmdline) in line 1190 and line 1197

The error was introduced in bf774366935874d59995f3649740c6d464d4762d 'Add secureboot support on efi chainloader'
where the second free call was added in as line 1107

The same issue also exists in other fedora versions that are based on Grub 2.12

Reproducible: Always

Comment 1 Thomas Frauendorfer 2025-05-28 12:02:31 UTC
Created attachment 2091898 [details]
Patch fixing the problem

Comment 2 Nicolas Frayer 2025-05-28 15:30:24 UTC
Hi Thomas,

Thanks for reporting this as well as the patch.
Please add a Signed-off-by and also a Reviewed-by: Nicolas Frayer <nfrayer>

Regards,

Nicolas

Comment 3 Thomas Frauendorfer 2025-05-28 15:59:11 UTC
Created attachment 2091928 [details]
Patch v2

Added signed-off and reviewed-by

Comment 4 Fedora Update System 2025-06-17 16:56:43 UTC
FEDORA-2025-b0ae534a31 (grub2-2.12-32.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-b0ae534a31

Comment 5 Fedora Update System 2025-06-19 01:43:26 UTC
FEDORA-2025-b0ae534a31 has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-b0ae534a31`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-b0ae534a31

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2025-06-19 13:34:28 UTC
FEDORA-2025-eb145f3cb9 (grub2-2.12-25.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2025-eb145f3cb9

Comment 7 Fedora Update System 2025-06-21 01:27:26 UTC
FEDORA-2025-b0ae534a31 (grub2-2.12-32.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2025-06-21 02:24:10 UTC
FEDORA-2025-eb145f3cb9 has been pushed to the Fedora 41 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-eb145f3cb9`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-eb145f3cb9

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2025-06-24 01:05:05 UTC
FEDORA-2025-eb145f3cb9 (grub2-2.12-25.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.