Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Apr 2020 21:03:30 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r359901 - head/sys/cam
Message-ID:  <202004132103.03DL3U2s066659@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Mon Apr 13 21:03:30 2020
New Revision: 359901
URL: https://svnweb.freebsd.org/changeset/base/359901

Log:
  Remove stale comment
  
  There's no useracc here, and even if there was it shouldn't be here. vmapbuf is
  sufficient and as the comment says, useracc is racy.

Modified:
  head/sys/cam/cam_periph.c

Modified: head/sys/cam/cam_periph.c
==============================================================================
--- head/sys/cam/cam_periph.c	Mon Apr 13 20:59:09 2020	(r359900)
+++ head/sys/cam/cam_periph.c	Mon Apr 13 21:03:30 2020	(r359901)
@@ -971,14 +971,7 @@ cam_periph_mapmem(union ccb *ccb, struct cam_periph_ma
 		mapinfo->bp[i]->b_iocmd = (dirs[i] == CAM_DIR_OUT) ?
 		    BIO_WRITE : BIO_READ;
 
-		/*
-		 * Map the buffer into kernel memory.
-		 *
-		 * Note that useracc() alone is not a  sufficient test.
-		 * vmapbuf() can still fail due to a smaller file mapped
-		 * into a larger area of VM, or if userland races against
-		 * vmapbuf() after the useracc() check.
-		 */
+		/* Map the buffer into kernel memory. */
 		if (vmapbuf(mapinfo->bp[i], 1) < 0) {
 			uma_zfree(pbuf_zone, mapinfo->bp[i]);
 			goto fail;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004132103.03DL3U2s066659>