CVS commit: src/sys/arch/x68k/dev

2017-08-11 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Aug 11 07:08:40 UTC 2017

Modified Files:
src/sys/arch/x68k/dev: dmacvar.h fd.c intio_dmac.c vs.c

Log Message:
Allow dmac_alloc_channel() to specify DCR and OCR.
FDC uses 'Cycle Steal Mode with Hold' but ADPCM
should use 'Cycle Steal Mode without Hold' on x68k.
>From Y.Suhagara and it was found by XM6i.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/x68k/dev/dmacvar.h
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/x68k/dev/fd.c
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/x68k/dev/intio_dmac.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/x68k/dev/vs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x68k/dev/dmacvar.h
diff -u src/sys/arch/x68k/dev/dmacvar.h:1.10 src/sys/arch/x68k/dev/dmacvar.h:1.11
--- src/sys/arch/x68k/dev/dmacvar.h:1.10	Wed Jun 25 13:30:24 2008
+++ src/sys/arch/x68k/dev/dmacvar.h	Fri Aug 11 07:08:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmacvar.h,v 1.10 2008/06/25 13:30:24 isaki Exp $	*/
+/*	$NetBSD: dmacvar.h,v 1.11 2017/08/11 07:08:40 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -99,9 +99,14 @@ struct dmac_softc {
 #define DMAC_MAXSEGSZ	0xff00
 #define DMAC_BOUNDARY	0
 
-struct dmac_channel_stat *dmac_alloc_channel(device_t, int, const char *,
-	int, dmac_intr_handler_t, void *, int, dmac_intr_handler_t, void *);
-		/* ch, name, normalv, normal, errorv, error */
+struct dmac_channel_stat *dmac_alloc_channel(device_t,
+	int,		/* ch */
+	const char *,	/* name */
+	int, dmac_intr_handler_t, void *,	/* normal handler */
+	int, dmac_intr_handler_t, void *,	/* error handler */
+	uint8_t,	/* dcr */
+	uint8_t		/* ocr */
+);
 int dmac_free_channel(device_t, int, void *);
 		/* ch, channel */
 struct dmac_dma_xfer *dmac_alloc_xfer(struct dmac_channel_stat *,

Index: src/sys/arch/x68k/dev/fd.c
diff -u src/sys/arch/x68k/dev/fd.c:1.119 src/sys/arch/x68k/dev/fd.c:1.120
--- src/sys/arch/x68k/dev/fd.c:1.119	Thu Jan 12 14:24:53 2017
+++ src/sys/arch/x68k/dev/fd.c	Fri Aug 11 07:08:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd.c,v 1.119 2017/01/12 14:24:53 isaki Exp $	*/
+/*	$NetBSD: fd.c,v 1.120 2017/08/11 07:08:40 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.119 2017/01/12 14:24:53 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.120 2017/08/11 07:08:40 isaki Exp $");
 
 #include "opt_ddb.h"
 #include "opt_m68k_arch.h"
@@ -487,7 +487,10 @@ fdcattach(device_t parent, device_t self
 	/* Initialize DMAC channel */
 	fdc->sc_dmachan = dmac_alloc_channel(parent, ia->ia_dma, "fdc",
 	ia->ia_dmaintr, fdcdmaintr, fdc,
-	ia->ia_dmaintr + 1, fdcdmaerrintr, fdc);
+	ia->ia_dmaintr + 1, fdcdmaerrintr, fdc,
+	(DMAC_DCR_XRM_CSWH | DMAC_DCR_OTYP_EASYNC | DMAC_DCR_OPS_8BIT),
+	(DMAC_OCR_SIZE_BYTE | DMAC_OCR_REQG_EXTERNAL));
+
 	if (bus_dmamap_create(fdc->sc_dmat, FDC_MAXIOSIZE, 1, DMAC_MAXSEGSZ,
 	0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &fdc->sc_dmamap)) {
 		aprint_error_dev(self, "can't set up intio DMA map\n");

Index: src/sys/arch/x68k/dev/intio_dmac.c
diff -u src/sys/arch/x68k/dev/intio_dmac.c:1.35 src/sys/arch/x68k/dev/intio_dmac.c:1.36
--- src/sys/arch/x68k/dev/intio_dmac.c:1.35	Wed Mar 26 08:17:59 2014
+++ src/sys/arch/x68k/dev/intio_dmac.c	Fri Aug 11 07:08:40 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: intio_dmac.c,v 1.35 2014/03/26 08:17:59 christos Exp $	*/
+/*	$NetBSD: intio_dmac.c,v 1.36 2017/08/11 07:08:40 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #include "opt_m68k_arch.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intio_dmac.c,v 1.35 2014/03/26 08:17:59 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intio_dmac.c,v 1.36 2017/08/11 07:08:40 isaki Exp $");
 
 #include 
 #include 
@@ -159,9 +159,10 @@ dmac_init_channels(struct dmac_softc *sc
  * Channel initialization/deinitialization per user device.
  */
 struct dmac_channel_stat *
-dmac_alloc_channel(device_t self, int ch, const char *name, int normalv,
-dmac_intr_handler_t normal, void *normalarg, int errorv,
-dmac_intr_handler_t error, void *errorarg)
+dmac_alloc_channel(device_t self, int ch, const char *name,
+int normalv, dmac_intr_handler_t normal, void *normalarg,
+int errorv,  dmac_intr_handler_t error,  void *errorarg,
+uint8_t dcr, uint8_t ocr)
 {
 	struct intio_softc *intio = device_private(self);
 	struct dmac_softc *dmac = device_private(intio->sc_dmac);
@@ -201,9 +202,8 @@ dmac_alloc_channel(device_t self, int ch
 
 	/* fill the channel status structure by the default values. */
 	strcpy(chan->ch_name, name);
-	chan->ch_dcr = (DMAC_DCR_XRM_CSWH | DMAC_DCR_OTYP_EASYNC |
-			DMAC_DCR_OPS_8BIT);
-	chan->ch_ocr = (DMAC_OCR_SIZE_BYTE | DMAC_OCR_REQG_EXTERNAL);
+	chan->ch_dcr = dcr;
+	chan->ch_ocr = ocr;
 	chan->ch_normalv = normalv;
 	chan->ch_er

CVS commit: src/sys/arch/x68k/dev

2017-08-11 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Aug 11 07:30:01 UTC 2017

Modified Files:
src/sys/arch/x68k/dev: dmacvar.h intio_dmac.c

Log Message:
Fix a Continue Operation.
Patch from Y.Sugahara.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x68k/dev/dmacvar.h
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/x68k/dev/intio_dmac.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x68k/dev/dmacvar.h
diff -u src/sys/arch/x68k/dev/dmacvar.h:1.11 src/sys/arch/x68k/dev/dmacvar.h:1.12
--- src/sys/arch/x68k/dev/dmacvar.h:1.11	Fri Aug 11 07:08:40 2017
+++ src/sys/arch/x68k/dev/dmacvar.h	Fri Aug 11 07:30:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmacvar.h,v 1.11 2017/08/11 07:08:40 isaki Exp $	*/
+/*	$NetBSD: dmacvar.h,v 1.12 2017/08/11 07:30:01 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -55,8 +55,6 @@ struct dmac_dma_xfer {
 	struct dmac_sg_array *dx_array;	/* DMAC array chain */
 	int		dx_done;
 #endif
-	int		dx_nextoff;	/* for continued operation */
-	int		dx_nextsize;
 };
 
 /*

Index: src/sys/arch/x68k/dev/intio_dmac.c
diff -u src/sys/arch/x68k/dev/intio_dmac.c:1.36 src/sys/arch/x68k/dev/intio_dmac.c:1.37
--- src/sys/arch/x68k/dev/intio_dmac.c:1.36	Fri Aug 11 07:08:40 2017
+++ src/sys/arch/x68k/dev/intio_dmac.c	Fri Aug 11 07:30:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: intio_dmac.c,v 1.36 2017/08/11 07:08:40 isaki Exp $	*/
+/*	$NetBSD: intio_dmac.c,v 1.37 2017/08/11 07:30:01 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #include "opt_m68k_arch.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intio_dmac.c,v 1.36 2017/08/11 07:08:40 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intio_dmac.c,v 1.37 2017/08/11 07:30:01 isaki Exp $");
 
 #include 
 #include 
@@ -284,7 +284,6 @@ dmac_alloc_xfer(struct dmac_channel_stat
 	xf->dx_array = chan->ch_map;
 	xf->dx_done = 0;
 #endif
-	xf->dx_nextoff = xf->dx_nextsize = -1;
 	return xf;
 }
 
@@ -300,8 +299,6 @@ dmac_load_xfer(struct dmac_softc *dmac, 
 		xf->dx_ocr |= DMAC_OCR_CHAIN_DISABLED;
 	else {
 		xf->dx_ocr |= DMAC_OCR_CHAIN_ARRAY;
-		xf->dx_nextoff = ~0;
-		xf->dx_nextsize = ~0;
 	}
 
 	bus_space_write_1(dmac->sc_bst, chan->ch_bht, DMAC_REG_CSR, 0xff);
@@ -352,6 +349,8 @@ dmac_start_xfer_offset(struct dmac_softc
 	struct dmac_channel_stat *chan = xf->dx_channel;
 	struct x68k_bus_dmamap *dmamap = xf->dx_dmamap;
 	int go = DMAC_CCR_STR|DMAC_CCR_INT;
+	bus_addr_t paddr;
+	uint8_t csr;
 #ifdef DMAC_ARRAYCHAIN
 	int c;
 #endif
@@ -391,20 +390,21 @@ dmac_start_xfer_offset(struct dmac_softc
 		if (dmamap->dm_mapsize != dmamap->dm_segs[0].ds_len)
 			panic("dmac_start_xfer_offset: dmamap curruption");
 #endif
-		if (offset == xf->dx_nextoff &&
-		size == xf->dx_nextsize) {
-			/* Use continued operation */
+		paddr = dmamap->dm_segs[0].ds_addr + offset;
+		csr = bus_space_read_1(dmac->sc_bst, chan->ch_bht, DMAC_REG_CSR);
+		if ((csr & DMAC_CSR_ACT) != 0) {
+			/* Use 'Continue Mode' */
+			bus_space_write_4(dmac->sc_bst, chan->ch_bht,
+			DMAC_REG_BAR, paddr);
+			bus_space_write_2(dmac->sc_bst, chan->ch_bht,
+			DMAC_REG_BTCR, (int) size);
 			go |=  DMAC_CCR_CNT;
-			xf->dx_nextoff += size;
+			go &= ~DMAC_CCR_STR;
 		} else {
 			bus_space_write_4(dmac->sc_bst, chan->ch_bht,
-	  DMAC_REG_MAR,
-	  (int) dmamap->dm_segs[0].ds_addr
-	  + offset);
+	  DMAC_REG_MAR, paddr);
 			bus_space_write_2(dmac->sc_bst, chan->ch_bht,
 	  DMAC_REG_MTCR, (int) size);
-			xf->dx_nextoff = offset;
-			xf->dx_nextsize = size;
 		}
 #ifdef DMAC_ARRAYCHAIN
 		xf->dx_done = 1;
@@ -436,13 +436,6 @@ dmac_start_xfer_offset(struct dmac_softc
 #endif
 	bus_space_write_1(dmac->sc_bst, chan->ch_bht, DMAC_REG_CCR, go);
 
-	if (xf->dx_nextoff != ~0) {
-		bus_space_write_4(dmac->sc_bst, chan->ch_bht,
-  DMAC_REG_BAR, xf->dx_nextoff);
-		bus_space_write_2(dmac->sc_bst, chan->ch_bht,
-  DMAC_REG_BTCR, xf->dx_nextsize);
-	}
-
 	return 0;
 }
 
@@ -563,7 +556,6 @@ dmac_abort_xfer(struct dmac_softc *dmac,
 	bus_space_write_1(dmac->sc_bst, chan->ch_bht, DMAC_REG_CCR,
 			  DMAC_CCR_INT | DMAC_CCR_SAB);
 	bus_space_write_1(dmac->sc_bst, chan->ch_bht, DMAC_REG_CSR, 0xff);
-	xf->dx_nextoff = xf->dx_nextsize = -1;
 
 	return 0;
 }



CVS commit: src/usr.sbin/btattach

2017-08-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Aug 11 11:54:08 UTC 2017

Modified Files:
src/usr.sbin/btattach: btattach.8 btattach.c

Log Message:
Make the "bcm43xx" type use H4 transport and add a new "bcm43xx-3wire"
type for use with H5 transport. The naming of the types here matches
those used in a series of BlueZ patches from the Raspberry Pi foundation.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/btattach/btattach.8
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/btattach/btattach.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/btattach/btattach.8
diff -u src/usr.sbin/btattach/btattach.8:1.8 src/usr.sbin/btattach/btattach.8:1.9
--- src/usr.sbin/btattach/btattach.8:1.8	Tue Mar 18 18:20:46 2014
+++ src/usr.sbin/btattach/btattach.8	Fri Aug 11 11:54:08 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: btattach.8,v 1.8 2014/03/18 18:20:46 riastradh Exp $
+.\" $NetBSD: btattach.8,v 1.9 2017/08/11 11:54:08 jmcneill Exp $
 .\"
 .\" Copyright (c) 2007 KIYOHARA Takashi
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd March 9, 2010
+.Dd August 11, 2017
 .Dt BTATTACH 8
 .Os
 .Sh NAME
@@ -58,6 +58,10 @@ Supported types are:
 .Bl -tag -compact -width ericssonxx -offset indent
 .It Cm bcm2035
 Broadcom BCM2035
+.It Cm bcm43xx
+Broadcom BCM43xx
+.It Cm bcm43xx-3wire
+Broadcom BCM43xx (3-wire)
 .It Cm bcsp
 Generic BCSP (BlueCore Serial Protocol)
 .It Cm bgb2xx

Index: src/usr.sbin/btattach/btattach.c
diff -u src/usr.sbin/btattach/btattach.c:1.14 src/usr.sbin/btattach/btattach.c:1.15
--- src/usr.sbin/btattach/btattach.c:1.14	Thu Aug 10 13:34:29 2017
+++ src/usr.sbin/btattach/btattach.c	Fri Aug 11 11:54:08 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: btattach.c,v 1.14 2017/08/10 13:34:29 nat Exp $	*/
+/*	$NetBSD: btattach.c,v 1.15 2017/08/11 11:54:08 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2008 Iain Hibbert
@@ -27,7 +27,7 @@
 
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008 Iain Hibbert.  All rights reserved.");
-__RCSID("$NetBSD: btattach.c,v 1.14 2017/08/10 13:34:29 nat Exp $");
+__RCSID("$NetBSD: btattach.c,v 1.15 2017/08/11 11:54:08 jmcneill Exp $");
 
 #include 
 #include 
@@ -63,12 +63,19 @@ static const struct devtype types[] = {
 },
 {
 	.name = "bcm43xx",
-	.line = "bth5",
+	.line = "btuart",
 	.descr = "Broadcom BCM43xx",
 	.init = &init_bcm43xx,
 	.speed = B115200,
 },
 {
+	.name = "bcm43xx-3wire",
+	.line = "bth5",
+	.descr = "Broadcom BCM43xx (3-wire)",
+	.init = &init_bcm43xx,
+	.speed = B115200,
+},
+{
 	.name = "bcsp",
 	.line = "bcsp",
 	.descr = "Generic BlueCore Serial Protocol",



CVS commit: src/etc/bluetooth

2017-08-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Aug 11 11:57:05 UTC 2017

Modified Files:
src/etc/bluetooth: btattach.conf

Log Message:
Add an example for configuring the Raspberry Pi 3's bluetooth chip.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/etc/bluetooth/btattach.conf

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/bluetooth/btattach.conf
diff -u src/etc/bluetooth/btattach.conf:1.1 src/etc/bluetooth/btattach.conf:1.2
--- src/etc/bluetooth/btattach.conf:1.1	Tue Apr 15 11:17:47 2008
+++ src/etc/bluetooth/btattach.conf	Fri Aug 11 11:57:05 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: btattach.conf,v 1.1 2008/04/15 11:17:47 plunky Exp $
+#	$NetBSD: btattach.conf,v 1.2 2017/08/11 11:57:05 jmcneill Exp $
 #
 # Bluetooth serial devices configuration.
 #
@@ -10,3 +10,6 @@
 
 #btuart		/dev/tty00	115200
 #digi		/dev/tty01	57600
+
+# Raspberry Pi 3 Bluetooth UART
+#bcm43xx-3wire	/dev/dty00	921600		-FPi 115200



CVS commit: src/sys/modules

2017-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Aug 11 12:58:14 UTC 2017

Modified Files:
src/sys/modules: Makefile

Log Message:
Don't build the ibcs2 module on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.194 -r1.195 src/sys/modules/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.194 src/sys/modules/Makefile:1.195
--- src/sys/modules/Makefile:1.194	Tue Aug  1 13:49:50 2017
+++ src/sys/modules/Makefile	Fri Aug 11 12:58:14 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.194 2017/08/01 13:49:50 maxv Exp $
+#	$NetBSD: Makefile,v 1.195 2017/08/11 12:58:14 maxv Exp $
 
 .include 
 
@@ -265,7 +265,6 @@ SUBDIR+=	compat_netbsd32_sysvipc
 .if ${MACHINE_ARCH} == "i386"
 SUBDIR+=	ati_pcigart
 SUBDIR+=	compat_freebsd
-SUBDIR+=	compat_ibcs2
 SUBDIR+=	mach64drm
 SUBDIR+=	mgadrm
 SUBDIR+=	nsclpcsio



CVS commit: [netbsd-7-0] src/sys/arch/newsmips/apbus

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug 11 15:20:22 UTC 2017

Modified Files:
src/sys/arch/newsmips/apbus [netbsd-7-0]: if_sn.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1467):
sys/arch/newsmips/apbus/if_sn.c: revision 1.39
Avoid memory leak in sonic_get.
If this is the first time around, top is null and nothing else will
free m.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.16.1 src/sys/arch/newsmips/apbus/if_sn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/newsmips/apbus/if_sn.c
diff -u src/sys/arch/newsmips/apbus/if_sn.c:1.34 src/sys/arch/newsmips/apbus/if_sn.c:1.34.16.1
--- src/sys/arch/newsmips/apbus/if_sn.c:1.34	Sat Oct 13 06:24:15 2012
+++ src/sys/arch/newsmips/apbus/if_sn.c	Fri Aug 11 15:20:21 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sn.c,v 1.34 2012/10/13 06:24:15 tsutsui Exp $	*/
+/*	$NetBSD: if_sn.c,v 1.34.16.1 2017/08/11 15:20:21 snj Exp $	*/
 
 /*
  * National Semiconductor  DP8393X SONIC Driver
@@ -16,7 +16,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.34 2012/10/13 06:24:15 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.34.16.1 2017/08/11 15:20:21 snj Exp $");
 
 #include "opt_inet.h"
 
@@ -1093,7 +1093,10 @@ sonic_get(struct sn_softc *sc, void *pkt
 		if (datalen >= MINCLSIZE) {
 			MCLGET(m, M_DONTWAIT);
 			if ((m->m_flags & M_EXT) == 0) {
-if (top) m_freem(top);
+if (top)
+	m_freem(top);
+else
+	m_freem(m);
 return 0;
 			}
 			len = MCLBYTES;



CVS commit: [netbsd-7-1] src/sys/arch/newsmips/apbus

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug 11 15:20:52 UTC 2017

Modified Files:
src/sys/arch/newsmips/apbus [netbsd-7-1]: if_sn.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1467):
sys/arch/newsmips/apbus/if_sn.c: revision 1.39
Avoid memory leak in sonic_get.
If this is the first time around, top is null and nothing else will
free m.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.20.1 src/sys/arch/newsmips/apbus/if_sn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/newsmips/apbus/if_sn.c
diff -u src/sys/arch/newsmips/apbus/if_sn.c:1.34 src/sys/arch/newsmips/apbus/if_sn.c:1.34.20.1
--- src/sys/arch/newsmips/apbus/if_sn.c:1.34	Sat Oct 13 06:24:15 2012
+++ src/sys/arch/newsmips/apbus/if_sn.c	Fri Aug 11 15:20:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sn.c,v 1.34 2012/10/13 06:24:15 tsutsui Exp $	*/
+/*	$NetBSD: if_sn.c,v 1.34.20.1 2017/08/11 15:20:52 snj Exp $	*/
 
 /*
  * National Semiconductor  DP8393X SONIC Driver
@@ -16,7 +16,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.34 2012/10/13 06:24:15 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.34.20.1 2017/08/11 15:20:52 snj Exp $");
 
 #include "opt_inet.h"
 
@@ -1093,7 +1093,10 @@ sonic_get(struct sn_softc *sc, void *pkt
 		if (datalen >= MINCLSIZE) {
 			MCLGET(m, M_DONTWAIT);
 			if ((m->m_flags & M_EXT) == 0) {
-if (top) m_freem(top);
+if (top)
+	m_freem(top);
+else
+	m_freem(m);
 return 0;
 			}
 			len = MCLBYTES;



CVS commit: [netbsd-7] src/sys/arch/newsmips/apbus

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug 11 15:21:38 UTC 2017

Modified Files:
src/sys/arch/newsmips/apbus [netbsd-7]: if_sn.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1467):
sys/arch/newsmips/apbus/if_sn.c: revision 1.39
Avoid memory leak in sonic_get.
If this is the first time around, top is null and nothing else will
free m.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.12.1 src/sys/arch/newsmips/apbus/if_sn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/newsmips/apbus/if_sn.c
diff -u src/sys/arch/newsmips/apbus/if_sn.c:1.34 src/sys/arch/newsmips/apbus/if_sn.c:1.34.12.1
--- src/sys/arch/newsmips/apbus/if_sn.c:1.34	Sat Oct 13 06:24:15 2012
+++ src/sys/arch/newsmips/apbus/if_sn.c	Fri Aug 11 15:21:38 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_sn.c,v 1.34 2012/10/13 06:24:15 tsutsui Exp $	*/
+/*	$NetBSD: if_sn.c,v 1.34.12.1 2017/08/11 15:21:38 snj Exp $	*/
 
 /*
  * National Semiconductor  DP8393X SONIC Driver
@@ -16,7 +16,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.34 2012/10/13 06:24:15 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sn.c,v 1.34.12.1 2017/08/11 15:21:38 snj Exp $");
 
 #include "opt_inet.h"
 
@@ -1093,7 +1093,10 @@ sonic_get(struct sn_softc *sc, void *pkt
 		if (datalen >= MINCLSIZE) {
 			MCLGET(m, M_DONTWAIT);
 			if ((m->m_flags & M_EXT) == 0) {
-if (top) m_freem(top);
+if (top)
+	m_freem(top);
+else
+	m_freem(m);
 return 0;
 			}
 			len = MCLBYTES;



CVS commit: [netbsd-7-0] src/sys/arch/mac68k/nubus

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug 11 15:31:49 UTC 2017

Modified Files:
src/sys/arch/mac68k/nubus [netbsd-7-0]: if_netdock_nubus.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1468):
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.26
Avoid memory leak in netdock_get.
If top is null, this is the first time through and nothing else will
free m.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.16.1 src/sys/arch/mac68k/nubus/if_netdock_nubus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mac68k/nubus/if_netdock_nubus.c
diff -u src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.22 src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.22.16.1
--- src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.22	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/nubus/if_netdock_nubus.c	Fri Aug 11 15:31:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_netdock_nubus.c,v 1.22 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: if_netdock_nubus.c,v 1.22.16.1 2017/08/11 15:31:49 snj Exp $	*/
 
 /*
  * Copyright (C) 2000,2002 Daishi Kato 
@@ -43,7 +43,7 @@
 /***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.22 2012/10/27 17:17:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.22.16.1 2017/08/11 15:31:49 snj Exp $");
 
 #include 
 #include 
@@ -804,6 +804,8 @@ netdock_get(struct netdock_softc *sc, in
 			if ((m->m_flags & M_EXT) == 0) {
 if (top)
 	m_freem(top);
+else
+	m_freem(m);
 return (NULL);
 			}
 			len = MCLBYTES;



CVS commit: [netbsd-7-1] src/sys/arch/mac68k/nubus

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug 11 15:32:26 UTC 2017

Modified Files:
src/sys/arch/mac68k/nubus [netbsd-7-1]: if_netdock_nubus.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1468):
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.26
Avoid memory leak in netdock_get.
If top is null, this is the first time through and nothing else will
free m.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.20.1 src/sys/arch/mac68k/nubus/if_netdock_nubus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mac68k/nubus/if_netdock_nubus.c
diff -u src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.22 src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.22.20.1
--- src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.22	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/nubus/if_netdock_nubus.c	Fri Aug 11 15:32:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_netdock_nubus.c,v 1.22 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: if_netdock_nubus.c,v 1.22.20.1 2017/08/11 15:32:26 snj Exp $	*/
 
 /*
  * Copyright (C) 2000,2002 Daishi Kato 
@@ -43,7 +43,7 @@
 /***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.22 2012/10/27 17:17:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.22.20.1 2017/08/11 15:32:26 snj Exp $");
 
 #include 
 #include 
@@ -804,6 +804,8 @@ netdock_get(struct netdock_softc *sc, in
 			if ((m->m_flags & M_EXT) == 0) {
 if (top)
 	m_freem(top);
+else
+	m_freem(m);
 return (NULL);
 			}
 			len = MCLBYTES;



CVS commit: [netbsd-7-0] src/doc

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug 11 15:32:14 UTC 2017

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
146[78]


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.51 -r1.1.2.52 src/doc/CHANGES-7.0.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.51 src/doc/CHANGES-7.0.3:1.1.2.52
--- src/doc/CHANGES-7.0.3:1.1.2.51	Wed Aug  9 07:32:43 2017
+++ src/doc/CHANGES-7.0.3	Fri Aug 11 15:32:14 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.51 2017/08/09 07:32:43 snj Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.52 2017/08/11 15:32:14 snj Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -3048,3 +3048,13 @@ sys/dev/usb/if_ural.c1.52
 	Free the RX list if ural_alloc_rx_list fails part way through.
 	[skrll, ticket #1462]
 
+sys/arch/newsmips/apbus/if_sn.c			1.39
+
+	memory leak in sonic_get()
+	[mrg, ticket #1467]
+
+sys/arch/mac68k/nubus/if_netdock_nubus.c	1.26
+
+	memory leak in netdock_get()
+	[mrg, ticket #1468]
+



CVS commit: [netbsd-7-1] src/doc

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug 11 15:32:45 UTC 2017

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.1

Log Message:
146[78]


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.20 -r1.1.2.21 src/doc/CHANGES-7.1.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-7.1.1
diff -u src/doc/CHANGES-7.1.1:1.1.2.20 src/doc/CHANGES-7.1.1:1.1.2.21
--- src/doc/CHANGES-7.1.1:1.1.2.20	Wed Aug  9 07:27:01 2017
+++ src/doc/CHANGES-7.1.1	Fri Aug 11 15:32:45 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.1,v 1.1.2.20 2017/08/09 07:27:01 snj Exp $
+# $NetBSD: CHANGES-7.1.1,v 1.1.2.21 2017/08/11 15:32:45 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.1.1
 release:
@@ -1758,3 +1758,13 @@ sys/dev/usb/if_ural.c1.52
 	Free the RX list if ural_alloc_rx_list fails part way through.
 	[skrll, ticket #1462]
 
+sys/arch/newsmips/apbus/if_sn.c			1.39
+
+	memory leak in sonic_get()
+	[mrg, ticket #1467]
+
+sys/arch/mac68k/nubus/if_netdock_nubus.c	1.26
+
+	memory leak in netdock_get()
+	[mrg, ticket #1468]
+



CVS commit: [netbsd-7] src/doc

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug 11 15:33:19 UTC 2017

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
146[78]


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.34 -r1.1.2.35 src/doc/CHANGES-7.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.34 src/doc/CHANGES-7.2:1.1.2.35
--- src/doc/CHANGES-7.2:1.1.2.34	Wed Aug  9 07:19:05 2017
+++ src/doc/CHANGES-7.2	Fri Aug 11 15:33:19 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.34 2017/08/09 07:19:05 snj Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.35 2017/08/11 15:33:19 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -2713,3 +2713,13 @@ sys/arch/hpcsh/dev/pfckbd.c			1.30
 	Make early ddb work with wscons console again.
 	[uwe, ticket #1466]
 
+sys/arch/newsmips/apbus/if_sn.c			1.39
+
+	memory leak in sonic_get()
+	[mrg, ticket #1467]
+
+sys/arch/mac68k/nubus/if_netdock_nubus.c	1.26
+
+	memory leak in netdock_get()
+	[mrg, ticket #1468]
+



CVS commit: [netbsd-7] src/sys/arch/mac68k/nubus

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Aug 11 15:33:01 UTC 2017

Modified Files:
src/sys/arch/mac68k/nubus [netbsd-7]: if_netdock_nubus.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1468):
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.26
Avoid memory leak in netdock_get.
If top is null, this is the first time through and nothing else will
free m.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.22.12.1 src/sys/arch/mac68k/nubus/if_netdock_nubus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/mac68k/nubus/if_netdock_nubus.c
diff -u src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.22 src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.22.12.1
--- src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.22	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/nubus/if_netdock_nubus.c	Fri Aug 11 15:33:01 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_netdock_nubus.c,v 1.22 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: if_netdock_nubus.c,v 1.22.12.1 2017/08/11 15:33:01 snj Exp $	*/
 
 /*
  * Copyright (C) 2000,2002 Daishi Kato 
@@ -43,7 +43,7 @@
 /***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.22 2012/10/27 17:17:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.22.12.1 2017/08/11 15:33:01 snj Exp $");
 
 #include 
 #include 
@@ -804,6 +804,8 @@ netdock_get(struct netdock_softc *sc, in
 			if ((m->m_flags & M_EXT) == 0) {
 if (top)
 	m_freem(top);
+else
+	m_freem(m);
 return (NULL);
 			}
 			len = MCLBYTES;



CVS commit: src/share/misc

2017-08-11 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Fri Aug 11 16:03:14 UTC 2017

Modified Files:
src/share/misc: acronyms acronyms.comp

Log Message:
PR/52479: Nikolai Lifanov: Add definitions for CRM and CMS. Thanks!


To generate a diff of this commit:
cvs rdiff -u -r1.255 -r1.256 src/share/misc/acronyms
cvs rdiff -u -r1.183 -r1.184 src/share/misc/acronyms.comp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.255 src/share/misc/acronyms:1.256
--- src/share/misc/acronyms:1.255	Wed Jun 14 20:56:33 2017
+++ src/share/misc/acronyms	Fri Aug 11 16:03:14 2017
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.255 2017/06/14 20:56:33 dholland Exp $
+$NetBSD: acronyms,v 1.256 2017/08/11 16:03:14 ginsbach Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -92,6 +92,7 @@ COB	close of business [day]
 COTS	commercial off-the-shelf
 CPC	cost per click
 CPE	customer premises equipment
+CRM	customer relationship management
 CTN	can't talk now
 CU	see you
 CUL	see you later

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.183 src/share/misc/acronyms.comp:1.184
--- src/share/misc/acronyms.comp:1.183	Fri May 12 21:14:47 2017
+++ src/share/misc/acronyms.comp	Fri Aug 11 16:03:14 2017
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.183 2017/05/12 21:14:47 kamil Exp $
+$NetBSD: acronyms.comp,v 1.184 2017/08/11 16:03:14 ginsbach Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -213,8 +213,8 @@ CLUT	color look-up table
 CLV	constant linear velocity
 CM	configuration management
 CMA	concert multithread architecture
-CMI	control management interface
-CMI	control method interface
+CMS	{configuration,content,course} management system
+CMI	control {management,method} interface
 CMOS	complementary metal-oxide-semiconductor
 CMP	chip multi-processing
 CMS	content management system



CVS commit: src/usr.sbin/timed/timed

2017-08-11 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Fri Aug 11 16:47:42 UTC 2017

Modified Files:
src/usr.sbin/timed/timed: readmsg.c

Log Message:
PR bin/42464: Timothy McIntosh: Fix timed interoperability

Fix is a combination of FreeBSD fix and submitted patch.

[From the FreeBSD change]
The timed protocol is not implemented in a compatible way by all
vendors; the size of the tsp_name field is OS-dependent.  4.3BSD
used a 32-byte field, FreeBSD uses MAXHOSTNAMELEN and RedHat
apparently uses a 64-byte field.  As a result, sanity checking code
added a few months ago to detect short packets will fail when
interoperating with one of these other vendors.

Change the short packet detection code to expect a minimum packet
size corresponding to the 4.3BSD implementation, which should be
a safe minimum size.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/timed/timed/readmsg.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/timed/timed/readmsg.c
diff -u src/usr.sbin/timed/timed/readmsg.c:1.22 src/usr.sbin/timed/timed/readmsg.c:1.23
--- src/usr.sbin/timed/timed/readmsg.c:1.22	Sat Feb 16 07:30:15 2008
+++ src/usr.sbin/timed/timed/readmsg.c	Fri Aug 11 16:47:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: readmsg.c,v 1.22 2008/02/16 07:30:15 matt Exp $	*/
+/*	$NetBSD: readmsg.c,v 1.23 2017/08/11 16:47:42 ginsbach Exp $	*/
 
 /*-
  * Copyright (c) 1985, 1993 The Regents of the University of California.
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)readmsg.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: readmsg.c,v 1.22 2008/02/16 07:30:15 matt Exp $");
+__RCSID("$NetBSD: readmsg.c,v 1.23 2017/08/11 16:47:42 ginsbach Exp $");
 #endif
 #endif /* not lint */
 
@@ -203,15 +203,22 @@ again:
 			continue;
 		}
 		length = sizeof(from);
+		memset(&msgin, 0, sizeof(msgin));
 		if ((n = recvfrom(sock, &msgin, sizeof(struct tsp), 0,
 			 (struct sockaddr*)(void *)&from, &length)) < 0) {
 			syslog(LOG_ERR, "recvfrom: %m");
 			exit(EXIT_FAILURE);
 		}
-		if (n < (ssize_t)sizeof(struct tsp)) {
+		/*
+		 * The 4.3BSD protocol spec had a 32-byte tsp_name field, and
+		 * this is still OS-dependent.  Demand that the packet is at
+		 * least long enough to hold a 4.3BSD packet.
+		 */
+		if (n < (ssize_t)(sizeof(struct tsp) - MAXHOSTNAMELEN + 32)) {
 			syslog(LOG_NOTICE,
 			"short packet (%lu/%lu bytes) from %s",
-			  (u_long)n, (u_long)sizeof(struct tsp),
+			  (u_long)n,
+			  (u_long)(sizeof(struct tsp) - MAXHOSTNAMELEN + 32),
 			  inet_ntoa(from.sin_addr));
 			continue;
 		}



CVS commit: [jdolecek-ncq] src/sys/dev/ic

2017-08-11 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Fri Aug 11 18:20:13 UTC 2017

Modified Files:
src/sys/dev/ic [jdolecek-ncq]: siisata.c

Log Message:
replace magic 3100 with locall defined WDC_RESET_WAIT


To generate a diff of this commit:
cvs rdiff -u -r1.30.4.33 -r1.30.4.34 src/sys/dev/ic/siisata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/siisata.c
diff -u src/sys/dev/ic/siisata.c:1.30.4.33 src/sys/dev/ic/siisata.c:1.30.4.34
--- src/sys/dev/ic/siisata.c:1.30.4.33	Fri Aug  4 20:53:46 2017
+++ src/sys/dev/ic/siisata.c	Fri Aug 11 18:20:13 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata.c,v 1.30.4.33 2017/08/04 20:53:46 jdolecek Exp $ */
+/* $NetBSD: siisata.c,v 1.30.4.34 2017/08/11 18:20:13 jdolecek Exp $ */
 
 /* from ahcisata_core.c */
 
@@ -79,7 +79,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.33 2017/08/04 20:53:46 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata.c,v 1.30.4.34 2017/08/11 18:20:13 jdolecek Exp $");
 
 #include 
 #include 
@@ -109,6 +109,7 @@ int siisata_debug_mask = 0;
 #endif
 
 #define ATA_DELAY 1		/* 10s for a drive I/O */
+#define WDC_RESET_WAIT 31000	/* 31s for drive reset */
 
 #ifndef __BUS_SPACE_HAS_STREAM_METHODS
 #if _BYTE_ORDER == _LITTLE_ENDIAN
@@ -721,6 +722,7 @@ siisata_reset_drive(struct ata_drive_dat
 	struct ata_xfer *xfer;
 	uint32_t pss, pis;
 	int i;
+	bool timed_out;
 
 	siisata_reinit_port(chp, drvp->drive);
 
@@ -737,10 +739,13 @@ siisata_reset_drive(struct ata_drive_dat
 
 	siisata_activate_prb(schp, xfer->c_slot);
 
-	for(i = 0; i < 3100; i++) {
+	timed_out = true;
+	for(i = 0; i < WDC_RESET_WAIT / 10; i++) {
 		pss = PRREAD(sc, PRX(chp->ch_channel, PRO_PSS));
-		if ((pss & PR_PXSS(xfer->c_slot)) == 0)
+		if ((pss & PR_PXSS(xfer->c_slot)) == 0) {
+			timed_out = false;
 			break;
+		}
 		if (pss & PR_PSS_ATTENTION)
 			break;
 		ata_delay(10, "siiprb", flags);
@@ -764,7 +769,7 @@ siisata_reset_drive(struct ata_drive_dat
 
 	siisata_enable_port_interrupt(chp);
 
-	if (i == 3100) {
+	if (timed_out) {
 		/* timeout */
 		siisata_device_reset(chp);	/* XXX is this right? */
 		if (sigp)
@@ -888,7 +893,7 @@ siisata_probe_drive(struct ata_channel *
 		siisata_activate_prb(schp, xfer->c_slot);
 
 		timed_out = 1;
-		for(i = 0; i < 3100; i++) {
+		for(i = 0; i < WDC_RESET_WAIT / 10; i++) {
 			if ((PRREAD(sc, PRX(chp->ch_channel, PRO_PSS)) &
 			PR_PXSS(xfer->c_slot)) == 0) {
 /* prb completed */



CVS commit: src/sys/dev/sdmmc

2017-08-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Aug 11 18:41:42 UTC 2017

Modified Files:
src/sys/dev/sdmmc: ld_sdmmc.c

Log Message:
Defer sdmmc discard operations to the sdmmc task queue. Fixes a panic
introduced by ld.c r1.102.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/sdmmc/ld_sdmmc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/sdmmc/ld_sdmmc.c
diff -u src/sys/dev/sdmmc/ld_sdmmc.c:1.32 src/sys/dev/sdmmc/ld_sdmmc.c:1.33
--- src/sys/dev/sdmmc/ld_sdmmc.c:1.32	Wed Aug  9 16:44:40 2017
+++ src/sys/dev/sdmmc/ld_sdmmc.c	Fri Aug 11 18:41:42 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_sdmmc.c,v 1.32 2017/08/09 16:44:40 mlelstv Exp $	*/
+/*	$NetBSD: ld_sdmmc.c,v 1.33 2017/08/11 18:41:42 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.32 2017/08/09 16:44:40 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v 1.33 2017/08/11 18:41:42 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -65,15 +65,24 @@ __KERNEL_RCSID(0, "$NetBSD: ld_sdmmc.c,v
 #define	LD_SDMMC_IORETRIES	5	/* number of retries before giving up */
 #define	RECOVERYTIME		hz/2	/* time to wait before retrying a cmd */
 
+#define	LD_SDMMC_MAXQUEUECNT	4	/* number of queued bio requests */
+#define	LD_SDMMC_MAXTASKCNT	8	/* number of tasks in task pool */
+
 struct ld_sdmmc_softc;
 
 struct ld_sdmmc_task {
 	struct sdmmc_task task;
 
 	struct ld_sdmmc_softc *task_sc;
+
+	/* bio tasks */
 	struct buf *task_bp;
 	int task_retries; /* number of xfer retry */
 	struct callout task_restart_ch;
+
+	/* discard tasks */
+	off_t task_pos;
+	off_t task_len;
 };
 
 struct ld_sdmmc_softc {
@@ -81,9 +90,12 @@ struct ld_sdmmc_softc {
 	int sc_hwunit;
 
 	struct sdmmc_function *sc_sf;
-#define LD_SDMMC_MAXQUEUECNT 4
-	struct ld_sdmmc_task sc_task[LD_SDMMC_MAXQUEUECNT];
+	struct ld_sdmmc_task sc_task[LD_SDMMC_MAXTASKCNT];
 	pcq_t *sc_freeq;
+
+	struct evcnt sc_ev_discard;	/* discard counter */
+	struct evcnt sc_ev_discarderr;	/* discard error counter */
+	struct evcnt sc_ev_discardbusy;	/* discard busy counter */
 };
 
 static int ld_sdmmc_match(device_t, cfdata_t, void *);
@@ -98,6 +110,7 @@ static int ld_sdmmc_ioctl(struct ld_soft
 
 static void ld_sdmmc_doattach(void *);
 static void ld_sdmmc_dobio(void *);
+static void ld_sdmmc_dodiscard(void *);
 
 CFATTACH_DECL_NEW(ld_sdmmc, sizeof(struct ld_sdmmc_softc),
 ld_sdmmc_match, ld_sdmmc_attach, ld_sdmmc_detach, NULL);
@@ -132,6 +145,13 @@ ld_sdmmc_attach(device_t parent, device_
 	sa->sf->cid.rev, sa->sf->cid.psn, sa->sf->cid.mdt);
 	aprint_naive("\n");
 
+	evcnt_attach_dynamic(&sc->sc_ev_discard, EVCNT_TYPE_MISC,
+	NULL, device_xname(self), "sdmmc discard count");
+	evcnt_attach_dynamic(&sc->sc_ev_discarderr, EVCNT_TYPE_MISC,
+	NULL, device_xname(self), "sdmmc discard errors");
+	evcnt_attach_dynamic(&sc->sc_ev_discardbusy, EVCNT_TYPE_MISC,
+	NULL, device_xname(self), "sdmmc discard busy");
+
 	const int ntask = __arraycount(sc->sc_task);
 	sc->sc_freeq = pcq_create(ntask, KM_SLEEP);
 	for (i = 0; i < ntask; i++) {
@@ -213,6 +233,9 @@ ld_sdmmc_detach(device_t dev, int flags)
 		callout_destroy(&sc->sc_task[i].task_restart_ch);
 
 	pcq_destroy(sc->sc_freeq);
+	evcnt_detach(&sc->sc_ev_discard);
+	evcnt_detach(&sc->sc_ev_discarderr);
+	evcnt_detach(&sc->sc_ev_discardbusy);
 
 	return 0;
 }
@@ -314,12 +337,44 @@ ld_sdmmc_dump(struct ld_softc *ld, void 
 	blkcnt * ld->sc_secsize);
 }
 
+static void
+ld_sdmmc_dodiscard(void *arg)
+{
+	struct ld_sdmmc_task *task = arg;
+	struct ld_sdmmc_softc *sc = task->task_sc;
+	const off_t pos = task->task_pos;
+	const off_t len = task->task_len;
+	int error;
+
+	/* An error from discard is non-fatal */
+	error = sdmmc_mem_discard(sc->sc_sf, pos, len);
+	if (error != 0)
+		sc->sc_ev_discarderr.ev_count++;
+	else
+		sc->sc_ev_discard.ev_count++;
+
+	pcq_put(sc->sc_freeq, task);
+}
+
 static int
 ld_sdmmc_discard(struct ld_softc *ld, off_t pos, off_t len)
 {
 	struct ld_sdmmc_softc *sc = device_private(ld->sc_dv);
+	struct ld_sdmmc_task *task = pcq_get(sc->sc_freeq);
+
+	if (task == NULL) {
+		sc->sc_ev_discardbusy.ev_count++;
+		return 0;
+	}
 
-	return sdmmc_mem_discard(sc->sc_sf, pos, len);
+	task->task_pos = pos;
+	task->task_len = len;
+
+	sdmmc_init_task(&task->task, ld_sdmmc_dodiscard, task);
+
+	sdmmc_add_task(sc->sc_sf->sc, &task->task);
+
+	return 0;
 }
 
 static int



CVS commit: src/lib/libm

2017-08-11 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Fri Aug 11 20:24:56 UTC 2017

Modified Files:
src/lib/libm: Makefile

Log Message:
Move s_nearbyint.c out of the cpu ifdefs and into COMMON_SRCS,
which is used everywhere except on vax.  This is to simplify and
to ensure the function is included in the build, allowing us to
re-add the nearbyint() test.


To generate a diff of this commit:
cvs rdiff -u -r1.195 -r1.196 src/lib/libm/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libm/Makefile
diff -u src/lib/libm/Makefile:1.195 src/lib/libm/Makefile:1.196
--- src/lib/libm/Makefile:1.195	Thu Jul 27 10:03:10 2017
+++ src/lib/libm/Makefile	Fri Aug 11 20:24:56 2017
@@ -1,4 +1,4 @@
-#  $NetBSD: Makefile,v 1.195 2017/07/27 10:03:10 he Exp $
+#  $NetBSD: Makefile,v 1.196 2017/08/11 20:24:56 he Exp $
 #
 #  @(#)Makefile 5.1beta 93/09/24
 #
@@ -66,7 +66,7 @@ COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 .elif (${LIBC_MACHINE_ARCH} == "alpha")
 .PATH: ${.CURDIR}/arch/alpha
 ARCH_SRCS = s_copysign.S s_copysignf.S lrint.S
-COMMON_SRCS+= fenv.c s_nearbyint.c
+COMMON_SRCS+= fenv.c
 COPTS+=	-mfloat-ieee -mieee-with-inexact -mfp-trap-mode=sui -mtrap-precision=i
 
 .elif (${LIBC_MACHINE_CPU} == "arm")
@@ -74,7 +74,7 @@ COPTS+=	-mfloat-ieee -mieee-with-inexact
 .if ${MKSOFTFLOAT} == "no"
 COMMON_SRCS+= fenv.c
 .endif
-COMMON_SRCS+= s_nexttowardf.c s_nearbyint.c s_rintl.c
+COMMON_SRCS+= s_nexttowardf.c s_rintl.c
 .for f in fenv.c lrint.S lrintf.S s_fabsf.S s_fma.S s_fmaf.S
 COPTS.$f +=	-mfpu=vfp
 .endfor
@@ -86,21 +86,21 @@ ARCH_SRCS = e_sqrt.S e_sqrtf.S lrint.S l
 
 .elif (${LIBC_MACHINE_ARCH} == "ia64")
 .PATH: ${.CURDIR}/arch/ia64
-COMMON_SRCS += fenv.c s_nearbyint.c
+COMMON_SRCS += fenv.c
 
 .elif (${LIBC_MACHINE_ARCH} == "hppa")
 .PATH.c: ${.CURDIR}/arch/hppa
-COMMON_SRCS+= fenv.c s_nexttowardf.c s_nearbyint.c s_rintl.c
+COMMON_SRCS+= fenv.c s_nexttowardf.c s_rintl.c
 
 .elif (${LIBC_MACHINE_ARCH} == "sparc")
 .PATH: ${.CURDIR}/arch/sparc
-COMMON_SRCS+= fenv.c s_nearbyint.c
+COMMON_SRCS+= fenv.c
 COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 
 .elif (${LIBC_MACHINE_ARCH} == "sparc64")
 .PATH: ${.CURDIR}/arch/sparc64
 COMMON_SRCS+= fenv.c
-COMMON_SRCS+= s_nexttowardf.c s_nearbyint.c s_rintl.c
+COMMON_SRCS+= s_nexttowardf.c s_rintl.c
 .ifndef _COMPAT_M32_MK_
 COMMON_SRCS+= s_nexttoward.c
 .endif
@@ -114,8 +114,7 @@ COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 .endif
 .PATH:	${.CURDIR}/arch/i387
 
-COMMON_SRCS+= fenv.c s_nexttoward.c s_nexttowardf.c \
-	s_nearbyint.c s_rintl.c
+COMMON_SRCS+= fenv.c s_nexttoward.c s_nexttowardf.c s_rintl.c
 COMMON_SRCS+= s_fma.c s_fmaf.c s_fmal.c
 
 ARCH_SRCS = e_acos.S e_asin.S e_atan2.S e_exp.S e_expf.S e_fmod.S e_log.S \
@@ -154,7 +153,7 @@ ARCH_SRCS = e_acos.S e_asin.S e_atanh.S 
 	e_log10.S e_remainder.S e_scalb.S e_sinh.S e_sqrt.S s_atan.S \
 	s_ceil.S s_copysign.S s_cos.S s_expm1.S s_finite.S s_floor.S \
 	s_log1p.S s_logb.S s_rint.S s_scalbn.S s_sin.S s_tan.S s_tanh.S
-COMMON_SRCS += fenv.c s_nearbyint.c s_rintl.c
+COMMON_SRCS += fenv.c s_rintl.c
 .endif
 .endif
 # end of m68k
@@ -174,7 +173,7 @@ WARNS?=5
 .PATH:	${.CURDIR}/arch/riscv
 
 .if ${MKSOFTFLOAT} == "no"
-COMMON_SRCS += fenv.c s_nearbyint.c
+COMMON_SRCS += fenv.c
 ARCH_SRCS = e_sqrt.S e_sqrtf.S
 ARCH_SRCS += s_copysign.S s_copysignf.S
 ARCH_SRCS += s_fabs.S s_fabsf.S
@@ -186,19 +185,19 @@ ARCH_SRCS += s_fmin.S s_fminf.S
 .elif (${LIBC_MACHINE_ARCH} == "powerpc")
 .PATH:	${.CURDIR}/arch/powerpc
 .if ${MKSOFTFLOAT} == "no"
-COMMON_SRCS += fenv.c s_nearbyint.c
+COMMON_SRCS += fenv.c
 .endif
 
 .elif (${LIBC_MACHINE_CPU} == "mips")
 .PATH:	${.CURDIR}/arch/mips
 .if ${MKSOFTFLOAT} == "no"
-COMMON_SRCS += fenv.c s_nearbyint.c
+COMMON_SRCS += fenv.c
 .endif
 
 .elif (${LIBC_MACHINE_CPU} == "sh3")
 .PATH:	${.CURDIR}/arch/sh3
 .if ${MKSOFTFLOAT} == "no"
-COMMON_SRCS += fenv.c s_nearbyint.c
+COMMON_SRCS += fenv.c
 .endif
 .endif
 # End of list of CPU tests
@@ -267,7 +266,7 @@ COMMON_SRCS+= b_exp.c b_log.c b_tgamma.c
 	s_lrint.c s_lrintf.c s_lrintl.c \
 	s_lround.c s_lroundf.c s_lroundl.c \
 	s_log1pf.c s_logb.c s_logbf.c s_logbl.c \
-	s_matherr.c s_modff.c s_modfl.c s_nextafter.c s_nextafterl.c \
+	s_matherr.c s_modff.c s_modfl.c s_nearbyint.c s_nextafter.c s_nextafterl.c \
 	s_nextafterf.c s_remquo.c s_remquof.c s_rint.c s_rintf.c \
 	s_round.c s_roundf.c s_roundl.c s_scalbn.c \
 	s_scalbnf.c s_scalbnl.c s_signgam.c s_significand.c s_significandf.c s_sin.c \



CVS commit: src/tests/lib/libm

2017-08-11 Thread Havard Eidnes
Module Name:src
Committed By:   he
Date:   Fri Aug 11 20:31:58 UTC 2017

Modified Files:
src/tests/lib/libm: t_fe_round.c

Log Message:
Re-enable the test for nearbyint(), now that all ports (save vax,
which has a separate #if section here) should have nearbyint().


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libm/t_fe_round.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libm/t_fe_round.c
diff -u src/tests/lib/libm/t_fe_round.c:1.5 src/tests/lib/libm/t_fe_round.c:1.6
--- src/tests/lib/libm/t_fe_round.c:1.5	Tue Jul 25 21:26:56 2017
+++ src/tests/lib/libm/t_fe_round.c	Fri Aug 11 20:31:58 2017
@@ -93,10 +93,40 @@ ATF_TC_BODY(fe_round, tc)
 	}
 }
 
+ATF_TC(fe_nearbyint);
+ATF_TC_HEAD(fe_nearbyint, tc)
+{
+	atf_tc_set_md_var(tc, "descr","Checking IEEE 754 rounding modes using nearbyint");
+}
+
+ATF_TC_BODY(fe_nearbyint, tc)
+{
+	double received;
+
+	for (unsigned int i = 0; i < __arraycount(values); i++) {
+		fesetround(values[i].round_mode);
+
+		received = nearbyint(values[i].input);
+		ATF_CHECK_MSG(
+		(fabs(received - values[i].expected) < EPSILON),
+		"nearbyint rounding wrong, difference too large\n"
+		"input: %f (index %d): got %f, expected %ld\n",
+		values[i].input, i, received, values[i].expected);
+
+		/* Do we get the same rounding mode out? */
+		ATF_CHECK_MSG(
+		(fegetround() == values[i].round_mode),
+		"Didn't get the same rounding mode out!\n"
+		"(index %d) fed in %d rounding mode, got %d out\n",
+		i, values[i].round_mode, fegetround());
+	}
+}
+
 ATF_TP_ADD_TCS(tp)
 {
 
 	ATF_TP_ADD_TC(tp, fe_round);
+	ATF_TP_ADD_TC(tp, fe_nearbyint);
 
 	return atf_no_error();
 }
@@ -115,9 +145,24 @@ ATF_TC_BODY(t_nofe_round, tc)
 	atf_tc_skip("no fenv.h support on this architecture");
 }
 
+ATF_TC(t_nofe_nearbyint);
+
+ATF_TC_HEAD(t_nofe_nearbyint, tc)
+{
+	atf_tc_set_md_var(tc, "descr",
+	"dummy test case - no fenv.h support");
+}
+
+ATF_TC_BODY(t_nofe_nearbyint, tc)
+{
+	atf_tc_skip("no fenv.h support on this architecture");
+}
+
+
 ATF_TP_ADD_TCS(tp)
 {
 	ATF_TP_ADD_TC(tp, t_nofe_round);
+	ATF_TP_ADD_TC(tp, t_nofe_nearbyint);
 	return atf_no_error();
 }
 



CVS commit: src/usr.bin/ypwhich

2017-08-11 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Fri Aug 11 20:32:34 UTC 2017

Modified Files:
src/usr.bin/ypwhich: ypwhich.c

Log Message:
Remove spurious error(1) inserted compiler error message comments.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/ypwhich/ypwhich.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/ypwhich/ypwhich.c
diff -u src/usr.bin/ypwhich/ypwhich.c:1.20 src/usr.bin/ypwhich/ypwhich.c:1.21
--- src/usr.bin/ypwhich/ypwhich.c:1.20	Sat Oct 18 08:33:30 2014
+++ src/usr.bin/ypwhich/ypwhich.c	Fri Aug 11 20:32:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ypwhich.c,v 1.20 2014/10/18 08:33:30 snj Exp $	*/
+/*	$NetBSD: ypwhich.c,v 1.21 2017/08/11 20:32:34 ginsbach Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor
@@ -306,9 +306,6 @@ find_mapmaster(const char *host, const c
  * now translate nicknames [unless inhibited]
  */
 	if (map && !inhibit) {
-/*###325 [cc] error: 'i' undeclared (first use in this function)%%%*/
-/*###325 [cc] error: (Each undeclared identifier is reported only once%%%*/
-/*###325 [cc] error: for each function it appears in.)%%%*/
 		for (i = 0; ypaliases[i].alias; i++) {
 			if (strcmp(map, ypaliases[i].alias) == 0) {
 map = ypaliases[i].name;



CVS commit: src/distrib/sets/lists/debug

2017-08-11 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Fri Aug 11 20:47:58 UTC 2017

Modified Files:
src/distrib/sets/lists/debug: mi

Log Message:
fix filename. sorry


To generate a diff of this commit:
cvs rdiff -u -r1.222 -r1.223 src/distrib/sets/lists/debug/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.222 src/distrib/sets/lists/debug/mi:1.223
--- src/distrib/sets/lists/debug/mi:1.222	Thu Aug 10 04:31:58 2017
+++ src/distrib/sets/lists/debug/mi	Fri Aug 11 20:47:58 2017
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.222 2017/08/10 04:31:58 ryo Exp $
+# $NetBSD: mi,v 1.223 2017/08/11 20:47:58 ryo Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -2280,7 +2280,7 @@
 ./usr/libdata/debug/usr/tests/net/mcast/mcast.debug		tests-net-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/net/mcast/t_mcast.debug		tests-obsolete		debug,atf,rump,obsolete
 ./usr/libdata/debug/usr/tests/net/net/t_pktinfo.debug		tests-net-debug		debug,atf,compattestfile
-./usr/libdata/debug/usr/tests/net/net/t_pktinfo_test.debug	tests-net-debug		debug,atf,rump
+./usr/libdata/debug/usr/tests/net/net/t_pktinfo_send.debug	tests-net-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/net/net/t_raw.debug		tests-net-debug		debug,atf,rump
 ./usr/libdata/debug/usr/tests/net/net/t_tcp.debug		tests-net-debug		debug,atf,compattestfile
 ./usr/libdata/debug/usr/tests/net/net/t_udp.debug		tests-net-debug		debug,atf,compattestfile



CVS commit: xsrc/external/mit/xf86-video-ati/dist/src

2017-08-11 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Aug 11 20:55:49 UTC 2017

Modified Files:
xsrc/external/mit/xf86-video-ati/dist/src: radeon_output.c

Log Message:
add voodoo to get the Mac model name from OpenFirmware so the driver can
automatically enable model specific workarounds
Now X works out of the box on my Mini


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.10 -r1.2 \
xsrc/external/mit/xf86-video-ati/dist/src/radeon_output.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xf86-video-ati/dist/src/radeon_output.c
diff -u xsrc/external/mit/xf86-video-ati/dist/src/radeon_output.c:1.1.1.10 xsrc/external/mit/xf86-video-ati/dist/src/radeon_output.c:1.2
--- xsrc/external/mit/xf86-video-ati/dist/src/radeon_output.c:1.1.1.10	Sun Sep 23 19:49:36 2012
+++ xsrc/external/mit/xf86-video-ati/dist/src/radeon_output.c	Fri Aug 11 20:55:49 2017
@@ -33,7 +33,10 @@
 #include 
 #include 
 #include 
-
+#ifdef __NetBSD__
+#include 
+#include 
+#endif
 /* X and server generic header files */
 #include "xf86.h"
 #include "xf86_OSproc.h"
@@ -2731,6 +2734,25 @@ static RADEONMacModel RADEONDetectMacMod
 if (f != NULL) {
 	while (fgets(cpuline, sizeof cpuline, f)) {
 	if (!strncmp(cpuline, "machine", strlen ("machine"))) {
+#elif defined(__NetBSD__)
+char cpuline[50];
+int of;
+struct ofiocdesc ofio;
+
+of = open("/dev/openfirm", O_RDONLY);
+if (of > 0) {
+	ofio.of_nodeid = 0;
+ofio.of_name = "/";
+	ofio.of_namelen = 1;
+	if (ioctl(of, OFIOCFINDDEVICE, &ofio) != -1) {
+	ofio.of_name = "model";
+	ofio.of_namelen = 5;
+	ofio.of_buf = cpuline;
+	ofio.of_buflen = sizeof(cpuline);
+	while (ioctl(of, OFIOCGET, &ofio) != -1) {
+		cpuline[49] = 0;
+	xf86Msg(X_ERROR, "model %s\n", cpuline);
+#endif
 		if (strstr(cpuline, "PowerBook5,1") ||
 		strstr(cpuline, "PowerBook5,2") ||
 		strstr(cpuline, "PowerBook5,3") ||
@@ -2767,6 +2789,7 @@ static RADEONMacModel RADEONDetectMacMod
 		ret = RADEON_MAC_MINI_EXTERNAL; /* external tmds */
 		break;
 		}
+#ifdef __linux__
 	} else if (!strncmp(cpuline, "detected as", strlen("detected as"))) {
 		if (strstr(cpuline, "iBook")) {
 		ret = RADEON_MAC_IBOOK;
@@ -2781,19 +2804,25 @@ static RADEONMacModel RADEONDetectMacMod
 		ret = RADEON_MAC_EMAC;
 		break;
 		}
-
+#endif
 		/* No known PowerMac model detected */
 		break;
 	}
 	}
 
+#ifdef __linux__
 	fclose (f);
 } else
 	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 		   "Cannot detect PowerMac model because /proc/cpuinfo not "
 		   "readable.\n");
-
-#endif /* __linux */
+#elif defined(__NetBSD__)
+	close(of);
+} else
+	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+		   "Cannot detect PowerMac model because /dev/openfirm not "
+		   "readable.\n");
+#endif
 
 #ifdef __OpenBSD__
 char model[32];



CVS commit: src/sys/arch/macppc/conf

2017-08-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Aug 11 21:03:23 UTC 2017

Modified Files:
src/sys/arch/macppc/conf: GENERIC

Log Message:
add wsfont now that it's actually usable on at least some drivers


To generate a diff of this commit:
cvs rdiff -u -r1.330 -r1.331 src/sys/arch/macppc/conf/GENERIC

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/macppc/conf/GENERIC
diff -u src/sys/arch/macppc/conf/GENERIC:1.330 src/sys/arch/macppc/conf/GENERIC:1.331
--- src/sys/arch/macppc/conf/GENERIC:1.330	Sat Jul 29 18:08:58 2017
+++ src/sys/arch/macppc/conf/GENERIC	Fri Aug 11 21:03:23 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.330 2017/07/29 18:08:58 maxv Exp $
+# $NetBSD: GENERIC,v 1.331 2017/08/11 21:03:23 macallan Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include		"arch/macppc/conf/std.macppc"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.330 $"
+#ident 		"GENERIC-$Revision: 1.331 $"
 
 maxusers	32
 
@@ -642,6 +642,7 @@ pseudo-device	agr			# IEEE 802.3ad link 
 pseudo-device	pty			# pseudo-terminals
 pseudo-device	openfirm		# /dev/openfirm
 pseudo-device	wsmux			# mouse and keyboard multiplexer
+pseudo-device 	wsfont
 pseudo-device	swwdog			# software watchdog driver - swwdog(4)
 pseudo-device	clockctl		# user control of clock subsystem
 pseudo-device	ksyms			# /dev/ksyms



CVS commit: src/sys/arch/macppc/macppc

2017-08-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Aug 11 22:55:49 UTC 2017

Modified Files:
src/sys/arch/macppc/macppc: machdep.c

Log Message:
set properties to signal Mac Mini video output wiring to radeonfb


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/macppc/macppc/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/macppc/macppc/machdep.c
diff -u src/sys/arch/macppc/macppc/machdep.c:1.165 src/sys/arch/macppc/macppc/machdep.c:1.166
--- src/sys/arch/macppc/macppc/machdep.c:1.165	Fri Jul 14 21:36:19 2017
+++ src/sys/arch/macppc/macppc/machdep.c	Fri Aug 11 22:55:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.165 2017/07/14 21:36:19 macallan Exp $	*/
+/*	$NetBSD: machdep.c,v 1.166 2017/08/11 22:55:49 macallan Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.165 2017/07/14 21:36:19 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.166 2017/08/11 22:55:49 macallan Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -396,6 +396,10 @@ add_model_specifics(prop_dictionary_t di
 		"PowerBook4,3", "PowerBook6,3", "PowerBook6,5", NULL};
 	const char *pismo[] = {
 		"PowerBook3,1", NULL};
+	const char *mini1[] = {
+		"PowerMac10,1", NULL};
+	const char *mini2[] = {
+		"PowerMac10,2", NULL};
 	int node;
 
 	node = OF_finddevice("/");
@@ -410,6 +414,12 @@ add_model_specifics(prop_dictionary_t di
 		prop_dictionary_set(dict, "EDID", edid);
 		prop_object_release(edid);
 	}
+	if (of_compatible(node, mini1) != -1) {
+		prop_dictionary_set_bool(dict, "dvi-internal", 1);
+	}
+	if (of_compatible(node, mini2) != -1) {
+		prop_dictionary_set_bool(dict, "dvi-external", 1);
+	}
 }
 
 static void



CVS commit: src/sys/dev/pci

2017-08-11 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Aug 11 22:59:05 UTC 2017

Modified Files:
src/sys/dev/pci: radeonfb.c

Log Message:
set display output parameters according to properties
Now VGA output works as intended on my Mini 2. DVI is still garbled ( but
visible ) and Mini 1 is untested.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/dev/pci/radeonfb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.89 src/sys/dev/pci/radeonfb.c:1.90
--- src/sys/dev/pci/radeonfb.c:1.89	Fri Jun  2 22:08:00 2017
+++ src/sys/dev/pci/radeonfb.c	Fri Aug 11 22:59:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.89 2017/06/02 22:08:00 macallan Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.90 2017/08/11 22:59:05 macallan Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.89 2017/06/02 22:08:00 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.90 2017/08/11 22:59:05 macallan Exp $");
 
 #include 
 #include 
@@ -379,6 +379,9 @@ static struct {
 	{ PCI_PRODUCT_ATI_RADEON_R423_UT,	RADEON_R420, 0 },
 	{ PCI_PRODUCT_ATI_RADEON_R423_5D57,	RADEON_R420, 0 },
 	{ PCI_PRODUCT_ATI_RADEON_R430_554F,	RADEON_R420, 0 },
+
+	/* R5xx family */
+	{ 0x7240,	RADEON_R420, 0 },	
 #endif
 	{ 0, 0, 0 }
 };
@@ -1769,8 +1772,27 @@ radeonfb_getconnectors(struct radeonfb_s
 
 nobios:
 	if (!found) {
+		bool dvi_ext = FALSE, dvi_int = FALSE;
 		DPRINTF(("No connector info in BIOS!\n"));
-		if IS_MOBILITY(sc) {
+		prop_dictionary_get_bool(device_properties(sc->sc_dev),
+		"dvi-internal", &dvi_int);
+		prop_dictionary_get_bool(device_properties(sc->sc_dev),
+		"dvi-external", &dvi_ext);
+		if (dvi_ext) {
+			sc->sc_ports[0].rp_mon_type = RADEON_MT_UNKNOWN;
+			sc->sc_ports[0].rp_ddc_type = RADEON_DDC_DVI;
+			sc->sc_ports[0].rp_dac_type = RADEON_DAC_TVDAC;
+			sc->sc_ports[0].rp_conn_type = RADEON_CONN_DVI_I;
+			sc->sc_ports[0].rp_tmds_type = RADEON_TMDS_EXT;
+			sc->sc_ports[0].rp_number = 1;
+		} else	if (dvi_int) {
+			sc->sc_ports[0].rp_mon_type = RADEON_MT_UNKNOWN;
+			sc->sc_ports[0].rp_ddc_type = RADEON_DDC_DVI;
+			sc->sc_ports[0].rp_dac_type = RADEON_DAC_TVDAC;
+			sc->sc_ports[0].rp_conn_type = RADEON_CONN_DVI_I;
+			sc->sc_ports[0].rp_tmds_type = RADEON_TMDS_INT;
+			sc->sc_ports[0].rp_number = 1;
+		} else if IS_MOBILITY(sc) {
 			/* default, port 0 = internal TMDS, port 1 = CRT */
 			sc->sc_ports[0].rp_mon_type = RADEON_MT_UNKNOWN;
 			sc->sc_ports[0].rp_ddc_type = RADEON_DDC_DVI;
@@ -2591,7 +2613,7 @@ radeonfb_putpal(struct radeonfb_display 
 	/* initialize the palette for every CRTC used by this display */
 	for (cc = 0; cc < dp->rd_ncrtcs; cc++) {
 		crtc = dp->rd_crtcs[cc].rc_number;
-		DPRINTF(("%s: doing crtc %d %d\n", __func__, cc, crtc));
+		//DPRINTF(("%s: doing crtc %d %d\n", __func__, cc, crtc));
 
 		if (crtc)
 			SET32(sc, RADEON_DAC_CNTL2, RADEON_DAC2_PALETTE_ACC_CTL);



CVS commit: src/external/bsd/libpcap/dist

2017-08-11 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Sat Aug 12 00:43:25 UTC 2017

Modified Files:
src/external/bsd/libpcap/dist: gencode.c

Log Message:
PR lib/51952: Brad Harder: Apply upstream ada959c9

[From upstream tcpdump]
 In pcap_compile(), first check whether the pcap_t is activated.

 Before we allocate or otherwise set up anything, check whether the
 pcap_t is activated, and set the error message string and return -1 if
 it's not.

 That way, we don't go through the cleanup code in that code path -
 there's nothing to clean up.

 Fixes the issue in GitHub pull request #552.

XXX: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/libpcap/dist/gencode.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/libpcap/dist/gencode.c
diff -u src/external/bsd/libpcap/dist/gencode.c:1.9 src/external/bsd/libpcap/dist/gencode.c:1.10
--- src/external/bsd/libpcap/dist/gencode.c:1.9	Tue Jan 24 22:29:28 2017
+++ src/external/bsd/libpcap/dist/gencode.c	Sat Aug 12 00:43:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: gencode.c,v 1.9 2017/01/24 22:29:28 christos Exp $	*/
+/*	$NetBSD: gencode.c,v 1.10 2017/08/12 00:43:25 ginsbach Exp $	*/
 
 /*#define CHASE_CHAIN*/
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: gencode.c,v 1.9 2017/01/24 22:29:28 christos Exp $");
+__RCSID("$NetBSD: gencode.c,v 1.10 2017/08/12 00:43:25 ginsbach Exp $");
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -669,6 +669,9 @@ int
 pcap_compile(pcap_t *p, struct bpf_program *program,
 	 const char *buf, int optimize, bpf_u_int32 mask)
 {
+#ifdef _WIN32
+	static int done = 0;
+#endif
 	compiler_state_t cstate;
 	const char * volatile xbuf = buf;
 	yyscan_t scanner = NULL;
@@ -676,14 +679,6 @@ pcap_compile(pcap_t *p, struct bpf_progr
 	u_int len;
 	int  rc;
 
-#ifdef _WIN32
-	static int done = 0;
-
-	if (!done)
-		pcap_wsockinit();
-	done = 1;
-#endif
-
 	/*
 	 * If this pcap_t hasn't been activated, it doesn't have a
 	 * link-layer type, so we can't use it.
@@ -691,9 +686,14 @@ pcap_compile(pcap_t *p, struct bpf_progr
 	if (!p->activated) {
 		pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
 		"not-yet-activated pcap_t passed to pcap_compile");
-		rc = -1;
-		goto quit;
+		return  -1;
 	}
+
+#ifdef _WIN32
+	if (!done)
+		pcap_wsockinit();
+	done = 1;
+#endif
 	initchunks(&cstate);
 	cstate.no_optimize = 0;
 	cstate.ai = NULL;



CVS commit: src/lib/libc/stdlib

2017-08-11 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Sat Aug 12 01:10:04 UTC 2017

Modified Files:
src/lib/libc/stdlib: merge.c

Log Message:
PR lib/50316: Gracefully handle a zero number of members argument.

Taken from FreeBSD (which fixed this same issue long ago).

XXX: pullup-8
XXX: pullup-7
XXX: pullup-6


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/lib/libc/stdlib/merge.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/stdlib/merge.c
diff -u src/lib/libc/stdlib/merge.c:1.14 src/lib/libc/stdlib/merge.c:1.15
--- src/lib/libc/stdlib/merge.c:1.14	Tue Mar 13 21:13:48 2012
+++ src/lib/libc/stdlib/merge.c	Sat Aug 12 01:10:04 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: merge.c,v 1.14 2012/03/13 21:13:48 christos Exp $	*/
+/*	$NetBSD: merge.c,v 1.15 2017/08/12 01:10:04 ginsbach Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "from: @(#)merge.c	8.2 (Berkeley) 2/14/94";
 #else
-__RCSID("$NetBSD: merge.c,v 1.14 2012/03/13 21:13:48 christos Exp $");
+__RCSID("$NetBSD: merge.c,v 1.15 2017/08/12 01:10:04 ginsbach Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -125,6 +125,9 @@ mergesort(void *base, size_t nmemb, size
 		return (-1);
 	}
 
+	if (nmemb == 0)
+		return (0);
+
 	/*
 	 * XXX
 	 * Stupid subtraction for the Cray.



CVS commit: [netbsd-7-0] src/sys/dev/pci

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:23:03 UTC 2017

Modified Files:
src/sys/dev/pci [netbsd-7-0]: if_ipw.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1469):
sys/dev/pci/if_ipw.c: revision 1.65
Null out sbuf->m on failure to avoid double-free later.
>From Ilja Van Sprundel.
Also null out sbuf->map out of paranoia.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.57.8.1 src/sys/dev/pci/if_ipw.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_ipw.c
diff -u src/sys/dev/pci/if_ipw.c:1.57 src/sys/dev/pci/if_ipw.c:1.57.8.1
--- src/sys/dev/pci/if_ipw.c:1.57	Sat Mar 29 19:28:24 2014
+++ src/sys/dev/pci/if_ipw.c	Sat Aug 12 03:23:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ipw.c,v 1.57 2014/03/29 19:28:24 christos Exp $	*/
+/*	$NetBSD: if_ipw.c,v 1.57.8.1 2017/08/12 03:23:03 snj Exp $	*/
 /*	FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp 	*/
 
 /*-
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.57 2014/03/29 19:28:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.57.8.1 2017/08/12 03:23:03 snj Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2100 MiniPCI driver
@@ -592,6 +592,7 @@ ipw_dma_alloc(struct ipw_softc *sc)
 		MCLGET(sbuf->m, M_DONTWAIT);
 		if (!(sbuf->m->m_flags & M_EXT)) {
 			m_freem(sbuf->m);
+			sbuf->m = NULL;
 			aprint_error_dev(sc->sc_dev, "could not allocate rx mbuf cluster\n");
 			error = ENOMEM;
 			goto fail;
@@ -604,6 +605,7 @@ ipw_dma_alloc(struct ipw_softc *sc)
 		if (error != 0) {
 			aprint_error_dev(sc->sc_dev, "could not create rxbuf dma map\n");
 			m_freem(sbuf->m);
+			sbuf->m = NULL;
 			goto fail;
 		}
 
@@ -611,7 +613,9 @@ ipw_dma_alloc(struct ipw_softc *sc)
 		sbuf->m, BUS_DMA_READ | BUS_DMA_NOWAIT);
 		if (error != 0) {
 			bus_dmamap_destroy(sc->sc_dmat, sbuf->map);
+			sbuf->map = NULL;
 			m_freem(sbuf->m);
+			sbuf->m = NULL;
 			aprint_error_dev(sc->sc_dev, "could not map rxbuf dma memory\n");
 			goto fail;
 		}



CVS commit: [netbsd-7-1] src/sys/dev/pci

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:23:45 UTC 2017

Modified Files:
src/sys/dev/pci [netbsd-7-1]: if_ipw.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1469):
sys/dev/pci/if_ipw.c: revision 1.65
Null out sbuf->m on failure to avoid double-free later.
>From Ilja Van Sprundel.
Also null out sbuf->map out of paranoia.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.57.12.1 src/sys/dev/pci/if_ipw.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_ipw.c
diff -u src/sys/dev/pci/if_ipw.c:1.57 src/sys/dev/pci/if_ipw.c:1.57.12.1
--- src/sys/dev/pci/if_ipw.c:1.57	Sat Mar 29 19:28:24 2014
+++ src/sys/dev/pci/if_ipw.c	Sat Aug 12 03:23:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ipw.c,v 1.57 2014/03/29 19:28:24 christos Exp $	*/
+/*	$NetBSD: if_ipw.c,v 1.57.12.1 2017/08/12 03:23:45 snj Exp $	*/
 /*	FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp 	*/
 
 /*-
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.57 2014/03/29 19:28:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.57.12.1 2017/08/12 03:23:45 snj Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2100 MiniPCI driver
@@ -592,6 +592,7 @@ ipw_dma_alloc(struct ipw_softc *sc)
 		MCLGET(sbuf->m, M_DONTWAIT);
 		if (!(sbuf->m->m_flags & M_EXT)) {
 			m_freem(sbuf->m);
+			sbuf->m = NULL;
 			aprint_error_dev(sc->sc_dev, "could not allocate rx mbuf cluster\n");
 			error = ENOMEM;
 			goto fail;
@@ -604,6 +605,7 @@ ipw_dma_alloc(struct ipw_softc *sc)
 		if (error != 0) {
 			aprint_error_dev(sc->sc_dev, "could not create rxbuf dma map\n");
 			m_freem(sbuf->m);
+			sbuf->m = NULL;
 			goto fail;
 		}
 
@@ -611,7 +613,9 @@ ipw_dma_alloc(struct ipw_softc *sc)
 		sbuf->m, BUS_DMA_READ | BUS_DMA_NOWAIT);
 		if (error != 0) {
 			bus_dmamap_destroy(sc->sc_dmat, sbuf->map);
+			sbuf->map = NULL;
 			m_freem(sbuf->m);
+			sbuf->m = NULL;
 			aprint_error_dev(sc->sc_dev, "could not map rxbuf dma memory\n");
 			goto fail;
 		}



CVS commit: [netbsd-7] src/sys/dev/pci

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:24:03 UTC 2017

Modified Files:
src/sys/dev/pci [netbsd-7]: if_ipw.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1469):
sys/dev/pci/if_ipw.c: revision 1.65
Null out sbuf->m on failure to avoid double-free later.
>From Ilja Van Sprundel.
Also null out sbuf->map out of paranoia.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.57.4.1 src/sys/dev/pci/if_ipw.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_ipw.c
diff -u src/sys/dev/pci/if_ipw.c:1.57 src/sys/dev/pci/if_ipw.c:1.57.4.1
--- src/sys/dev/pci/if_ipw.c:1.57	Sat Mar 29 19:28:24 2014
+++ src/sys/dev/pci/if_ipw.c	Sat Aug 12 03:24:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ipw.c,v 1.57 2014/03/29 19:28:24 christos Exp $	*/
+/*	$NetBSD: if_ipw.c,v 1.57.4.1 2017/08/12 03:24:03 snj Exp $	*/
 /*	FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp 	*/
 
 /*-
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.57 2014/03/29 19:28:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.57.4.1 2017/08/12 03:24:03 snj Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2100 MiniPCI driver
@@ -592,6 +592,7 @@ ipw_dma_alloc(struct ipw_softc *sc)
 		MCLGET(sbuf->m, M_DONTWAIT);
 		if (!(sbuf->m->m_flags & M_EXT)) {
 			m_freem(sbuf->m);
+			sbuf->m = NULL;
 			aprint_error_dev(sc->sc_dev, "could not allocate rx mbuf cluster\n");
 			error = ENOMEM;
 			goto fail;
@@ -604,6 +605,7 @@ ipw_dma_alloc(struct ipw_softc *sc)
 		if (error != 0) {
 			aprint_error_dev(sc->sc_dev, "could not create rxbuf dma map\n");
 			m_freem(sbuf->m);
+			sbuf->m = NULL;
 			goto fail;
 		}
 
@@ -611,7 +613,9 @@ ipw_dma_alloc(struct ipw_softc *sc)
 		sbuf->m, BUS_DMA_READ | BUS_DMA_NOWAIT);
 		if (error != 0) {
 			bus_dmamap_destroy(sc->sc_dmat, sbuf->map);
+			sbuf->map = NULL;
 			m_freem(sbuf->m);
+			sbuf->m = NULL;
 			aprint_error_dev(sc->sc_dev, "could not map rxbuf dma memory\n");
 			goto fail;
 		}



CVS commit: [netbsd-7-0] src/sys/dev/pci

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:26:20 UTC 2017

Modified Files:
src/sys/dev/pci [netbsd-7-0]: if_et.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1470):
sys/dev/pci/if_et.c: revision 1.15
Check for MCLGET failure in et_newbuf.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.1 -r1.8.4.1.2.1 src/sys/dev/pci/if_et.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_et.c
diff -u src/sys/dev/pci/if_et.c:1.8.4.1 src/sys/dev/pci/if_et.c:1.8.4.1.2.1
--- src/sys/dev/pci/if_et.c:1.8.4.1	Tue Aug  4 21:16:43 2015
+++ src/sys/dev/pci/if_et.c	Sat Aug 12 03:26:20 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_et.c,v 1.8.4.1 2015/08/04 21:16:43 snj Exp $	*/
+/*	$NetBSD: if_et.c,v 1.8.4.1.2.1 2017/08/12 03:26:20 snj Exp $	*/
 /*	$OpenBSD: if_et.c,v 1.11 2008/06/08 06:18:07 jsg Exp $	*/
 /*
  * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.8.4.1 2015/08/04 21:16:43 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.8.4.1.2.1 2017/08/12 03:26:20 snj Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -2028,6 +2028,10 @@ et_newbuf(struct et_rxbuf_data *rbd, int
 		if (m == NULL)
 			return (ENOBUFS);
 		MCLGET(m, init ? M_WAITOK : M_DONTWAIT);
+		if ((m->m_flags & M_EXT) == 0) {
+			m_freem(m);
+			return (ENOBUFS);
+		}
 		len = MCLBYTES;
 	} else {
 		MGETHDR(m, init ? M_WAITOK : M_DONTWAIT, MT_DATA);



CVS commit: [netbsd-7-1] src/sys/dev/pci

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:26:39 UTC 2017

Modified Files:
src/sys/dev/pci [netbsd-7-1]: if_et.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1470):
sys/dev/pci/if_et.c: revision 1.15
Check for MCLGET failure in et_newbuf.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.1 -r1.8.4.1.6.1 src/sys/dev/pci/if_et.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_et.c
diff -u src/sys/dev/pci/if_et.c:1.8.4.1 src/sys/dev/pci/if_et.c:1.8.4.1.6.1
--- src/sys/dev/pci/if_et.c:1.8.4.1	Tue Aug  4 21:16:43 2015
+++ src/sys/dev/pci/if_et.c	Sat Aug 12 03:26:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_et.c,v 1.8.4.1 2015/08/04 21:16:43 snj Exp $	*/
+/*	$NetBSD: if_et.c,v 1.8.4.1.6.1 2017/08/12 03:26:39 snj Exp $	*/
 /*	$OpenBSD: if_et.c,v 1.11 2008/06/08 06:18:07 jsg Exp $	*/
 /*
  * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.8.4.1 2015/08/04 21:16:43 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.8.4.1.6.1 2017/08/12 03:26:39 snj Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -2028,6 +2028,10 @@ et_newbuf(struct et_rxbuf_data *rbd, int
 		if (m == NULL)
 			return (ENOBUFS);
 		MCLGET(m, init ? M_WAITOK : M_DONTWAIT);
+		if ((m->m_flags & M_EXT) == 0) {
+			m_freem(m);
+			return (ENOBUFS);
+		}
 		len = MCLBYTES;
 	} else {
 		MGETHDR(m, init ? M_WAITOK : M_DONTWAIT, MT_DATA);



CVS commit: [netbsd-7] src/sys/dev/pci

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:27:49 UTC 2017

Modified Files:
src/sys/dev/pci [netbsd-7]: if_et.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1470):
sys/dev/pci/if_et.c: revision 1.15
Check for MCLGET failure in et_newbuf.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.1 -r1.8.4.2 src/sys/dev/pci/if_et.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_et.c
diff -u src/sys/dev/pci/if_et.c:1.8.4.1 src/sys/dev/pci/if_et.c:1.8.4.2
--- src/sys/dev/pci/if_et.c:1.8.4.1	Tue Aug  4 21:16:43 2015
+++ src/sys/dev/pci/if_et.c	Sat Aug 12 03:27:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_et.c,v 1.8.4.1 2015/08/04 21:16:43 snj Exp $	*/
+/*	$NetBSD: if_et.c,v 1.8.4.2 2017/08/12 03:27:48 snj Exp $	*/
 /*	$OpenBSD: if_et.c,v 1.11 2008/06/08 06:18:07 jsg Exp $	*/
 /*
  * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.8.4.1 2015/08/04 21:16:43 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.8.4.2 2017/08/12 03:27:48 snj Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -2028,6 +2028,10 @@ et_newbuf(struct et_rxbuf_data *rbd, int
 		if (m == NULL)
 			return (ENOBUFS);
 		MCLGET(m, init ? M_WAITOK : M_DONTWAIT);
+		if ((m->m_flags & M_EXT) == 0) {
+			m_freem(m);
+			return (ENOBUFS);
+		}
 		len = MCLBYTES;
 	} else {
 		MGETHDR(m, init ? M_WAITOK : M_DONTWAIT, MT_DATA);



CVS commit: src/lib/libc/time

2017-08-11 Thread Brian Ginsbach
Module Name:src
Committed By:   ginsbach
Date:   Sat Aug 12 03:29:23 UTC 2017

Modified Files:
src/lib/libc/time: strptime.c

Log Message:
Fix a couple comments and a spacing nit.

- Change a XXX comment that no longer applies.
- Add a clarifying comment.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/lib/libc/time/strptime.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/time/strptime.c
diff -u src/lib/libc/time/strptime.c:1.60 src/lib/libc/time/strptime.c:1.61
--- src/lib/libc/time/strptime.c:1.60	Sun May 15 20:37:48 2016
+++ src/lib/libc/time/strptime.c	Sat Aug 12 03:29:23 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: strptime.c,v 1.60 2016/05/15 20:37:48 christos Exp $	*/
+/*	$NetBSD: strptime.c,v 1.61 2017/08/12 03:29:23 ginsbach Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strptime.c,v 1.60 2016/05/15 20:37:48 christos Exp $");
+__RCSID("$NetBSD: strptime.c,v 1.61 2017/08/12 03:29:23 ginsbach Exp $");
 #endif
 
 #include "namespace.h"
@@ -382,10 +382,10 @@ literal:
 		case 'U':	/* The week of year, beginning on sunday. */
 		case 'W':	/* The week of year, beginning on monday. */
 			/*
-			 * XXX This is bogus, as we can not assume any valid
+			 * This is bogus, as we can not assume any valid
 			 * information present in the tm structure at this
-			 * point to calculate a real value, so just check the
-			 * range for now.
+			 * point to calculate a real value, so save the
+			 * week for now in case it can be used later.
 			 */
 			bp = conv_num(bp, &i, 0, 53);
 			LEGAL_ALT(ALT_O);
@@ -516,7 +516,7 @@ namedzone:
 /* Nautical / Military style */
 if (delim(bp[1]) &&
 ((*bp >= 'A' && *bp <= 'I') ||
-(*bp >= 'L' && *bp <= 'Y'))) {
+ (*bp >= 'L' && *bp <= 'Y'))) {
 #ifdef TM_GMTOFF
 	/* Argh! No 'J'! */
 	if (*bp >= 'A' && *bp <= 'I')
@@ -635,6 +635,7 @@ loadzone:
 bp = zname;
 continue;
 			}
+			/* ISO 8601 & RFC 3339 limit to 23:59 max */
 			if (offs >= (HOURSPERDAY * SECSPERHOUR))
 goto out;
 			if (neg)



CVS commit: [netbsd-7-0] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:29:51 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7-0]: i82596.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1471):
sys/dev/ic/i82596.c: revision 1.37
Null out sc_rx_mbuf[i] after m_freem to avoid double-free later.
>From Ilja Van Sprundel.
Also null out sc_tx_mbuf[i] after m_freem, out of paranoia.
XXX Not entirely clear to how tx mbufs are freed, but no way to test
this since it's ews4800mips- and hp700-only, so not keen to make any
more elaborate changes...


To generate a diff of this commit:
cvs rdiff -u -r1.31.4.1 -r1.31.4.1.2.1 src/sys/dev/ic/i82596.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/i82596.c
diff -u src/sys/dev/ic/i82596.c:1.31.4.1 src/sys/dev/ic/i82596.c:1.31.4.1.2.1
--- src/sys/dev/ic/i82596.c:1.31.4.1	Sat Feb 21 19:27:49 2015
+++ src/sys/dev/ic/i82596.c	Sat Aug 12 03:29:51 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: i82596.c,v 1.31.4.1 2015/02/21 19:27:49 martin Exp $ */
+/* $NetBSD: i82596.c,v 1.31.4.1.2.1 2017/08/12 03:29:51 snj Exp $ */
 
 /*
  * Copyright (c) 2003 Jochen Kunz.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.31.4.1 2015/02/21 19:27:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.31.4.1.2.1 2017/08/12 03:29:51 snj Exp $");
 
 /* autoconfig and device stuff */
 #include 
@@ -754,6 +754,7 @@ iee_start(struct ifnet *ifp)
 printf("%s: iee_start: can't allocate mbuf\n",
 device_xname(sc->sc_dev));
 m_freem(sc->sc_tx_mbuf[t]);
+sc->sc_tx_mbuf[t] = NULL;
 t--;
 continue;
 			}
@@ -763,6 +764,7 @@ iee_start(struct ifnet *ifp)
 printf("%s: iee_start: can't allocate mbuf "
 "cluster\n", device_xname(sc->sc_dev));
 m_freem(sc->sc_tx_mbuf[t]);
+sc->sc_tx_mbuf[t] = NULL;
 m_freem(m);
 t--;
 continue;
@@ -778,6 +780,7 @@ iee_start(struct ifnet *ifp)
 printf("%s: iee_start: can't load TX DMA map\n",
 device_xname(sc->sc_dev));
 m_freem(sc->sc_tx_mbuf[t]);
+sc->sc_tx_mbuf[t] = NULL;
 t--;
 continue;
 			}
@@ -927,6 +930,7 @@ iee_init(struct ifnet *ifp)
 printf("%s: iee_init: can't allocate mbuf"
 " cluster\n", device_xname(sc->sc_dev));
 m_freem(sc->sc_rx_mbuf[r]);
+sc->sc_rx_mbuf[r] = NULL;
 err = 1;
 break;
 			}
@@ -940,6 +944,7 @@ iee_init(struct ifnet *ifp)
 printf("%s: iee_init: can't create RX "
 "DMA map\n", device_xname(sc->sc_dev));
 m_freem(sc->sc_rx_mbuf[r]);
+sc->sc_rx_mbuf[r] = NULL;
 err = 1;
 break;
 			}
@@ -949,6 +954,7 @@ iee_init(struct ifnet *ifp)
 			device_xname(sc->sc_dev));
 			bus_dmamap_destroy(sc->sc_dmat, sc->sc_rx_map[r]);
 			m_freem(sc->sc_rx_mbuf[r]);
+			sc->sc_rx_mbuf[r] = NULL;
 			err = 1;
 			break;
 		}



CVS commit: [netbsd-7-1] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:30:09 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7-1]: i82596.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1471):
sys/dev/ic/i82596.c: revision 1.37
Null out sc_rx_mbuf[i] after m_freem to avoid double-free later.
>From Ilja Van Sprundel.
Also null out sc_tx_mbuf[i] after m_freem, out of paranoia.
XXX Not entirely clear to how tx mbufs are freed, but no way to test
this since it's ews4800mips- and hp700-only, so not keen to make any
more elaborate changes...


To generate a diff of this commit:
cvs rdiff -u -r1.31.4.1 -r1.31.4.1.6.1 src/sys/dev/ic/i82596.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/i82596.c
diff -u src/sys/dev/ic/i82596.c:1.31.4.1 src/sys/dev/ic/i82596.c:1.31.4.1.6.1
--- src/sys/dev/ic/i82596.c:1.31.4.1	Sat Feb 21 19:27:49 2015
+++ src/sys/dev/ic/i82596.c	Sat Aug 12 03:30:08 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: i82596.c,v 1.31.4.1 2015/02/21 19:27:49 martin Exp $ */
+/* $NetBSD: i82596.c,v 1.31.4.1.6.1 2017/08/12 03:30:08 snj Exp $ */
 
 /*
  * Copyright (c) 2003 Jochen Kunz.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.31.4.1 2015/02/21 19:27:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.31.4.1.6.1 2017/08/12 03:30:08 snj Exp $");
 
 /* autoconfig and device stuff */
 #include 
@@ -754,6 +754,7 @@ iee_start(struct ifnet *ifp)
 printf("%s: iee_start: can't allocate mbuf\n",
 device_xname(sc->sc_dev));
 m_freem(sc->sc_tx_mbuf[t]);
+sc->sc_tx_mbuf[t] = NULL;
 t--;
 continue;
 			}
@@ -763,6 +764,7 @@ iee_start(struct ifnet *ifp)
 printf("%s: iee_start: can't allocate mbuf "
 "cluster\n", device_xname(sc->sc_dev));
 m_freem(sc->sc_tx_mbuf[t]);
+sc->sc_tx_mbuf[t] = NULL;
 m_freem(m);
 t--;
 continue;
@@ -778,6 +780,7 @@ iee_start(struct ifnet *ifp)
 printf("%s: iee_start: can't load TX DMA map\n",
 device_xname(sc->sc_dev));
 m_freem(sc->sc_tx_mbuf[t]);
+sc->sc_tx_mbuf[t] = NULL;
 t--;
 continue;
 			}
@@ -927,6 +930,7 @@ iee_init(struct ifnet *ifp)
 printf("%s: iee_init: can't allocate mbuf"
 " cluster\n", device_xname(sc->sc_dev));
 m_freem(sc->sc_rx_mbuf[r]);
+sc->sc_rx_mbuf[r] = NULL;
 err = 1;
 break;
 			}
@@ -940,6 +944,7 @@ iee_init(struct ifnet *ifp)
 printf("%s: iee_init: can't create RX "
 "DMA map\n", device_xname(sc->sc_dev));
 m_freem(sc->sc_rx_mbuf[r]);
+sc->sc_rx_mbuf[r] = NULL;
 err = 1;
 break;
 			}
@@ -949,6 +954,7 @@ iee_init(struct ifnet *ifp)
 			device_xname(sc->sc_dev));
 			bus_dmamap_destroy(sc->sc_dmat, sc->sc_rx_map[r]);
 			m_freem(sc->sc_rx_mbuf[r]);
+			sc->sc_rx_mbuf[r] = NULL;
 			err = 1;
 			break;
 		}



CVS commit: [netbsd-7] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:30:30 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7]: i82596.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1471):
sys/dev/ic/i82596.c: revision 1.37
Null out sc_rx_mbuf[i] after m_freem to avoid double-free later.
>From Ilja Van Sprundel.
Also null out sc_tx_mbuf[i] after m_freem, out of paranoia.
XXX Not entirely clear to how tx mbufs are freed, but no way to test
this since it's ews4800mips- and hp700-only, so not keen to make any
more elaborate changes...


To generate a diff of this commit:
cvs rdiff -u -r1.31.4.1 -r1.31.4.2 src/sys/dev/ic/i82596.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/i82596.c
diff -u src/sys/dev/ic/i82596.c:1.31.4.1 src/sys/dev/ic/i82596.c:1.31.4.2
--- src/sys/dev/ic/i82596.c:1.31.4.1	Sat Feb 21 19:27:49 2015
+++ src/sys/dev/ic/i82596.c	Sat Aug 12 03:30:30 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: i82596.c,v 1.31.4.1 2015/02/21 19:27:49 martin Exp $ */
+/* $NetBSD: i82596.c,v 1.31.4.2 2017/08/12 03:30:30 snj Exp $ */
 
 /*
  * Copyright (c) 2003 Jochen Kunz.
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.31.4.1 2015/02/21 19:27:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82596.c,v 1.31.4.2 2017/08/12 03:30:30 snj Exp $");
 
 /* autoconfig and device stuff */
 #include 
@@ -754,6 +754,7 @@ iee_start(struct ifnet *ifp)
 printf("%s: iee_start: can't allocate mbuf\n",
 device_xname(sc->sc_dev));
 m_freem(sc->sc_tx_mbuf[t]);
+sc->sc_tx_mbuf[t] = NULL;
 t--;
 continue;
 			}
@@ -763,6 +764,7 @@ iee_start(struct ifnet *ifp)
 printf("%s: iee_start: can't allocate mbuf "
 "cluster\n", device_xname(sc->sc_dev));
 m_freem(sc->sc_tx_mbuf[t]);
+sc->sc_tx_mbuf[t] = NULL;
 m_freem(m);
 t--;
 continue;
@@ -778,6 +780,7 @@ iee_start(struct ifnet *ifp)
 printf("%s: iee_start: can't load TX DMA map\n",
 device_xname(sc->sc_dev));
 m_freem(sc->sc_tx_mbuf[t]);
+sc->sc_tx_mbuf[t] = NULL;
 t--;
 continue;
 			}
@@ -927,6 +930,7 @@ iee_init(struct ifnet *ifp)
 printf("%s: iee_init: can't allocate mbuf"
 " cluster\n", device_xname(sc->sc_dev));
 m_freem(sc->sc_rx_mbuf[r]);
+sc->sc_rx_mbuf[r] = NULL;
 err = 1;
 break;
 			}
@@ -940,6 +944,7 @@ iee_init(struct ifnet *ifp)
 printf("%s: iee_init: can't create RX "
 "DMA map\n", device_xname(sc->sc_dev));
 m_freem(sc->sc_rx_mbuf[r]);
+sc->sc_rx_mbuf[r] = NULL;
 err = 1;
 break;
 			}
@@ -949,6 +954,7 @@ iee_init(struct ifnet *ifp)
 			device_xname(sc->sc_dev));
 			bus_dmamap_destroy(sc->sc_dmat, sc->sc_rx_map[r]);
 			m_freem(sc->sc_rx_mbuf[r]);
+			sc->sc_rx_mbuf[r] = NULL;
 			err = 1;
 			break;
 		}



CVS commit: [netbsd-7-0] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:40:34 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7-0]: dp83932.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1472):
sys/dev/ic/dp83932.c: revision 1.41
Plug mbuf leak on MCLGET failure in sonic_rxintr.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.8.1 src/sys/dev/ic/dp83932.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/dp83932.c
diff -u src/sys/dev/ic/dp83932.c:1.36 src/sys/dev/ic/dp83932.c:1.36.8.1
--- src/sys/dev/ic/dp83932.c:1.36	Fri Oct 25 21:29:28 2013
+++ src/sys/dev/ic/dp83932.c	Sat Aug 12 03:40:34 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dp83932.c,v 1.36 2013/10/25 21:29:28 martin Exp $	*/
+/*	$NetBSD: dp83932.c,v 1.36.8.1 2017/08/12 03:40:34 snj Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.36 2013/10/25 21:29:28 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.36.8.1 2017/08/12 03:40:34 snj Exp $");
 
 
 #include 
@@ -785,8 +785,10 @@ sonic_rxintr(struct sonic_softc *sc)
 goto dropit;
 			if (len > (MHLEN - 2)) {
 MCLGET(m, M_DONTWAIT);
-if ((m->m_flags & M_EXT) == 0)
+if ((m->m_flags & M_EXT) == 0) {
+	m_freem(m);
 	goto dropit;
+}
 			}
 			m->m_data += 2;
 			/*



CVS commit: [netbsd-7] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:42:52 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7]: dp83932.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1472):
sys/dev/ic/dp83932.c: revision 1.41
Plug mbuf leak on MCLGET failure in sonic_rxintr.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.4.1 src/sys/dev/ic/dp83932.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/dp83932.c
diff -u src/sys/dev/ic/dp83932.c:1.36 src/sys/dev/ic/dp83932.c:1.36.4.1
--- src/sys/dev/ic/dp83932.c:1.36	Fri Oct 25 21:29:28 2013
+++ src/sys/dev/ic/dp83932.c	Sat Aug 12 03:42:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dp83932.c,v 1.36 2013/10/25 21:29:28 martin Exp $	*/
+/*	$NetBSD: dp83932.c,v 1.36.4.1 2017/08/12 03:42:52 snj Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.36 2013/10/25 21:29:28 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.36.4.1 2017/08/12 03:42:52 snj Exp $");
 
 
 #include 
@@ -785,8 +785,10 @@ sonic_rxintr(struct sonic_softc *sc)
 goto dropit;
 			if (len > (MHLEN - 2)) {
 MCLGET(m, M_DONTWAIT);
-if ((m->m_flags & M_EXT) == 0)
+if ((m->m_flags & M_EXT) == 0) {
+	m_freem(m);
 	goto dropit;
+}
 			}
 			m->m_data += 2;
 			/*



CVS commit: [netbsd-7-1] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:42:33 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7-1]: dp83932.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1472):
sys/dev/ic/dp83932.c: revision 1.41
Plug mbuf leak on MCLGET failure in sonic_rxintr.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.36.12.1 src/sys/dev/ic/dp83932.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/dp83932.c
diff -u src/sys/dev/ic/dp83932.c:1.36 src/sys/dev/ic/dp83932.c:1.36.12.1
--- src/sys/dev/ic/dp83932.c:1.36	Fri Oct 25 21:29:28 2013
+++ src/sys/dev/ic/dp83932.c	Sat Aug 12 03:42:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dp83932.c,v 1.36 2013/10/25 21:29:28 martin Exp $	*/
+/*	$NetBSD: dp83932.c,v 1.36.12.1 2017/08/12 03:42:33 snj Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.36 2013/10/25 21:29:28 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dp83932.c,v 1.36.12.1 2017/08/12 03:42:33 snj Exp $");
 
 
 #include 
@@ -785,8 +785,10 @@ sonic_rxintr(struct sonic_softc *sc)
 goto dropit;
 			if (len > (MHLEN - 2)) {
 MCLGET(m, M_DONTWAIT);
-if ((m->m_flags & M_EXT) == 0)
+if ((m->m_flags & M_EXT) == 0) {
+	m_freem(m);
 	goto dropit;
+}
 			}
 			m->m_data += 2;
 			/*



CVS commit: [netbsd-7-0] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:44:15 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7-0]: dm9000.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1473):
sys/dev/ic/dm9000.c: revision 1.12
Check for MCLGET failure in dme_alloc_receive_buffer.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.4.22.1 -r1.4.22.1.2.1 src/sys/dev/ic/dm9000.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/dm9000.c
diff -u src/sys/dev/ic/dm9000.c:1.4.22.1 src/sys/dev/ic/dm9000.c:1.4.22.1.2.1
--- src/sys/dev/ic/dm9000.c:1.4.22.1	Fri Jan  2 20:24:14 2015
+++ src/sys/dev/ic/dm9000.c	Sat Aug 12 03:44:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm9000.c,v 1.4.22.1 2015/01/02 20:24:14 martin Exp $	*/
+/*	$NetBSD: dm9000.c,v 1.4.22.1.2.1 2017/08/12 03:44:15 snj Exp $	*/
 
 /*
  * Copyright (c) 2009 Paul Fleischer
@@ -1122,8 +1122,13 @@ dme_alloc_receive_buffer(struct ifnet *i
 		sizeof(struct ether_header);
 	/* All our frames have the CRC attached */
 	m->m_flags |= M_HASFCS;
-	if (m->m_pkthdr.len + pad > MHLEN )
+	if (m->m_pkthdr.len + pad > MHLEN) {
 		MCLGET(m, M_DONTWAIT);
+		if ((m->m_flags & M_EXT) == 0) {
+			m_freem(m);
+			return NULL;
+		}
+	}
 
 	m->m_data += pad;
 	m->m_len = frame_length + (frame_length % sc->sc_data_width);



CVS commit: [netbsd-7-1] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:44:39 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7-1]: dm9000.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1473):
sys/dev/ic/dm9000.c: revision 1.12
Check for MCLGET failure in dme_alloc_receive_buffer.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.4.22.1 -r1.4.22.1.6.1 src/sys/dev/ic/dm9000.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/dm9000.c
diff -u src/sys/dev/ic/dm9000.c:1.4.22.1 src/sys/dev/ic/dm9000.c:1.4.22.1.6.1
--- src/sys/dev/ic/dm9000.c:1.4.22.1	Fri Jan  2 20:24:14 2015
+++ src/sys/dev/ic/dm9000.c	Sat Aug 12 03:44:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm9000.c,v 1.4.22.1 2015/01/02 20:24:14 martin Exp $	*/
+/*	$NetBSD: dm9000.c,v 1.4.22.1.6.1 2017/08/12 03:44:39 snj Exp $	*/
 
 /*
  * Copyright (c) 2009 Paul Fleischer
@@ -1122,8 +1122,13 @@ dme_alloc_receive_buffer(struct ifnet *i
 		sizeof(struct ether_header);
 	/* All our frames have the CRC attached */
 	m->m_flags |= M_HASFCS;
-	if (m->m_pkthdr.len + pad > MHLEN )
+	if (m->m_pkthdr.len + pad > MHLEN) {
 		MCLGET(m, M_DONTWAIT);
+		if ((m->m_flags & M_EXT) == 0) {
+			m_freem(m);
+			return NULL;
+		}
+	}
 
 	m->m_data += pad;
 	m->m_len = frame_length + (frame_length % sc->sc_data_width);



CVS commit: [netbsd-7] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:45:15 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7]: dm9000.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1473):
sys/dev/ic/dm9000.c: revision 1.12
Check for MCLGET failure in dme_alloc_receive_buffer.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.4.22.1 -r1.4.22.2 src/sys/dev/ic/dm9000.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/dm9000.c
diff -u src/sys/dev/ic/dm9000.c:1.4.22.1 src/sys/dev/ic/dm9000.c:1.4.22.2
--- src/sys/dev/ic/dm9000.c:1.4.22.1	Fri Jan  2 20:24:14 2015
+++ src/sys/dev/ic/dm9000.c	Sat Aug 12 03:45:15 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm9000.c,v 1.4.22.1 2015/01/02 20:24:14 martin Exp $	*/
+/*	$NetBSD: dm9000.c,v 1.4.22.2 2017/08/12 03:45:15 snj Exp $	*/
 
 /*
  * Copyright (c) 2009 Paul Fleischer
@@ -1122,8 +1122,13 @@ dme_alloc_receive_buffer(struct ifnet *i
 		sizeof(struct ether_header);
 	/* All our frames have the CRC attached */
 	m->m_flags |= M_HASFCS;
-	if (m->m_pkthdr.len + pad > MHLEN )
+	if (m->m_pkthdr.len + pad > MHLEN) {
 		MCLGET(m, M_DONTWAIT);
+		if ((m->m_flags & M_EXT) == 0) {
+			m_freem(m);
+			return NULL;
+		}
+	}
 
 	m->m_data += pad;
 	m->m_len = frame_length + (frame_length % sc->sc_data_width);



CVS commit: [netbsd-7-0] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:47:51 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7-0]: bwi.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1474):
sys/dev/ic/bwi.c: revision 1.32
Check for M_EXT in m->m_flags, whether m is NULL, after MCLGET.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.24.4.1 -r1.24.4.1.2.1 src/sys/dev/ic/bwi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/bwi.c
diff -u src/sys/dev/ic/bwi.c:1.24.4.1 src/sys/dev/ic/bwi.c:1.24.4.1.2.1
--- src/sys/dev/ic/bwi.c:1.24.4.1	Tue Apr 21 04:55:15 2015
+++ src/sys/dev/ic/bwi.c	Sat Aug 12 03:47:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bwi.c,v 1.24.4.1 2015/04/21 04:55:15 snj Exp $	*/
+/*	$NetBSD: bwi.c,v 1.24.4.1.2.1 2017/08/12 03:47:50 snj Exp $	*/
 /*	$OpenBSD: bwi.c,v 1.74 2008/02/25 21:13:30 mglocker Exp $	*/
 
 /*
@@ -48,7 +48,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.24.4.1 2015/04/21 04:55:15 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.24.4.1.2.1 2017/08/12 03:47:50 snj Exp $");
 
 #include 
 #include 
@@ -8292,7 +8292,7 @@ bwi_newbuf(struct bwi_softc *sc, int buf
 	if (m == NULL)
 		return (ENOBUFS);
 	MCLGET(m, init ? M_WAITOK : M_DONTWAIT);
-	if (m == NULL) {
+	if ((m->m_flags & M_EXT) == 0) {
 		error = ENOBUFS;
 
 		/*



CVS commit: [netbsd-7] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:48:49 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7]: bwi.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1474):
sys/dev/ic/bwi.c: revision 1.32
Check for M_EXT in m->m_flags, whether m is NULL, after MCLGET.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.24.4.1 -r1.24.4.2 src/sys/dev/ic/bwi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/bwi.c
diff -u src/sys/dev/ic/bwi.c:1.24.4.1 src/sys/dev/ic/bwi.c:1.24.4.2
--- src/sys/dev/ic/bwi.c:1.24.4.1	Tue Apr 21 04:55:15 2015
+++ src/sys/dev/ic/bwi.c	Sat Aug 12 03:48:49 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bwi.c,v 1.24.4.1 2015/04/21 04:55:15 snj Exp $	*/
+/*	$NetBSD: bwi.c,v 1.24.4.2 2017/08/12 03:48:49 snj Exp $	*/
 /*	$OpenBSD: bwi.c,v 1.74 2008/02/25 21:13:30 mglocker Exp $	*/
 
 /*
@@ -48,7 +48,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.24.4.1 2015/04/21 04:55:15 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.24.4.2 2017/08/12 03:48:49 snj Exp $");
 
 #include 
 #include 
@@ -8292,7 +8292,7 @@ bwi_newbuf(struct bwi_softc *sc, int buf
 	if (m == NULL)
 		return (ENOBUFS);
 	MCLGET(m, init ? M_WAITOK : M_DONTWAIT);
-	if (m == NULL) {
+	if ((m->m_flags & M_EXT) == 0) {
 		error = ENOBUFS;
 
 		/*



CVS commit: [netbsd-7-1] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:48:33 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7-1]: bwi.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1474):
sys/dev/ic/bwi.c: revision 1.32
Check for M_EXT in m->m_flags, whether m is NULL, after MCLGET.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.24.4.1 -r1.24.4.1.6.1 src/sys/dev/ic/bwi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/bwi.c
diff -u src/sys/dev/ic/bwi.c:1.24.4.1 src/sys/dev/ic/bwi.c:1.24.4.1.6.1
--- src/sys/dev/ic/bwi.c:1.24.4.1	Tue Apr 21 04:55:15 2015
+++ src/sys/dev/ic/bwi.c	Sat Aug 12 03:48:33 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: bwi.c,v 1.24.4.1 2015/04/21 04:55:15 snj Exp $	*/
+/*	$NetBSD: bwi.c,v 1.24.4.1.6.1 2017/08/12 03:48:33 snj Exp $	*/
 /*	$OpenBSD: bwi.c,v 1.74 2008/02/25 21:13:30 mglocker Exp $	*/
 
 /*
@@ -48,7 +48,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.24.4.1 2015/04/21 04:55:15 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bwi.c,v 1.24.4.1.6.1 2017/08/12 03:48:33 snj Exp $");
 
 #include 
 #include 
@@ -8292,7 +8292,7 @@ bwi_newbuf(struct bwi_softc *sc, int buf
 	if (m == NULL)
 		return (ENOBUFS);
 	MCLGET(m, init ? M_WAITOK : M_DONTWAIT);
-	if (m == NULL) {
+	if ((m->m_flags & M_EXT) == 0) {
 		error = ENOBUFS;
 
 		/*



CVS commit: [netbsd-7-0] src/sys/compat

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:59:24 UTC 2017

Modified Files:
src/sys/compat/svr4 [netbsd-7-0]: svr4_lwp.c svr4_signal.c
svr4_stream.c
src/sys/compat/svr4_32 [netbsd-7-0]: svr4_32_signal.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1475):
sys/compat/svr4/svr4_lwp.c: revision 1.20
sys/compat/svr4/svr4_signal.c: revision 1.67
sys/compat/svr4/svr4_stream.c: revision 1.89-1.91 via patch
sys/compat/svr4_32/svr4_32_signal.c: revision 1.29
Fix some of the multitudinous holes in svr4 streams.
We should never have enabled this by default; it is a minefield.
>From Ilja Van Sprundel.
--
Zero stack data before copyout.
>From Ilja Van Sprundel.
--
Fix indexing of svr4 signals.
>From Ilja Van Sprundel.
--
Feebly attempt to get this reference counting less bad.
This svr4 streams code is bad and it should feel bad.
>From Ilja Van Sprundel.
--
Check bounds in svr4_sys_putmsg.  Check more svr4_strmcmd bounds.
svr4 streams code is still a disaster.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.42.1 src/sys/compat/svr4/svr4_lwp.c
cvs rdiff -u -r1.65.30.1 -r1.65.30.1.2.1 src/sys/compat/svr4/svr4_signal.c
cvs rdiff -u -r1.80 -r1.80.4.1 src/sys/compat/svr4/svr4_stream.c
cvs rdiff -u -r1.26 -r1.26.66.1 src/sys/compat/svr4_32/svr4_32_signal.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/svr4/svr4_lwp.c
diff -u src/sys/compat/svr4/svr4_lwp.c:1.19 src/sys/compat/svr4/svr4_lwp.c:1.19.42.1
--- src/sys/compat/svr4/svr4_lwp.c:1.19	Mon Nov 23 00:46:07 2009
+++ src/sys/compat/svr4/svr4_lwp.c	Sat Aug 12 03:59:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_lwp.c,v 1.19 2009/11/23 00:46:07 rmind Exp $	*/
+/*	$NetBSD: svr4_lwp.c,v 1.19.42.1 2017/08/12 03:59:24 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.19 2009/11/23 00:46:07 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.19.42.1 2017/08/12 03:59:24 snj Exp $");
 
 #include 
 #include 
@@ -108,6 +108,8 @@ svr4_sys__lwp_info(struct lwp *l, const 
 	struct svr4_lwpinfo lwpinfo;
 	int error;
 
+	memset(&lwpinfo, 0, sizeof(lwpinfo));
+
 	/* XXX NJWLWP */
 	TIMEVAL_TO_TIMESPEC(&l->l_proc->p_stats->p_ru.ru_stime, &lwpinfo.lwp_stime);
 	TIMEVAL_TO_TIMESPEC(&l->l_proc->p_stats->p_ru.ru_utime, &lwpinfo.lwp_utime);

Index: src/sys/compat/svr4/svr4_signal.c
diff -u src/sys/compat/svr4/svr4_signal.c:1.65.30.1 src/sys/compat/svr4/svr4_signal.c:1.65.30.1.2.1
--- src/sys/compat/svr4/svr4_signal.c:1.65.30.1	Sat Jan 17 12:10:53 2015
+++ src/sys/compat/svr4/svr4_signal.c	Sat Aug 12 03:59:24 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_signal.c,v 1.65.30.1 2015/01/17 12:10:53 martin Exp $	 */
+/*	$NetBSD: svr4_signal.c,v 1.65.30.1.2.1 2017/08/12 03:59:24 snj Exp $	 */
 
 /*-
  * Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.65.30.1 2015/01/17 12:10:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.65.30.1.2.1 2017/08/12 03:59:24 snj Exp $");
 
 #include 
 #include 
@@ -72,6 +72,21 @@ void native_to_svr4_sigaction(const stru
 extern const int native_to_svr4_signo[];
 extern const int svr4_to_native_signo[];
 
+static int
+svr4_decode_signum(int signum, int *native_signo, int *sigcall)
+{
+
+	if (SVR4_SIGNO(signum) >= SVR4_NSIG)
+		return EINVAL;
+
+	if (native_signo)
+		*native_signo = svr4_to_native_signo[SVR4_SIGNO(signum)];
+	if (sigcall)
+		*sigcall = SVR4_SIGCALL(signum);
+
+	return 0;
+}
+
 static inline void
 svr4_sigfillset(svr4_sigset_t *s)
 {
@@ -173,6 +188,7 @@ svr4_sys_sigaction(struct lwp *l, const 
 	} */
 	struct svr4_sigaction nssa, ossa;
 	struct sigaction nbsa, obsa;
+	int native_signo;
 	int error;
 
 	if (SCARG(uap, nsa)) {
@@ -181,7 +197,12 @@ svr4_sys_sigaction(struct lwp *l, const 
 			return (error);
 		svr4_to_native_sigaction(&nssa, &nbsa);
 	}
-	error = sigaction1(l, svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))],
+
+	error = svr4_decode_signum(SCARG(uap, signum), &native_signo, NULL);
+	if (error)
+		return error;
+
+	error = sigaction1(l, native_signo,
 	SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0,
 	NULL, 0);
 	if (error)
@@ -216,16 +237,18 @@ svr4_sys_signal(struct lwp *l, const str
 		syscallarg(int) signum;
 		syscallarg(svr4_sig_t) handler;
 	} */
-	int signum = svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))];
+	int native_signo, sigcall;
 	struct proc *p = l->l_proc;
 	struct sigaction nbsa, obsa;
 	sigset_t ss;
 	int error;
 
-	if (signum <= 0 || signum >= SVR4_NSIG)
-		return (EINVAL);
+	error = svr4_decode_signum(SCARG(uap, signum), &native_signo,
+	&sigcall);
+	if (error)
+		return error;
 
-	switch (SVR4_SIGCALL(SCARG(uap, signum))) {
+	switch (sigcall)

CVS commit: [netbsd-7-1] src/sys/compat

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 03:59:55 UTC 2017

Modified Files:
src/sys/compat/svr4 [netbsd-7-1]: svr4_lwp.c svr4_signal.c
svr4_stream.c
src/sys/compat/svr4_32 [netbsd-7-1]: svr4_32_signal.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1475):
sys/compat/svr4/svr4_lwp.c: revision 1.20
sys/compat/svr4/svr4_signal.c: revision 1.67
sys/compat/svr4/svr4_stream.c: revision 1.89-1.91 via patch
sys/compat/svr4_32/svr4_32_signal.c: revision 1.29
Fix some of the multitudinous holes in svr4 streams.
We should never have enabled this by default; it is a minefield.
>From Ilja Van Sprundel.
--
Zero stack data before copyout.
>From Ilja Van Sprundel.
--
Fix indexing of svr4 signals.
>From Ilja Van Sprundel.
--
Feebly attempt to get this reference counting less bad.
This svr4 streams code is bad and it should feel bad.
>From Ilja Van Sprundel.
--
Check bounds in svr4_sys_putmsg.  Check more svr4_strmcmd bounds.
svr4 streams code is still a disaster.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.50.1 src/sys/compat/svr4/svr4_lwp.c
cvs rdiff -u -r1.65.30.1 -r1.65.30.1.6.1 src/sys/compat/svr4/svr4_signal.c
cvs rdiff -u -r1.80 -r1.80.8.1 src/sys/compat/svr4/svr4_stream.c
cvs rdiff -u -r1.26 -r1.26.70.1 src/sys/compat/svr4_32/svr4_32_signal.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/svr4/svr4_lwp.c
diff -u src/sys/compat/svr4/svr4_lwp.c:1.19 src/sys/compat/svr4/svr4_lwp.c:1.19.50.1
--- src/sys/compat/svr4/svr4_lwp.c:1.19	Mon Nov 23 00:46:07 2009
+++ src/sys/compat/svr4/svr4_lwp.c	Sat Aug 12 03:59:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_lwp.c,v 1.19 2009/11/23 00:46:07 rmind Exp $	*/
+/*	$NetBSD: svr4_lwp.c,v 1.19.50.1 2017/08/12 03:59:55 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.19 2009/11/23 00:46:07 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.19.50.1 2017/08/12 03:59:55 snj Exp $");
 
 #include 
 #include 
@@ -108,6 +108,8 @@ svr4_sys__lwp_info(struct lwp *l, const 
 	struct svr4_lwpinfo lwpinfo;
 	int error;
 
+	memset(&lwpinfo, 0, sizeof(lwpinfo));
+
 	/* XXX NJWLWP */
 	TIMEVAL_TO_TIMESPEC(&l->l_proc->p_stats->p_ru.ru_stime, &lwpinfo.lwp_stime);
 	TIMEVAL_TO_TIMESPEC(&l->l_proc->p_stats->p_ru.ru_utime, &lwpinfo.lwp_utime);

Index: src/sys/compat/svr4/svr4_signal.c
diff -u src/sys/compat/svr4/svr4_signal.c:1.65.30.1 src/sys/compat/svr4/svr4_signal.c:1.65.30.1.6.1
--- src/sys/compat/svr4/svr4_signal.c:1.65.30.1	Sat Jan 17 12:10:53 2015
+++ src/sys/compat/svr4/svr4_signal.c	Sat Aug 12 03:59:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_signal.c,v 1.65.30.1 2015/01/17 12:10:53 martin Exp $	 */
+/*	$NetBSD: svr4_signal.c,v 1.65.30.1.6.1 2017/08/12 03:59:55 snj Exp $	 */
 
 /*-
  * Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.65.30.1 2015/01/17 12:10:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.65.30.1.6.1 2017/08/12 03:59:55 snj Exp $");
 
 #include 
 #include 
@@ -72,6 +72,21 @@ void native_to_svr4_sigaction(const stru
 extern const int native_to_svr4_signo[];
 extern const int svr4_to_native_signo[];
 
+static int
+svr4_decode_signum(int signum, int *native_signo, int *sigcall)
+{
+
+	if (SVR4_SIGNO(signum) >= SVR4_NSIG)
+		return EINVAL;
+
+	if (native_signo)
+		*native_signo = svr4_to_native_signo[SVR4_SIGNO(signum)];
+	if (sigcall)
+		*sigcall = SVR4_SIGCALL(signum);
+
+	return 0;
+}
+
 static inline void
 svr4_sigfillset(svr4_sigset_t *s)
 {
@@ -173,6 +188,7 @@ svr4_sys_sigaction(struct lwp *l, const 
 	} */
 	struct svr4_sigaction nssa, ossa;
 	struct sigaction nbsa, obsa;
+	int native_signo;
 	int error;
 
 	if (SCARG(uap, nsa)) {
@@ -181,7 +197,12 @@ svr4_sys_sigaction(struct lwp *l, const 
 			return (error);
 		svr4_to_native_sigaction(&nssa, &nbsa);
 	}
-	error = sigaction1(l, svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))],
+
+	error = svr4_decode_signum(SCARG(uap, signum), &native_signo, NULL);
+	if (error)
+		return error;
+
+	error = sigaction1(l, native_signo,
 	SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0,
 	NULL, 0);
 	if (error)
@@ -216,16 +237,18 @@ svr4_sys_signal(struct lwp *l, const str
 		syscallarg(int) signum;
 		syscallarg(svr4_sig_t) handler;
 	} */
-	int signum = svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))];
+	int native_signo, sigcall;
 	struct proc *p = l->l_proc;
 	struct sigaction nbsa, obsa;
 	sigset_t ss;
 	int error;
 
-	if (signum <= 0 || signum >= SVR4_NSIG)
-		return (EINVAL);
+	error = svr4_decode_signum(SCARG(uap, signum), &native_signo,
+	&sigcall);
+	if (error)
+		return error;
 
-	switch (SVR4_SIGCALL(SCARG(uap, signum))) {
+	switch (sigcall)

CVS commit: [netbsd-7] src/sys/compat

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:00:50 UTC 2017

Modified Files:
src/sys/compat/svr4 [netbsd-7]: svr4_lwp.c svr4_signal.c svr4_stream.c
src/sys/compat/svr4_32 [netbsd-7]: svr4_32_signal.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1475):
sys/compat/svr4/svr4_lwp.c: revision 1.20
sys/compat/svr4/svr4_signal.c: revision 1.67
sys/compat/svr4/svr4_stream.c: revision 1.89-1.91 via patch
sys/compat/svr4_32/svr4_32_signal.c: revision 1.29
Fix some of the multitudinous holes in svr4 streams.
We should never have enabled this by default; it is a minefield.
>From Ilja Van Sprundel.
--
Zero stack data before copyout.
>From Ilja Van Sprundel.
--
Fix indexing of svr4 signals.
>From Ilja Van Sprundel.
--
Feebly attempt to get this reference counting less bad.
This svr4 streams code is bad and it should feel bad.
>From Ilja Van Sprundel.
--
Check bounds in svr4_sys_putmsg.  Check more svr4_strmcmd bounds.
svr4 streams code is still a disaster.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.19.38.1 src/sys/compat/svr4/svr4_lwp.c
cvs rdiff -u -r1.65.30.1 -r1.65.30.2 src/sys/compat/svr4/svr4_signal.c
cvs rdiff -u -r1.80 -r1.80.2.1 src/sys/compat/svr4/svr4_stream.c
cvs rdiff -u -r1.26 -r1.26.62.1 src/sys/compat/svr4_32/svr4_32_signal.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/svr4/svr4_lwp.c
diff -u src/sys/compat/svr4/svr4_lwp.c:1.19 src/sys/compat/svr4/svr4_lwp.c:1.19.38.1
--- src/sys/compat/svr4/svr4_lwp.c:1.19	Mon Nov 23 00:46:07 2009
+++ src/sys/compat/svr4/svr4_lwp.c	Sat Aug 12 04:00:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_lwp.c,v 1.19 2009/11/23 00:46:07 rmind Exp $	*/
+/*	$NetBSD: svr4_lwp.c,v 1.19.38.1 2017/08/12 04:00:50 snj Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.19 2009/11/23 00:46:07 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_lwp.c,v 1.19.38.1 2017/08/12 04:00:50 snj Exp $");
 
 #include 
 #include 
@@ -108,6 +108,8 @@ svr4_sys__lwp_info(struct lwp *l, const 
 	struct svr4_lwpinfo lwpinfo;
 	int error;
 
+	memset(&lwpinfo, 0, sizeof(lwpinfo));
+
 	/* XXX NJWLWP */
 	TIMEVAL_TO_TIMESPEC(&l->l_proc->p_stats->p_ru.ru_stime, &lwpinfo.lwp_stime);
 	TIMEVAL_TO_TIMESPEC(&l->l_proc->p_stats->p_ru.ru_utime, &lwpinfo.lwp_utime);

Index: src/sys/compat/svr4/svr4_signal.c
diff -u src/sys/compat/svr4/svr4_signal.c:1.65.30.1 src/sys/compat/svr4/svr4_signal.c:1.65.30.2
--- src/sys/compat/svr4/svr4_signal.c:1.65.30.1	Sat Jan 17 12:10:53 2015
+++ src/sys/compat/svr4/svr4_signal.c	Sat Aug 12 04:00:50 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_signal.c,v 1.65.30.1 2015/01/17 12:10:53 martin Exp $	 */
+/*	$NetBSD: svr4_signal.c,v 1.65.30.2 2017/08/12 04:00:50 snj Exp $	 */
 
 /*-
  * Copyright (c) 1994, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.65.30.1 2015/01/17 12:10:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: svr4_signal.c,v 1.65.30.2 2017/08/12 04:00:50 snj Exp $");
 
 #include 
 #include 
@@ -72,6 +72,21 @@ void native_to_svr4_sigaction(const stru
 extern const int native_to_svr4_signo[];
 extern const int svr4_to_native_signo[];
 
+static int
+svr4_decode_signum(int signum, int *native_signo, int *sigcall)
+{
+
+	if (SVR4_SIGNO(signum) >= SVR4_NSIG)
+		return EINVAL;
+
+	if (native_signo)
+		*native_signo = svr4_to_native_signo[SVR4_SIGNO(signum)];
+	if (sigcall)
+		*sigcall = SVR4_SIGCALL(signum);
+
+	return 0;
+}
+
 static inline void
 svr4_sigfillset(svr4_sigset_t *s)
 {
@@ -173,6 +188,7 @@ svr4_sys_sigaction(struct lwp *l, const 
 	} */
 	struct svr4_sigaction nssa, ossa;
 	struct sigaction nbsa, obsa;
+	int native_signo;
 	int error;
 
 	if (SCARG(uap, nsa)) {
@@ -181,7 +197,12 @@ svr4_sys_sigaction(struct lwp *l, const 
 			return (error);
 		svr4_to_native_sigaction(&nssa, &nbsa);
 	}
-	error = sigaction1(l, svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))],
+
+	error = svr4_decode_signum(SCARG(uap, signum), &native_signo, NULL);
+	if (error)
+		return error;
+
+	error = sigaction1(l, native_signo,
 	SCARG(uap, nsa) ? &nbsa : 0, SCARG(uap, osa) ? &obsa : 0,
 	NULL, 0);
 	if (error)
@@ -216,16 +237,18 @@ svr4_sys_signal(struct lwp *l, const str
 		syscallarg(int) signum;
 		syscallarg(svr4_sig_t) handler;
 	} */
-	int signum = svr4_to_native_signo[SVR4_SIGNO(SCARG(uap, signum))];
+	int native_signo, sigcall;
 	struct proc *p = l->l_proc;
 	struct sigaction nbsa, obsa;
 	sigset_t ss;
 	int error;
 
-	if (signum <= 0 || signum >= SVR4_NSIG)
-		return (EINVAL);
+	error = svr4_decode_signum(SCARG(uap, signum), &native_signo,
+	&sigcall);
+	if (error)
+		return error;
 
-	switch (SVR4_SIGCALL(SCARG(uap, signum))) {
+	switch (sigcall) {
 	case SVR4_SIGDEFER_MASK:
 	

CVS commit: [netbsd-7-0] src/sys/compat/ibcs2

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:08:26 UTC 2017

Modified Files:
src/sys/compat/ibcs2 [netbsd-7-0]: ibcs2_exec_coff.c ibcs2_ioctl.c
ibcs2_stat.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1477):
sys/compat/ibcs2/ibcs2_exec_coff.c: revision 1.27-1.29
sys/compat/ibcs2/ibcs2_ioctl.c: revision 1.46
sys/compat/ibcs2/ibcs2_stat.c: revision 1.49-1.50
Check for NUL termination within the buffer we have.
>From Ilja Van Sprundel.
--
Make sure we have enough space in the buffer before reading it.
>From Ilja Van Sprundel.
--
Make sure we move forward over the buffer.
>From Ilja Van Sprundel.
--
Zero buffers in ibcs2 ioctl to avoid disclosing stack to userland.
>From Ilja Van Sprundel.
--
Don't drop vnode ref until we're done with mount in ibcs2_stat(v)fs.
Nothing else guarantees the mount will stick around.
>From Ilja Van Sprundel.
--
Little happy on the commit trigger.  Actually use the out label.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.8.1 src/sys/compat/ibcs2/ibcs2_exec_coff.c
cvs rdiff -u -r1.45 -r1.45.62.1 src/sys/compat/ibcs2/ibcs2_ioctl.c
cvs rdiff -u -r1.47 -r1.47.40.1 src/sys/compat/ibcs2/ibcs2_stat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/ibcs2/ibcs2_exec_coff.c
diff -u src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.26 src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.26.8.1
--- src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.26	Fri Oct 25 14:46:35 2013
+++ src/sys/compat/ibcs2/ibcs2_exec_coff.c	Sat Aug 12 04:08:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_exec_coff.c,v 1.26 2013/10/25 14:46:35 martin Exp $	*/
+/*	$NetBSD: ibcs2_exec_coff.c,v 1.26.8.1 2017/08/12 04:08:25 snj Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995, 1998 Scott Bartram
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_coff.c,v 1.26 2013/10/25 14:46:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_coff.c,v 1.26.8.1 2017/08/12 04:08:25 snj Exp $");
 
 #include 
 #include 
@@ -454,6 +454,10 @@ exec_ibcs2_coff_prep_zmagic(struct lwp *
 		}
 		bufp = tbuf;
 		while (len) {
+			if (len < sizeof(struct coff_slhdr)) {
+free(tbuf, M_TEMP);
+return ENOEXEC;
+			}
 			slhdr = (struct coff_slhdr *)bufp;
 
 			if (slhdr->path_index > LONG_MAX / sizeof(long) ||
@@ -465,7 +469,9 @@ exec_ibcs2_coff_prep_zmagic(struct lwp *
 			/* path_index = slhdr->path_index * sizeof(long); */
 			entry_len = slhdr->entry_len * sizeof(long);
 
-			if (entry_len > len) {
+			if (entry_len < sizeof(struct coff_slhdr) ||
+			entry_len > len ||
+			strnlen(slhdr->sl_name, entry_len) == entry_len) {
 free(tbuf, M_TEMP);
 return ENOEXEC;
 			}

Index: src/sys/compat/ibcs2/ibcs2_ioctl.c
diff -u src/sys/compat/ibcs2/ibcs2_ioctl.c:1.45 src/sys/compat/ibcs2/ibcs2_ioctl.c:1.45.62.1
--- src/sys/compat/ibcs2/ibcs2_ioctl.c:1.45	Tue Jun 24 10:03:17 2008
+++ src/sys/compat/ibcs2/ibcs2_ioctl.c	Sat Aug 12 04:08:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_ioctl.c,v 1.45 2008/06/24 10:03:17 gmcgarry Exp $	*/
+/*	$NetBSD: ibcs2_ioctl.c,v 1.45.62.1 2017/08/12 04:08:25 snj Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Scott Bartram
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_ioctl.c,v 1.45 2008/06/24 10:03:17 gmcgarry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_ioctl.c,v 1.45.62.1 2017/08/12 04:08:25 snj Exp $");
 
 #include 
 #include 
@@ -402,8 +402,10 @@ ibcs2_sys_ioctl(struct lwp *l, const str
 		if ((error = (*ctl)(fp, TIOCGETA, &bts)) != 0)
 			goto out;
 
+		memset(&sts, 0, sizeof(sts));
 		btios2stios(&bts, &sts);
 		if (SCARG(uap, cmd) == IBCS2_TCGETA) {
+			memset(&st, 0, sizeof(st));
 			stios2stio(&sts, &st);
 			error = copyout(&st, SCARG(uap, data), sizeof(st));
 			if (error)
@@ -559,6 +561,7 @@ ibcs2_sys_gtty(struct lwp *l, const stru
 
 	fd_putfile(SCARG(uap, fd));
 
+	memset(&itb, 0, sizeof(itb));
 	itb.sg_ispeed = tb.sg_ispeed;
 	itb.sg_ospeed = tb.sg_ospeed;
 	itb.sg_erase = tb.sg_erase;

Index: src/sys/compat/ibcs2/ibcs2_stat.c
diff -u src/sys/compat/ibcs2/ibcs2_stat.c:1.47 src/sys/compat/ibcs2/ibcs2_stat.c:1.47.40.1
--- src/sys/compat/ibcs2/ibcs2_stat.c:1.47	Mon Jun 29 05:08:16 2009
+++ src/sys/compat/ibcs2/ibcs2_stat.c	Sat Aug 12 04:08:25 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_stat.c,v 1.47 2009/06/29 05:08:16 dholland Exp $	*/
+/*	$NetBSD: ibcs2_stat.c,v 1.47.40.1 2017/08/12 04:08:25 snj Exp $	*/
 /*
  * Copyright (c) 1995, 1998 Scott Bartram
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.47 2009/06/29 05:08:16 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.47.40.1 2017/08/12 04:08:25 snj Exp $");
 
 #include 
 #include 
@@ -147,11 +147,13 @@ ibcs2_sys_statfs(struct lwp *l, const st
 		return (error);
 	mp = vp->v_mount;
 	sp = &mp->mnt_stat;
-	vrele(vp);
 	if ((error = VFS_STATVFS(mp, sp))

CVS commit: [netbsd-7-1] src/sys/compat/ibcs2

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:09:05 UTC 2017

Modified Files:
src/sys/compat/ibcs2 [netbsd-7-1]: ibcs2_exec_coff.c ibcs2_ioctl.c
ibcs2_stat.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1477):
sys/compat/ibcs2/ibcs2_exec_coff.c: revision 1.27-1.29
sys/compat/ibcs2/ibcs2_ioctl.c: revision 1.46
sys/compat/ibcs2/ibcs2_stat.c: revision 1.49-1.50
Check for NUL termination within the buffer we have.
>From Ilja Van Sprundel.
--
Make sure we have enough space in the buffer before reading it.
>From Ilja Van Sprundel.
--
Make sure we move forward over the buffer.
>From Ilja Van Sprundel.
--
Zero buffers in ibcs2 ioctl to avoid disclosing stack to userland.
>From Ilja Van Sprundel.
--
Don't drop vnode ref until we're done with mount in ibcs2_stat(v)fs.
Nothing else guarantees the mount will stick around.
>From Ilja Van Sprundel.
--
Little happy on the commit trigger.  Actually use the out label.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.16.1 src/sys/compat/ibcs2/ibcs2_exec_coff.c
cvs rdiff -u -r1.45 -r1.45.70.1 src/sys/compat/ibcs2/ibcs2_ioctl.c
cvs rdiff -u -r1.47 -r1.47.44.1 src/sys/compat/ibcs2/ibcs2_stat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/ibcs2/ibcs2_exec_coff.c
diff -u src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.26 src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.26.16.1
--- src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.26	Fri Oct 25 14:46:35 2013
+++ src/sys/compat/ibcs2/ibcs2_exec_coff.c	Sat Aug 12 04:09:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_exec_coff.c,v 1.26 2013/10/25 14:46:35 martin Exp $	*/
+/*	$NetBSD: ibcs2_exec_coff.c,v 1.26.16.1 2017/08/12 04:09:05 snj Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995, 1998 Scott Bartram
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_coff.c,v 1.26 2013/10/25 14:46:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_coff.c,v 1.26.16.1 2017/08/12 04:09:05 snj Exp $");
 
 #include 
 #include 
@@ -454,6 +454,10 @@ exec_ibcs2_coff_prep_zmagic(struct lwp *
 		}
 		bufp = tbuf;
 		while (len) {
+			if (len < sizeof(struct coff_slhdr)) {
+free(tbuf, M_TEMP);
+return ENOEXEC;
+			}
 			slhdr = (struct coff_slhdr *)bufp;
 
 			if (slhdr->path_index > LONG_MAX / sizeof(long) ||
@@ -465,7 +469,9 @@ exec_ibcs2_coff_prep_zmagic(struct lwp *
 			/* path_index = slhdr->path_index * sizeof(long); */
 			entry_len = slhdr->entry_len * sizeof(long);
 
-			if (entry_len > len) {
+			if (entry_len < sizeof(struct coff_slhdr) ||
+			entry_len > len ||
+			strnlen(slhdr->sl_name, entry_len) == entry_len) {
 free(tbuf, M_TEMP);
 return ENOEXEC;
 			}

Index: src/sys/compat/ibcs2/ibcs2_ioctl.c
diff -u src/sys/compat/ibcs2/ibcs2_ioctl.c:1.45 src/sys/compat/ibcs2/ibcs2_ioctl.c:1.45.70.1
--- src/sys/compat/ibcs2/ibcs2_ioctl.c:1.45	Tue Jun 24 10:03:17 2008
+++ src/sys/compat/ibcs2/ibcs2_ioctl.c	Sat Aug 12 04:09:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_ioctl.c,v 1.45 2008/06/24 10:03:17 gmcgarry Exp $	*/
+/*	$NetBSD: ibcs2_ioctl.c,v 1.45.70.1 2017/08/12 04:09:05 snj Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Scott Bartram
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_ioctl.c,v 1.45 2008/06/24 10:03:17 gmcgarry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_ioctl.c,v 1.45.70.1 2017/08/12 04:09:05 snj Exp $");
 
 #include 
 #include 
@@ -402,8 +402,10 @@ ibcs2_sys_ioctl(struct lwp *l, const str
 		if ((error = (*ctl)(fp, TIOCGETA, &bts)) != 0)
 			goto out;
 
+		memset(&sts, 0, sizeof(sts));
 		btios2stios(&bts, &sts);
 		if (SCARG(uap, cmd) == IBCS2_TCGETA) {
+			memset(&st, 0, sizeof(st));
 			stios2stio(&sts, &st);
 			error = copyout(&st, SCARG(uap, data), sizeof(st));
 			if (error)
@@ -559,6 +561,7 @@ ibcs2_sys_gtty(struct lwp *l, const stru
 
 	fd_putfile(SCARG(uap, fd));
 
+	memset(&itb, 0, sizeof(itb));
 	itb.sg_ispeed = tb.sg_ispeed;
 	itb.sg_ospeed = tb.sg_ospeed;
 	itb.sg_erase = tb.sg_erase;

Index: src/sys/compat/ibcs2/ibcs2_stat.c
diff -u src/sys/compat/ibcs2/ibcs2_stat.c:1.47 src/sys/compat/ibcs2/ibcs2_stat.c:1.47.44.1
--- src/sys/compat/ibcs2/ibcs2_stat.c:1.47	Mon Jun 29 05:08:16 2009
+++ src/sys/compat/ibcs2/ibcs2_stat.c	Sat Aug 12 04:09:05 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_stat.c,v 1.47 2009/06/29 05:08:16 dholland Exp $	*/
+/*	$NetBSD: ibcs2_stat.c,v 1.47.44.1 2017/08/12 04:09:05 snj Exp $	*/
 /*
  * Copyright (c) 1995, 1998 Scott Bartram
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.47 2009/06/29 05:08:16 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.47.44.1 2017/08/12 04:09:05 snj Exp $");
 
 #include 
 #include 
@@ -147,11 +147,13 @@ ibcs2_sys_statfs(struct lwp *l, const st
 		return (error);
 	mp = vp->v_mount;
 	sp = &mp->mnt_stat;
-	vrele(vp);
 	if ((error = VFS_STATVFS(mp, 

CVS commit: [netbsd-7] src/sys/compat/ibcs2

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:09:39 UTC 2017

Modified Files:
src/sys/compat/ibcs2 [netbsd-7]: ibcs2_exec_coff.c ibcs2_ioctl.c
ibcs2_stat.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1477):
sys/compat/ibcs2/ibcs2_exec_coff.c: revision 1.27-1.29
sys/compat/ibcs2/ibcs2_ioctl.c: revision 1.46
sys/compat/ibcs2/ibcs2_stat.c: revision 1.49-1.50
Check for NUL termination within the buffer we have.
>From Ilja Van Sprundel.
--
Make sure we have enough space in the buffer before reading it.
>From Ilja Van Sprundel.
--
Make sure we move forward over the buffer.
>From Ilja Van Sprundel.
--
Zero buffers in ibcs2 ioctl to avoid disclosing stack to userland.
>From Ilja Van Sprundel.
--
Don't drop vnode ref until we're done with mount in ibcs2_stat(v)fs.
Nothing else guarantees the mount will stick around.
>From Ilja Van Sprundel.
--
Little happy on the commit trigger.  Actually use the out label.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/compat/ibcs2/ibcs2_exec_coff.c
cvs rdiff -u -r1.45 -r1.45.58.1 src/sys/compat/ibcs2/ibcs2_ioctl.c
cvs rdiff -u -r1.47 -r1.47.38.1 src/sys/compat/ibcs2/ibcs2_stat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/ibcs2/ibcs2_exec_coff.c
diff -u src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.26 src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.26.4.1
--- src/sys/compat/ibcs2/ibcs2_exec_coff.c:1.26	Fri Oct 25 14:46:35 2013
+++ src/sys/compat/ibcs2/ibcs2_exec_coff.c	Sat Aug 12 04:09:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_exec_coff.c,v 1.26 2013/10/25 14:46:35 martin Exp $	*/
+/*	$NetBSD: ibcs2_exec_coff.c,v 1.26.4.1 2017/08/12 04:09:39 snj Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995, 1998 Scott Bartram
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_coff.c,v 1.26 2013/10/25 14:46:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_exec_coff.c,v 1.26.4.1 2017/08/12 04:09:39 snj Exp $");
 
 #include 
 #include 
@@ -454,6 +454,10 @@ exec_ibcs2_coff_prep_zmagic(struct lwp *
 		}
 		bufp = tbuf;
 		while (len) {
+			if (len < sizeof(struct coff_slhdr)) {
+free(tbuf, M_TEMP);
+return ENOEXEC;
+			}
 			slhdr = (struct coff_slhdr *)bufp;
 
 			if (slhdr->path_index > LONG_MAX / sizeof(long) ||
@@ -465,7 +469,9 @@ exec_ibcs2_coff_prep_zmagic(struct lwp *
 			/* path_index = slhdr->path_index * sizeof(long); */
 			entry_len = slhdr->entry_len * sizeof(long);
 
-			if (entry_len > len) {
+			if (entry_len < sizeof(struct coff_slhdr) ||
+			entry_len > len ||
+			strnlen(slhdr->sl_name, entry_len) == entry_len) {
 free(tbuf, M_TEMP);
 return ENOEXEC;
 			}

Index: src/sys/compat/ibcs2/ibcs2_ioctl.c
diff -u src/sys/compat/ibcs2/ibcs2_ioctl.c:1.45 src/sys/compat/ibcs2/ibcs2_ioctl.c:1.45.58.1
--- src/sys/compat/ibcs2/ibcs2_ioctl.c:1.45	Tue Jun 24 10:03:17 2008
+++ src/sys/compat/ibcs2/ibcs2_ioctl.c	Sat Aug 12 04:09:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_ioctl.c,v 1.45 2008/06/24 10:03:17 gmcgarry Exp $	*/
+/*	$NetBSD: ibcs2_ioctl.c,v 1.45.58.1 2017/08/12 04:09:39 snj Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Scott Bartram
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_ioctl.c,v 1.45 2008/06/24 10:03:17 gmcgarry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_ioctl.c,v 1.45.58.1 2017/08/12 04:09:39 snj Exp $");
 
 #include 
 #include 
@@ -402,8 +402,10 @@ ibcs2_sys_ioctl(struct lwp *l, const str
 		if ((error = (*ctl)(fp, TIOCGETA, &bts)) != 0)
 			goto out;
 
+		memset(&sts, 0, sizeof(sts));
 		btios2stios(&bts, &sts);
 		if (SCARG(uap, cmd) == IBCS2_TCGETA) {
+			memset(&st, 0, sizeof(st));
 			stios2stio(&sts, &st);
 			error = copyout(&st, SCARG(uap, data), sizeof(st));
 			if (error)
@@ -559,6 +561,7 @@ ibcs2_sys_gtty(struct lwp *l, const stru
 
 	fd_putfile(SCARG(uap, fd));
 
+	memset(&itb, 0, sizeof(itb));
 	itb.sg_ispeed = tb.sg_ispeed;
 	itb.sg_ospeed = tb.sg_ospeed;
 	itb.sg_erase = tb.sg_erase;

Index: src/sys/compat/ibcs2/ibcs2_stat.c
diff -u src/sys/compat/ibcs2/ibcs2_stat.c:1.47 src/sys/compat/ibcs2/ibcs2_stat.c:1.47.38.1
--- src/sys/compat/ibcs2/ibcs2_stat.c:1.47	Mon Jun 29 05:08:16 2009
+++ src/sys/compat/ibcs2/ibcs2_stat.c	Sat Aug 12 04:09:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_stat.c,v 1.47 2009/06/29 05:08:16 dholland Exp $	*/
+/*	$NetBSD: ibcs2_stat.c,v 1.47.38.1 2017/08/12 04:09:39 snj Exp $	*/
 /*
  * Copyright (c) 1995, 1998 Scott Bartram
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.47 2009/06/29 05:08:16 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_stat.c,v 1.47.38.1 2017/08/12 04:09:39 snj Exp $");
 
 #include 
 #include 
@@ -147,11 +147,13 @@ ibcs2_sys_statfs(struct lwp *l, const st
 		return (error);
 	mp = vp->v_mount;
 	sp = &mp->mnt_stat;
-	vrele(vp);
 	if ((error = VFS_STATVFS(mp, sp)) !

CVS commit: [netbsd-7-0] src/sys/kern

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:11:10 UTC 2017

Modified Files:
src/sys/kern [netbsd-7-0]: vfs_getcwd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1478):
sys/kern/vfs_getcwd.c: revision 1.52
Don't walk off the end of the dirent buffer.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.50.8.1 src/sys/kern/vfs_getcwd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_getcwd.c
diff -u src/sys/kern/vfs_getcwd.c:1.50 src/sys/kern/vfs_getcwd.c:1.50.8.1
--- src/sys/kern/vfs_getcwd.c:1.50	Fri Feb  7 15:29:22 2014
+++ src/sys/kern/vfs_getcwd.c	Sat Aug 12 04:11:10 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_getcwd.c,v 1.50 2014/02/07 15:29:22 hannken Exp $ */
+/* $NetBSD: vfs_getcwd.c,v 1.50.8.1 2017/08/12 04:11:10 snj Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_getcwd.c,v 1.50 2014/02/07 15:29:22 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_getcwd.c,v 1.50.8.1 2017/08/12 04:11:10 snj Exp $");
 
 #include 
 #include 
@@ -211,7 +211,8 @@ unionread:
 reclen = dp->d_reclen;
 
 /* check for malformed directory.. */
-if (reclen < _DIRENT_MINSIZE(dp)) {
+if (reclen < _DIRENT_MINSIZE(dp) ||
+reclen > len) {
 	error = EINVAL;
 	goto out;
 }



CVS commit: [netbsd-7-1] src/sys/kern

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:11:36 UTC 2017

Modified Files:
src/sys/kern [netbsd-7-1]: vfs_getcwd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1478):
sys/kern/vfs_getcwd.c: revision 1.52
Don't walk off the end of the dirent buffer.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.50.16.1 src/sys/kern/vfs_getcwd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_getcwd.c
diff -u src/sys/kern/vfs_getcwd.c:1.50 src/sys/kern/vfs_getcwd.c:1.50.16.1
--- src/sys/kern/vfs_getcwd.c:1.50	Fri Feb  7 15:29:22 2014
+++ src/sys/kern/vfs_getcwd.c	Sat Aug 12 04:11:36 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_getcwd.c,v 1.50 2014/02/07 15:29:22 hannken Exp $ */
+/* $NetBSD: vfs_getcwd.c,v 1.50.16.1 2017/08/12 04:11:36 snj Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_getcwd.c,v 1.50 2014/02/07 15:29:22 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_getcwd.c,v 1.50.16.1 2017/08/12 04:11:36 snj Exp $");
 
 #include 
 #include 
@@ -211,7 +211,8 @@ unionread:
 reclen = dp->d_reclen;
 
 /* check for malformed directory.. */
-if (reclen < _DIRENT_MINSIZE(dp)) {
+if (reclen < _DIRENT_MINSIZE(dp) ||
+reclen > len) {
 	error = EINVAL;
 	goto out;
 }



CVS commit: [netbsd-7] src/sys/kern

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:12:11 UTC 2017

Modified Files:
src/sys/kern [netbsd-7]: vfs_getcwd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1478):
sys/kern/vfs_getcwd.c: revision 1.52
Don't walk off the end of the dirent buffer.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.50.4.1 src/sys/kern/vfs_getcwd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/vfs_getcwd.c
diff -u src/sys/kern/vfs_getcwd.c:1.50 src/sys/kern/vfs_getcwd.c:1.50.4.1
--- src/sys/kern/vfs_getcwd.c:1.50	Fri Feb  7 15:29:22 2014
+++ src/sys/kern/vfs_getcwd.c	Sat Aug 12 04:12:10 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_getcwd.c,v 1.50 2014/02/07 15:29:22 hannken Exp $ */
+/* $NetBSD: vfs_getcwd.c,v 1.50.4.1 2017/08/12 04:12:10 snj Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_getcwd.c,v 1.50 2014/02/07 15:29:22 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_getcwd.c,v 1.50.4.1 2017/08/12 04:12:10 snj Exp $");
 
 #include 
 #include 
@@ -211,7 +211,8 @@ unionread:
 reclen = dp->d_reclen;
 
 /* check for malformed directory.. */
-if (reclen < _DIRENT_MINSIZE(dp)) {
+if (reclen < _DIRENT_MINSIZE(dp) ||
+reclen > len) {
 	error = EINVAL;
 	goto out;
 }



CVS commit: [netbsd-7-0] src/sys

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:16:17 UTC 2017

Modified Files:
src/sys/compat/common [netbsd-7-0]: vfs_syscalls_12.c vfs_syscalls_43.c
src/sys/compat/ibcs2 [netbsd-7-0]: ibcs2_misc.c
src/sys/compat/linux/common [netbsd-7-0]: linux_file64.c linux_misc.c
src/sys/compat/linux32/common [netbsd-7-0]: linux32_dirent.c
src/sys/compat/osf1 [netbsd-7-0]: osf1_file.c
src/sys/compat/sunos [netbsd-7-0]: sunos_misc.c
src/sys/compat/sunos32 [netbsd-7-0]: sunos32_misc.c
src/sys/compat/svr4 [netbsd-7-0]: svr4_misc.c
src/sys/compat/svr4_32 [netbsd-7-0]: svr4_32_misc.c
src/sys/rump/kern/lib/libsys_sunos [netbsd-7-0]: rump_sunos_compat.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1479):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.6.1 src/sys/compat/common/vfs_syscalls_12.c
cvs rdiff -u -r1.56.6.1 -r1.56.6.2 src/sys/compat/common/vfs_syscalls_43.c
cvs rdiff -u -r1.112 -r1.112.14.1 src/sys/compat/ibcs2/ibcs2_misc.c
cvs rdiff -u -r1.55 -r1.55.8.1 src/sys/compat/linux/common/linux_file64.c
cvs rdiff -u -r1.229 -r1.229.4.1 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.13 -r1.13.32.1 \
src/sys/compat/linux32/common/linux32_dirent.c
cvs rdiff -u -r1.41.28.1 -r1.41.28.1.2.1 src/sys/compat/osf1/osf1_file.c
cvs rdiff -u -r1.168 -r1.168.36.1 src/sys/compat/sunos/sunos_misc.c
cvs rdiff -u -r1.74 -r1.74.24.1 src/sys/compat/sunos32/sunos32_misc.c
cvs rdiff -u -r1.155 -r1.155.30.1 src/sys/compat/svr4/svr4_misc.c
cvs rdiff -u -r1.74 -r1.74.30.1 src/sys/compat/svr4_32/svr4_32_misc.c
cvs rdiff -u -r1.1 -r1.1.18.1 \
src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/common/vfs_syscalls_12.c
diff -u src/sys/compat/common/vfs_syscalls_12.c:1.30 src/sys/compat/common/vfs_syscalls_12.c:1.30.6.1
--- src/sys/compat/common/vfs_syscalls_12.c:1.30	Fri Jan 24 22:11:46 2014
+++ src/sys/compat/common/vfs_syscalls_12.c	Sat Aug 12 04:16:16 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_12.c,v 1.30 2014/01/24 22:11:46 christos Exp $	*/
+/*	$NetBSD: vfs_syscalls_12.c,v 1.30.6.1 2017/08/12 04:16:16 snj Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.30 2014/01/24 22:11:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.30.6.1 2017/08/12 04:16:16 snj Exp $");
 
 #include 
 #include 
@@ -171,8 +171,10 @@ again:
 	for (cookie = cookiebuf; len > 0; len -= reclen) {
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
-		if (reclen & 3)
-			panic(__func__);
+		if (reclen & 3) {
+			error = EIO;
+			goto out;
+		}
 		if (bdp->d_fileno == 0) {
 			inp += reclen;	/* it is a hole; squish it out */
 			if (cookie)

Index: src/sys/compat/common/vfs_syscalls_43.c
diff -u src/sys/compat/common/vfs_syscalls_43.c:1.56.6.1 src/sys/compat/common/vfs_syscalls_43.c:1.56.6.2
--- src/sys/compat/common/vfs_syscalls_43.c:1.56.6.1	Sat Aug 27 15:10:42 2016
+++ src/sys/compat/common/vfs_syscalls_43.c	Sat Aug 12 04:16:16 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_43.c,v 1.56.6.1 2016/08/27 15:10:42 bouyer Exp $	*/
+/*	$NetBSD: vfs_syscalls_43.c,v 1.56.6.2 2017/08/12 04:16:16 snj Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.56.6.1 2016/08/27 15:10:42 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.56.6.2 2017/08/12 04:16:16 snj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -450,8 +450,10 @@ again:
 	for (cookie = cookiebuf; len > 0; len -= reclen) {
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
-		if (reclen & 3)
-			panic(__func__);
+		if (reclen & 3) {
+			error = EIO;
+			goto out;
+		}
 		if (bdp->d_fileno == 0) {
 			inp += reclen;	/* it is a hole; squish it out */
 			if (cookie)

Index: src/sys/compat/ibcs2/ibcs2_misc.c
diff -u src/sys/compat/ibcs2/ibcs2_misc.c:1.112 src/sys/compat/ibcs2

CVS commit: [netbsd-7-1] src/sys/compat

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:16:53 UTC 2017

Modified Files:
src/sys/compat/common [netbsd-7-1]: vfs_syscalls_12.c vfs_syscalls_43.c
src/sys/compat/ibcs2 [netbsd-7-1]: ibcs2_misc.c
src/sys/compat/linux/common [netbsd-7-1]: linux_file64.c linux_misc.c
src/sys/compat/linux32/common [netbsd-7-1]: linux32_dirent.c
src/sys/compat/osf1 [netbsd-7-1]: osf1_file.c
src/sys/compat/sunos [netbsd-7-1]: sunos_misc.c
src/sys/compat/sunos32 [netbsd-7-1]: sunos32_misc.c
src/sys/compat/svr4 [netbsd-7-1]: svr4_misc.c
src/sys/compat/svr4_32 [netbsd-7-1]: svr4_32_misc.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1479):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.10.1 src/sys/compat/common/vfs_syscalls_12.c
cvs rdiff -u -r1.56.4.1 -r1.56.4.1.4.1 \
src/sys/compat/common/vfs_syscalls_43.c
cvs rdiff -u -r1.112 -r1.112.18.1 src/sys/compat/ibcs2/ibcs2_misc.c
cvs rdiff -u -r1.55 -r1.55.14.1 src/sys/compat/linux/common/linux_file64.c
cvs rdiff -u -r1.229 -r1.229.8.1 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.13 -r1.13.38.1 \
src/sys/compat/linux32/common/linux32_dirent.c
cvs rdiff -u -r1.41.28.1 -r1.41.28.1.6.1 src/sys/compat/osf1/osf1_file.c
cvs rdiff -u -r1.168 -r1.168.40.1 src/sys/compat/sunos/sunos_misc.c
cvs rdiff -u -r1.74 -r1.74.28.1 src/sys/compat/sunos32/sunos32_misc.c
cvs rdiff -u -r1.155 -r1.155.34.1 src/sys/compat/svr4/svr4_misc.c
cvs rdiff -u -r1.74 -r1.74.34.1 src/sys/compat/svr4_32/svr4_32_misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/common/vfs_syscalls_12.c
diff -u src/sys/compat/common/vfs_syscalls_12.c:1.30 src/sys/compat/common/vfs_syscalls_12.c:1.30.10.1
--- src/sys/compat/common/vfs_syscalls_12.c:1.30	Fri Jan 24 22:11:46 2014
+++ src/sys/compat/common/vfs_syscalls_12.c	Sat Aug 12 04:16:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_12.c,v 1.30 2014/01/24 22:11:46 christos Exp $	*/
+/*	$NetBSD: vfs_syscalls_12.c,v 1.30.10.1 2017/08/12 04:16:52 snj Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.30 2014/01/24 22:11:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.30.10.1 2017/08/12 04:16:52 snj Exp $");
 
 #include 
 #include 
@@ -171,8 +171,10 @@ again:
 	for (cookie = cookiebuf; len > 0; len -= reclen) {
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
-		if (reclen & 3)
-			panic(__func__);
+		if (reclen & 3) {
+			error = EIO;
+			goto out;
+		}
 		if (bdp->d_fileno == 0) {
 			inp += reclen;	/* it is a hole; squish it out */
 			if (cookie)

Index: src/sys/compat/common/vfs_syscalls_43.c
diff -u src/sys/compat/common/vfs_syscalls_43.c:1.56.4.1 src/sys/compat/common/vfs_syscalls_43.c:1.56.4.1.4.1
--- src/sys/compat/common/vfs_syscalls_43.c:1.56.4.1	Sat Aug 27 15:10:59 2016
+++ src/sys/compat/common/vfs_syscalls_43.c	Sat Aug 12 04:16:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_43.c,v 1.56.4.1 2016/08/27 15:10:59 bouyer Exp $	*/
+/*	$NetBSD: vfs_syscalls_43.c,v 1.56.4.1.4.1 2017/08/12 04:16:52 snj Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.56.4.1 2016/08/27 15:10:59 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.56.4.1.4.1 2017/08/12 04:16:52 snj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -450,8 +450,10 @@ again:
 	for (cookie = cookiebuf; len > 0; len -= reclen) {
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
-		if (reclen & 3)
-			panic(__func__);
+		if (reclen & 3) {
+			error = EIO;
+			goto out;
+		}
 		if (bdp->d_fileno == 0) {
 			inp += reclen;	/* it is a hole; squish it out */
 			if (cookie)

Index: src/sys/compat/ibcs2/ibcs2_misc.c
diff -u src/sys/compat/ibcs2/ibcs2_misc.c:1.112 src/sys/compat/ibcs2/ibcs2_misc.c:1.112.18.1
--- src/sys/compat/ibcs2/ibcs2_misc.c:1.112	Tue Oct  2 01:44:27 2012
+++ src/sys/compat/ibcs2/ibcs2_misc.c	Sat Aug 1

CVS commit: [netbsd-7-1] src/sys/rump/kern/lib/libsys_sunos

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:17:37 UTC 2017

Modified Files:
src/sys/rump/kern/lib/libsys_sunos [netbsd-7-1]: rump_sunos_compat.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1479):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.26.1 \
src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c
diff -u src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c:1.1 src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c:1.1.26.1
--- src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c:1.1	Tue Apr  9 13:08:33 2013
+++ src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c	Sat Aug 12 04:17:37 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_sunos_compat.c,v 1.1 2013/04/09 13:08:33 pooka Exp $	*/
+/*	$NetBSD: rump_sunos_compat.c,v 1.1.26.1 2017/08/12 04:17:37 snj Exp $	*/
 
 /*
  * Copyright (c) 2013 Antti Kantee.  All Rights Reserved.
@@ -313,8 +313,10 @@ again:
 	for (cookie = cookiebuf; len > 0; len -= reclen) {
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
-		if (reclen & 3)
-			panic("sunos_getdents");
+		if (reclen & 3) {
+			error = EIO;
+			goto out;
+		}
 		if ((*cookie >> 32) != 0) {
 			printf("rump_sunos_sys_getdents: offset too large\n");
 			error = EINVAL;



CVS commit: [netbsd-7] src/sys

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:18:10 UTC 2017

Modified Files:
src/sys/compat/common [netbsd-7]: vfs_syscalls_12.c vfs_syscalls_43.c
src/sys/compat/ibcs2 [netbsd-7]: ibcs2_misc.c
src/sys/compat/linux/common [netbsd-7]: linux_file64.c linux_misc.c
src/sys/compat/linux32/common [netbsd-7]: linux32_dirent.c
src/sys/compat/osf1 [netbsd-7]: osf1_file.c
src/sys/compat/sunos [netbsd-7]: sunos_misc.c
src/sys/compat/sunos32 [netbsd-7]: sunos32_misc.c
src/sys/compat/svr4 [netbsd-7]: svr4_misc.c
src/sys/compat/svr4_32 [netbsd-7]: svr4_32_misc.c
src/sys/rump/kern/lib/libsys_sunos [netbsd-7]: rump_sunos_compat.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1479):
sys/compat/common/vfs_syscalls_12.c: revision 1.34
sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c: revision 1.2
sys/compat/svr4_32/svr4_32_misc.c: revision 1.78
sys/compat/sunos32/sunos32_misc.c: revision 1.78
sys/compat/linux/common/linux_misc.c: revision 1.239
sys/compat/osf1/osf1_file.c: revision 1.44
sys/compat/common/vfs_syscalls_43.c: revision 1.60
sys/compat/svr4/svr4_misc.c: revision 1.158
sys/compat/ibcs2/ibcs2_misc.c: revision 1.114
sys/compat/linux/common/linux_file64.c: revision 1.59
sys/compat/linux32/common/linux32_dirent.c: revision 1.18
sys/compat/sunos/sunos_misc.c: revision 1.171
Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.4.1 src/sys/compat/common/vfs_syscalls_12.c
cvs rdiff -u -r1.56.4.1 -r1.56.4.2 src/sys/compat/common/vfs_syscalls_43.c
cvs rdiff -u -r1.112 -r1.112.12.1 src/sys/compat/ibcs2/ibcs2_misc.c
cvs rdiff -u -r1.55 -r1.55.4.1 src/sys/compat/linux/common/linux_file64.c
cvs rdiff -u -r1.229.2.1 -r1.229.2.2 src/sys/compat/linux/common/linux_misc.c
cvs rdiff -u -r1.13 -r1.13.28.1 \
src/sys/compat/linux32/common/linux32_dirent.c
cvs rdiff -u -r1.41.28.1 -r1.41.28.2 src/sys/compat/osf1/osf1_file.c
cvs rdiff -u -r1.168 -r1.168.34.1 src/sys/compat/sunos/sunos_misc.c
cvs rdiff -u -r1.74 -r1.74.22.1 src/sys/compat/sunos32/sunos32_misc.c
cvs rdiff -u -r1.155 -r1.155.28.1 src/sys/compat/svr4/svr4_misc.c
cvs rdiff -u -r1.74 -r1.74.28.1 src/sys/compat/svr4_32/svr4_32_misc.c
cvs rdiff -u -r1.1 -r1.1.14.1 \
src/sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/common/vfs_syscalls_12.c
diff -u src/sys/compat/common/vfs_syscalls_12.c:1.30 src/sys/compat/common/vfs_syscalls_12.c:1.30.4.1
--- src/sys/compat/common/vfs_syscalls_12.c:1.30	Fri Jan 24 22:11:46 2014
+++ src/sys/compat/common/vfs_syscalls_12.c	Sat Aug 12 04:18:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_12.c,v 1.30 2014/01/24 22:11:46 christos Exp $	*/
+/*	$NetBSD: vfs_syscalls_12.c,v 1.30.4.1 2017/08/12 04:18:09 snj Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.30 2014/01/24 22:11:46 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_12.c,v 1.30.4.1 2017/08/12 04:18:09 snj Exp $");
 
 #include 
 #include 
@@ -171,8 +171,10 @@ again:
 	for (cookie = cookiebuf; len > 0; len -= reclen) {
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
-		if (reclen & 3)
-			panic(__func__);
+		if (reclen & 3) {
+			error = EIO;
+			goto out;
+		}
 		if (bdp->d_fileno == 0) {
 			inp += reclen;	/* it is a hole; squish it out */
 			if (cookie)

Index: src/sys/compat/common/vfs_syscalls_43.c
diff -u src/sys/compat/common/vfs_syscalls_43.c:1.56.4.1 src/sys/compat/common/vfs_syscalls_43.c:1.56.4.2
--- src/sys/compat/common/vfs_syscalls_43.c:1.56.4.1	Sat Aug 27 15:10:59 2016
+++ src/sys/compat/common/vfs_syscalls_43.c	Sat Aug 12 04:18:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_43.c,v 1.56.4.1 2016/08/27 15:10:59 bouyer Exp $	*/
+/*	$NetBSD: vfs_syscalls_43.c,v 1.56.4.2 2017/08/12 04:18:09 snj Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.56.4.1 2016/08/27 15:10:59 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_43.c,v 1.56.4.2 2017/08/12 04:18:09 snj Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -450,8 +450,10 @@ again:
 	for (cookie = cookiebuf; len > 0; len -= reclen) {
 		bdp = (struct dirent *)inp;
 		reclen = bdp->d_reclen;
-		if (reclen & 3)
-			panic(__func__);
+		if (reclen & 3) {
+			error = EIO;
+			goto out;
+		}
 		if (bdp->d_fileno == 0) {
 			inp += reclen;	/* it is a hole; squish it out */
 			if (cookie)

Index: src/sys/compat/ibcs2/ibcs2_misc.c
diff -u src/sys/compat/ibcs2/ibcs2_misc.c:1.112 src/sys/compat/ibcs2/ibcs2_misc.c:1.112.

CVS commit: [netbsd-7-0] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:22:26 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7-0]: isp_netbsd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1482):
sys/dev/ic/isp_netbsd.c: revision 1.89
Reject out-of-bounds channel index.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.86.16.1 src/sys/dev/ic/isp_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/isp_netbsd.c
diff -u src/sys/dev/ic/isp_netbsd.c:1.86 src/sys/dev/ic/isp_netbsd.c:1.86.16.1
--- src/sys/dev/ic/isp_netbsd.c:1.86	Tue Aug 21 15:53:07 2012
+++ src/sys/dev/ic/isp_netbsd.c	Sat Aug 12 04:22:26 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.c,v 1.86 2012/08/21 15:53:07 bouyer Exp $ */
+/* $NetBSD: isp_netbsd.c,v 1.86.16.1 2017/08/12 04:22:26 snj Exp $ */
 /*
  * Platform (NetBSD) dependent common attachment code for Qlogic adapters.
  */
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.86 2012/08/21 15:53:07 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.86.16.1 2017/08/12 04:22:26 snj Exp $");
 
 #include 
 #include 
@@ -475,6 +475,10 @@ ispioctl(struct scsipi_channel *chan, u_
 		}
 		lim = local.count;
 		channel = local.channel;
+		if (channel >= isp->isp_nchan) {
+			retval = EINVAL;
+			break;
+		}
 
 		ua = *(isp_dlist_t **)addr;
 		uptr = &ua->wwns[0];



CVS commit: [netbsd-7-1] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:23:19 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7-1]: isp_netbsd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1482):
sys/dev/ic/isp_netbsd.c: revision 1.89
Reject out-of-bounds channel index.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.86.20.1 src/sys/dev/ic/isp_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/isp_netbsd.c
diff -u src/sys/dev/ic/isp_netbsd.c:1.86 src/sys/dev/ic/isp_netbsd.c:1.86.20.1
--- src/sys/dev/ic/isp_netbsd.c:1.86	Tue Aug 21 15:53:07 2012
+++ src/sys/dev/ic/isp_netbsd.c	Sat Aug 12 04:23:19 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.c,v 1.86 2012/08/21 15:53:07 bouyer Exp $ */
+/* $NetBSD: isp_netbsd.c,v 1.86.20.1 2017/08/12 04:23:19 snj Exp $ */
 /*
  * Platform (NetBSD) dependent common attachment code for Qlogic adapters.
  */
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.86 2012/08/21 15:53:07 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.86.20.1 2017/08/12 04:23:19 snj Exp $");
 
 #include 
 #include 
@@ -475,6 +475,10 @@ ispioctl(struct scsipi_channel *chan, u_
 		}
 		lim = local.count;
 		channel = local.channel;
+		if (channel >= isp->isp_nchan) {
+			retval = EINVAL;
+			break;
+		}
 
 		ua = *(isp_dlist_t **)addr;
 		uptr = &ua->wwns[0];



CVS commit: [netbsd-7] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:23:41 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7]: isp_netbsd.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1482):
sys/dev/ic/isp_netbsd.c: revision 1.89
Reject out-of-bounds channel index.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.86.14.1 src/sys/dev/ic/isp_netbsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/isp_netbsd.c
diff -u src/sys/dev/ic/isp_netbsd.c:1.86 src/sys/dev/ic/isp_netbsd.c:1.86.14.1
--- src/sys/dev/ic/isp_netbsd.c:1.86	Tue Aug 21 15:53:07 2012
+++ src/sys/dev/ic/isp_netbsd.c	Sat Aug 12 04:23:41 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.c,v 1.86 2012/08/21 15:53:07 bouyer Exp $ */
+/* $NetBSD: isp_netbsd.c,v 1.86.14.1 2017/08/12 04:23:41 snj Exp $ */
 /*
  * Platform (NetBSD) dependent common attachment code for Qlogic adapters.
  */
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.86 2012/08/21 15:53:07 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.86.14.1 2017/08/12 04:23:41 snj Exp $");
 
 #include 
 #include 
@@ -475,6 +475,10 @@ ispioctl(struct scsipi_channel *chan, u_
 		}
 		lim = local.count;
 		channel = local.channel;
+		if (channel >= isp->isp_nchan) {
+			retval = EINVAL;
+			break;
+		}
 
 		ua = *(isp_dlist_t **)addr;
 		uptr = &ua->wwns[0];



CVS commit: [netbsd-7-0] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:28:39 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7-0]: ciss.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1483):
sys/dev/ic/ciss.c: revision 1.37
Reject negative indices from userland.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.32.8.1 src/sys/dev/ic/ciss.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ciss.c
diff -u src/sys/dev/ic/ciss.c:1.32 src/sys/dev/ic/ciss.c:1.32.8.1
--- src/sys/dev/ic/ciss.c:1.32	Thu Oct 17 21:24:24 2013
+++ src/sys/dev/ic/ciss.c	Sat Aug 12 04:28:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ciss.c,v 1.32 2013/10/17 21:24:24 christos Exp $	*/
+/*	$NetBSD: ciss.c,v 1.32.8.1 2017/08/12 04:28:39 snj Exp $	*/
 /*	$OpenBSD: ciss.c,v 1.68 2013/05/30 16:15:02 deraadt Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.32 2013/10/17 21:24:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.32.8.1 2017/08/12 04:28:39 snj Exp $");
 
 #include "bio.h"
 
@@ -1274,12 +1274,12 @@ ciss_ioctl(device_t dev, u_long cmd, voi
 		/* FALLTHROUGH */
 	case BIOCDISK:
 		bd = (struct bioc_disk *)addr;
-		if (bd->bd_volid > sc->maxunits) {
+		if (bd->bd_volid < 0 || bd->bd_volid > sc->maxunits) {
 			error = EINVAL;
 			break;
 		}
 		ldp = sc->sc_lds[0];
-		if (!ldp || (pd = bd->bd_diskid) > ldp->ndrives) {
+		if (!ldp || (pd = bd->bd_diskid) < 0 || pd > ldp->ndrives) {
 			error = EINVAL;
 			break;
 		}
@@ -1380,7 +1380,7 @@ ciss_ioctl_vol(struct ciss_softc *sc, st
 	int error = 0;
 	u_int blks;
 
-	if (bv->bv_volid > sc->maxunits) {
+	if (bv->bv_volid < 0 || bv->bv_volid > sc->maxunits) {
 		return EINVAL;
 	}
 	ldp = sc->sc_lds[bv->bv_volid];



CVS commit: [netbsd-7-1] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:28:55 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7-1]: ciss.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1483):
sys/dev/ic/ciss.c: revision 1.37
Reject negative indices from userland.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.32.12.1 src/sys/dev/ic/ciss.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ciss.c
diff -u src/sys/dev/ic/ciss.c:1.32 src/sys/dev/ic/ciss.c:1.32.12.1
--- src/sys/dev/ic/ciss.c:1.32	Thu Oct 17 21:24:24 2013
+++ src/sys/dev/ic/ciss.c	Sat Aug 12 04:28:55 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ciss.c,v 1.32 2013/10/17 21:24:24 christos Exp $	*/
+/*	$NetBSD: ciss.c,v 1.32.12.1 2017/08/12 04:28:55 snj Exp $	*/
 /*	$OpenBSD: ciss.c,v 1.68 2013/05/30 16:15:02 deraadt Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.32 2013/10/17 21:24:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.32.12.1 2017/08/12 04:28:55 snj Exp $");
 
 #include "bio.h"
 
@@ -1274,12 +1274,12 @@ ciss_ioctl(device_t dev, u_long cmd, voi
 		/* FALLTHROUGH */
 	case BIOCDISK:
 		bd = (struct bioc_disk *)addr;
-		if (bd->bd_volid > sc->maxunits) {
+		if (bd->bd_volid < 0 || bd->bd_volid > sc->maxunits) {
 			error = EINVAL;
 			break;
 		}
 		ldp = sc->sc_lds[0];
-		if (!ldp || (pd = bd->bd_diskid) > ldp->ndrives) {
+		if (!ldp || (pd = bd->bd_diskid) < 0 || pd > ldp->ndrives) {
 			error = EINVAL;
 			break;
 		}
@@ -1380,7 +1380,7 @@ ciss_ioctl_vol(struct ciss_softc *sc, st
 	int error = 0;
 	u_int blks;
 
-	if (bv->bv_volid > sc->maxunits) {
+	if (bv->bv_volid < 0 || bv->bv_volid > sc->maxunits) {
 		return EINVAL;
 	}
 	ldp = sc->sc_lds[bv->bv_volid];



CVS commit: [netbsd-7] src/sys/dev/ic

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:29:22 UTC 2017

Modified Files:
src/sys/dev/ic [netbsd-7]: ciss.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1483):
sys/dev/ic/ciss.c: revision 1.37
Reject negative indices from userland.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.32.4.1 src/sys/dev/ic/ciss.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ciss.c
diff -u src/sys/dev/ic/ciss.c:1.32 src/sys/dev/ic/ciss.c:1.32.4.1
--- src/sys/dev/ic/ciss.c:1.32	Thu Oct 17 21:24:24 2013
+++ src/sys/dev/ic/ciss.c	Sat Aug 12 04:29:22 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ciss.c,v 1.32 2013/10/17 21:24:24 christos Exp $	*/
+/*	$NetBSD: ciss.c,v 1.32.4.1 2017/08/12 04:29:22 snj Exp $	*/
 /*	$OpenBSD: ciss.c,v 1.68 2013/05/30 16:15:02 deraadt Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.32 2013/10/17 21:24:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciss.c,v 1.32.4.1 2017/08/12 04:29:22 snj Exp $");
 
 #include "bio.h"
 
@@ -1274,12 +1274,12 @@ ciss_ioctl(device_t dev, u_long cmd, voi
 		/* FALLTHROUGH */
 	case BIOCDISK:
 		bd = (struct bioc_disk *)addr;
-		if (bd->bd_volid > sc->maxunits) {
+		if (bd->bd_volid < 0 || bd->bd_volid > sc->maxunits) {
 			error = EINVAL;
 			break;
 		}
 		ldp = sc->sc_lds[0];
-		if (!ldp || (pd = bd->bd_diskid) > ldp->ndrives) {
+		if (!ldp || (pd = bd->bd_diskid) < 0 || pd > ldp->ndrives) {
 			error = EINVAL;
 			break;
 		}
@@ -1380,7 +1380,7 @@ ciss_ioctl_vol(struct ciss_softc *sc, st
 	int error = 0;
 	u_int blks;
 
-	if (bv->bv_volid > sc->maxunits) {
+	if (bv->bv_volid < 0 || bv->bv_volid > sc->maxunits) {
 		return EINVAL;
 	}
 	ldp = sc->sc_lds[bv->bv_volid];



CVS commit: [netbsd-7-0] src/sys/netsmb

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:32:43 UTC 2017

Modified Files:
src/sys/netsmb [netbsd-7-0]: smb_dev.c smb_subr.c smb_subr.h smb_usr.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1484):
sys/netsmb/smb_dev.c: revision 1.50
sys/netsmb/smb_subr.c: revision 1.38
sys/netsmb/smb_subr.h: revision 1.22
sys/netsmb/smb_usr.c: revision 1.17-1.19
Reject allocations for too-small buffers from userland.
>From Ilja Van Sprundel.
--
Plug another overflow: refuse bogus sa_len from user.
--
Reject negative ioc_setupcnt.
--
Reject negative offset/count for smb read/write.
Not clear that this is actually a problem for the kernel -- might
overwrite user's buffers or return garbage to user, but that's their
own damn fault.  But it's hard to imagine that negative offset/count
ever makes sense, and I haven't ruled out a problem for the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.4.1 src/sys/netsmb/smb_dev.c
cvs rdiff -u -r1.36.28.1 -r1.36.28.1.2.1 src/sys/netsmb/smb_subr.c
cvs rdiff -u -r1.21 -r1.21.18.1 src/sys/netsmb/smb_subr.h
cvs rdiff -u -r1.16 -r1.16.42.1 src/sys/netsmb/smb_usr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netsmb/smb_dev.c
diff -u src/sys/netsmb/smb_dev.c:1.42 src/sys/netsmb/smb_dev.c:1.42.4.1
--- src/sys/netsmb/smb_dev.c:1.42	Fri Jul 25 08:10:40 2014
+++ src/sys/netsmb/smb_dev.c	Sat Aug 12 04:32:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_dev.c,v 1.42 2014/07/25 08:10:40 dholland Exp $	*/
+/*	$NetBSD: smb_dev.c,v 1.42.4.1 2017/08/12 04:32:43 snj Exp $	*/
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.42 2014/07/25 08:10:40 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.42.4.1 2017/08/12 04:32:43 snj Exp $");
 
 #include 
 #include 
@@ -344,6 +344,8 @@ nsmb_dev_ioctl(dev_t dev, u_long cmd, vo
 		struct uio auio;
 		struct iovec iov;
 
+		if (rwrq->ioc_cnt < 0 || rwrq->ioc_offset < 0)
+			return EINVAL;
 		if ((ssp = sdp->sd_share) == NULL)
 			return ENOTCONN;
 		iov.iov_base = rwrq->ioc_base;

Index: src/sys/netsmb/smb_subr.c
diff -u src/sys/netsmb/smb_subr.c:1.36.28.1 src/sys/netsmb/smb_subr.c:1.36.28.1.2.1
--- src/sys/netsmb/smb_subr.c:1.36.28.1	Mon Dec  1 09:31:40 2014
+++ src/sys/netsmb/smb_subr.c	Sat Aug 12 04:32:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_subr.c,v 1.36.28.1 2014/12/01 09:31:40 martin Exp $	*/
+/*	$NetBSD: smb_subr.c,v 1.36.28.1.2.1 2017/08/12 04:32:43 snj Exp $	*/
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smb_subr.c,v 1.36.28.1 2014/12/01 09:31:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_subr.c,v 1.36.28.1.2.1 2017/08/12 04:32:43 snj Exp $");
 
 #include 
 #include 
@@ -380,3 +380,32 @@ dup_sockaddr(struct sockaddr *sa, int ca
 		memcpy(sa2, sa, sa->sa_len);
 	return sa2;
 }
+
+int
+dup_sockaddr_copyin(struct sockaddr **ksap, struct sockaddr *usa,
+size_t usalen)
+{
+	struct sockaddr *ksa;
+
+	/* Make sure user provided enough data for a generic sockaddr.  */
+	if (usalen < sizeof(*ksa))
+		return EINVAL;
+
+	/* Don't let the user overfeed us.  */
+	usalen = MIN(usalen, sizeof(struct sockaddr_storage));
+
+	/* Copy the buffer in from userland.  */
+	ksa = smb_memdupin(usa, usalen);
+	if (ksa == NULL)
+		return ENOMEM;
+
+	/* Make sure the user's idea of sa_len is reasonable.  */
+	if (ksa->sa_len > usalen) {
+		smb_memfree(ksa);
+		return EINVAL;
+	}
+
+	/* Success!  */
+	*ksap = ksa;
+	return 0;
+}

Index: src/sys/netsmb/smb_subr.h
diff -u src/sys/netsmb/smb_subr.h:1.21 src/sys/netsmb/smb_subr.h:1.21.18.1
--- src/sys/netsmb/smb_subr.h:1.21	Tue Mar 13 18:41:01 2012
+++ src/sys/netsmb/smb_subr.h	Sat Aug 12 04:32:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_subr.h,v 1.21 2012/03/13 18:41:01 elad Exp $	*/
+/*	$NetBSD: smb_subr.h,v 1.21.18.1 2017/08/12 04:32:43 snj Exp $	*/
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -128,5 +128,6 @@ int  smb_put_asunistring(struct smb_rq *
 #endif
 
 struct sockaddr *dup_sockaddr(struct sockaddr *, int);
+int dup_sockaddr_copyin(struct sockaddr **, struct sockaddr *, size_t);
 
 #endif /* !_NETSMB_SMB_SUBR_H_ */

Index: src/sys/netsmb/smb_usr.c
diff -u src/sys/netsmb/smb_usr.c:1.16 src/sys/netsmb/smb_usr.c:1.16.42.1
--- src/sys/netsmb/smb_usr.c:1.16	Wed Mar 18 16:00:24 2009
+++ src/sys/netsmb/smb_usr.c	Sat Aug 12 04:32:43 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_usr.c,v 1.16 2009/03/18 16:00:24 cegger Exp $	*/
+/*	$NetBSD: smb_usr.c,v 1.16.42.1 2017/08/12 04:32:43 snj Exp $	*/
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smb_usr.c,v 1.16 2009/03/18 16:00:24 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_usr.c,v 1.16.42.1 2017/08/12 04:32:43 snj Exp $");
 
 #include 
 #include 
@@ -65,6 +65,7 

CVS commit: [netbsd-7] src/sys/netsmb

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:34:12 UTC 2017

Modified Files:
src/sys/netsmb [netbsd-7]: smb_dev.c smb_subr.c smb_subr.h smb_usr.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1484):
sys/netsmb/smb_dev.c: revision 1.50
sys/netsmb/smb_subr.c: revision 1.38
sys/netsmb/smb_subr.h: revision 1.22
sys/netsmb/smb_usr.c: revision 1.17-1.19
Reject allocations for too-small buffers from userland.
>From Ilja Van Sprundel.
--
Plug another overflow: refuse bogus sa_len from user.
--
Reject negative ioc_setupcnt.
--
Reject negative offset/count for smb read/write.
Not clear that this is actually a problem for the kernel -- might
overwrite user's buffers or return garbage to user, but that's their
own damn fault.  But it's hard to imagine that negative offset/count
ever makes sense, and I haven't ruled out a problem for the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.2.1 src/sys/netsmb/smb_dev.c
cvs rdiff -u -r1.36.28.1 -r1.36.28.2 src/sys/netsmb/smb_subr.c
cvs rdiff -u -r1.21 -r1.21.14.1 src/sys/netsmb/smb_subr.h
cvs rdiff -u -r1.16 -r1.16.38.1 src/sys/netsmb/smb_usr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netsmb/smb_dev.c
diff -u src/sys/netsmb/smb_dev.c:1.42 src/sys/netsmb/smb_dev.c:1.42.2.1
--- src/sys/netsmb/smb_dev.c:1.42	Fri Jul 25 08:10:40 2014
+++ src/sys/netsmb/smb_dev.c	Sat Aug 12 04:34:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_dev.c,v 1.42 2014/07/25 08:10:40 dholland Exp $	*/
+/*	$NetBSD: smb_dev.c,v 1.42.2.1 2017/08/12 04:34:12 snj Exp $	*/
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.42 2014/07/25 08:10:40 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.42.2.1 2017/08/12 04:34:12 snj Exp $");
 
 #include 
 #include 
@@ -344,6 +344,8 @@ nsmb_dev_ioctl(dev_t dev, u_long cmd, vo
 		struct uio auio;
 		struct iovec iov;
 
+		if (rwrq->ioc_cnt < 0 || rwrq->ioc_offset < 0)
+			return EINVAL;
 		if ((ssp = sdp->sd_share) == NULL)
 			return ENOTCONN;
 		iov.iov_base = rwrq->ioc_base;

Index: src/sys/netsmb/smb_subr.c
diff -u src/sys/netsmb/smb_subr.c:1.36.28.1 src/sys/netsmb/smb_subr.c:1.36.28.2
--- src/sys/netsmb/smb_subr.c:1.36.28.1	Mon Dec  1 09:31:40 2014
+++ src/sys/netsmb/smb_subr.c	Sat Aug 12 04:34:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_subr.c,v 1.36.28.1 2014/12/01 09:31:40 martin Exp $	*/
+/*	$NetBSD: smb_subr.c,v 1.36.28.2 2017/08/12 04:34:12 snj Exp $	*/
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smb_subr.c,v 1.36.28.1 2014/12/01 09:31:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_subr.c,v 1.36.28.2 2017/08/12 04:34:12 snj Exp $");
 
 #include 
 #include 
@@ -380,3 +380,32 @@ dup_sockaddr(struct sockaddr *sa, int ca
 		memcpy(sa2, sa, sa->sa_len);
 	return sa2;
 }
+
+int
+dup_sockaddr_copyin(struct sockaddr **ksap, struct sockaddr *usa,
+size_t usalen)
+{
+	struct sockaddr *ksa;
+
+	/* Make sure user provided enough data for a generic sockaddr.  */
+	if (usalen < sizeof(*ksa))
+		return EINVAL;
+
+	/* Don't let the user overfeed us.  */
+	usalen = MIN(usalen, sizeof(struct sockaddr_storage));
+
+	/* Copy the buffer in from userland.  */
+	ksa = smb_memdupin(usa, usalen);
+	if (ksa == NULL)
+		return ENOMEM;
+
+	/* Make sure the user's idea of sa_len is reasonable.  */
+	if (ksa->sa_len > usalen) {
+		smb_memfree(ksa);
+		return EINVAL;
+	}
+
+	/* Success!  */
+	*ksap = ksa;
+	return 0;
+}

Index: src/sys/netsmb/smb_subr.h
diff -u src/sys/netsmb/smb_subr.h:1.21 src/sys/netsmb/smb_subr.h:1.21.14.1
--- src/sys/netsmb/smb_subr.h:1.21	Tue Mar 13 18:41:01 2012
+++ src/sys/netsmb/smb_subr.h	Sat Aug 12 04:34:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_subr.h,v 1.21 2012/03/13 18:41:01 elad Exp $	*/
+/*	$NetBSD: smb_subr.h,v 1.21.14.1 2017/08/12 04:34:12 snj Exp $	*/
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -128,5 +128,6 @@ int  smb_put_asunistring(struct smb_rq *
 #endif
 
 struct sockaddr *dup_sockaddr(struct sockaddr *, int);
+int dup_sockaddr_copyin(struct sockaddr **, struct sockaddr *, size_t);
 
 #endif /* !_NETSMB_SMB_SUBR_H_ */

Index: src/sys/netsmb/smb_usr.c
diff -u src/sys/netsmb/smb_usr.c:1.16 src/sys/netsmb/smb_usr.c:1.16.38.1
--- src/sys/netsmb/smb_usr.c:1.16	Wed Mar 18 16:00:24 2009
+++ src/sys/netsmb/smb_usr.c	Sat Aug 12 04:34:12 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_usr.c,v 1.16 2009/03/18 16:00:24 cegger Exp $	*/
+/*	$NetBSD: smb_usr.c,v 1.16.38.1 2017/08/12 04:34:12 snj Exp $	*/
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smb_usr.c,v 1.16 2009/03/18 16:00:24 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_usr.c,v 1.16.38.1 2017/08/12 04:34:12 snj Exp $");
 
 #include 
 #include 
@@ -65,6 +65,7 @@ static int
 smb

CVS commit: [netbsd-7-1] src/sys/netsmb

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:33:26 UTC 2017

Modified Files:
src/sys/netsmb [netbsd-7-1]: smb_dev.c smb_subr.c smb_subr.h smb_usr.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1484):
sys/netsmb/smb_dev.c: revision 1.50
sys/netsmb/smb_subr.c: revision 1.38
sys/netsmb/smb_subr.h: revision 1.22
sys/netsmb/smb_usr.c: revision 1.17-1.19
Reject allocations for too-small buffers from userland.
>From Ilja Van Sprundel.
--
Plug another overflow: refuse bogus sa_len from user.
--
Reject negative ioc_setupcnt.
--
Reject negative offset/count for smb read/write.
Not clear that this is actually a problem for the kernel -- might
overwrite user's buffers or return garbage to user, but that's their
own damn fault.  But it's hard to imagine that negative offset/count
ever makes sense, and I haven't ruled out a problem for the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.42.8.1 src/sys/netsmb/smb_dev.c
cvs rdiff -u -r1.36.28.1 -r1.36.28.1.6.1 src/sys/netsmb/smb_subr.c
cvs rdiff -u -r1.21 -r1.21.26.1 src/sys/netsmb/smb_subr.h
cvs rdiff -u -r1.16 -r1.16.50.1 src/sys/netsmb/smb_usr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netsmb/smb_dev.c
diff -u src/sys/netsmb/smb_dev.c:1.42 src/sys/netsmb/smb_dev.c:1.42.8.1
--- src/sys/netsmb/smb_dev.c:1.42	Fri Jul 25 08:10:40 2014
+++ src/sys/netsmb/smb_dev.c	Sat Aug 12 04:33:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_dev.c,v 1.42 2014/07/25 08:10:40 dholland Exp $	*/
+/*	$NetBSD: smb_dev.c,v 1.42.8.1 2017/08/12 04:33:26 snj Exp $	*/
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.42 2014/07/25 08:10:40 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.42.8.1 2017/08/12 04:33:26 snj Exp $");
 
 #include 
 #include 
@@ -344,6 +344,8 @@ nsmb_dev_ioctl(dev_t dev, u_long cmd, vo
 		struct uio auio;
 		struct iovec iov;
 
+		if (rwrq->ioc_cnt < 0 || rwrq->ioc_offset < 0)
+			return EINVAL;
 		if ((ssp = sdp->sd_share) == NULL)
 			return ENOTCONN;
 		iov.iov_base = rwrq->ioc_base;

Index: src/sys/netsmb/smb_subr.c
diff -u src/sys/netsmb/smb_subr.c:1.36.28.1 src/sys/netsmb/smb_subr.c:1.36.28.1.6.1
--- src/sys/netsmb/smb_subr.c:1.36.28.1	Mon Dec  1 09:31:40 2014
+++ src/sys/netsmb/smb_subr.c	Sat Aug 12 04:33:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_subr.c,v 1.36.28.1 2014/12/01 09:31:40 martin Exp $	*/
+/*	$NetBSD: smb_subr.c,v 1.36.28.1.6.1 2017/08/12 04:33:26 snj Exp $	*/
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smb_subr.c,v 1.36.28.1 2014/12/01 09:31:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_subr.c,v 1.36.28.1.6.1 2017/08/12 04:33:26 snj Exp $");
 
 #include 
 #include 
@@ -380,3 +380,32 @@ dup_sockaddr(struct sockaddr *sa, int ca
 		memcpy(sa2, sa, sa->sa_len);
 	return sa2;
 }
+
+int
+dup_sockaddr_copyin(struct sockaddr **ksap, struct sockaddr *usa,
+size_t usalen)
+{
+	struct sockaddr *ksa;
+
+	/* Make sure user provided enough data for a generic sockaddr.  */
+	if (usalen < sizeof(*ksa))
+		return EINVAL;
+
+	/* Don't let the user overfeed us.  */
+	usalen = MIN(usalen, sizeof(struct sockaddr_storage));
+
+	/* Copy the buffer in from userland.  */
+	ksa = smb_memdupin(usa, usalen);
+	if (ksa == NULL)
+		return ENOMEM;
+
+	/* Make sure the user's idea of sa_len is reasonable.  */
+	if (ksa->sa_len > usalen) {
+		smb_memfree(ksa);
+		return EINVAL;
+	}
+
+	/* Success!  */
+	*ksap = ksa;
+	return 0;
+}

Index: src/sys/netsmb/smb_subr.h
diff -u src/sys/netsmb/smb_subr.h:1.21 src/sys/netsmb/smb_subr.h:1.21.26.1
--- src/sys/netsmb/smb_subr.h:1.21	Tue Mar 13 18:41:01 2012
+++ src/sys/netsmb/smb_subr.h	Sat Aug 12 04:33:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_subr.h,v 1.21 2012/03/13 18:41:01 elad Exp $	*/
+/*	$NetBSD: smb_subr.h,v 1.21.26.1 2017/08/12 04:33:26 snj Exp $	*/
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -128,5 +128,6 @@ int  smb_put_asunistring(struct smb_rq *
 #endif
 
 struct sockaddr *dup_sockaddr(struct sockaddr *, int);
+int dup_sockaddr_copyin(struct sockaddr **, struct sockaddr *, size_t);
 
 #endif /* !_NETSMB_SMB_SUBR_H_ */

Index: src/sys/netsmb/smb_usr.c
diff -u src/sys/netsmb/smb_usr.c:1.16 src/sys/netsmb/smb_usr.c:1.16.50.1
--- src/sys/netsmb/smb_usr.c:1.16	Wed Mar 18 16:00:24 2009
+++ src/sys/netsmb/smb_usr.c	Sat Aug 12 04:33:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: smb_usr.c,v 1.16 2009/03/18 16:00:24 cegger Exp $	*/
+/*	$NetBSD: smb_usr.c,v 1.16.50.1 2017/08/12 04:33:26 snj Exp $	*/
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smb_usr.c,v 1.16 2009/03/18 16:00:24 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_usr.c,v 1.16.50.1 2017/08/12 04:33:26 snj Exp $");
 
 #include 
 #include 
@@ -65,6 +65,7 

CVS commit: [netbsd-7-1] src/sys/altq

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:44:48 UTC 2017

Modified Files:
src/sys/altq [netbsd-7-1]: altq_cbq.c altq_hfsc.c altq_jobs.c
altq_priq.c altq_wfq.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1485):
sys/altq/altq_cbq.c: revision 1.31
sys/altq/altq_hfsc.c: revision 1.27
sys/altq/altq_priq.c: revision 1.24
sys/altq/altq_jobs.c: revision 1.11
sys/altq/altq_wfq.c: revision 1.22
Zero buffers copied to userland to avoid stack disclosure.
>From Ilja Van Sprundel.
--
Reject negative indices.
(Would be nice to change the types too, and it's *probably* safe to
replace int by u_int, but I'm reluctant to touch the ioctl
definitions without at least a modicum more thought.  Also one of
them is a u_long, because why not?)
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.27.10.1 src/sys/altq/altq_cbq.c
cvs rdiff -u -r1.24 -r1.24.66.1 src/sys/altq/altq_hfsc.c
cvs rdiff -u -r1.6.34.1 -r1.6.34.1.6.1 src/sys/altq/altq_jobs.c
cvs rdiff -u -r1.21 -r1.21.46.1 src/sys/altq/altq_priq.c
cvs rdiff -u -r1.20 -r1.20.12.1 src/sys/altq/altq_wfq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/altq/altq_cbq.c
diff -u src/sys/altq/altq_cbq.c:1.27 src/sys/altq/altq_cbq.c:1.27.10.1
--- src/sys/altq/altq_cbq.c:1.27	Thu Mar 20 20:51:54 2014
+++ src/sys/altq/altq_cbq.c	Sat Aug 12 04:44:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_cbq.c,v 1.27 2014/03/20 20:51:54 christos Exp $	*/
+/*	$NetBSD: altq_cbq.c,v 1.27.10.1 2017/08/12 04:44:48 snj Exp $	*/
 /*	$KAME: altq_cbq.c,v 1.21 2005/04/13 03:44:24 suz Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.27 2014/03/20 20:51:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.27.10.1 2017/08/12 04:44:48 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq.h"
@@ -472,6 +472,7 @@ cbq_getqstats(struct pf_altq *a, void *u
 	if (*nbytes < sizeof(stats))
 		return (EINVAL);
 
+	memset(&stats, 0, sizeof(stats));
 	get_class_stats(&stats, cl);
 
 	if ((error = copyout((void *)&stats, ubuf, sizeof(stats))) != 0)
@@ -876,6 +877,7 @@ cbq_getstats(struct cbq_getstats *gsp)
 			if (++i >= CBQ_MAX_CLASSES)
 goto out;
 
+		memset(&stats, 0, sizeof(stats));
 		get_class_stats(&stats, cl);
 		stats.handle = cl->stats_.handle;
 

Index: src/sys/altq/altq_hfsc.c
diff -u src/sys/altq/altq_hfsc.c:1.24 src/sys/altq/altq_hfsc.c:1.24.66.1
--- src/sys/altq/altq_hfsc.c:1.24	Wed Jun 18 09:06:27 2008
+++ src/sys/altq/altq_hfsc.c	Sat Aug 12 04:44:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_hfsc.c,v 1.24 2008/06/18 09:06:27 yamt Exp $	*/
+/*	$NetBSD: altq_hfsc.c,v 1.24.66.1 2017/08/12 04:44:48 snj Exp $	*/
 /*	$KAME: altq_hfsc.c,v 1.26 2005/04/13 03:44:24 suz Exp $	*/
 
 /*
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.24 2008/06/18 09:06:27 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.24.66.1 2017/08/12 04:44:48 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq.h"
@@ -313,6 +313,7 @@ hfsc_getqstats(struct pf_altq *a, void *
 	if (*nbytes < sizeof(stats))
 		return (EINVAL);
 
+	memset(&stats, 0, sizeof(stats));
 	get_class_stats(&stats, cl);
 
 	if ((error = copyout((void *)&stats, ubuf, sizeof(stats))) != 0)

Index: src/sys/altq/altq_jobs.c
diff -u src/sys/altq/altq_jobs.c:1.6.34.1 src/sys/altq/altq_jobs.c:1.6.34.1.6.1
--- src/sys/altq/altq_jobs.c:1.6.34.1	Fri Aug 22 10:15:22 2014
+++ src/sys/altq/altq_jobs.c	Sat Aug 12 04:44:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_jobs.c,v 1.6.34.1 2014/08/22 10:15:22 martin Exp $	*/
+/*	$NetBSD: altq_jobs.c,v 1.6.34.1.6.1 2017/08/12 04:44:48 snj Exp $	*/
 /*	$KAME: altq_jobs.c,v 1.11 2005/04/13 03:44:25 suz Exp $	*/
 /*
  * Copyright (c) 2001, the Rector and Board of Visitors of the
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: altq_jobs.c,v 1.6.34.1 2014/08/22 10:15:22 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_jobs.c,v 1.6.34.1.6.1 2017/08/12 04:44:48 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq.h"
@@ -2111,10 +2111,9 @@ jobscmd_class_stats(struct jobs_class_st
 	usp = ap->stats;
 	for (pri = 0; pri <= jif->jif_maxpri; pri++) {
 		cl = jif->jif_classes[pri];
+		(void)memset(&stats, 0, sizeof(stats));
 		if (cl != NULL)
 			get_class_stats(&stats, cl);
-		else
-			(void)memset(&stats, 0, sizeof(stats));
 		if ((error = copyout((void *)&stats, (void *)usp++,
  sizeof(stats))) != 0)
 			return (error);

Index: src/sys/altq/altq_priq.c
diff -u src/sys/altq/altq_priq.c:1.21 src/sys/altq/altq_priq.c:1.21.46.1
--- src/sys/altq/altq_priq.c:1.21	Sat Mar 14 15:35:58 2009
+++ src/sys/altq/altq_priq.c	Sat Aug 12 04:44:48 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_priq.c,v 1.21 2009/03/14 15:35:58 dsl Exp $	*/
+/*	$NetBSD: altq_priq.c,v 1.21.46.1 2017/08/12 04:44:48 snj Exp $	*/
 /*	$KAME: al

CVS commit: [netbsd-7-0] src/sys/altq

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:44:32 UTC 2017

Modified Files:
src/sys/altq [netbsd-7-0]: altq_cbq.c altq_hfsc.c altq_jobs.c
altq_priq.c altq_wfq.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1485):
sys/altq/altq_cbq.c: revision 1.31
sys/altq/altq_hfsc.c: revision 1.27
sys/altq/altq_priq.c: revision 1.24
sys/altq/altq_jobs.c: revision 1.11
sys/altq/altq_wfq.c: revision 1.22
Zero buffers copied to userland to avoid stack disclosure.
>From Ilja Van Sprundel.
--
Reject negative indices.
(Would be nice to change the types too, and it's *probably* safe to
replace int by u_int, but I'm reluctant to touch the ioctl
definitions without at least a modicum more thought.  Also one of
them is a u_long, because why not?)
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.27.6.1 src/sys/altq/altq_cbq.c
cvs rdiff -u -r1.24 -r1.24.62.1 src/sys/altq/altq_hfsc.c
cvs rdiff -u -r1.6.34.1 -r1.6.34.1.2.1 src/sys/altq/altq_jobs.c
cvs rdiff -u -r1.21 -r1.21.42.1 src/sys/altq/altq_priq.c
cvs rdiff -u -r1.20 -r1.20.8.1 src/sys/altq/altq_wfq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/altq/altq_cbq.c
diff -u src/sys/altq/altq_cbq.c:1.27 src/sys/altq/altq_cbq.c:1.27.6.1
--- src/sys/altq/altq_cbq.c:1.27	Thu Mar 20 20:51:54 2014
+++ src/sys/altq/altq_cbq.c	Sat Aug 12 04:44:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_cbq.c,v 1.27 2014/03/20 20:51:54 christos Exp $	*/
+/*	$NetBSD: altq_cbq.c,v 1.27.6.1 2017/08/12 04:44:32 snj Exp $	*/
 /*	$KAME: altq_cbq.c,v 1.21 2005/04/13 03:44:24 suz Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.27 2014/03/20 20:51:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.27.6.1 2017/08/12 04:44:32 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq.h"
@@ -472,6 +472,7 @@ cbq_getqstats(struct pf_altq *a, void *u
 	if (*nbytes < sizeof(stats))
 		return (EINVAL);
 
+	memset(&stats, 0, sizeof(stats));
 	get_class_stats(&stats, cl);
 
 	if ((error = copyout((void *)&stats, ubuf, sizeof(stats))) != 0)
@@ -876,6 +877,7 @@ cbq_getstats(struct cbq_getstats *gsp)
 			if (++i >= CBQ_MAX_CLASSES)
 goto out;
 
+		memset(&stats, 0, sizeof(stats));
 		get_class_stats(&stats, cl);
 		stats.handle = cl->stats_.handle;
 

Index: src/sys/altq/altq_hfsc.c
diff -u src/sys/altq/altq_hfsc.c:1.24 src/sys/altq/altq_hfsc.c:1.24.62.1
--- src/sys/altq/altq_hfsc.c:1.24	Wed Jun 18 09:06:27 2008
+++ src/sys/altq/altq_hfsc.c	Sat Aug 12 04:44:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_hfsc.c,v 1.24 2008/06/18 09:06:27 yamt Exp $	*/
+/*	$NetBSD: altq_hfsc.c,v 1.24.62.1 2017/08/12 04:44:32 snj Exp $	*/
 /*	$KAME: altq_hfsc.c,v 1.26 2005/04/13 03:44:24 suz Exp $	*/
 
 /*
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.24 2008/06/18 09:06:27 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.24.62.1 2017/08/12 04:44:32 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq.h"
@@ -313,6 +313,7 @@ hfsc_getqstats(struct pf_altq *a, void *
 	if (*nbytes < sizeof(stats))
 		return (EINVAL);
 
+	memset(&stats, 0, sizeof(stats));
 	get_class_stats(&stats, cl);
 
 	if ((error = copyout((void *)&stats, ubuf, sizeof(stats))) != 0)

Index: src/sys/altq/altq_jobs.c
diff -u src/sys/altq/altq_jobs.c:1.6.34.1 src/sys/altq/altq_jobs.c:1.6.34.1.2.1
--- src/sys/altq/altq_jobs.c:1.6.34.1	Fri Aug 22 10:15:22 2014
+++ src/sys/altq/altq_jobs.c	Sat Aug 12 04:44:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_jobs.c,v 1.6.34.1 2014/08/22 10:15:22 martin Exp $	*/
+/*	$NetBSD: altq_jobs.c,v 1.6.34.1.2.1 2017/08/12 04:44:32 snj Exp $	*/
 /*	$KAME: altq_jobs.c,v 1.11 2005/04/13 03:44:25 suz Exp $	*/
 /*
  * Copyright (c) 2001, the Rector and Board of Visitors of the
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: altq_jobs.c,v 1.6.34.1 2014/08/22 10:15:22 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_jobs.c,v 1.6.34.1.2.1 2017/08/12 04:44:32 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq.h"
@@ -2111,10 +2111,9 @@ jobscmd_class_stats(struct jobs_class_st
 	usp = ap->stats;
 	for (pri = 0; pri <= jif->jif_maxpri; pri++) {
 		cl = jif->jif_classes[pri];
+		(void)memset(&stats, 0, sizeof(stats));
 		if (cl != NULL)
 			get_class_stats(&stats, cl);
-		else
-			(void)memset(&stats, 0, sizeof(stats));
 		if ((error = copyout((void *)&stats, (void *)usp++,
  sizeof(stats))) != 0)
 			return (error);

Index: src/sys/altq/altq_priq.c
diff -u src/sys/altq/altq_priq.c:1.21 src/sys/altq/altq_priq.c:1.21.42.1
--- src/sys/altq/altq_priq.c:1.21	Sat Mar 14 15:35:58 2009
+++ src/sys/altq/altq_priq.c	Sat Aug 12 04:44:32 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_priq.c,v 1.21 2009/03/14 15:35:58 dsl Exp $	*/
+/*	$NetBSD: altq_priq.c,v 1.21.42.1 2017/08/12 04:44:32 snj Exp $	*/
 /*	$KAME: altq_pr

CVS commit: [netbsd-7] src/sys/altq

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:45:02 UTC 2017

Modified Files:
src/sys/altq [netbsd-7]: altq_cbq.c altq_hfsc.c altq_jobs.c altq_priq.c
altq_wfq.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1485):
sys/altq/altq_cbq.c: revision 1.31
sys/altq/altq_hfsc.c: revision 1.27
sys/altq/altq_priq.c: revision 1.24
sys/altq/altq_jobs.c: revision 1.11
sys/altq/altq_wfq.c: revision 1.22
Zero buffers copied to userland to avoid stack disclosure.
>From Ilja Van Sprundel.
--
Reject negative indices.
(Would be nice to change the types too, and it's *probably* safe to
replace int by u_int, but I'm reluctant to touch the ioctl
definitions without at least a modicum more thought.  Also one of
them is a u_long, because why not?)
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.27.4.1 src/sys/altq/altq_cbq.c
cvs rdiff -u -r1.24 -r1.24.58.1 src/sys/altq/altq_hfsc.c
cvs rdiff -u -r1.6.34.1 -r1.6.34.2 src/sys/altq/altq_jobs.c
cvs rdiff -u -r1.21 -r1.21.38.1 src/sys/altq/altq_priq.c
cvs rdiff -u -r1.20 -r1.20.4.1 src/sys/altq/altq_wfq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/altq/altq_cbq.c
diff -u src/sys/altq/altq_cbq.c:1.27 src/sys/altq/altq_cbq.c:1.27.4.1
--- src/sys/altq/altq_cbq.c:1.27	Thu Mar 20 20:51:54 2014
+++ src/sys/altq/altq_cbq.c	Sat Aug 12 04:45:02 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_cbq.c,v 1.27 2014/03/20 20:51:54 christos Exp $	*/
+/*	$NetBSD: altq_cbq.c,v 1.27.4.1 2017/08/12 04:45:02 snj Exp $	*/
 /*	$KAME: altq_cbq.c,v 1.21 2005/04/13 03:44:24 suz Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.27 2014/03/20 20:51:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_cbq.c,v 1.27.4.1 2017/08/12 04:45:02 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq.h"
@@ -472,6 +472,7 @@ cbq_getqstats(struct pf_altq *a, void *u
 	if (*nbytes < sizeof(stats))
 		return (EINVAL);
 
+	memset(&stats, 0, sizeof(stats));
 	get_class_stats(&stats, cl);
 
 	if ((error = copyout((void *)&stats, ubuf, sizeof(stats))) != 0)
@@ -876,6 +877,7 @@ cbq_getstats(struct cbq_getstats *gsp)
 			if (++i >= CBQ_MAX_CLASSES)
 goto out;
 
+		memset(&stats, 0, sizeof(stats));
 		get_class_stats(&stats, cl);
 		stats.handle = cl->stats_.handle;
 

Index: src/sys/altq/altq_hfsc.c
diff -u src/sys/altq/altq_hfsc.c:1.24 src/sys/altq/altq_hfsc.c:1.24.58.1
--- src/sys/altq/altq_hfsc.c:1.24	Wed Jun 18 09:06:27 2008
+++ src/sys/altq/altq_hfsc.c	Sat Aug 12 04:45:02 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_hfsc.c,v 1.24 2008/06/18 09:06:27 yamt Exp $	*/
+/*	$NetBSD: altq_hfsc.c,v 1.24.58.1 2017/08/12 04:45:02 snj Exp $	*/
 /*	$KAME: altq_hfsc.c,v 1.26 2005/04/13 03:44:24 suz Exp $	*/
 
 /*
@@ -43,7 +43,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.24 2008/06/18 09:06:27 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_hfsc.c,v 1.24.58.1 2017/08/12 04:45:02 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq.h"
@@ -313,6 +313,7 @@ hfsc_getqstats(struct pf_altq *a, void *
 	if (*nbytes < sizeof(stats))
 		return (EINVAL);
 
+	memset(&stats, 0, sizeof(stats));
 	get_class_stats(&stats, cl);
 
 	if ((error = copyout((void *)&stats, ubuf, sizeof(stats))) != 0)

Index: src/sys/altq/altq_jobs.c
diff -u src/sys/altq/altq_jobs.c:1.6.34.1 src/sys/altq/altq_jobs.c:1.6.34.2
--- src/sys/altq/altq_jobs.c:1.6.34.1	Fri Aug 22 10:15:22 2014
+++ src/sys/altq/altq_jobs.c	Sat Aug 12 04:45:02 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_jobs.c,v 1.6.34.1 2014/08/22 10:15:22 martin Exp $	*/
+/*	$NetBSD: altq_jobs.c,v 1.6.34.2 2017/08/12 04:45:02 snj Exp $	*/
 /*	$KAME: altq_jobs.c,v 1.11 2005/04/13 03:44:25 suz Exp $	*/
 /*
  * Copyright (c) 2001, the Rector and Board of Visitors of the
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: altq_jobs.c,v 1.6.34.1 2014/08/22 10:15:22 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: altq_jobs.c,v 1.6.34.2 2017/08/12 04:45:02 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altq.h"
@@ -2111,10 +2111,9 @@ jobscmd_class_stats(struct jobs_class_st
 	usp = ap->stats;
 	for (pri = 0; pri <= jif->jif_maxpri; pri++) {
 		cl = jif->jif_classes[pri];
+		(void)memset(&stats, 0, sizeof(stats));
 		if (cl != NULL)
 			get_class_stats(&stats, cl);
-		else
-			(void)memset(&stats, 0, sizeof(stats));
 		if ((error = copyout((void *)&stats, (void *)usp++,
  sizeof(stats))) != 0)
 			return (error);

Index: src/sys/altq/altq_priq.c
diff -u src/sys/altq/altq_priq.c:1.21 src/sys/altq/altq_priq.c:1.21.38.1
--- src/sys/altq/altq_priq.c:1.21	Sat Mar 14 15:35:58 2009
+++ src/sys/altq/altq_priq.c	Sat Aug 12 04:45:02 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_priq.c,v 1.21 2009/03/14 15:35:58 dsl Exp $	*/
+/*	$NetBSD: altq_priq.c,v 1.21.38.1 2017/08/12 04:45:02 snj Exp $	*/
 /*	$KAME: altq_priq.c,v 1.13 2005/0

CVS commit: [netbsd-7] src/sys/compat/linux/common

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:50:31 UTC 2017

Modified Files:
src/sys/compat/linux/common [netbsd-7]: linux_time.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1486):
sys/compat/linux/common/linux_time.c: revision 1.38-1.39 via patch
Only let the superuser set the compat_linux timezone.
Not really keen to invent a new kauth cookie for this useless purpose.
>From Ilja Van Sprundel.
--
Put suser check in the right function: settimeofday, not gettimeofday.
While here, remove wrong comment.
Noted by kre@.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.4.1 src/sys/compat/linux/common/linux_time.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_time.c
diff -u src/sys/compat/linux/common/linux_time.c:1.37 src/sys/compat/linux/common/linux_time.c:1.37.4.1
--- src/sys/compat/linux/common/linux_time.c:1.37	Mon Jan 13 10:33:03 2014
+++ src/sys/compat/linux/common/linux_time.c	Sat Aug 12 04:50:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_time.c,v 1.37 2014/01/13 10:33:03 njoly Exp $ */
+/*	$NetBSD: linux_time.c,v 1.37.4.1 2017/08/12 04:50:31 snj Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.37 2014/01/13 10:33:03 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.37.4.1 2017/08/12 04:50:31 snj Exp $");
 
 #include 
 #include 
@@ -102,11 +102,10 @@ linux_sys_settimeofday(struct lwp *l, co
 			return (error);
 	}
 
-	/*
-	 * If user is not the superuser, we returned
-	 * after the sys_settimeofday() call.
-	 */
 	if (SCARG(uap, tzp)) {
+		if (kauth_authorize_generic(kauth_cred_get(),
+			KAUTH_GENERIC_ISSUSER, NULL) != 0)
+			return (EPERM);
 		error = copyin(SCARG(uap, tzp), &linux_sys_tz, sizeof(linux_sys_tz));
 		if (error)
 			return (error);



CVS commit: [netbsd-7-1] src/sys/compat/linux/common

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:50:11 UTC 2017

Modified Files:
src/sys/compat/linux/common [netbsd-7-1]: linux_time.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1486):
sys/compat/linux/common/linux_time.c: revision 1.38-1.39 via patch
Only let the superuser set the compat_linux timezone.
Not really keen to invent a new kauth cookie for this useless purpose.
>From Ilja Van Sprundel.
--
Put suser check in the right function: settimeofday, not gettimeofday.
While here, remove wrong comment.
Noted by kre@.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.16.1 src/sys/compat/linux/common/linux_time.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_time.c
diff -u src/sys/compat/linux/common/linux_time.c:1.37 src/sys/compat/linux/common/linux_time.c:1.37.16.1
--- src/sys/compat/linux/common/linux_time.c:1.37	Mon Jan 13 10:33:03 2014
+++ src/sys/compat/linux/common/linux_time.c	Sat Aug 12 04:50:11 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_time.c,v 1.37 2014/01/13 10:33:03 njoly Exp $ */
+/*	$NetBSD: linux_time.c,v 1.37.16.1 2017/08/12 04:50:11 snj Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.37 2014/01/13 10:33:03 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.37.16.1 2017/08/12 04:50:11 snj Exp $");
 
 #include 
 #include 
@@ -102,11 +102,10 @@ linux_sys_settimeofday(struct lwp *l, co
 			return (error);
 	}
 
-	/*
-	 * If user is not the superuser, we returned
-	 * after the sys_settimeofday() call.
-	 */
 	if (SCARG(uap, tzp)) {
+		if (kauth_authorize_generic(kauth_cred_get(),
+			KAUTH_GENERIC_ISSUSER, NULL) != 0)
+			return (EPERM);
 		error = copyin(SCARG(uap, tzp), &linux_sys_tz, sizeof(linux_sys_tz));
 		if (error)
 			return (error);



CVS commit: [netbsd-7-0] src/sys/compat/linux/common

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:49:52 UTC 2017

Modified Files:
src/sys/compat/linux/common [netbsd-7-0]: linux_time.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1486):
sys/compat/linux/common/linux_time.c: revision 1.38-1.39 via patch
Only let the superuser set the compat_linux timezone.
Not really keen to invent a new kauth cookie for this useless purpose.
>From Ilja Van Sprundel.
--
Put suser check in the right function: settimeofday, not gettimeofday.
While here, remove wrong comment.
Noted by kre@.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.8.1 src/sys/compat/linux/common/linux_time.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/common/linux_time.c
diff -u src/sys/compat/linux/common/linux_time.c:1.37 src/sys/compat/linux/common/linux_time.c:1.37.8.1
--- src/sys/compat/linux/common/linux_time.c:1.37	Mon Jan 13 10:33:03 2014
+++ src/sys/compat/linux/common/linux_time.c	Sat Aug 12 04:49:52 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_time.c,v 1.37 2014/01/13 10:33:03 njoly Exp $ */
+/*	$NetBSD: linux_time.c,v 1.37.8.1 2017/08/12 04:49:52 snj Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.37 2014/01/13 10:33:03 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_time.c,v 1.37.8.1 2017/08/12 04:49:52 snj Exp $");
 
 #include 
 #include 
@@ -102,11 +102,10 @@ linux_sys_settimeofday(struct lwp *l, co
 			return (error);
 	}
 
-	/*
-	 * If user is not the superuser, we returned
-	 * after the sys_settimeofday() call.
-	 */
 	if (SCARG(uap, tzp)) {
+		if (kauth_authorize_generic(kauth_cred_get(),
+			KAUTH_GENERIC_ISSUSER, NULL) != 0)
+			return (EPERM);
 		error = copyin(SCARG(uap, tzp), &linux_sys_tz, sizeof(linux_sys_tz));
 		if (error)
 			return (error);



CVS commit: [netbsd-7-0] src/doc

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 04:57:21 UTC 2017

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
tickets 1469-1475, 1477-1479, 1482-1486


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.52 -r1.1.2.53 src/doc/CHANGES-7.0.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.52 src/doc/CHANGES-7.0.3:1.1.2.53
--- src/doc/CHANGES-7.0.3:1.1.2.52	Fri Aug 11 15:32:14 2017
+++ src/doc/CHANGES-7.0.3	Sat Aug 12 04:57:21 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.52 2017/08/11 15:32:14 snj Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.53 2017/08/12 04:57:21 snj Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -3058,3 +3058,118 @@ sys/arch/mac68k/nubus/if_netdock_nubus.c
 	memory leak in netdock_get()
 	[mrg, ticket #1468]
 
+sys/dev/pci/if_ipw.c1.65
+
+	double free in ipw_dma_alloc()
+	[mrg, ticket #1469]
+
+sys/dev/pci/if_et.c1.15
+
+	missing mbuf cluster allocation error checking in et_newbuf()
+	[mrg, ticket #1470]
+
+sys/dev/ic/i82596.c1.37
+
+	potential double free in iee_init()/iee_stop()
+	[mrg, ticket #1471]
+
+sys/dev/ic/dp83932.c1.41
+
+	memory leak in sonic_rxintr()
+	[mrg, ticket #1472]
+
+sys/dev/ic/dm9000.c1.12
+
+	missing mbuf cluster allocation error checking in
+	dme_alloc_receive_buffer()
+	[mrg, ticket #1473]
+
+sys/dev/ic/bwi.c1.32
+
+	wrong error checking in bwi_newbuf() can cause an mbuf to
+	declare an mbuf length that is too big
+	[mrg, ticket #1474]
+
+sys/compat/svr4/svr4_lwp.c			1.20
+sys/compat/svr4/svr4_signal.c			1.67
+sys/compat/svr4/svr4_stream.c			1.89-1.91 via patch
+sys/compat/svr4_32/svr4_32_signal.c		1.29
+
+	Fix some of the multitudinous holes in svr4 streams.
+	Zero stack data before copyout.
+	Fix indexing of svr4 signals.
+	Attempt to get reference counting less bad.
+	Check bounds in svr4_sys_putmsg. Check more svr4_strmcmd bounds.
+	[mrg, ticket #1475]
+
+sys/compat/ibcs2/ibcs2_exec_coff.c		1.27-1.29
+sys/compat/ibcs2/ibcs2_ioctl.c			1.46
+sys/compat/ibcs2/ibcs2_stat.c			1.49-1.50
+
+	Out of bound read and endless loop in exec_ibcs2_coff_prep_zmagic().
+	Infoleak in ibcs2_sys_ioctl.
+	Potenial use of expired pointers in ibcs2_sys_statfs()/
+	ibcs2_sys_statvfs()
+	[mrg, ticket #1477]
+
+sys/kern/vfs_getcwd.c1.52
+
+	out of bound read in getcwd_scandir()
+	[mrg, ticket #1478]
+
+sys/compat/common/vfs_syscalls_12.c		1.34
+sys/compat/common/vfs_syscalls_43.c		1.60
+sys/compat/ibcs2/ibcs2_misc.c			1.114
+sys/compat/linux/common/linux_file64.c		1.59
+sys/compat/linux/common/linux_misc.c		1.239
+sys/compat/linux32/common/linux32_dirent.c	1.18
+sys/compat/osf1/osf1_file.c			1.44
+sys/compat/sunos/sunos_misc.c			1.171
+sys/compat/sunos32/sunos32_misc.c		1.78
+sys/compat/svr4/svr4_misc.c			1.158
+sys/compat/svr4_32/svr4_32_misc.c		1.78
+sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c 1.2
+
+	puffs userland can trigger panic in compat getdents
+	[mrg, ticket #1479]
+
+sys/dev/ic/isp_netbsd.c1.89
+
+	unvalidated channel index in ISP_FC_GETDLIST case of
+	ispioctl() can cause out of bound read
+	[mrg, ticket #1482]
+
+sys/dev/ic/ciss.c1.37
+
+	out of bound read in ciss_ioctl_vol()
+	signedness bug in ciss_ioctl()
+	[mrg, ticket #1483]
+
+sys/netsmb/smb_dev.c1.50
+sys/netsmb/smb_subr.c1.38
+sys/netsmb/smb_subr.h1.22
+sys/netsmb/smb_usr.c1.17-1.19
+
+	netsmb:
+	- no length validation in smb_usr_vc2spec() can cause out
+	  of bound read.
+	- signedness bug in smb_usr_t2request() can cause out of
+	  bound read
+	[mrg, ticket #1484]
+
+sys/altq/altq_cbq.c1.31
+sys/altq/altq_hfsc.c1.27
+sys/altq/altq_jobs.c1.11
+sys/altq/altq_priq.c1.24
+sys/altq/altq_wfq.c1.22
+
+	ALTQ:
+	- info leak in get_class_stats()
+	- signedness bug in wfq_getstats()
+	[mrg, ticket #1485]
+
+sys/compat/linux/common/linux_time.c		1.38-1.39 via patch
+
+	missing cred check in linux_sys_settimeofday()
+	[mrg, ticket #1486]
+



CVS commit: [netbsd-7-1] src/doc

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 05:01:54 UTC 2017

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.1

Log Message:
1469-1475, 1477-1479, 1482-1486


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.21 -r1.1.2.22 src/doc/CHANGES-7.1.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-7.1.1
diff -u src/doc/CHANGES-7.1.1:1.1.2.21 src/doc/CHANGES-7.1.1:1.1.2.22
--- src/doc/CHANGES-7.1.1:1.1.2.21	Fri Aug 11 15:32:45 2017
+++ src/doc/CHANGES-7.1.1	Sat Aug 12 05:01:54 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.1,v 1.1.2.21 2017/08/11 15:32:45 snj Exp $
+# $NetBSD: CHANGES-7.1.1,v 1.1.2.22 2017/08/12 05:01:54 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.1.1
 release:
@@ -1768,3 +1768,118 @@ sys/arch/mac68k/nubus/if_netdock_nubus.c
 	memory leak in netdock_get()
 	[mrg, ticket #1468]
 
+sys/dev/pci/if_ipw.c1.65
+
+	double free in ipw_dma_alloc()
+	[mrg, ticket #1469]
+
+sys/dev/pci/if_et.c1.15
+
+	missing mbuf cluster allocation error checking in et_newbuf()
+	[mrg, ticket #1470]
+
+sys/dev/ic/i82596.c1.37
+
+	potential double free in iee_init()/iee_stop()
+	[mrg, ticket #1471]
+
+sys/dev/ic/dp83932.c1.41
+
+	memory leak in sonic_rxintr()
+	[mrg, ticket #1472]
+
+sys/dev/ic/dm9000.c1.12
+
+	missing mbuf cluster allocation error checking in
+	dme_alloc_receive_buffer()
+	[mrg, ticket #1473]
+
+sys/dev/ic/bwi.c1.32
+
+	wrong error checking in bwi_newbuf() can cause an mbuf to
+	declare an mbuf length that is too big
+	[mrg, ticket #1474]
+
+sys/compat/svr4/svr4_lwp.c			1.20
+sys/compat/svr4/svr4_signal.c			1.67
+sys/compat/svr4/svr4_stream.c			1.89-1.91 via patch
+sys/compat/svr4_32/svr4_32_signal.c		1.29
+
+	Fix some of the multitudinous holes in svr4 streams.
+	Zero stack data before copyout.
+	Fix indexing of svr4 signals.
+	Attempt to get reference counting less bad.
+	Check bounds in svr4_sys_putmsg. Check more svr4_strmcmd bounds.
+	[mrg, ticket #1475]
+
+sys/compat/ibcs2/ibcs2_exec_coff.c		1.27-1.29
+sys/compat/ibcs2/ibcs2_ioctl.c			1.46
+sys/compat/ibcs2/ibcs2_stat.c			1.49-1.50
+
+	Out of bound read and endless loop in exec_ibcs2_coff_prep_zmagic().
+	Infoleak in ibcs2_sys_ioctl.
+	Potenial use of expired pointers in ibcs2_sys_statfs()/
+	ibcs2_sys_statvfs()
+	[mrg, ticket #1477]
+
+sys/kern/vfs_getcwd.c1.52
+
+	out of bound read in getcwd_scandir()
+	[mrg, ticket #1478]
+
+sys/compat/common/vfs_syscalls_12.c		1.34
+sys/compat/common/vfs_syscalls_43.c		1.60
+sys/compat/ibcs2/ibcs2_misc.c			1.114
+sys/compat/linux/common/linux_file64.c		1.59
+sys/compat/linux/common/linux_misc.c		1.239
+sys/compat/linux32/common/linux32_dirent.c	1.18
+sys/compat/osf1/osf1_file.c			1.44
+sys/compat/sunos/sunos_misc.c			1.171
+sys/compat/sunos32/sunos32_misc.c		1.78
+sys/compat/svr4/svr4_misc.c			1.158
+sys/compat/svr4_32/svr4_32_misc.c		1.78
+sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c 1.2
+
+	puffs userland can trigger panic in compat getdents
+	[mrg, ticket #1479]
+
+sys/dev/ic/isp_netbsd.c1.89
+
+	unvalidated channel index in ISP_FC_GETDLIST case of
+	ispioctl() can cause out of bound read
+	[mrg, ticket #1482]
+
+sys/dev/ic/ciss.c1.37
+
+	out of bound read in ciss_ioctl_vol()
+	signedness bug in ciss_ioctl()
+	[mrg, ticket #1483]
+
+sys/netsmb/smb_dev.c1.50
+sys/netsmb/smb_subr.c1.38
+sys/netsmb/smb_subr.h1.22
+sys/netsmb/smb_usr.c1.17-1.19
+
+	netsmb:
+	- no length validation in smb_usr_vc2spec() can cause out
+	  of bound read.
+	- signedness bug in smb_usr_t2request() can cause out of
+	  bound read
+	[mrg, ticket #1484]
+
+sys/altq/altq_cbq.c1.31
+sys/altq/altq_hfsc.c1.27
+sys/altq/altq_jobs.c1.11
+sys/altq/altq_priq.c1.24
+sys/altq/altq_wfq.c1.22
+
+	ALTQ:
+	- info leak in get_class_stats()
+	- signedness bug in wfq_getstats()
+	[mrg, ticket #1485]
+
+sys/compat/linux/common/linux_time.c		1.38-1.39 via patch
+
+	missing cred check in linux_sys_settimeofday()
+	[mrg, ticket #1486]
+



CVS commit: [netbsd-7] src/doc

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 05:07:31 UTC 2017

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
tickets 1469-1475, 1477-1479, 1482-1486


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.35 -r1.1.2.36 src/doc/CHANGES-7.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.35 src/doc/CHANGES-7.2:1.1.2.36
--- src/doc/CHANGES-7.2:1.1.2.35	Fri Aug 11 15:33:19 2017
+++ src/doc/CHANGES-7.2	Sat Aug 12 05:07:30 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.35 2017/08/11 15:33:19 snj Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.36 2017/08/12 05:07:30 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -2723,3 +2723,118 @@ sys/arch/mac68k/nubus/if_netdock_nubus.c
 	memory leak in netdock_get()
 	[mrg, ticket #1468]
 
+sys/dev/pci/if_ipw.c1.65
+
+	double free in ipw_dma_alloc()
+	[mrg, ticket #1469]
+
+sys/dev/pci/if_et.c1.15
+
+	missing mbuf cluster allocation error checking in et_newbuf()
+	[mrg, ticket #1470]
+
+sys/dev/ic/i82596.c1.37
+
+	potential double free in iee_init()/iee_stop()
+	[mrg, ticket #1471]
+
+sys/dev/ic/dp83932.c1.41
+
+	memory leak in sonic_rxintr()
+	[mrg, ticket #1472]
+
+sys/dev/ic/dm9000.c1.12
+
+	missing mbuf cluster allocation error checking in
+	dme_alloc_receive_buffer()
+	[mrg, ticket #1473]
+
+sys/dev/ic/bwi.c1.32
+
+	wrong error checking in bwi_newbuf() can cause an mbuf to
+	declare an mbuf length that is too big
+	[mrg, ticket #1474]
+
+sys/compat/svr4/svr4_lwp.c			1.20
+sys/compat/svr4/svr4_signal.c			1.67
+sys/compat/svr4/svr4_stream.c			1.89-1.91 via patch
+sys/compat/svr4_32/svr4_32_signal.c		1.29
+
+	Fix some of the multitudinous holes in svr4 streams.
+	Zero stack data before copyout.
+	Fix indexing of svr4 signals.
+	Attempt to get reference counting less bad.
+	Check bounds in svr4_sys_putmsg. Check more svr4_strmcmd bounds.
+	[mrg, ticket #1475]
+
+sys/compat/ibcs2/ibcs2_exec_coff.c		1.27-1.29
+sys/compat/ibcs2/ibcs2_ioctl.c			1.46
+sys/compat/ibcs2/ibcs2_stat.c			1.49-1.50
+
+	Out of bound read and endless loop in exec_ibcs2_coff_prep_zmagic().
+	Infoleak in ibcs2_sys_ioctl.
+	Potenial use of expired pointers in ibcs2_sys_statfs()/
+	ibcs2_sys_statvfs()
+	[mrg, ticket #1477]
+
+sys/kern/vfs_getcwd.c1.52
+
+	out of bound read in getcwd_scandir()
+	[mrg, ticket #1478]
+
+sys/compat/common/vfs_syscalls_12.c		1.34
+sys/compat/common/vfs_syscalls_43.c		1.60
+sys/compat/ibcs2/ibcs2_misc.c			1.114
+sys/compat/linux/common/linux_file64.c		1.59
+sys/compat/linux/common/linux_misc.c		1.239
+sys/compat/linux32/common/linux32_dirent.c	1.18
+sys/compat/osf1/osf1_file.c			1.44
+sys/compat/sunos/sunos_misc.c			1.171
+sys/compat/sunos32/sunos32_misc.c		1.78
+sys/compat/svr4/svr4_misc.c			1.158
+sys/compat/svr4_32/svr4_32_misc.c		1.78
+sys/rump/kern/lib/libsys_sunos/rump_sunos_compat.c 1.2
+
+	puffs userland can trigger panic in compat getdents
+	[mrg, ticket #1479]
+
+sys/dev/ic/isp_netbsd.c1.89
+
+	unvalidated channel index in ISP_FC_GETDLIST case of
+	ispioctl() can cause out of bound read
+	[mrg, ticket #1482]
+
+sys/dev/ic/ciss.c1.37
+
+	out of bound read in ciss_ioctl_vol()
+	signedness bug in ciss_ioctl()
+	[mrg, ticket #1483]
+
+sys/netsmb/smb_dev.c1.50
+sys/netsmb/smb_subr.c1.38
+sys/netsmb/smb_subr.h1.22
+sys/netsmb/smb_usr.c1.17-1.19
+
+	netsmb:
+	- no length validation in smb_usr_vc2spec() can cause out
+	  of bound read.
+	- signedness bug in smb_usr_t2request() can cause out of
+	  bound read
+	[mrg, ticket #1484]
+
+sys/altq/altq_cbq.c1.31
+sys/altq/altq_hfsc.c1.27
+sys/altq/altq_jobs.c1.11
+sys/altq/altq_priq.c1.24
+sys/altq/altq_wfq.c1.22
+
+	ALTQ:
+	- info leak in get_class_stats()
+	- signedness bug in wfq_getstats()
+	[mrg, ticket #1485]
+
+sys/compat/linux/common/linux_time.c		1.38-1.39 via patch
+
+	missing cred check in linux_sys_settimeofday()
+	[mrg, ticket #1486]
+



CVS commit: [netbsd-7-0] src

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 05:16:40 UTC 2017

Modified Files:
src/doc [netbsd-7-0]: 3RDPARTY
src/external/bsd/bind [netbsd-7-0]: Makefile.inc
src/external/bsd/bind/dist [netbsd-7-0]: CHANGES README srcid version
src/external/bsd/bind/dist/doc/arm [netbsd-7-0]: Bv9ARM.ch01.html
Bv9ARM.ch02.html Bv9ARM.ch03.html Bv9ARM.ch04.html Bv9ARM.ch05.html
Bv9ARM.ch06.html Bv9ARM.ch07.html Bv9ARM.ch08.html Bv9ARM.ch09.html
Bv9ARM.ch10.html Bv9ARM.ch11.html Bv9ARM.ch12.html Bv9ARM.ch13.html
Bv9ARM.html Bv9ARM.pdf man.arpaname.html man.ddns-confgen.html
man.delv.html man.dig.html man.dnssec-checkds.html
man.dnssec-coverage.html man.dnssec-dsfromkey.html
man.dnssec-importkey.html man.dnssec-keyfromlabel.html
man.dnssec-keygen.html man.dnssec-revoke.html
man.dnssec-settime.html man.dnssec-signzone.html
man.dnssec-verify.html man.genrandom.html man.host.html
man.isc-hmac-fixup.html man.lwresd.html man.named-checkconf.html
man.named-checkzone.html man.named-journalprint.html
man.named-rrchecker.html man.named.conf.html man.named.html
man.nsec3hash.html man.nsupdate.html man.rndc-confgen.html
man.rndc.conf.html man.rndc.html notes.html notes.pdf notes.xml
src/external/bsd/bind/dist/lib/dns [netbsd-7-0]: api dnssec.c message.c
rootns.c tsig.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1489):
doc/3RDPARTY: patch
external/bsd/bind/Makefile.inc: up to 1.26 via patch
external/bsd/bind/dist/CHANGES: up to 1.28
external/bsd/bind/dist/README: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch01.html: up to 1.1.1.26
external/bsd/bind/dist/doc/arm/Bv9ARM.ch02.html: up to 1.1.1.23
external/bsd/bind/dist/doc/arm/Bv9ARM.ch03.html: up to 1.1.1.28
external/bsd/bind/dist/doc/arm/Bv9ARM.ch04.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch05.html: up to 1.1.1.29
external/bsd/bind/dist/doc/arm/Bv9ARM.ch06.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch07.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch08.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch09.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch10.html: up to 1.1.1.25
external/bsd/bind/dist/doc/arm/Bv9ARM.ch11.html: up to 1.1.1.14
external/bsd/bind/dist/doc/arm/Bv9ARM.ch12.html: up to 1.1.1.14
external/bsd/bind/dist/doc/arm/Bv9ARM.ch13.html: up to 1.1.1.14
external/bsd/bind/dist/doc/arm/Bv9ARM.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.pdf: up to 1.21
external/bsd/bind/dist/doc/arm/man.arpaname.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.ddns-confgen.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.delv.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dig.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-checkds.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-coverage.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-dsfromkey.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-importkey.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-keyfromlabel.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-keygen.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-revoke.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-settime.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-signzone.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-verify.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.genrandom.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.host.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.isc-hmac-fixup.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.lwresd.html: up to 1.1.1.8
external/bsd/bind/dist/doc/arm/man.named-checkconf.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.named-checkzone.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.named-journalprint.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.named-rrchecker.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.named.conf.html: up to 1.1.1.8
external/bsd/bind/dist/doc/arm/man.named.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.nsec3hash.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.nsupdate.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.rndc-confgen.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.rndc.conf.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.rndc.html: up to 1.16
external/bsd/bind/dist/doc/arm/notes.html: up to 1.1.1.14
 

CVS commit: [netbsd-7-1] src

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 05:19:38 UTC 2017

Modified Files:
src/doc [netbsd-7-1]: 3RDPARTY
src/external/bsd/bind [netbsd-7-1]: Makefile.inc
src/external/bsd/bind/dist [netbsd-7-1]: CHANGES README srcid version
src/external/bsd/bind/dist/doc/arm [netbsd-7-1]: Bv9ARM.ch01.html
Bv9ARM.ch02.html Bv9ARM.ch03.html Bv9ARM.ch04.html Bv9ARM.ch05.html
Bv9ARM.ch06.html Bv9ARM.ch07.html Bv9ARM.ch08.html Bv9ARM.ch09.html
Bv9ARM.ch10.html Bv9ARM.ch11.html Bv9ARM.ch12.html Bv9ARM.ch13.html
Bv9ARM.html Bv9ARM.pdf man.arpaname.html man.ddns-confgen.html
man.delv.html man.dig.html man.dnssec-checkds.html
man.dnssec-coverage.html man.dnssec-dsfromkey.html
man.dnssec-importkey.html man.dnssec-keyfromlabel.html
man.dnssec-keygen.html man.dnssec-revoke.html
man.dnssec-settime.html man.dnssec-signzone.html
man.dnssec-verify.html man.genrandom.html man.host.html
man.isc-hmac-fixup.html man.lwresd.html man.named-checkconf.html
man.named-checkzone.html man.named-journalprint.html
man.named-rrchecker.html man.named.conf.html man.named.html
man.nsec3hash.html man.nsupdate.html man.rndc-confgen.html
man.rndc.conf.html man.rndc.html notes.html notes.pdf notes.xml
src/external/bsd/bind/dist/lib/dns [netbsd-7-1]: api dnssec.c message.c
rootns.c tsig.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1489):
doc/3RDPARTY: patch
external/bsd/bind/Makefile.inc: up to 1.26 via patch
external/bsd/bind/dist/CHANGES: up to 1.28
external/bsd/bind/dist/README: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch01.html: up to 1.1.1.26
external/bsd/bind/dist/doc/arm/Bv9ARM.ch02.html: up to 1.1.1.23
external/bsd/bind/dist/doc/arm/Bv9ARM.ch03.html: up to 1.1.1.28
external/bsd/bind/dist/doc/arm/Bv9ARM.ch04.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch05.html: up to 1.1.1.29
external/bsd/bind/dist/doc/arm/Bv9ARM.ch06.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch07.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch08.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch09.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch10.html: up to 1.1.1.25
external/bsd/bind/dist/doc/arm/Bv9ARM.ch11.html: up to 1.1.1.14
external/bsd/bind/dist/doc/arm/Bv9ARM.ch12.html: up to 1.1.1.14
external/bsd/bind/dist/doc/arm/Bv9ARM.ch13.html: up to 1.1.1.14
external/bsd/bind/dist/doc/arm/Bv9ARM.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.pdf: up to 1.21
external/bsd/bind/dist/doc/arm/man.arpaname.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.ddns-confgen.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.delv.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dig.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-checkds.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-coverage.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-dsfromkey.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-importkey.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-keyfromlabel.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-keygen.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-revoke.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-settime.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-signzone.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-verify.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.genrandom.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.host.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.isc-hmac-fixup.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.lwresd.html: up to 1.1.1.8
external/bsd/bind/dist/doc/arm/man.named-checkconf.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.named-checkzone.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.named-journalprint.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.named-rrchecker.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.named.conf.html: up to 1.1.1.8
external/bsd/bind/dist/doc/arm/man.named.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.nsec3hash.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.nsupdate.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.rndc-confgen.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.rndc.conf.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.rndc.html: up to 1.16
external/bsd/bind/dist/doc/arm/notes.html: up to 1.1.1.14
 

CVS commit: [netbsd-7] src

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 05:20:28 UTC 2017

Modified Files:
src/doc [netbsd-7]: 3RDPARTY
src/external/bsd/bind [netbsd-7]: Makefile.inc
src/external/bsd/bind/dist [netbsd-7]: CHANGES README srcid version
src/external/bsd/bind/dist/doc/arm [netbsd-7]: Bv9ARM.ch01.html
Bv9ARM.ch02.html Bv9ARM.ch03.html Bv9ARM.ch04.html Bv9ARM.ch05.html
Bv9ARM.ch06.html Bv9ARM.ch07.html Bv9ARM.ch08.html Bv9ARM.ch09.html
Bv9ARM.ch10.html Bv9ARM.ch11.html Bv9ARM.ch12.html Bv9ARM.ch13.html
Bv9ARM.html Bv9ARM.pdf man.arpaname.html man.ddns-confgen.html
man.delv.html man.dig.html man.dnssec-checkds.html
man.dnssec-coverage.html man.dnssec-dsfromkey.html
man.dnssec-importkey.html man.dnssec-keyfromlabel.html
man.dnssec-keygen.html man.dnssec-revoke.html
man.dnssec-settime.html man.dnssec-signzone.html
man.dnssec-verify.html man.genrandom.html man.host.html
man.isc-hmac-fixup.html man.lwresd.html man.named-checkconf.html
man.named-checkzone.html man.named-journalprint.html
man.named-rrchecker.html man.named.conf.html man.named.html
man.nsec3hash.html man.nsupdate.html man.rndc-confgen.html
man.rndc.conf.html man.rndc.html notes.html notes.pdf notes.xml
src/external/bsd/bind/dist/lib/dns [netbsd-7]: api dnssec.c message.c
rootns.c tsig.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1489):
doc/3RDPARTY: patch
external/bsd/bind/Makefile.inc: up to 1.26 via patch
external/bsd/bind/dist/CHANGES: up to 1.28
external/bsd/bind/dist/README: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch01.html: up to 1.1.1.26
external/bsd/bind/dist/doc/arm/Bv9ARM.ch02.html: up to 1.1.1.23
external/bsd/bind/dist/doc/arm/Bv9ARM.ch03.html: up to 1.1.1.28
external/bsd/bind/dist/doc/arm/Bv9ARM.ch04.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch05.html: up to 1.1.1.29
external/bsd/bind/dist/doc/arm/Bv9ARM.ch06.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch07.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch08.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch09.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.ch10.html: up to 1.1.1.25
external/bsd/bind/dist/doc/arm/Bv9ARM.ch11.html: up to 1.1.1.14
external/bsd/bind/dist/doc/arm/Bv9ARM.ch12.html: up to 1.1.1.14
external/bsd/bind/dist/doc/arm/Bv9ARM.ch13.html: up to 1.1.1.14
external/bsd/bind/dist/doc/arm/Bv9ARM.html: up to 1.16
external/bsd/bind/dist/doc/arm/Bv9ARM.pdf: up to 1.21
external/bsd/bind/dist/doc/arm/man.arpaname.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.ddns-confgen.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.delv.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dig.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-checkds.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-coverage.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-dsfromkey.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-importkey.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-keyfromlabel.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-keygen.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-revoke.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-settime.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-signzone.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.dnssec-verify.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.genrandom.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.host.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.isc-hmac-fixup.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.lwresd.html: up to 1.1.1.8
external/bsd/bind/dist/doc/arm/man.named-checkconf.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.named-checkzone.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.named-journalprint.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.named-rrchecker.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.named.conf.html: up to 1.1.1.8
external/bsd/bind/dist/doc/arm/man.named.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.nsec3hash.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.nsupdate.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.rndc-confgen.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.rndc.conf.html: up to 1.16
external/bsd/bind/dist/doc/arm/man.rndc.html: up to 1.16
external/bsd/bind/dist/doc/arm/notes.html: up to 1.1.1.14
externa

CVS commit: [netbsd-7-0] src

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 05:31:37 UTC 2017

Modified Files:
src/doc [netbsd-7-0]: 3RDPARTY
src/external/bsd/wpa/bin [netbsd-7-0]: Makefile.inc
src/external/bsd/wpa/bin/hostapd [netbsd-7-0]: Makefile aes-xinternal.c
src/external/bsd/wpa/bin/hostapd_cli [netbsd-7-0]: Makefile
src/external/bsd/wpa/bin/wpa_cli [netbsd-7-0]: Makefile
src/external/bsd/wpa/bin/wpa_passphrase [netbsd-7-0]: Makefile
src/external/bsd/wpa/bin/wpa_supplicant [netbsd-7-0]: Makefile
aes-xinternal.c wpa_supplicant.8
src/external/bsd/wpa/dist [netbsd-7-0]: CONTRIBUTIONS COPYING README
src/external/bsd/wpa/dist/hostapd [netbsd-7-0]: Android.mk ChangeLog
Makefile README android.config config_file.c config_file.h
ctrl_iface.c defconfig hapd_module_tests.c hlr_auc_gw.c
hlr_auc_gw.milenage_db hostapd.conf hostapd_cli.c main.c
src/external/bsd/wpa/dist/hs20/client [netbsd-7-0]: Android.mk Makefile
est.c osu_client.c spp_client.c
src/external/bsd/wpa/dist/src [netbsd-7-0]: Makefile
src/external/bsd/wpa/dist/src/ap [netbsd-7-0]: Makefile accounting.c
accounting.h acs.c ap_config.c ap_config.h ap_drv_ops.c
ap_drv_ops.h ap_list.c ap_list.h ap_mlme.c authsrv.c beacon.c
beacon.h ctrl_iface_ap.c ctrl_iface_ap.h dfs.c dhcp_snoop.c
drv_callbacks.c eap_user_db.c gas_serv.c gas_serv.h hostapd.c
hostapd.h hw_features.c hw_features.h iapp.c ieee802_11.c
ieee802_11.h ieee802_11_auth.c ieee802_11_auth.h ieee802_11_ht.c
ieee802_11_shared.c ieee802_11_vht.c ieee802_1x.c ieee802_1x.h
ndisc_snoop.c pmksa_cache_auth.c pmksa_cache_auth.h sta_info.c
sta_info.h utils.c vlan_init.c vlan_init.h vlan_util.c vlan_util.h
wnm_ap.c wnm_ap.h wpa_auth.c wpa_auth.h wpa_auth_ft.c
wpa_auth_glue.c wpa_auth_i.h wpa_auth_ie.c wps_hostapd.c x_snoop.c
src/external/bsd/wpa/dist/src/common [netbsd-7-0]: Makefile
common_module_tests.c defs.h eapol_common.h hw_features_common.c
hw_features_common.h ieee802_11_common.c ieee802_11_common.h
ieee802_11_defs.h ieee802_1x_defs.h privsep_commands.h qca-vendor.h
sae.c sae.h version.h wpa_common.c wpa_common.h wpa_ctrl.c
wpa_ctrl.h wpa_helpers.c
src/external/bsd/wpa/dist/src/crypto [netbsd-7-0]: Makefile aes-cbc.c
aes-omac1.c crypto.h crypto_internal.c crypto_module_tests.c
crypto_openssl.c dh_group5.c dh_groups.c fips_prf_openssl.c
md4-internal.c md5-internal.c ms_funcs.c ms_funcs.h random.c
sha1-internal.c sha1-tlsprf.c sha1-tprf.c sha256-internal.c
sha256-kdf.c sha256-prf.c sha256.h sha384.h tls.h tls_gnutls.c
tls_internal.c tls_none.c tls_openssl.c
src/external/bsd/wpa/dist/src/drivers [netbsd-7-0]: driver.h
driver_atheros.c driver_bsd.c driver_common.c driver_hostap.c
driver_hostap.h driver_macsec_qca.c driver_ndis.c driver_nl80211.c
driver_nl80211.h driver_nl80211_android.c driver_nl80211_capa.c
driver_nl80211_event.c driver_nl80211_monitor.c
driver_nl80211_scan.c driver_privsep.c driver_roboswitch.c
driver_wext.c driver_wired.c drivers.c drivers.mak drivers.mk
linux_ioctl.c linux_ioctl.h nl80211_copy.h rfkill.c
src/external/bsd/wpa/dist/src/eap_common [netbsd-7-0]: Makefile
eap_common.c eap_eke_common.c eap_fast_common.c eap_fast_common.h
eap_gpsk_common.c eap_pax_common.c eap_pwd_common.c
eap_pwd_common.h eap_sake_common.c ikev2_common.c
src/external/bsd/wpa/dist/src/eap_peer [netbsd-7-0]: Makefile eap.c
eap.h eap_aka.c eap_config.h eap_eke.c eap_fast.c eap_fast_pac.c
eap_gpsk.c eap_gtc.c eap_i.h eap_ikev2.c eap_leap.c eap_md5.c
eap_methods.c eap_methods.h eap_mschapv2.c eap_otp.c eap_pax.c
eap_peap.c eap_psk.c eap_pwd.c eap_sake.c eap_sim.c eap_tls.c
eap_tls_common.c eap_tls_common.h eap_tnc.c eap_ttls.c
eap_vendor_test.c eap_wsc.c ikev2.c tncc.c
src/external/bsd/wpa/dist/src/eap_server [netbsd-7-0]: Makefile eap.h
eap_i.h eap_methods.h eap_server.c eap_server_aka.c
eap_server_eke.c eap_server_fast.c eap_server_gpsk.c
eap_server_gtc.c eap_server_identity.c eap_server_ikev2.c
eap_server_md5.c eap_server_methods.c eap_server_mschapv2.c
eap_server_pax.c eap_server_peap.c eap_server_psk.c
eap_server_pwd.c eap_server_sake.c eap_server_sim.c
eap_server_tls.c eap_server_tls_common.c eap_server_tnc.c
eap_server_ttls.c eap_server_vendor_test.c eap_server_wsc.c
eap_sim_db.c eap_sim_db.h eap_tls_common.h ikev2.c tncs.c
src/external/bsd/wpa/dist/s

CVS commit: [netbsd-7-0] src/doc

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 05:42:13 UTC 2017

Modified Files:
src/doc [netbsd-7-0]: CHANGES-7.0.3

Log Message:
1489, 1490


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.53 -r1.1.2.54 src/doc/CHANGES-7.0.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.53 src/doc/CHANGES-7.0.3:1.1.2.54
--- src/doc/CHANGES-7.0.3:1.1.2.53	Sat Aug 12 04:57:21 2017
+++ src/doc/CHANGES-7.0.3	Sat Aug 12 05:42:12 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.53 2017/08/12 04:57:21 snj Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.54 2017/08/12 05:42:12 snj Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -3173,3 +3173,625 @@ sys/compat/linux/common/linux_time.c		1.
 	missing cred check in linux_sys_settimeofday()
 	[mrg, ticket #1486]
 
+doc/3RDPARTY	patch
+external/bsd/bind/Makefile.inc  up to 1.26 via patch
+external/bsd/bind/dist/CHANGES  up to 1.28
+external/bsd/bind/dist/README   up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch01.html up to 1.1.1.26
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch02.html up to 1.1.1.23
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch03.html up to 1.1.1.28
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch04.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch05.html up to 1.1.1.29
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch06.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch07.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch08.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch09.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch10.html up to 1.1.1.25
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch11.html up to 1.1.1.14
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch12.html up to 1.1.1.14
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch13.html up to 1.1.1.14
+external/bsd/bind/dist/doc/arm/Bv9ARM.html  up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.pdf   up to 1.21
+external/bsd/bind/dist/doc/arm/man.arpaname.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.ddns-confgen.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.delv.htmlup to 1.16
+external/bsd/bind/dist/doc/arm/man.dig.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-checkds.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-coverage.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-dsfromkey.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-importkey.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-keyfromlabel.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-keygen.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-revoke.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-settime.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-signzone.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-verify.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.genrandom.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.host.htmlup to 1.16
+external/bsd/bind/dist/doc/arm/man.isc-hmac-fixup.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.lwresd.html  up to 1.1.1.8
+external/bsd/bind/dist/doc/arm/man.named-checkconf.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.named-checkzone.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.named-journalprint.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.named-rrchecker.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.named.conf.html up to 1.1.1.8
+external/bsd/bind/dist/doc/arm/man.named.html   up to 1.16
+external/bsd/bind/dist/doc/arm/man.nsec3hash.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.nsupdate.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.rndc-confgen.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.rndc.conf.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.rndc.htmlup to 1.16
+external/bsd/bind/dist/doc/arm/notes.html   up to 1.1.1.14
+external/bsd/bind/dist/doc/arm/notes.pdfup to 1.1.1.14
+external/bsd/bind/dist/doc/arm/notes.xmlup to 1.1.1.14
+external/bsd/bind/dist/lib/dns/api  up to 1.16
+external/bsd/bind/dist/lib/dns/dnssec.c up to 1.14
+external/bsd/bind/dist/lib/dns/message.cup to 1.24
+external/bsd/bind/dist/lib/dns/rootns.c up to 1.13
+external/bsd/bind/dist/lib/dns/tsig.c   up to 1.11
+external/bsd/bind/dist/srcidup to 1.22
+external/bsd/bind/dist/version  up to 1.26
+external/bsd/bind/include/isc/platform.hup to 1.23
+
+	Update BIND to 9.10.5-P2.
+	[mrg, ticket #1489]
+
+doc/3RDPARTY	patch
+external/bsd/wpa/bin/Makefile.inc   up to 1.6
+external/bsd/wpa/bin/hostapd/Makefile   up to 1.10
+external/bsd/wpa/bin/hostapd/aes-xinternal.cup to 1.2
+external/bsd/wpa/bin/hostapd_cli/Makefile   up to 

CVS commit: [netbsd-7-1] src

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 05:44:05 UTC 2017

Modified Files:
src/doc [netbsd-7-1]: 3RDPARTY
src/external/bsd/wpa/bin [netbsd-7-1]: Makefile.inc
src/external/bsd/wpa/bin/hostapd [netbsd-7-1]: Makefile aes-xinternal.c
src/external/bsd/wpa/bin/hostapd_cli [netbsd-7-1]: Makefile
src/external/bsd/wpa/bin/wpa_cli [netbsd-7-1]: Makefile
src/external/bsd/wpa/bin/wpa_passphrase [netbsd-7-1]: Makefile
src/external/bsd/wpa/bin/wpa_supplicant [netbsd-7-1]: Makefile
aes-xinternal.c wpa_supplicant.8
src/external/bsd/wpa/dist [netbsd-7-1]: CONTRIBUTIONS COPYING README
src/external/bsd/wpa/dist/hostapd [netbsd-7-1]: Android.mk ChangeLog
Makefile README android.config config_file.c config_file.h
ctrl_iface.c defconfig hapd_module_tests.c hlr_auc_gw.c
hlr_auc_gw.milenage_db hostapd.conf hostapd_cli.c main.c
src/external/bsd/wpa/dist/hs20/client [netbsd-7-1]: Android.mk Makefile
est.c osu_client.c spp_client.c
src/external/bsd/wpa/dist/src [netbsd-7-1]: Makefile
src/external/bsd/wpa/dist/src/ap [netbsd-7-1]: Makefile accounting.c
accounting.h acs.c ap_config.c ap_config.h ap_drv_ops.c
ap_drv_ops.h ap_list.c ap_list.h ap_mlme.c authsrv.c beacon.c
beacon.h ctrl_iface_ap.c ctrl_iface_ap.h dfs.c dhcp_snoop.c
drv_callbacks.c eap_user_db.c gas_serv.c gas_serv.h hostapd.c
hostapd.h hw_features.c hw_features.h iapp.c ieee802_11.c
ieee802_11.h ieee802_11_auth.c ieee802_11_auth.h ieee802_11_ht.c
ieee802_11_shared.c ieee802_11_vht.c ieee802_1x.c ieee802_1x.h
ndisc_snoop.c pmksa_cache_auth.c pmksa_cache_auth.h sta_info.c
sta_info.h utils.c vlan_init.c vlan_init.h vlan_util.c vlan_util.h
wnm_ap.c wnm_ap.h wpa_auth.c wpa_auth.h wpa_auth_ft.c
wpa_auth_glue.c wpa_auth_i.h wpa_auth_ie.c wps_hostapd.c x_snoop.c
src/external/bsd/wpa/dist/src/common [netbsd-7-1]: Makefile
common_module_tests.c defs.h eapol_common.h hw_features_common.c
hw_features_common.h ieee802_11_common.c ieee802_11_common.h
ieee802_11_defs.h ieee802_1x_defs.h privsep_commands.h qca-vendor.h
sae.c sae.h version.h wpa_common.c wpa_common.h wpa_ctrl.c
wpa_ctrl.h wpa_helpers.c
src/external/bsd/wpa/dist/src/crypto [netbsd-7-1]: Makefile aes-cbc.c
aes-omac1.c crypto.h crypto_internal.c crypto_module_tests.c
crypto_openssl.c dh_group5.c dh_groups.c fips_prf_openssl.c
md4-internal.c md5-internal.c ms_funcs.c ms_funcs.h random.c
sha1-internal.c sha1-tlsprf.c sha1-tprf.c sha256-internal.c
sha256-kdf.c sha256-prf.c sha256.h sha384.h tls.h tls_gnutls.c
tls_internal.c tls_none.c tls_openssl.c
src/external/bsd/wpa/dist/src/drivers [netbsd-7-1]: driver.h
driver_atheros.c driver_bsd.c driver_common.c driver_hostap.c
driver_hostap.h driver_macsec_qca.c driver_ndis.c driver_nl80211.c
driver_nl80211.h driver_nl80211_android.c driver_nl80211_capa.c
driver_nl80211_event.c driver_nl80211_monitor.c
driver_nl80211_scan.c driver_privsep.c driver_roboswitch.c
driver_wext.c driver_wired.c drivers.c drivers.mak drivers.mk
linux_ioctl.c linux_ioctl.h nl80211_copy.h rfkill.c
src/external/bsd/wpa/dist/src/eap_common [netbsd-7-1]: Makefile
eap_common.c eap_eke_common.c eap_fast_common.c eap_fast_common.h
eap_gpsk_common.c eap_pax_common.c eap_pwd_common.c
eap_pwd_common.h eap_sake_common.c ikev2_common.c
src/external/bsd/wpa/dist/src/eap_peer [netbsd-7-1]: Makefile eap.c
eap.h eap_aka.c eap_config.h eap_eke.c eap_fast.c eap_fast_pac.c
eap_gpsk.c eap_gtc.c eap_i.h eap_ikev2.c eap_leap.c eap_md5.c
eap_methods.c eap_methods.h eap_mschapv2.c eap_otp.c eap_pax.c
eap_peap.c eap_psk.c eap_pwd.c eap_sake.c eap_sim.c eap_tls.c
eap_tls_common.c eap_tls_common.h eap_tnc.c eap_ttls.c
eap_vendor_test.c eap_wsc.c ikev2.c tncc.c
src/external/bsd/wpa/dist/src/eap_server [netbsd-7-1]: Makefile eap.h
eap_i.h eap_methods.h eap_server.c eap_server_aka.c
eap_server_eke.c eap_server_fast.c eap_server_gpsk.c
eap_server_gtc.c eap_server_identity.c eap_server_ikev2.c
eap_server_md5.c eap_server_methods.c eap_server_mschapv2.c
eap_server_pax.c eap_server_peap.c eap_server_psk.c
eap_server_pwd.c eap_server_sake.c eap_server_sim.c
eap_server_tls.c eap_server_tls_common.c eap_server_tnc.c
eap_server_ttls.c eap_server_vendor_test.c eap_server_wsc.c
eap_sim_db.c eap_sim_db.h eap_tls_common.h ikev2.c tncs.c
src/external/bsd/wpa/dist/s

CVS commit: [netbsd-7-1] src/doc

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 05:53:31 UTC 2017

Modified Files:
src/doc [netbsd-7-1]: CHANGES-7.1.1

Log Message:
1489, 1490


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.22 -r1.1.2.23 src/doc/CHANGES-7.1.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-7.1.1
diff -u src/doc/CHANGES-7.1.1:1.1.2.22 src/doc/CHANGES-7.1.1:1.1.2.23
--- src/doc/CHANGES-7.1.1:1.1.2.22	Sat Aug 12 05:01:54 2017
+++ src/doc/CHANGES-7.1.1	Sat Aug 12 05:53:31 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.1,v 1.1.2.22 2017/08/12 05:01:54 snj Exp $
+# $NetBSD: CHANGES-7.1.1,v 1.1.2.23 2017/08/12 05:53:31 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.1.1
 release:
@@ -1883,3 +1883,625 @@ sys/compat/linux/common/linux_time.c		1.
 	missing cred check in linux_sys_settimeofday()
 	[mrg, ticket #1486]
 
+doc/3RDPARTY	patch
+external/bsd/bind/Makefile.inc  up to 1.26 via patch
+external/bsd/bind/dist/CHANGES  up to 1.28
+external/bsd/bind/dist/README   up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch01.html up to 1.1.1.26
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch02.html up to 1.1.1.23
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch03.html up to 1.1.1.28
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch04.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch05.html up to 1.1.1.29
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch06.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch07.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch08.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch09.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch10.html up to 1.1.1.25
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch11.html up to 1.1.1.14
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch12.html up to 1.1.1.14
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch13.html up to 1.1.1.14
+external/bsd/bind/dist/doc/arm/Bv9ARM.html  up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.pdf   up to 1.21
+external/bsd/bind/dist/doc/arm/man.arpaname.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.ddns-confgen.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.delv.htmlup to 1.16
+external/bsd/bind/dist/doc/arm/man.dig.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-checkds.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-coverage.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-dsfromkey.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-importkey.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-keyfromlabel.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-keygen.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-revoke.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-settime.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-signzone.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-verify.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.genrandom.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.host.htmlup to 1.16
+external/bsd/bind/dist/doc/arm/man.isc-hmac-fixup.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.lwresd.html  up to 1.1.1.8
+external/bsd/bind/dist/doc/arm/man.named-checkconf.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.named-checkzone.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.named-journalprint.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.named-rrchecker.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.named.conf.html up to 1.1.1.8
+external/bsd/bind/dist/doc/arm/man.named.html   up to 1.16
+external/bsd/bind/dist/doc/arm/man.nsec3hash.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.nsupdate.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.rndc-confgen.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.rndc.conf.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.rndc.htmlup to 1.16
+external/bsd/bind/dist/doc/arm/notes.html   up to 1.1.1.14
+external/bsd/bind/dist/doc/arm/notes.pdfup to 1.1.1.14
+external/bsd/bind/dist/doc/arm/notes.xmlup to 1.1.1.14
+external/bsd/bind/dist/lib/dns/api  up to 1.16
+external/bsd/bind/dist/lib/dns/dnssec.c up to 1.14
+external/bsd/bind/dist/lib/dns/message.cup to 1.24
+external/bsd/bind/dist/lib/dns/rootns.c up to 1.13
+external/bsd/bind/dist/lib/dns/tsig.c   up to 1.11
+external/bsd/bind/dist/srcidup to 1.22
+external/bsd/bind/dist/version  up to 1.26
+external/bsd/bind/include/isc/platform.hup to 1.23
+
+	Update BIND to 9.10.5-P2.
+	[mrg, ticket #1489]
+
+doc/3RDPARTY	patch
+external/bsd/wpa/bin/Makefile.inc   up to 1.6
+external/bsd/wpa/bin/hostapd/Makefile   up to 1.10
+external/bsd/wpa/bin/hostapd/aes-xinternal.cup to 1.2
+external/bsd/wpa/bin/hostapd_cli/Makefile   up to 1.

CVS commit: [netbsd-7] src

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 05:56:21 UTC 2017

Modified Files:
src/doc [netbsd-7]: 3RDPARTY
src/external/bsd/wpa/bin [netbsd-7]: Makefile.inc
src/external/bsd/wpa/bin/hostapd [netbsd-7]: Makefile aes-xinternal.c
src/external/bsd/wpa/bin/hostapd_cli [netbsd-7]: Makefile
src/external/bsd/wpa/bin/wpa_cli [netbsd-7]: Makefile
src/external/bsd/wpa/bin/wpa_passphrase [netbsd-7]: Makefile
src/external/bsd/wpa/bin/wpa_supplicant [netbsd-7]: Makefile
aes-xinternal.c wpa_supplicant.8
src/external/bsd/wpa/dist [netbsd-7]: CONTRIBUTIONS COPYING README
src/external/bsd/wpa/dist/hostapd [netbsd-7]: Android.mk ChangeLog
Makefile README android.config config_file.c config_file.h
ctrl_iface.c defconfig hapd_module_tests.c hlr_auc_gw.c
hlr_auc_gw.milenage_db hostapd.conf hostapd_cli.c main.c
src/external/bsd/wpa/dist/hs20/client [netbsd-7]: Android.mk Makefile
est.c osu_client.c spp_client.c
src/external/bsd/wpa/dist/src [netbsd-7]: Makefile
src/external/bsd/wpa/dist/src/ap [netbsd-7]: Makefile accounting.c
accounting.h acs.c ap_config.c ap_config.h ap_drv_ops.c
ap_drv_ops.h ap_list.c ap_list.h ap_mlme.c authsrv.c beacon.c
beacon.h ctrl_iface_ap.c ctrl_iface_ap.h dfs.c dhcp_snoop.c
drv_callbacks.c eap_user_db.c gas_serv.c gas_serv.h hostapd.c
hostapd.h hw_features.c hw_features.h iapp.c ieee802_11.c
ieee802_11.h ieee802_11_auth.c ieee802_11_auth.h ieee802_11_ht.c
ieee802_11_shared.c ieee802_11_vht.c ieee802_1x.c ieee802_1x.h
ndisc_snoop.c pmksa_cache_auth.c pmksa_cache_auth.h sta_info.c
sta_info.h utils.c vlan_init.c vlan_init.h vlan_util.c vlan_util.h
wnm_ap.c wnm_ap.h wpa_auth.c wpa_auth.h wpa_auth_ft.c
wpa_auth_glue.c wpa_auth_i.h wpa_auth_ie.c wps_hostapd.c x_snoop.c
src/external/bsd/wpa/dist/src/common [netbsd-7]: Makefile
common_module_tests.c defs.h eapol_common.h hw_features_common.c
hw_features_common.h ieee802_11_common.c ieee802_11_common.h
ieee802_11_defs.h ieee802_1x_defs.h privsep_commands.h qca-vendor.h
sae.c sae.h version.h wpa_common.c wpa_common.h wpa_ctrl.c
wpa_ctrl.h wpa_helpers.c
src/external/bsd/wpa/dist/src/crypto [netbsd-7]: Makefile aes-cbc.c
aes-omac1.c crypto.h crypto_internal.c crypto_module_tests.c
crypto_openssl.c dh_group5.c dh_groups.c fips_prf_openssl.c
md4-internal.c md5-internal.c ms_funcs.c ms_funcs.h random.c
sha1-internal.c sha1-tlsprf.c sha1-tprf.c sha256-internal.c
sha256-kdf.c sha256-prf.c sha256.h sha384.h tls.h tls_gnutls.c
tls_internal.c tls_none.c tls_openssl.c
src/external/bsd/wpa/dist/src/drivers [netbsd-7]: driver.h
driver_atheros.c driver_bsd.c driver_common.c driver_hostap.c
driver_hostap.h driver_macsec_qca.c driver_ndis.c driver_nl80211.c
driver_nl80211.h driver_nl80211_android.c driver_nl80211_capa.c
driver_nl80211_event.c driver_nl80211_monitor.c
driver_nl80211_scan.c driver_privsep.c driver_roboswitch.c
driver_wext.c driver_wired.c drivers.c drivers.mak drivers.mk
linux_ioctl.c linux_ioctl.h nl80211_copy.h rfkill.c
src/external/bsd/wpa/dist/src/eap_common [netbsd-7]: Makefile
eap_common.c eap_eke_common.c eap_fast_common.c eap_fast_common.h
eap_gpsk_common.c eap_pax_common.c eap_pwd_common.c
eap_pwd_common.h eap_sake_common.c ikev2_common.c
src/external/bsd/wpa/dist/src/eap_peer [netbsd-7]: Makefile eap.c eap.h
eap_aka.c eap_config.h eap_eke.c eap_fast.c eap_fast_pac.c
eap_gpsk.c eap_gtc.c eap_i.h eap_ikev2.c eap_leap.c eap_md5.c
eap_methods.c eap_methods.h eap_mschapv2.c eap_otp.c eap_pax.c
eap_peap.c eap_psk.c eap_pwd.c eap_sake.c eap_sim.c eap_tls.c
eap_tls_common.c eap_tls_common.h eap_tnc.c eap_ttls.c
eap_vendor_test.c eap_wsc.c ikev2.c tncc.c
src/external/bsd/wpa/dist/src/eap_server [netbsd-7]: Makefile eap.h
eap_i.h eap_methods.h eap_server.c eap_server_aka.c
eap_server_eke.c eap_server_fast.c eap_server_gpsk.c
eap_server_gtc.c eap_server_identity.c eap_server_ikev2.c
eap_server_md5.c eap_server_methods.c eap_server_mschapv2.c
eap_server_pax.c eap_server_peap.c eap_server_psk.c
eap_server_pwd.c eap_server_sake.c eap_server_sim.c
eap_server_tls.c eap_server_tls_common.c eap_server_tnc.c
eap_server_ttls.c eap_server_vendor_test.c eap_server_wsc.c
eap_sim_db.c eap_sim_db.h eap_tls_common.h ikev2.c tncs.c
src/external/bsd/wpa/dist/src/eapol_auth [netbsd-7]: Makefile
 

CVS commit: [netbsd-7] src/doc

2017-08-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Aug 12 06:05:16 UTC 2017

Modified Files:
src/doc [netbsd-7]: CHANGES-7.2

Log Message:
1489, 1490


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.36 -r1.1.2.37 src/doc/CHANGES-7.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-7.2
diff -u src/doc/CHANGES-7.2:1.1.2.36 src/doc/CHANGES-7.2:1.1.2.37
--- src/doc/CHANGES-7.2:1.1.2.36	Sat Aug 12 05:07:30 2017
+++ src/doc/CHANGES-7.2	Sat Aug 12 06:05:16 2017
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.36 2017/08/12 05:07:30 snj Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.37 2017/08/12 06:05:16 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -2838,3 +2838,625 @@ sys/compat/linux/common/linux_time.c		1.
 	missing cred check in linux_sys_settimeofday()
 	[mrg, ticket #1486]
 
+doc/3RDPARTY	patch
+external/bsd/bind/Makefile.inc  up to 1.26 via patch
+external/bsd/bind/dist/CHANGES  up to 1.28
+external/bsd/bind/dist/README   up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch01.html up to 1.1.1.26
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch02.html up to 1.1.1.23
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch03.html up to 1.1.1.28
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch04.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch05.html up to 1.1.1.29
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch06.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch07.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch08.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch09.html up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch10.html up to 1.1.1.25
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch11.html up to 1.1.1.14
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch12.html up to 1.1.1.14
+external/bsd/bind/dist/doc/arm/Bv9ARM.ch13.html up to 1.1.1.14
+external/bsd/bind/dist/doc/arm/Bv9ARM.html  up to 1.16
+external/bsd/bind/dist/doc/arm/Bv9ARM.pdf   up to 1.21
+external/bsd/bind/dist/doc/arm/man.arpaname.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.ddns-confgen.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.delv.htmlup to 1.16
+external/bsd/bind/dist/doc/arm/man.dig.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-checkds.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-coverage.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-dsfromkey.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-importkey.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-keyfromlabel.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-keygen.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-revoke.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-settime.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-signzone.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.dnssec-verify.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.genrandom.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.host.htmlup to 1.16
+external/bsd/bind/dist/doc/arm/man.isc-hmac-fixup.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.lwresd.html  up to 1.1.1.8
+external/bsd/bind/dist/doc/arm/man.named-checkconf.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.named-checkzone.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.named-journalprint.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.named-rrchecker.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.named.conf.html up to 1.1.1.8
+external/bsd/bind/dist/doc/arm/man.named.html   up to 1.16
+external/bsd/bind/dist/doc/arm/man.nsec3hash.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.nsupdate.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.rndc-confgen.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.rndc.conf.html up to 1.16
+external/bsd/bind/dist/doc/arm/man.rndc.htmlup to 1.16
+external/bsd/bind/dist/doc/arm/notes.html   up to 1.1.1.14
+external/bsd/bind/dist/doc/arm/notes.pdfup to 1.1.1.14
+external/bsd/bind/dist/doc/arm/notes.xmlup to 1.1.1.14
+external/bsd/bind/dist/lib/dns/api  up to 1.16
+external/bsd/bind/dist/lib/dns/dnssec.c up to 1.14
+external/bsd/bind/dist/lib/dns/message.cup to 1.24
+external/bsd/bind/dist/lib/dns/rootns.c up to 1.13
+external/bsd/bind/dist/lib/dns/tsig.c   up to 1.11
+external/bsd/bind/dist/srcidup to 1.22
+external/bsd/bind/dist/version  up to 1.26
+external/bsd/bind/include/isc/platform.hup to 1.23
+
+	Update BIND to 9.10.5-P2.
+	[mrg, ticket #1489]
+
+doc/3RDPARTY	patch
+external/bsd/wpa/bin/Makefile.inc   up to 1.6
+external/bsd/wpa/bin/hostapd/Makefile   up to 1.10
+external/bsd/wpa/bin/hostapd/aes-xinternal.cup to 1.2
+external/bsd/wpa/bin/hostapd_cli/Makefile   up to 1.3
+external/bsd/wpa/bi

CVS commit: src/sys/arch

2017-08-11 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Sat Aug 12 06:46:13 UTC 2017

Modified Files:
src/sys/arch/amd64/conf: ALL
src/sys/arch/i386/conf: ALL GENERIC GENERIC_PS2TINY GENERIC_TINY
INSTALL_FLOPPY INSTALL_TINY NET4501 XEN3_DOM0 XEN3_DOMU files.i386
Removed Files:
src/sys/arch/i386/i386: vm86.c

Log Message:
Remove support for vm86 on i386. It is bug-friendly, and there is no point
in having kernel support for this: the instruction set of the CPU is small,
and it can easily be emulated in userland entirely. There are also several
assumptions in the code that are not respected, and the slightest confusion
in the trap frame can lead to ring0 exploits.

vm86 has received zero maintenance. As far as I can tell, it was added
20 years ago in order to make doscmd work. But doscmd has not been
maintained either, and was removed from pkgsrc in 2011. dosbox can be used
instead: it does not require kernel support, and will produce better
results than our flimsy implementation.

Pass 1. (many pieces still in the tree)


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/amd64/conf/ALL
cvs rdiff -u -r1.425 -r1.426 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1164 -r1.1165 src/sys/arch/i386/conf/GENERIC
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/i386/conf/GENERIC_PS2TINY
cvs rdiff -u -r1.154 -r1.155 src/sys/arch/i386/conf/GENERIC_TINY
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/i386/conf/INSTALL_FLOPPY
cvs rdiff -u -r1.153 -r1.154 src/sys/arch/i386/conf/INSTALL_TINY
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/i386/conf/NET4501
cvs rdiff -u -r1.120 -r1.121 src/sys/arch/i386/conf/XEN3_DOM0
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/i386/conf/XEN3_DOMU
cvs rdiff -u -r1.384 -r1.385 src/sys/arch/i386/conf/files.i386
cvs rdiff -u -r1.51 -r0 src/sys/arch/i386/i386/vm86.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/amd64/conf/ALL
diff -u src/sys/arch/amd64/conf/ALL:1.65 src/sys/arch/amd64/conf/ALL:1.66
--- src/sys/arch/amd64/conf/ALL:1.65	Wed Aug  9 18:48:53 2017
+++ src/sys/arch/amd64/conf/ALL	Sat Aug 12 06:46:13 2017
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.65 2017/08/09 18:48:53 maxv Exp $
+# $NetBSD: ALL,v 1.66 2017/08/12 06:46:13 maxv Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,14 +17,13 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.65 $"
+#ident		"ALL-$Revision: 1.66 $"
 
 maxusers	64		# estimated number of users
 
 makeoptions	USE_SSP=yes
 
 # CPU-related options.
-#options 	VM86		# virtual 8086 emulation
 #options 	USER_LDT	# user-settable LDT; used by WINE
 options 	X86EMU		# 386 Real Mode emulator
 #options 	PAE		# PAE mode (36 bits physical addressing)

Index: src/sys/arch/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.425 src/sys/arch/i386/conf/ALL:1.426
--- src/sys/arch/i386/conf/ALL:1.425	Wed Aug  9 18:45:30 2017
+++ src/sys/arch/i386/conf/ALL	Sat Aug 12 06:46:13 2017
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.425 2017/08/09 18:45:30 maxv Exp $
+# $NetBSD: ALL,v 1.426 2017/08/12 06:46:13 maxv Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,14 +17,13 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.425 $"
+#ident		"ALL-$Revision: 1.426 $"
 
 maxusers	64		# estimated number of users
 
 makeoptions	USE_SSP=yes
 
 # CPU-related options.
-options 	VM86		# virtual 8086 emulation
 options 	USER_LDT	# user-settable LDT; used by WINE
 options 	X86EMU		# 386 Real Mode emulator
 options 	PAE		# PAE mode (36 bits physical addressing)

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1164 src/sys/arch/i386/conf/GENERIC:1.1165
--- src/sys/arch/i386/conf/GENERIC:1.1164	Wed Aug  9 18:45:30 2017
+++ src/sys/arch/i386/conf/GENERIC	Sat Aug 12 06:46:13 2017
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1164 2017/08/09 18:45:30 maxv Exp $
+# $NetBSD: GENERIC,v 1.1165 2017/08/12 06:46:13 maxv Exp $
 #
 # GENERIC machine description file
 #
@@ -22,12 +22,11 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.1164 $"
+#ident		"GENERIC-$Revision: 1.1165 $"
 
 maxusers	64		# estimated number of users
 
 # CPU-related options.
-#options 	VM86		# virtual 8086 emulation
 options 	USER_LDT	# user-settable LDT; used by WINE
 #options 	PAE		# PAE mode (36 bits physical addressing)
 

Index: src/sys/arch/i386/conf/GENERIC_PS2TINY
diff -u src/sys/arch/i386/conf/GENERIC_PS2TINY:1.77 src/sys/arch/i386/conf/GENERIC_PS2TINY:1.78
--- src/sys/arch/i386/conf/GENERIC_PS2TINY:1.77	Sun Feb 26 12:21:15 2017
+++ src/sys/arch/i386/conf/GENERIC_PS2TINY	Sat Aug 12 06:46:13 2017
@@ -1,4 +1,4 @@
-