summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2007-10-20 00:21:49 +0000
committerkrw <krw@openbsd.org>2007-10-20 00:21:49 +0000
commit1ddcc0d436ce456879e9edf54633d4153e71a03a (patch)
tree2e79815fab79e77f7253c94783f4b5b539d81025
parentdo setegid() before seteuid(); see pr 5605 for more info; ok millert (diff)
downloadwireguard-openbsd-1ddcc0d436ce456879e9edf54633d4153e71a03a.tar.xz
wireguard-openbsd-1ddcc0d436ce456879e9edf54633d4153e71a03a.zip
Put scsi_done() invocations inside existing splbio/splx pairs to make
damned sure scsi_done is invoked at splbio. Noted by deraadt@.
-rw-r--r--sys/dev/ic/aic79xx_openbsd.c11
-rw-r--r--sys/dev/ic/aic7xxx_openbsd.c7
2 files changed, 8 insertions, 10 deletions
diff --git a/sys/dev/ic/aic79xx_openbsd.c b/sys/dev/ic/aic79xx_openbsd.c
index d45b5ce72c9..278292dbe2d 100644
--- a/sys/dev/ic/aic79xx_openbsd.c
+++ b/sys/dev/ic/aic79xx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic79xx_openbsd.c,v 1.27 2007/09/07 17:58:39 krw Exp $ */
+/* $OpenBSD: aic79xx_openbsd.c,v 1.28 2007/10/20 00:21:49 krw Exp $ */
/*
* Copyright (c) 2004 Milos Urbanek, Kenneth R. Westerback & Marco Peereboom
@@ -278,10 +278,9 @@ ahd_done(struct ahd_softc *ahd, struct scb *scb)
ahd_lock(ahd, &s);
ahd_free_scb(ahd, scb);
- ahd_unlock(ahd, &s);
-
xs->flags |= ITSDONE;
scsi_done(xs);
+ ahd_unlock(ahd, &s);
}
void
@@ -324,17 +323,17 @@ ahd_action(struct scsi_xfer *xs)
target_id = xs->sc_link->target;
our_id = SCSI_SCSI_ID(ahd, xs->sc_link);
+ ahd_lock(ahd, &s);
if ((ahd->flags & AHD_INITIATORROLE) == 0) {
xs->error = XS_DRIVER_STUFFUP;
xs->flags |= ITSDONE;
scsi_done(xs);
+ ahd_unlock(ahd, &s);
return (COMPLETE);
- /* return ccb->ccb_h.status = CAM_PROVIDE_FAIL; */
}
/*
* get an scb to use.
*/
- ahd_lock(ahd, &s);
tinfo = ahd_fetch_transinfo(ahd, 'A', our_id, target_id, &tstate);
quirks = xs->sc_link->quirks;
@@ -550,10 +549,10 @@ ahd_setup_data(struct ahd_softc *ahd, struct scsi_xfer *xs,
if (hscb->cdb_len > MAX_CDB_LEN) {
ahd_lock(ahd, &s);
ahd_free_scb(ahd, scb);
- ahd_unlock(ahd, &s);
xs->error = XS_DRIVER_STUFFUP;
xs->flags |= ITSDONE;
scsi_done(xs);
+ ahd_unlock(ahd, &s);
return (COMPLETE);
}
diff --git a/sys/dev/ic/aic7xxx_openbsd.c b/sys/dev/ic/aic7xxx_openbsd.c
index 140489b1241..88d2f0b35e7 100644
--- a/sys/dev/ic/aic7xxx_openbsd.c
+++ b/sys/dev/ic/aic7xxx_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aic7xxx_openbsd.c,v 1.36 2007/09/07 17:58:39 krw Exp $ */
+/* $OpenBSD: aic7xxx_openbsd.c,v 1.37 2007/10/20 00:21:49 krw Exp $ */
/* $NetBSD: aic7xxx_osm.c,v 1.14 2003/11/02 11:07:44 wiz Exp $ */
/*
@@ -281,10 +281,9 @@ ahc_done(struct ahc_softc *ahc, struct scb *scb)
s = splbio();
ahc_free_scb(ahc, scb);
- splx(s);
-
xs->flags |= ITSDONE;
scsi_done(xs);
+ splx(s);
}
void
@@ -584,10 +583,10 @@ ahc_setup_data(struct ahc_softc *ahc, struct scsi_xfer *xs,
if (hscb->cdb_len > sizeof(hscb->cdb32)) {
s = splbio();
ahc_free_scb(ahc, scb);
- splx(s);
xs->error = XS_DRIVER_STUFFUP;
xs->flags |= ITSDONE;
scsi_done(xs);
+ splx(s);
return (COMPLETE);
}