Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Aug 2016 19:03:11 +0000 (UTC)
From:      "Landon J. Fuller" <landonf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r304692 - head/sys/dev/bhnd/bhndb
Message-ID:  <201608231903.u7NJ3Bjc019151@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: landonf
Date: Tue Aug 23 19:03:11 2016
New Revision: 304692
URL: https://svnweb.freebsd.org/changeset/base/304692

Log:
  bhndb(4): Fix unsigned integer underflow in dynamic register window
  handling. This resulted in the window target being left uninitialized
  when an underflow occured.
  
  Approved by:	adrian (mentor)
  Differential Revision:	https://reviews.freebsd.org/D7617

Modified:
  head/sys/dev/bhnd/bhndb/bhndb.c

Modified: head/sys/dev/bhnd/bhndb/bhndb.c
==============================================================================
--- head/sys/dev/bhnd/bhndb/bhndb.c	Tue Aug 23 17:42:03 2016	(r304691)
+++ head/sys/dev/bhnd/bhndb/bhndb.c	Tue Aug 23 19:03:11 2016	(r304692)
@@ -1728,8 +1728,9 @@ bhndb_io_resource(struct bhndb_softc *sc
 
 	/* Adjust the window if the I/O request won't fit in the current
 	 * target range. */
-	if (addr < dwa->target || 
-	   (dwa->target + dwa->win->win_size) - addr < size)
+	if (addr < dwa->target ||
+	    addr > dwa->target + dwa->win->win_size ||
+	    (dwa->target + dwa->win->win_size) - addr < size)
 	{
 		error = bhndb_dw_set_addr(sc->dev, sc->bus_res, dwa, addr,
 		    size);



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