Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Oct 2016 17:11:20 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org
Subject:   svn commit: r307935 - in releng/11.0: . sys/amd64/amd64 sys/conf usr.sbin/bhyve
Message-ID:  <201610251711.u9PHBKXU075510@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Oct 25 17:11:20 2016
New Revision: 307935
URL: https://svnweb.freebsd.org/changeset/base/307935

Log:
  Revised SA-16:15.  The initial patch didn't cover all possible overflows
  based on passing incorrect parameters to sysarch(2). [1]
  
  Fix unchecked array reference in the VGA device emulation code. [2]
  
  Security:	SA-16:15 [1]
  Security:       SA-16:32 [2]
  Approved by:	so

Modified:
  releng/11.0/UPDATING
  releng/11.0/sys/amd64/amd64/sys_machdep.c
  releng/11.0/sys/conf/newvers.sh
  releng/11.0/usr.sbin/bhyve/vga.c

Modified: releng/11.0/UPDATING
==============================================================================
--- releng/11.0/UPDATING	Tue Oct 25 17:11:15 2016	(r307934)
+++ releng/11.0/UPDATING	Tue Oct 25 17:11:20 2016	(r307935)
@@ -16,6 +16,12 @@ from older versions of FreeBSD, try WITH
 the tip of head, and then rebuild without this option. The bootstrap process
 from older version of current across the gcc/clang cutover is a bit fragile.
 
+20161025	p2	FreeBSD-SA-16:15.sysarch [revised]
+			FreeBSD-SA-16:32.bhyve
+
+	Fix incorrect argument validation in sysarch(2). [SA-16:15]
+	Fix access to host memory from guest in bhyve(8). [SA-16:32]
+
 20160928:
 	11.0-RELEASE.
 

Modified: releng/11.0/sys/amd64/amd64/sys_machdep.c
==============================================================================
--- releng/11.0/sys/amd64/amd64/sys_machdep.c	Tue Oct 25 17:11:15 2016	(r307934)
+++ releng/11.0/sys/amd64/amd64/sys_machdep.c	Tue Oct 25 17:11:20 2016	(r307935)
@@ -608,6 +608,8 @@ amd64_set_ldt(td, uap, descs)
 		largest_ld = uap->start + uap->num;
 		if (largest_ld > max_ldt_segment)
 			largest_ld = max_ldt_segment;
+		if (largest_ld < uap->start)
+			return (EINVAL);
 		i = largest_ld - uap->start;
 		mtx_lock(&dt_lock);
 		bzero(&((struct user_segment_descriptor *)(pldt->ldt_base))
@@ -620,7 +622,8 @@ amd64_set_ldt(td, uap, descs)
 		/* verify range of descriptors to modify */
 		largest_ld = uap->start + uap->num;
 		if (uap->start >= max_ldt_segment ||
-		    largest_ld > max_ldt_segment)
+		    largest_ld > max_ldt_segment ||
+		    largest_ld < uap->start)
 			return (EINVAL);
 	}
 

Modified: releng/11.0/sys/conf/newvers.sh
==============================================================================
--- releng/11.0/sys/conf/newvers.sh	Tue Oct 25 17:11:15 2016	(r307934)
+++ releng/11.0/sys/conf/newvers.sh	Tue Oct 25 17:11:20 2016	(r307935)
@@ -32,7 +32,7 @@
 
 TYPE="FreeBSD"
 REVISION="11.0"
-BRANCH="RELEASE-p1"
+BRANCH="RELEASE-p2"
 if [ -n "${BRANCH_OVERRIDE}" ]; then
 	BRANCH=${BRANCH_OVERRIDE}
 fi

Modified: releng/11.0/usr.sbin/bhyve/vga.c
==============================================================================
--- releng/11.0/usr.sbin/bhyve/vga.c	Tue Oct 25 17:11:15 2016	(r307934)
+++ releng/11.0/usr.sbin/bhyve/vga.c	Tue Oct 25 17:11:20 2016	(r307935)
@@ -161,10 +161,10 @@ struct vga_softc {
 	 */
 	struct {
 		uint8_t		dac_state;
-		int		dac_rd_index;
-		int		dac_rd_subindex;
-		int		dac_wr_index;
-		int		dac_wr_subindex;
+		uint8_t		dac_rd_index;
+		uint8_t		dac_rd_subindex;
+		uint8_t		dac_wr_index;
+		uint8_t		dac_wr_subindex;
 		uint8_t		dac_palette[3 * 256];
 		uint32_t	dac_palette_rgb[256];
 	} vga_dac;



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