login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
openbsd-tech
»
2010
»
December
»
2
Re: better matching of boot devices on amd64
view
thread
Previous message: [thread] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Theo de Raadt
Subject:
Re: better matching of boot devices on amd64
Date: Wednesday, December 1, 2010 - 10:21 pm
i386 doesn't have this bug?
quoted text
> the boot loader passes a variable that identifies the disk its > booting off made up of a bunch of fields like adapter, controller, > disk, and partition offsets, plus a table of all the disks it can > see which includes this id and a checksum. > > the kernel goes through and checksums the disks and then maps that > back to the id associated with that disk, and then compares some > of the fields in those ids against the boot disks id to figure out > which disk its on. > > the problem is we overflow one of those fields (the disk id one). > since the other fields are set to 0 by the boot loader, this doesnt > really matter that much. however, since those fields are now > significant because of the overflow, we should compare them too. > > this prevents sd16 being matched as the boot disk after sd0 on my > system with 25 disks attached. > > sorry if this explanation sucks. > > ok? > > Index: dkcsum.c > =================================================================== > RCS file: /cvs/src/sys/arch/amd64/amd64/dkcsum.c,v > retrieving revision 1.15 > diff -u -p -r1.15 dkcsum.c > --- dkcsum.c 10 Dec 2008 23:41:19 -0000 1.15 > +++ dkcsum.c 2 Dec 2010 05:08:25 -0000 > @@ -71,10 +71,13 @@ dkcsumattach(void) > > #ifdef DEBUG > printf("dkcsum: bootdev=%#x\n", bootdev); > - for (bdi = bios_diskinfo; bdi->bios_number != -1; bdi++) > - if (bdi->bios_number & 0x80) > - printf("dkcsum: BIOS drive %#x checksum is %#x\n", > - bdi->bios_number, bdi->checksum); > + for (bdi = bios_diskinfo; bdi->bios_number != -1; bdi++) { > + if (bdi->bios_number & 0x80) { > + printf("dkcsum: BIOS drive %#x bsd_dev=%#x " > + "checksum=%#x\n", bdi->bios_number, bdi->bsd_dev, > + bdi->checksum); > + } > + } > #endif > pribootdev = altbootdev = 0; > > @@ -180,7 +183,9 @@ dkcsumattach(void) > */ > > /* B_TYPE dependent hd unit counting bootblocks */ > - if ((B_TYPE(bootdev) == B_TYPE(hit->bsd_dev)) && > + if ((B_ADAPTOR(bootdev) == B_ADAPTOR(hit->bsd_dev)) && > + (B_CONTROLLER(bootdev) == B_CONTROLLER(hit->bsd_dev)) && > + (B_TYPE(bootdev) == B_TYPE(hit->bsd_dev)) && > (B_UNIT(bootdev) == B_UNIT(hit->bsd_dev))) { > int type, ctrl, adap, part, unit;
Previous message: [thread] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
Re: better matching of boot devices on amd64
, Theo de Raadt
, (Wed Dec 1, 10:21 pm)
Re: better matching of boot devices on amd64
, David Gwynne
, (Wed Dec 1, 10:45 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Gene Heskett
Re: New thread RDSL, post-2.6.20 kernels and amanda (tar) miss-fires
Ray Lee
Re: New thread RDSL, post-2.6.20 kernels and amanda (tar) miss-fires
Michael Moore
Re: underage models, pre teen models, lolita porn, young preteens, little lolitas
Gene Heskett
Re: New thread RDSL, post-2.6.20 kernels and amanda (tar) miss-fires
Justin Mattock
Re: macbook pro dvd playback after suspend Buffer I/O error
git
:
Bill Lear
cpio command not found
Gary Yang
fatal: did you run git update-server-info on the server? mv post-update.sample pos...
Uwe
Re: "bash: git-upload-pack: command not found" ??
Ben Schmidt
Getting the path right for git over SSH
Fredrik Kuivinen
Re: fatal: unable to create '.git/index': File exists
linux-netdev
:
Jamie Lokier
Re: [2/3] POHMELFS: Documentation.
Francois-Xavier Le Bail
[PATCH v2] net: typos in comments in include/linux/igmp.h
Stephen Hemminger
Re: vlan JMicron Technologies, Inc. JMC250 PCI Express Gigabit Ethernet
Sage Weil
Re: [2/3] POHMELFS: Documentation.
Patrick McHardy
Re: [ANNOUNCE]: First release of nftables
openbsd-misc
:
Netmaffia.hu
Tini Lányok AKCIÓBAN OTTHON
openbsd
observed spamd behavior
Ted Unangst
Re: OpenSMTPd actual development and integration
Paul M
Corrupted RAIDFrame device
BetClic
Benfica vs Porto - Qual o seu palpite?
git-commits-head
:
Linux Kernel Mailing List
Remove empty comment in acpi/power.c
Linux Kernel Mailing List
Linux 2.6.34-rc4
Linux Kernel Mailing List
[SCSI] scsi_dh_rdac: Retry for Quiescence in Progress in rdac device handler
Linux Kernel Mailing List
ALSA: cosmetic: make hda intel interrupt name consistent with others
Linux Kernel Mailing List
USB: gadget: audio: provide correct device id
Colocation donated by:
Syndicate