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

Submitted by:  David <davidsimner>
Submitted on:  Wed 12 Nov 2008 10:07:02 PM UTC  
 
Category: Disk & PartitionSeverity: Major
Priority: 5 - NormalItem Group: Software Error
Status: FixedPrivacy: Public
Assigned to: NoneOriginator Name: David Simner
Open/Closed: ClosedRelease: svn trunk at the time of writing
Release: NoneReproducibility: Every Time
Planned Release: None

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

Fixed

Vladimir Serbinenko <phcoder>
Project 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>

 

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
  • -unavailable- added by phcoder (Posted a comment)
  • -unavailable- added by davidsimner (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 17 Jun 2009 01:16:24 PM UTCphcoderStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Wed 12 Nov 2008 10:07:03 PM UTCdavidsimnerAttached File-=>Added patch, #16835

    Back to the top


    Powered by Savane 3.1-cleanup1