summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2011-04-29 13:03:13 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2011-04-29 13:03:13 +0000
commit70ad2345cc9d0ebb8db65a16e31f5c600350fa90 (patch)
tree9903ee63abc9c517d3a4c34e2690a7f645a51da3 /sys
parent4cf3f9b22f46d04b1dd9e7cf2b4ea7417c0079e8 (diff)
only handle vanilla scsi inquiry requests, reject VPD requests since theyre
not handled. based on atascsi code. ok marco@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/softraid.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index c81fd62636d..3187b6dc2c8 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.227 2011/04/14 02:11:23 marco Exp $ */
+/* $OpenBSD: softraid.c,v 1.228 2011/04/29 13:03:12 dlg Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -3468,10 +3468,17 @@ sr_raid_inquiry(struct sr_workunit *wu)
{
struct sr_discipline *sd = wu->swu_dis;
struct scsi_xfer *xs = wu->swu_xs;
+ struct scsi_inquiry *cdb = (struct scsi_inquiry *)xs->cmd;
struct scsi_inquiry_data inq;
DNPRINTF(SR_D_DIS, "%s: sr_raid_inquiry\n", DEVNAME(sd->sd_sc));
+ if (xs->cmdlen != sizeof(*cdb))
+ return (EINVAL);
+
+ if (ISSET(cdb->flags, SI_EVPD))
+ return (EOPNOTSUPP);
+
bzero(&inq, sizeof(inq));
inq.device = T_DIRECT;
inq.dev_qual2 = 0;