OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
CVS: cvs.openbsd.org: src

From: Joel Sing (jsingcvs.openbsd.org)
Date: Wed Sep 08 2010 - 10:16:22 CDT


CVSROOT: /cvs
Module name: src
Changes by: jsingcvs.openbsd.org 2010/09/08 09:16:22

Modified files:
        sys/sys : disk.h
        sys/kern : subr_disk.c
        sys/dev/ata : wd.c
        sys/scsi : cd.c sd.c

Log message:
Introduce a disk_lookup() function which calls device_lookup(), before
verifying that the resulting device is present on the disklist. This
avoids a race whereby the disk driver can be accessed as soon as the
softc has been allocated, but before the disk has completed
initialisation and has called disk_attach() (up until this point
dk_label is still a null pointer).

Cut cd(4), sd(4) and wd(4) across to disk_lookup(). All callers of
disk_attach() need to be tested and cut over in due course.

ok deraadt krw