DragonFly-2.3.0.48.g76adb master sys/boot/pc32/boot2 boot1.S

Matthew Dillon dillon at crater.dragonflybsd.org
Wed Feb 11 02:03:33 PST 2009


commit 76adb3c3574e7451137604b62e41fc0ed48b021b
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date:   Wed Feb 11 01:53:52 2009 -0800

    Fix long-standing bug in boot1 code - can read junk from fake partition table
    
    boot1 reads the MBR to locate the BSD partition type (0xA5).  However, to
    reduce the size of the boot1 code the 32 bit LBA for the MBR was being
    loaded via the fake partition table at label 'part4', which was assumed to
    contain a LBA of 0.  Unfortunately this portion of the boot1 code is not
    usually written by the disklabel program and may contain garbage.
    
    For the last few years we have worked around the issue by zeroing out
    the label area before installing a new label.  We still have to do this
    to avoid disklabel32/disklabel64 confusion, but with this fix forgetting
    to zero the area should not cause a properly installed disklabel to fail
    to boot properly.
    
    To fix the problem, add the necessary instructions to generate a 32 bit
    LBA of 0 directly for reading the MBR.  They barely fit.

Summary of changes:
 sys/boot/pc32/boot2/boot1.S |   25 ++++++++++++++++++-------
 1 files changed, 18 insertions(+), 7 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/76adb3c3574e7451137604b62e41fc0ed48b021b


-- 
DragonFly BSD source repository





More information about the Commits mailing list