From owner-freebsd-scsi Mon May 24 8:43:49 1999 Delivered-To: freebsd-scsi@freebsd.org Received: from panzer.plutotech.com (panzer.plutotech.com [206.168.67.125]) by hub.freebsd.org (Postfix) with ESMTP id E93D414C8C for ; Mon, 24 May 1999 08:43:47 -0700 (PDT) (envelope-from ken@panzer.plutotech.com) Received: (from ken@localhost) by panzer.plutotech.com (8.9.3/8.8.5) id JAA24675; Mon, 24 May 1999 09:41:25 -0600 (MDT) From: "Kenneth D. Merry" Message-Id: <199905241541.JAA24675@panzer.plutotech.com> Subject: Re: Bug in cam_periph.c In-Reply-To: <8025677B.00309A45.00@mail.plasmon.co.uk> from "amobbs@allstor-sw.co.uk" at "May 24, 1999 09:50:51 am" To: amobbs@allstor-sw.co.uk Date: Mon, 24 May 1999 09:41:25 -0600 (MDT) Cc: freebsd-scsi@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org amobbs@allstor-sw.co.uk wrote... > > It looks to me that the tests for useracc read/write permission in > cam_periph_mapmem are the wrong way around. Surely if the data direction is OUT, > you want to be able to read the memory, and if it's IN you need to be able to > write to the buffer. (He said, having tried to put a R/O mmap'd buffer through a > passthrough driver write with little success.) > > (patch against -stable). > > --- cam_periph.c.orig Sun May 23 11:58:17 1999 > +++ cam_periph.c Sun May 23 12:00:31 1999 > @@ -558,7 +558,7 @@ > return(E2BIG); > } > > - if (dirs[i] & CAM_DIR_IN) { > + if (dirs[i] & CAM_DIR_OUT) { > flags[i] = B_READ; > if (useracc(*data_ptrs[i], lengths[i], B_READ) == 0){ > printf("cam_periph_mapmem: error, " [ ... ] Oops, looks like a bug all right. Thanks for finding it. Ken -- Kenneth Merry ken@plutotech.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message