DragonFly commits List (threaded) for 2009-02
DragonFly-18.104.22.168.g76adb master sys/boot/pc32/boot2 boot1.S
Author: Matthew Dillon <firstname.lastname@example.org>
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(-)
DragonFly BSD source repository