URL:
<http://savannah.gnu.org/bugs/?24823>
Summary: Partial sector disk writes are always corrupted
Project: GNU GRUB
Submitted by: davidsimner
Submitted on: Wed 12 Nov 2008 22:07:02 GMT
Category: Disk & Partition
Severity: Major
Priority: 5 - Normal
Item Group: Software Error
Status: None
Privacy: Public
Assigned to: None
Originator Name: David Simner
Originator Email: [EMAIL PROTECTED]
Open/Closed: Open
Discussion Lock: Any
Release: svn trunk at the time of writing
Reproducibility: Every Time
Planned Release:
_______________________________________________________
Details:
In kern/disk.c if the grub_disk_write function is called to write data that
doesn't fill a whole sector [1], it will read the sector first using
grub_disk_read.
This causes a bug because grub_disk_read calls grub_disk_adjust_range, which
grub_disk_write has already called.
Therefore grub_disk_adjust_range will, for a second time, "Make sectors disk
relative from partition relative", and therefore grub_disk_read will read the
"wrong" sector, and hence grub_disk_write will subsequently corrupt the sector
it writes.
Please see the attached patch for a fix.
Cheers,
David
1. No-one seems to use this already existing feature of grub_disk_write. I
happened to stumble upon this bug when I did.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Wed 12 Nov 2008 22:07:03 GMT Name: patch Size: 4kB By: davidsimner
<http://savannah.gnu.org/bugs/download.php?file_id=16835>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?24823>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-grub mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-grub