bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #24823] Partial sector disk writes are always corrupted


From: David Simner
Subject: [bug #24823] Partial sector disk writes are always corrupted
Date: Wed, 12 Nov 2008 22:07:05 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.3) Gecko/2008101315 Ubuntu/8.10 (intrepid) Firefox/3.0.3

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 &amp; Partition
                Severity: Major
                Priority: 5 - Normal
              Item Group: Software Error
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: David Simner
        Originator Email: address@hidden
             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/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]