svn commit: r304692 - head/sys/dev/bhnd/bhndb

Landon J. Fuller landonf at FreeBSD.org
Tue Aug 23 19:03:12 UTC 2016


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);


More information about the svn-src-head mailing list