Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Feb 2019 18:30:51 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r344600 - head/sys/geom/concat
Message-ID:  <201902261830.x1QIUpCm082789@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Feb 26 18:30:51 2019
New Revision: 344600
URL: https://svnweb.freebsd.org/changeset/base/344600

Log:
  Add a missing return statement to g_concat_kernel_dump().
  
  The error occurs when upper layers attempt an out-of-bounds write.
  
  Submitted by:	Noah Bergbauer <noah.bergbauer@tum.de>
  MFC after:	1 week

Modified:
  head/sys/geom/concat/g_concat.c

Modified: head/sys/geom/concat/g_concat.c
==============================================================================
--- head/sys/geom/concat/g_concat.c	Tue Feb 26 18:20:41 2019	(r344599)
+++ head/sys/geom/concat/g_concat.c	Tue Feb 26 18:30:51 2019	(r344600)
@@ -238,8 +238,10 @@ g_concat_kernel_dump(struct bio *bp)
 		    sc->sc_disks[i].d_end > gkd->offset)
 			break;
 	}
-	if (i == sc->sc_ndisks)
+	if (i == sc->sc_ndisks) {
 		g_io_deliver(bp, EOPNOTSUPP);
+		return;
+	}
 	disk = &sc->sc_disks[i];
 	gkd->offset -= disk->d_start;
 	if (gkd->length > disk->d_end - disk->d_start - gkd->offset)



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