From owner-svn-src-all@freebsd.org Tue Nov 6 16:31:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9333E112926C; Tue, 6 Nov 2018 16:31:00 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 015857E802; Tue, 6 Nov 2018 16:30:59 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wA6GUwpN096772; Tue, 6 Nov 2018 08:30:58 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wA6GUwaK096771; Tue, 6 Nov 2018 08:30:58 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811061630.wA6GUwaK096771@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340187 - head/sys/geom In-Reply-To: <201811061555.wA6FtfiT017783@repo.freebsd.org> To: Maxim Sobolev Date: Tue, 6 Nov 2018 08:30:58 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 015857E802 X-Spamd-Result: default: False [0.92 / 200.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.75)[0.746,0]; NEURAL_HAM_LONG(-0.07)[-0.069,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.08)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_HAM_SHORT(-0.63)[-0.627,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Nov 2018 16:31:00 -0000 > 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); Isnt mediasize 0 based, such that any operation at pp->mediasize is technically past the end of the media and should get an EIO no matter how big it is? Who is doing 0 byte operations at pp->mediasize? That code should probably be fixed rather than allowing this special case here. > /* Truncate requests to the end of providers media. */ > excess = bp->bio_offset + bp->bio_length; > > -- Rod Grimes rgrimes@freebsd.org