Bug 496093

Summary: [PATCH] Fix memory corruption in grub
Product: [Fedora] Fedora Reporter: Thomas Jarosch <thomas.jarosch>
Component: grubAssignee: Peter Jones <pjones>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 10CC: bruno, bugs.michael, ekanter, mathguthrie, pjones
Target Milestone: ---Keywords: EasyFix
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.97-51.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-08-25 04:42:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix for memory corruption none

Description Thomas Jarosch 2009-04-16 15:26:33 UTC
Created attachment 339859 [details]
Fix for memory corruption

Hello together,

attached is a simple patch for a memory corruption in grub I discovered a while ago. This patch will make reliable booting from RAID1 discs possible again, atleast that's how I discovered the problem back then.

Cheers,
Thomas

Comment 1 Michael Schwendt 2009-05-29 15:30:01 UTC
OMG! Unbelievable! :-(  It's the

  s1[n - 1] = 0;

in grub_strncat(..) that corrupts the memory whenever n is out of bounds. In the place you've found, n is 256 instead of the target array size 16, and in turn the memory is corrupted *always*. (The generated device id string itself is never longer than 16, though)

Comment 2 Peter Jones 2009-06-04 13:52:24 UTC
Thanks for this patch; it'll be in grub-0.97-51 .

Comment 3 Fedora Update System 2009-06-04 14:03:26 UTC
grub-0.97-51.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/grub-0.97-51.fc11

Comment 4 Fedora Update System 2009-06-16 02:16:10 UTC
grub-0.97-51.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update grub'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-6351

Comment 5 Fedora Update System 2009-08-25 04:42:55 UTC
grub-0.97-51.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.