bugGNU GRUB - Bugs: bug #24823, Partial sector disk writes are...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #24823: Partial sector disk writes are always corrupted

Submitter:  David <davidsimner>
Submitted:  Wed 12 Nov 2008 10:07:02 PM UTC
   
 
Category:  Disk & Partition Severity:  Major
Priority:  5 - Normal Item Group:  Software Error
Status:  Fixed Privacy:  Public
Assigned to:  None Originator Name:  David Simner
Open/Closed:  Closed Release:  None
Release:  svn trunk at the time of writing Reproducibility:  Every Time
Planned Release:  None

Wed 17 Jun 2009 01:16:24 PM UTC, comment #1: 

Fixed

Vladimir Serbinenko <phcoder>
Group administrator
Wed 12 Nov 2008 10:07:02 PM UTC, original submission:  

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.

David <davidsimner>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #16835:  patch added by davidsimner (4KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by phcoder (Posted a comment)
  • -email is unavailable- added by davidsimner (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-06-17 phcoder StatusNone Fixed
        Open/ClosedOpen Closed
    2008-11-12 davidsimner Attached File- Added patch, #16835

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code