Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Nov 2018 15:55:41 +0000 (UTC)
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r340187 - head/sys/geom
Message-ID:  <201811061555.wA6FtfiT017783@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sobomax
Date: Tue Nov  6 15:55:41 2018
New Revision: 340187
URL: https://svnweb.freebsd.org/changeset/base/340187

Log:
  Don't allow BIO_READ, BIO_WRITE or BIO_DELETE requests that are
  fully beyond the end of providers media. The only exception is made
  for the zero length transfers which are allowed to be just on the
  boundary. Previously, any requests starting on the boundary (i.e. next
  byte after the last one) have been allowed to go through.
  
  No response from:	freebsd-geom@, phk
  MFC after:		1 month

Modified:
  head/sys/geom/geom_io.c

Modified: head/sys/geom/geom_io.c
==============================================================================
--- head/sys/geom/geom_io.c	Tue Nov  6 15:52:49 2018	(r340186)
+++ head/sys/geom/geom_io.c	Tue Nov  6 15:55:41 2018	(r340187)
@@ -420,6 +420,8 @@ g_io_check(struct bio *bp)
 			return (EIO);
 		if (bp->bio_offset > pp->mediasize)
 			return (EIO);
+		if (bp->bio_offset == pp->mediasize && bp->bio_length > 0)
+			return (EIO);
 
 		/* Truncate requests to the end of providers media. */
 		excess = bp->bio_offset + bp->bio_length;



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