Date: Mon, 24 May 1999 09:41:25 -0600 (MDT) From: "Kenneth D. Merry" <ken@plutotech.com> To: amobbs@allstor-sw.co.uk Cc: freebsd-scsi@FreeBSD.ORG Subject: Re: Bug in cam_periph.c Message-ID: <199905241541.JAA24675@panzer.plutotech.com> In-Reply-To: <8025677B.00309A45.00@mail.plasmon.co.uk> from "amobbs@allstor-sw.co.uk" at "May 24, 1999 09:50:51 am"
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905241541.JAA24675>