diff options
author | ken <ken@FreeBSD.org> | 1999-05-25 17:10:04 +0000 |
---|---|---|
committer | ken <ken@FreeBSD.org> | 1999-05-25 17:10:04 +0000 |
commit | 16dd45cbc81f1882781087fc31b6b979186f81c2 (patch) | |
tree | 29e2c2eac7c258948092665fb3ac30400608a01f /sys | |
parent | 72f52582010f107afea9ec91acad850da7a02383 (diff) | |
download | FreeBSD-src-16dd45cbc81f1882781087fc31b6b979186f81c2.zip FreeBSD-src-16dd45cbc81f1882781087fc31b6b979186f81c2.tar.gz |
Fix the read/write permission checks in cam_periph_mapmem(). If we're
writing, we want to be able to read the buffer. If we're reading, we want
to be able to write to the buffer.
PR: kern/11870
Submitted by: Andrew Mobbs <amobbs@allstor-sw.co.uk>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/cam/cam_periph.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 240e063..4068c68 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -2,7 +2,7 @@ * Common functions for CAM "type" (peripheral) drivers. * * Copyright (c) 1997, 1998 Justin T. Gibbs. - * Copyright (c) 1997, 1998 Kenneth D. Merry. + * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cam_periph.c,v 1.14 1999/05/22 21:58:45 gibbs Exp $ + * $Id: cam_periph.c,v 1.15 1999/05/23 18:57:29 gibbs Exp $ */ #include <sys/param.h> @@ -559,7 +559,7 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) 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, " @@ -575,7 +575,7 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) * XXX this check is really bogus, since B_WRITE currently * is all 0's, and so it is "set" all the time. */ - if (dirs[i] & CAM_DIR_OUT) { + if (dirs[i] & CAM_DIR_IN) { flags[i] |= B_WRITE; if (useracc(*data_ptrs[i], lengths[i], B_WRITE) == 0){ printf("cam_periph_mapmem: error, " |