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

2018-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Aug 29 01:58:54 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64

Log Message:
Add (commented out) EARLYCONS entry for rk3399


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/evbarm/conf/GENERIC64

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/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.32 src/sys/arch/evbarm/conf/GENERIC64:1.33
--- src/sys/arch/evbarm/conf/GENERIC64:1.32	Wed Aug 29 01:58:17 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Wed Aug 29 01:58:54 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.32 2018/08/29 01:58:17 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.33 2018/08/29 01:58:54 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -78,6 +78,7 @@ options 	VERBOSE_INIT_ARM # verbose boot
 # EARLYCONS is required for early init messages from VERBOSE_INIT_ARM.
 #options 	EARLYCONS=bcm2837
 #options 	EARLYCONS=rk3328, CONSADDR=0xff13
+#options 	EARLYCONS=rk3399, CONSADDR=0xff1a
 #options 	EARLYCONS=sunxi, CONSADDR=0x01c28000
 #options 	EARLYCONS=tegra, CONSADDR=0x70006000
 #options 	EARLYCONS=virt



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

2018-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Aug 29 01:58:17 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64

Log Message:
Add fan53555reg


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/evbarm/conf/GENERIC64

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/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.31 src/sys/arch/evbarm/conf/GENERIC64:1.32
--- src/sys/arch/evbarm/conf/GENERIC64:1.31	Sun Aug 12 18:01:22 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Wed Aug 29 01:58:17 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.31 2018/08/12 18:01:22 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.32 2018/08/29 01:58:17 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -246,6 +246,7 @@ as3722pmic*	at iic?
 as3722reg*	at as3722pmic?
 axppmic*	at iic?			# X-Powers AXP Power Management IC
 axpreg*		at axppmic?
+fan53555reg*	at iic?			# FAN53555 / SY82x regulator
 max77620pmic*	at iic?
 pcf8563rtc*	at iic?			# PCF8563 RTC
 tcagpio*	at iic?



CVS commit: src/sys/dev/i2c

2018-08-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Aug 29 01:57:38 UTC 2018

Modified Files:
src/sys/dev/i2c: files.i2c
Added Files:
src/sys/dev/i2c: fan53555.c

Log Message:
Add driver for Silergy SY827/SY828 step down regulator.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/fan53555.c
cvs rdiff -u -r1.94 -r1.95 src/sys/dev/i2c/files.i2c

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/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.94 src/sys/dev/i2c/files.i2c:1.95
--- src/sys/dev/i2c/files.i2c:1.94	Fri Jul 27 12:02:26 2018
+++ src/sys/dev/i2c/files.i2c	Wed Aug 29 01:57:38 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.94 2018/07/27 12:02:26 rkujawa Exp $
+#	$NetBSD: files.i2c,v 1.95 2018/08/29 01:57:38 jmcneill Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -345,3 +345,7 @@ device tea5767radio : radiodev
 attach tea5767radio at iic
 file dev/i2c/tea5767.ctea5767radio
 
+# Fairchild FAN53555 / Silergy SY82x regulator
+device	fan53555reg
+attach	fan53555reg at iic
+file	dev/i2c/fan53555.c			fan53555reg

Added files:

Index: src/sys/dev/i2c/fan53555.c
diff -u /dev/null src/sys/dev/i2c/fan53555.c:1.1
--- /dev/null	Wed Aug 29 01:57:38 2018
+++ src/sys/dev/i2c/fan53555.c	Wed Aug 29 01:57:38 2018
@@ -0,0 +1,293 @@
+/* $NetBSD: fan53555.c,v 1.1 2018/08/29 01:57:38 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: fan53555.c,v 1.1 2018/08/29 01:57:38 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#define	VSEL0_REG		0x00
+#define	VSEL1_REG		0x01
+#define	 VSEL_BUCK_EN			__BIT(7)
+#define	 VSEL_MODE			__BIT(6)
+#define	 VSEL_NSEL			__BITS(5,0)
+#define	CONTROL_REG		0x02
+#define	 CONTROL_OUTPUT_DISCHARGE	__BIT(7)
+#define	 CONTROL_SLEW			__BITS(6,4)
+#define	 CONTROL_RESET			__BIT(2)
+#define	ID1_REG			0x03
+#define	 ID1_VENDOR			__BITS(7,5)
+#define	 ID1_DIE_ID			__BITS(3,0)
+#define	  SILERGY_DIE_ID_SYR82X		8
+#define	ID2_REG			0x04
+#define	 ID2_DIE_REV			__BITS(3,0)
+#define	MONITOR_REG		0x05
+#define	 MONITOR_PGOOD			__BIT(7)
+
+struct fan53555_softc {
+	device_t	sc_dev;
+	i2c_tag_t	sc_i2c;
+	i2c_addr_t	sc_addr;
+	int		sc_phandle;
+
+	u_int		sc_suspend_reg;
+	u_int		sc_runtime_reg;
+
+	u_int		sc_base;
+	u_int		sc_step;
+
+	u_int		sc_ramp_delay;
+	u_int		sc_suspend_voltage_selector;
+};
+
+enum fan53555_vendor {
+	FAN_VENDOR_FAIRCHILD = 1,
+	FAN_VENDOR_SILERGY,
+};
+
+static const struct device_compatible_entry compat_data[] = {
+	{ "silergy,syr827",		FAN_VENDOR_SILERGY },
+	{ "silergy,syr828",		FAN_VENDOR_SILERGY },
+	{ NULL,0 }
+};
+
+static uint8_t
+fan53555_read(struct fan53555_softc *sc, uint8_t reg, int flags)
+{
+	uint8_t val = 0;
+	int error;
+
+	error = iic_exec(sc->sc_i2c, I2C_OP_READ_WITH_STOP, sc->sc_addr,
+	, 1, , 1, flags);
+	if (error != 0)
+		aprint_error_dev(sc->sc_dev, "error reading reg %#x: %d\n", reg, error);
+
+	return val;
+}
+
+static void
+fan53555_write(struct fan53555_softc *sc, uint8_t reg, uint8_t val, int flags)
+{
+	uint8_t buf[2];
+	int error;
+
+	buf[0] = reg;
+	buf[1] = val;
+
+	error = iic_exec(sc->sc_i2c, I2C_OP_WRITE_WITH_STOP, sc->sc_addr,
+	NULL, 0, buf, 2, flags);
+	if (error != 0)
+		aprint_error_dev(sc->sc_dev, "error writing reg %#x: %d\n", reg, error);
+}
+
+#define	I2C_READ(sc, reg)	fan53555_read((sc), (reg), I2C_F_POLL)
+#define	I2C_WRITE(sc, reg, val)	fan53555_write((sc), (reg), (val), I2C_F_POLL)

CVS commit: src/sys/external/bsd/drm2/dist/drm/nouveau

2018-08-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Aug 28 20:59:21 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau: nouveau_fence.c

Log Message:
move spin_lock_destroy() of the nouveau_fence_chan into
nouveau_fence_context_put() so it's available until all uses are done.
fixes a panic at reboot time.  idea from riastradh@.

(nv still has a off screen.)


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \
src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.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/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c:1.12 src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c:1.13
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c:1.12	Mon Aug 27 07:37:07 2018
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nouveau_fence.c	Tue Aug 28 20:59:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nouveau_fence.c,v 1.12 2018/08/27 07:37:07 riastradh Exp $	*/
+/*	$NetBSD: nouveau_fence.c,v 1.13 2018/08/28 20:59:21 mrg Exp $	*/
 
 /*
  * Copyright (C) 2007 Ben Skeggs.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nouveau_fence.c,v 1.12 2018/08/27 07:37:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_fence.c,v 1.13 2018/08/28 20:59:21 mrg Exp $");
 
 #include 
 
@@ -106,7 +106,6 @@ nouveau_fence_context_del(struct nouveau
 			nvif_notify_put(>notify);
 	}
 	spin_unlock_irq(>lock);
-	spin_lock_destroy(>lock);
 
 	nvif_notify_fini(>notify);
 	fctx->dead = 1;
@@ -121,7 +120,11 @@ nouveau_fence_context_del(struct nouveau
 static void
 nouveau_fence_context_put(struct kref *fence_ref)
 {
-	kfree(container_of(fence_ref, struct nouveau_fence_chan, fence_ref));
+	struct nouveau_fence_chan *fctx =
+	container_of(fence_ref, struct nouveau_fence_chan, fence_ref);
+
+	spin_lock_destroy(>lock);
+	kfree(fctx);
 }
 
 void



CVS commit: src/doc

2018-08-28 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Aug 28 20:11:58 UTC 2018

Modified Files:
src/doc: TODO.sanitizers

Log Message:
TODO.sanitizers: Mark switch of syscall(2)/__syscall(2) to libc done

Implemented in pkgsrc-wip, patches will land upstream review.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/doc/TODO.sanitizers

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

Modified files:

Index: src/doc/TODO.sanitizers
diff -u src/doc/TODO.sanitizers:1.5 src/doc/TODO.sanitizers:1.6
--- src/doc/TODO.sanitizers:1.5	Tue Aug 21 23:34:56 2018
+++ src/doc/TODO.sanitizers	Tue Aug 28 20:11:58 2018
@@ -4,7 +4,6 @@ Short term:
  - compiler-rt import and integration with base
  - merge TSan, MSan and libFuzzer ATF tests
  - prepare MKSANITIZER readme
- - switch syscall(2)/__syscall(2) to libc calls
  - upstream local patches, mostly to compiler-rt
  - develop fts(3) interceptors (MSan, for ls(1), find(1), mtree(8)
  - investigate and address the libcxx failing tests on NetBSD



CVS commit: [netbsd-8] src/doc

2018-08-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug 28 16:25:19 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.1

Log Message:
994


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.16 -r1.1.2.17 src/doc/CHANGES-8.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-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.16 src/doc/CHANGES-8.1:1.1.2.17
--- src/doc/CHANGES-8.1:1.1.2.16	Tue Aug 28 13:29:22 2018
+++ src/doc/CHANGES-8.1	Tue Aug 28 16:25:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.16 2018/08/28 13:29:22 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.17 2018/08/28 16:25:19 snj Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -650,3 +650,11 @@ xsrc/external/mit/libX11/dist/src/ListEx
 	Fixed out of boundary write (CVE-2018-14600)
 	Fixed crash on invalid reply (CVE-2018-14598)
 	[mrg, ticket #995]
+
+sys/arch/prep/prep/machdep.c			1.76
+sys/arch/prep/prep/mainbus.c			1.34
+
+	Fix initialization order so we can boot again on IBM PPS
+	Model 6015.
+	[martin, ticket #994]
+



CVS commit: [netbsd-8] src/sys/arch/prep/prep

2018-08-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Aug 28 16:24:24 UTC 2018

Modified Files:
src/sys/arch/prep/prep [netbsd-8]: machdep.c mainbus.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #994):
sys/arch/prep/prep/machdep.c: revision 1.76
sys/arch/prep/prep/mainbus.c: revision 1.34
Fix initialization order so we can boot again on IBM PPS Model 6015
(which needs pci interrupt fixup quirks).
>From Artyom Tarasenko.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.75.22.1 src/sys/arch/prep/prep/machdep.c
cvs rdiff -u -r1.33 -r1.33.40.1 src/sys/arch/prep/prep/mainbus.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/prep/prep/machdep.c
diff -u src/sys/arch/prep/prep/machdep.c:1.75 src/sys/arch/prep/prep/machdep.c:1.75.22.1
--- src/sys/arch/prep/prep/machdep.c:1.75	Thu Apr  3 23:49:47 2014
+++ src/sys/arch/prep/prep/machdep.c	Tue Aug 28 16:24:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.75 2014/04/03 23:49:47 mrg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.75.22.1 2018/08/28 16:24:24 snj Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.75 2014/04/03 23:49:47 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.75.22.1 2018/08/28 16:24:24 snj Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_openpic.h"
@@ -207,12 +207,6 @@ cpu_startup(void)
 	 * Now safe for bus space allocation to use malloc.
 	 */
 	bus_space_mallocok();
-
-	/*
-	 * Gather the pci interrupt routings.
- */
-	setup_pciroutinginfo();
-
 }
 
 /*

Index: src/sys/arch/prep/prep/mainbus.c
diff -u src/sys/arch/prep/prep/mainbus.c:1.33 src/sys/arch/prep/prep/mainbus.c:1.33.40.1
--- src/sys/arch/prep/prep/mainbus.c:1.33	Fri Jan 27 18:53:00 2012
+++ src/sys/arch/prep/prep/mainbus.c	Tue Aug 28 16:24:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.33 2012/01/27 18:53:00 para Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.33.40.1 2018/08/28 16:24:24 snj Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.33 2012/01/27 18:53:00 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.33.40.1 2018/08/28 16:24:24 snj Exp $");
 
 #include "opt_pci.h"
 #include "opt_residual.h"
@@ -140,6 +140,9 @@ mainbus_attach(device_t parent, device_t
 	SIMPLEQ_INIT(_pct->pc_pbi);
 	SIMPLEQ_INSERT_TAIL(_pct->pc_pbi, pbi, next);
 
+	/* fix pci interrupt routings on some models */
+	setup_pciroutinginfo();
+
 	/* find the primary host bridge */
 	setup_pciintr_map(pbi, 0, 0, 0);
 



CVS commit: src/sys/external/bsd/common/include/asm

2018-08-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 28 15:04:58 UTC 2018

Modified Files:
src/sys/external/bsd/common/include/asm: barrier.h

Log Message:
For module build assume multiprocessor.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/common/include/asm/barrier.h

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

Modified files:

Index: src/sys/external/bsd/common/include/asm/barrier.h
diff -u src/sys/external/bsd/common/include/asm/barrier.h:1.3 src/sys/external/bsd/common/include/asm/barrier.h:1.4
--- src/sys/external/bsd/common/include/asm/barrier.h:1.3	Mon Sep 11 07:33:45 2017
+++ src/sys/external/bsd/common/include/asm/barrier.h	Tue Aug 28 15:04:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: barrier.h,v 1.3 2017/09/11 07:33:45 maya Exp $	*/
+/*	$NetBSD: barrier.h,v 1.4 2018/08/28 15:04:58 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -36,6 +36,8 @@
 
 #ifdef _KERNEL_OPT
 #include "opt_multiprocessor.h"
+#else
+#define	MULTIPROCESSOR	1	/* safer to assume multiprocessor */
 #endif
 
 #define	mb	membar_sync



CVS commit: src/sys/external/bsd/drm2/linux

2018-08-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 28 15:04:02 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/linux: linux_fence.c

Log Message:
Issue __insn_barrier after loading hardclock_ticks.

For some reason this isn't volatile...


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/external/bsd/drm2/linux/linux_fence.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/external/bsd/drm2/linux/linux_fence.c
diff -u src/sys/external/bsd/drm2/linux/linux_fence.c:1.11 src/sys/external/bsd/drm2/linux/linux_fence.c:1.12
--- src/sys/external/bsd/drm2/linux/linux_fence.c:1.11	Tue Aug 28 15:03:39 2018
+++ src/sys/external/bsd/drm2/linux/linux_fence.c	Tue Aug 28 15:04:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_fence.c,v 1.11 2018/08/28 15:03:39 riastradh Exp $	*/
+/*	$NetBSD: linux_fence.c,v 1.12 2018/08/28 15:04:02 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_fence.c,v 1.11 2018/08/28 15:03:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_fence.c,v 1.12 2018/08/28 15:04:02 riastradh Exp $");
 
 #include 
 #include 
@@ -543,6 +543,7 @@ fence_wait_any_timeout(struct fence **fe
 	mutex_enter();
 	while (timeout > 0 && !common.done) {
 		start = hardclock_ticks;
+		__insn_barrier();
 		if (intr) {
 			if (timeout != MAX_SCHEDULE_TIMEOUT) {
 ret = -cv_timedwait_sig(,
@@ -562,6 +563,7 @@ fence_wait_any_timeout(struct fence **fe
 			}
 		}
 		end = hardclock_ticks;
+		__insn_barrier();
 		if (ret)
 			break;
 		timeout -= MIN(timeout, (unsigned)end - (unsigned)start);
@@ -672,6 +674,7 @@ fence_default_wait(struct fence *fence, 
 	/* Find out what our deadline is so we can handle spurious wakeup.  */
 	if (timeout < MAX_SCHEDULE_TIMEOUT) {
 		now = hardclock_ticks;
+		__insn_barrier();
 		starttime = now;
 		deadline = starttime + timeout;
 	}
@@ -684,6 +687,7 @@ fence_default_wait(struct fence *fence, 
 		 */
 		if (timeout < MAX_SCHEDULE_TIMEOUT) {
 			now = hardclock_ticks;
+			__insn_barrier();
 			if (deadline <= now)
 break;
 		}



CVS commit: src/sys/external/bsd/drm2/linux

2018-08-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 28 15:03:39 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/linux: linux_fence.c

Log Message:
Assert EWOULDBLOCK happens only with timeout.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/linux/linux_fence.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/external/bsd/drm2/linux/linux_fence.c
diff -u src/sys/external/bsd/drm2/linux/linux_fence.c:1.10 src/sys/external/bsd/drm2/linux/linux_fence.c:1.11
--- src/sys/external/bsd/drm2/linux/linux_fence.c:1.10	Tue Aug 28 14:23:02 2018
+++ src/sys/external/bsd/drm2/linux/linux_fence.c	Tue Aug 28 15:03:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_fence.c,v 1.10 2018/08/28 14:23:02 riastradh Exp $	*/
+/*	$NetBSD: linux_fence.c,v 1.11 2018/08/28 15:03:39 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_fence.c,v 1.10 2018/08/28 14:23:02 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_fence.c,v 1.11 2018/08/28 15:03:39 riastradh Exp $");
 
 #include 
 #include 
@@ -713,8 +713,11 @@ out:
 	spin_unlock(fence->lock);
 
 	/* If cv_timedwait gave up, return 0 meaning timeout.  */
-	if (ret == -EWOULDBLOCK)
+	if (ret == -EWOULDBLOCK) {
+		/* Only cv_timedwait and cv_timedwait_sig can return this.  */
+		KASSERT(timeout < MAX_SCHEDULE_TIMEOUT);
 		return 0;
+	}
 
 	/* If there was a timeout and the deadline passed, return 0.  */
 	if (timeout < MAX_SCHEDULE_TIMEOUT) {



CVS commit: src/sys/arch/arm/broadcom

2018-08-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 28 14:57:04 UTC 2018

Modified Files:
src/sys/arch/arm/broadcom: bcm283x_platform.c

Log Message:
Fix arm non-MULTIPROCESSOR build for RPI2


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/broadcom/bcm283x_platform.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/arm/broadcom/bcm283x_platform.c
diff -u src/sys/arch/arm/broadcom/bcm283x_platform.c:1.15 src/sys/arch/arm/broadcom/bcm283x_platform.c:1.16
--- src/sys/arch/arm/broadcom/bcm283x_platform.c:1.15	Sun Aug 26 18:15:49 2018
+++ src/sys/arch/arm/broadcom/bcm283x_platform.c	Tue Aug 28 14:57:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm283x_platform.c,v 1.15 2018/08/26 18:15:49 ryo Exp $	*/
+/*	$NetBSD: bcm283x_platform.c,v 1.16 2018/08/28 14:57:03 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.15 2018/08/26 18:15:49 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm283x_platform.c,v 1.16 2018/08/28 14:57:03 skrll Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_bcm283x.h"
@@ -799,6 +799,7 @@ bcm2836_bootstrap(void)
 		/* Wake up AP in case firmware has placed it in WFE state */
 		__asm __volatile("sev" ::: "memory");
 
+#ifdef MULTIPROCESSOR
 		/* Wait for APs to start */
 		for (int loop = 0; loop < 16; loop++) {
 			membar_consumer();
@@ -806,6 +807,7 @@ bcm2836_bootstrap(void)
 break;
 			gtmr_delay(1);
 		}
+#endif
 	}
 #endif
 



CVS commit: src/sys/arch/arm/arm32

2018-08-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 28 14:45:33 UTC 2018

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Fix arguments to align and align_offset for pmap_l2ptp_cache, i.e.align
is now L2_TABLE_SIZE_REAL and align_offset is now 0.  (There were
reversed previously)


To generate a diff of this commit:
cvs rdiff -u -r1.366 -r1.367 src/sys/arch/arm/arm32/pmap.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/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.366 src/sys/arch/arm/arm32/pmap.c:1.367
--- src/sys/arch/arm/arm32/pmap.c:1.366	Tue Jul 31 07:00:48 2018
+++ src/sys/arch/arm/arm32/pmap.c	Tue Aug 28 14:45:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.366 2018/07/31 07:00:48 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.367 2018/08/28 14:45:33 skrll Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -217,7 +217,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.366 2018/07/31 07:00:48 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.367 2018/08/28 14:45:33 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -6359,8 +6359,8 @@ pmap_bootstrap(vaddr_t vstart, vaddr_t v
 	/*
 	 * Initialise the L2 descriptor table pool and cache
 	 */
-	pool_cache_bootstrap(_l2ptp_cache, L2_TABLE_SIZE_REAL, 0,
-	L2_TABLE_SIZE_REAL, 0, "l2ptppl", NULL, IPL_NONE,
+	pool_cache_bootstrap(_l2ptp_cache, L2_TABLE_SIZE_REAL,
+	L2_TABLE_SIZE_REAL, 0, 0, "l2ptppl", NULL, IPL_NONE,
 	pmap_l2ptp_ctor, NULL, NULL);
 
 	mutex_init(, MUTEX_DEFAULT, IPL_NONE);



CVS commit: src/sys/external/bsd/drm2/linux

2018-08-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Aug 28 14:23:03 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/linux: linux_fence.c

Log Message:
With no timeout, fence_default_wait must return 1 on success, never 0.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/linux/linux_fence.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/external/bsd/drm2/linux/linux_fence.c
diff -u src/sys/external/bsd/drm2/linux/linux_fence.c:1.9 src/sys/external/bsd/drm2/linux/linux_fence.c:1.10
--- src/sys/external/bsd/drm2/linux/linux_fence.c:1.9	Mon Aug 27 14:40:44 2018
+++ src/sys/external/bsd/drm2/linux/linux_fence.c	Tue Aug 28 14:23:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_fence.c,v 1.9 2018/08/27 14:40:44 riastradh Exp $	*/
+/*	$NetBSD: linux_fence.c,v 1.10 2018/08/28 14:23:02 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_fence.c,v 1.9 2018/08/27 14:40:44 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_fence.c,v 1.10 2018/08/28 14:23:02 riastradh Exp $");
 
 #include 
 #include 
@@ -641,7 +641,7 @@ fence_wait(struct fence *fence, bool int
  *
  *	Default implementation of fence wait callback using a condition
  *	variable.  If the fence is already signalled, return timeout,
- *	or 0 if no timeout.  If the enable signalling callback hasn't
+ *	or 1 if no timeout.  If the enable signalling callback hasn't
  *	been called, call it, and if it fails, act as if the fence had
  *	been signalled.  Otherwise, wait on the internal condvar.  If
  *	timeout is MAX_SCHEDULE_TIMEOUT, treat it as no timeout.
@@ -659,7 +659,7 @@ fence_default_wait(struct fence *fence, 
 
 	/* Optimistically try to skip the lock if it's already signalled.  */
 	if (fence->flags & (1u << FENCE_FLAG_SIGNALED_BIT))
-		return (timeout < MAX_SCHEDULE_TIMEOUT ? timeout : 0);
+		return (timeout < MAX_SCHEDULE_TIMEOUT ? timeout : 1);
 
 	/* Acquire the lock.  */
 	spin_lock(fence->lock);
@@ -731,8 +731,8 @@ out:
 		return ret;
 
 	/*
-	 * Success!  Return the number of ticks left, at least 1, or 0
+	 * Success!  Return the number of ticks left, at least 1, or 1
 	 * if no timeout.
 	 */
-	return (timeout < MAX_SCHEDULE_TIMEOUT ? MIN(deadline - now, 1) : 0);
+	return (timeout < MAX_SCHEDULE_TIMEOUT ? MIN(deadline - now, 1) : 1);
 }



CVS commit: [netbsd-8] src/doc

2018-08-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 28 13:29:22 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.1

Log Message:
Tickets #992, #993 and #995


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/doc/CHANGES-8.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-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.15 src/doc/CHANGES-8.1:1.1.2.16
--- src/doc/CHANGES-8.1:1.1.2.15	Mon Aug 27 07:50:41 2018
+++ src/doc/CHANGES-8.1	Tue Aug 28 13:29:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.15 2018/08/27 07:50:41 martin Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.16 2018/08/28 13:29:22 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -621,3 +621,32 @@ sys/net/if.c	1.434
 	Restore splx() removed accidentally in rev 1.406
 	[ozaki-r, ticket #991]
 
+bin/df/df.1	1.48,1.49
+bin/df/df.c	1.93
+bin/ksh/ksh.Man	1.26
+bin/ln/ln.c	1.40
+external/bsd/top/dist/top.1.in			1.11
+sbin/amrctl/amrctl.c1.11
+sbin/fsck_ext2fs/fsck_ext2fs.8			1.21
+sbin/fsck_ext2fs/main.c1.38
+sbin/gpt/main.c	1.12
+
+	Various minor man / usage fixes.
+	[sevan, ticket #992]
+
+sbin/fdisk/fdisk.c1.155
+
+	Add missing -z flag to usage().
+	[sevan, ticket #993]
+
+xsrc/external/mit/libX11/dist/src/FontNames.c	(patch)
+xsrc/external/mit/libX11/dist/src/GetFPath.c	(patch)
+xsrc/external/mit/libX11/dist/src/LiHosts.c	(patch)
+xsrc/external/mit/libX11/dist/src/ListExt.c	(patch)
+
+	Apply fixes from libX11 1.6.5 for the following vulnerabilities:
+	Fixed off-by-one writes (CVE-2018-14599)
+	Validation of server response in XListHosts
+	Fixed out of boundary write (CVE-2018-14600)
+	Fixed crash on invalid reply (CVE-2018-14598)
+	[mrg, ticket #995]



CVS commit: [netbsd-8] xsrc/external/mit/libX11/dist/src

2018-08-28 Thread Martin Husemann
Module Name:xsrc
Committed By:   martin
Date:   Tue Aug 28 13:27:24 UTC 2018

Modified Files:
xsrc/external/mit/libX11/dist/src [netbsd-8]: FontNames.c GetFPath.c
LiHosts.c ListExt.c

Log Message:
Apply patch, requested by mrg in ticket #995:

xsrc/external/mit/libX11/dist/src/FontNames.c
xsrc/external/mit/libX11/dist/src/GetFPath.c
xsrc/external/mit/libX11/dist/src/LiHosts.c
xsrc/external/mit/libX11/dist/src/ListExt.c

Apply fixes from libX11 1.6.5 for the following vulnerabilities:
Fixed off-by-one writes (CVE-2018-14599)
Validation of server response in XListHosts
Fixed out of boundary write (CVE-2018-14600)
Fixed crash on invalid reply (CVE-2018-14598)
(Backport of upstream git commits b469da1430cdcee06e31c6251b83aede072a1ff0,
 d81da209fd4d0c2c9ad0596a8078e58864479d0d,
 dbf72805fd9d7b1846fe9a11b46f3994bfc27fea,
 e83722768fd5c467ef61fa159e8c6278770b45c2 resp)


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.2.1 xsrc/external/mit/libX11/dist/src/FontNames.c
cvs rdiff -u -r1.5 -r1.5.2.1 xsrc/external/mit/libX11/dist/src/GetFPath.c \
xsrc/external/mit/libX11/dist/src/ListExt.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.10.1 \
xsrc/external/mit/libX11/dist/src/LiHosts.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/libX11/dist/src/FontNames.c
diff -u xsrc/external/mit/libX11/dist/src/FontNames.c:1.6 xsrc/external/mit/libX11/dist/src/FontNames.c:1.6.2.1
--- xsrc/external/mit/libX11/dist/src/FontNames.c:1.6	Sat Mar  4 22:00:21 2017
+++ xsrc/external/mit/libX11/dist/src/FontNames.c	Tue Aug 28 13:27:24 2018
@@ -88,24 +88,16 @@ int *actualCount)	/* RETURN */
 	 * unpack into null terminated strings.
 	 */
 	chstart = ch;
-	chend = ch + (rlen + 1);
+	chend = ch + rlen;
 	length = *(unsigned char *)ch;
 	*ch = 1; /* make sure it is non-zero for XFreeFontNames */
 	for (i = 0; i < rep.nFonts; i++) {
 	if (ch + length < chend) {
 		flist[i] = ch + 1;  /* skip over length */
 		ch += length + 1;  /* find next length ... */
-		if (ch <= chend) {
-		length = *(unsigned char *)ch;
-		*ch = '\0';  /* and replace with null-termination */
-		count++;
-		} else {
-Xfree(chstart);
-Xfree(flist);
-flist = NULL;
-count = 0;
-break;
-		}
+		length = *(unsigned char *)ch;
+		*ch = '\0';  /* and replace with null-termination */
+		count++;
 	} else {
 Xfree(chstart);
 Xfree(flist);

Index: xsrc/external/mit/libX11/dist/src/GetFPath.c
diff -u xsrc/external/mit/libX11/dist/src/GetFPath.c:1.5 xsrc/external/mit/libX11/dist/src/GetFPath.c:1.5.2.1
--- xsrc/external/mit/libX11/dist/src/GetFPath.c:1.5	Tue Oct  4 22:04:39 2016
+++ xsrc/external/mit/libX11/dist/src/GetFPath.c	Tue Aug 28 13:27:24 2018
@@ -69,15 +69,20 @@ char **XGetFontPath(
 	/*
 	 * unpack into null terminated strings.
 	 */
-	chend = ch + (nbytes + 1);
-	length = *ch;
+	chend = ch + nbytes;
+	length = *(unsigned char *)ch;
 	for (i = 0; i < rep.nPaths; i++) {
 		if (ch + length < chend) {
 		flist[i] = ch+1;  /* skip over length */
 		ch += length + 1; /* find next length ... */
-		length = *ch;
+		length = *(unsigned char *)ch;
 		*ch = '\0'; /* and replace with null-termination */
 		count++;
+		} else if (i == 0) {
+		Xfree(flist);
+		Xfree(ch);
+		flist = NULL;
+		break;
 		} else
 		flist[i] = NULL;
 	}
Index: xsrc/external/mit/libX11/dist/src/ListExt.c
diff -u xsrc/external/mit/libX11/dist/src/ListExt.c:1.5 xsrc/external/mit/libX11/dist/src/ListExt.c:1.5.2.1
--- xsrc/external/mit/libX11/dist/src/ListExt.c:1.5	Tue Oct  4 22:04:39 2016
+++ xsrc/external/mit/libX11/dist/src/ListExt.c	Tue Aug 28 13:27:24 2018
@@ -74,19 +74,20 @@ char **XListExtensions(
 	/*
 	 * unpack into null terminated strings.
 	 */
-	chend = ch + (rlen + 1);
-	length = *ch;
+	chend = ch + rlen;
+	length = *(unsigned char *)ch;
 	for (i = 0; i < rep.nExtensions; i++) {
 		if (ch + length < chend) {
 		list[i] = ch+1;  /* skip over length */
 		ch += length + 1; /* find next length ... */
-		if (ch <= chend) {
-			length = *ch;
-			*ch = '\0'; /* and replace with null-termination */
-			count++;
-		} else {
-			list[i] = NULL;
-		}
+		length = *(unsigned char *)ch;
+		*ch = '\0'; /* and replace with null-termination */
+		count++;
+		} else if (i == 0) {
+		Xfree(list);
+		Xfree(ch);
+		list = NULL;
+		break;
 		} else
 		list[i] = NULL;
 	}

Index: xsrc/external/mit/libX11/dist/src/LiHosts.c
diff -u xsrc/external/mit/libX11/dist/src/LiHosts.c:1.1.1.5 xsrc/external/mit/libX11/dist/src/LiHosts.c:1.1.1.5.10.1
--- xsrc/external/mit/libX11/dist/src/LiHosts.c:1.1.1.5	Thu May 30 23:04:40 2013
+++ 

CVS commit: [netbsd-8] src/sbin/fdisk

2018-08-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 28 13:23:34 UTC 2018

Modified Files:
src/sbin/fdisk [netbsd-8]: fdisk.c

Log Message:
Pull up following revision(s) (requested by sevan in ticket #993):

sbin/fdisk/fdisk.c: revision 1.155

Add missing -z flag to usage()


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.153.8.1 src/sbin/fdisk/fdisk.c

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

Modified files:

Index: src/sbin/fdisk/fdisk.c
diff -u src/sbin/fdisk/fdisk.c:1.153 src/sbin/fdisk/fdisk.c:1.153.8.1
--- src/sbin/fdisk/fdisk.c:1.153	Sun Nov 22 15:53:10 2015
+++ src/sbin/fdisk/fdisk.c	Tue Aug 28 13:23:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdisk.c,v 1.153 2015/11/22 15:53:10 christos Exp $ */
+/*	$NetBSD: fdisk.c,v 1.153.8.1 2018/08/28 13:23:34 martin Exp $ */
 
 /*
  * Mach Operating System
@@ -39,7 +39,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: fdisk.c,v 1.153 2015/11/22 15:53:10 christos Exp $");
+__RCSID("$NetBSD: fdisk.c,v 1.153.8.1 2018/08/28 13:23:34 martin Exp $");
 #endif /* not lint */
 
 #define MBRPTYPENAMES
@@ -677,7 +677,7 @@ usage(void)
 		"[-s [id][/[start][/[size][/bootmenu \\\n"
 		"%*s[-t disktab] [-T disktype] \\\n"
 		"%*s[-c bootcode] "
-		"[-r|-w file] [device]\n"
+		"[-r|-w file] [-z sectorsize] [device]\n"
 		"\t-a change active partition\n"
 		"\t-f force - not interactive\n"
 		"\t-i initialise MBR code\n"



CVS commit: [netbsd-8] src

2018-08-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 28 13:21:42 UTC 2018

Modified Files:
src/bin/df [netbsd-8]: df.1 df.c
src/bin/ksh [netbsd-8]: ksh.Man
src/bin/ln [netbsd-8]: ln.c
src/external/bsd/top/dist [netbsd-8]: top.1.in
src/sbin/amrctl [netbsd-8]: amrctl.c
src/sbin/fsck_ext2fs [netbsd-8]: fsck_ext2fs.8 main.c
src/sbin/gpt [netbsd-8]: main.c

Log Message:
Pull up following revision(s) (requested by sevan in ticket #992):

external/bsd/top/dist/top.1.in: revision 1.11
sbin/gpt/main.c: revision 1.12
sbin/amrctl/amrctl.c: revision 1.11
bin/df/df.c: revision 1.93
sbin/fsck_ext2fs/fsck_ext2fs.8: revision 1.21
sbin/fsck_ext2fs/main.c: revision 1.38
bin/ksh/ksh.Man: revision 1.26
bin/ln/ln.c: revision 1.40
bin/df/df.1: revision 1.48
bin/df/df.1: revision 1.49

Document the WCPU field.

Match SYNOPSIS with usage()

-G cannot be specified alongside -i or -P.
Heads up by 

Add -l to SYNOPSIS

Update usage to include -w

Match sequence as per SYNOPSIS in manual

Remove reference to -c flag which was never implemented.

Remove references to -c flag which was never included.

Add the -T flag to usage()


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.6.1 src/bin/df/df.1
cvs rdiff -u -r1.92 -r1.92.8.1 src/bin/df/df.c
cvs rdiff -u -r1.25 -r1.25.8.1 src/bin/ksh/ksh.Man
cvs rdiff -u -r1.39 -r1.39.4.1 src/bin/ln/ln.c
cvs rdiff -u -r1.10 -r1.10.6.1 src/external/bsd/top/dist/top.1.in
cvs rdiff -u -r1.10 -r1.10.18.1 src/sbin/amrctl/amrctl.c
cvs rdiff -u -r1.20 -r1.20.6.1 src/sbin/fsck_ext2fs/fsck_ext2fs.8
cvs rdiff -u -r1.37 -r1.37.34.1 src/sbin/fsck_ext2fs/main.c
cvs rdiff -u -r1.10.4.1 -r1.10.4.2 src/sbin/gpt/main.c

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

Modified files:

Index: src/bin/df/df.1
diff -u src/bin/df/df.1:1.46 src/bin/df/df.1:1.46.6.1
--- src/bin/df/df.1:1.46	Wed Aug 10 23:48:14 2016
+++ src/bin/df/df.1	Tue Aug 28 13:21:42 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: df.1,v 1.46 2016/08/10 23:48:14 sevan Exp $
+.\"	$NetBSD: df.1,v 1.46.6.1 2018/08/28 13:21:42 martin Exp $
 .\"
 .\" Copyright (c) 1989, 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)df.1	8.2 (Berkeley) 1/13/92
 .\"
-.Dd August 10, 2016
+.Dd August 27, 2018
 .Dt DF 1
 .Os
 .Sh NAME
@@ -37,8 +37,8 @@
 .Nd display free disk space
 .Sh SYNOPSIS
 .Nm
-.Op Fl agklmn
-.Op Fl G | Fl i | Fl P
+.Op Fl agln
+.Op Fl Ghkm | Fl ihkm | Fl Pk
 .Op Fl t Ar type
 .Op Ar file | Ar file_system ...
 .Sh DESCRIPTION

Index: src/bin/df/df.c
diff -u src/bin/df/df.c:1.92 src/bin/df/df.c:1.92.8.1
--- src/bin/df/df.c:1.92	Sat Mar  5 08:15:01 2016
+++ src/bin/df/df.c	Tue Aug 28 13:21:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: df.c,v 1.92 2016/03/05 08:15:01 kamil Exp $ */
+/*	$NetBSD: df.c,v 1.92.8.1 2018/08/28 13:21:42 martin Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993, 1994
@@ -45,7 +45,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = "@(#)df.c	8.7 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: df.c,v 1.92 2016/03/05 08:15:01 kamil Exp $");
+__RCSID("$NetBSD: df.c,v 1.92.8.1 2018/08/28 13:21:42 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -512,7 +512,7 @@ usage(void)
 {
 
 	(void)fprintf(stderr,
-	"Usage: %s [-aGgln] [-hkm|-ihkm|-Pk] [-t type] [file | "
+	"Usage: %s [-agln] [-Ghkm|-ihkm|-Pk] [-t type] [file | "
 	"file_system ...]\n",
 	getprogname());
 	exit(1);

Index: src/bin/ksh/ksh.Man
diff -u src/bin/ksh/ksh.Man:1.25 src/bin/ksh/ksh.Man:1.25.8.1
--- src/bin/ksh/ksh.Man:1.25	Wed Dec 30 22:26:26 2015
+++ src/bin/ksh/ksh.Man	Tue Aug 28 13:21:42 2018
@@ -1,5 +1,5 @@
 '\" t
-.\" $NetBSD: ksh.Man,v 1.25 2015/12/30 22:26:26 christos Exp $
+.\" $NetBSD: ksh.Man,v 1.25.8.1 2018/08/28 13:21:42 martin Exp $
 .\"{{{}}}
 .\"{{{  Notes about man page
 .\" - use the pseudo-macros .sh( and .sh) to begin and end sh-specific
@@ -19,10 +19,10 @@
 .\"}}}
 .\"{{{  Title
 .ksh(
-.TH KSH 1 "April 12, 2015" "" "User commands"
+.TH KSH 1 "August 26, 2018" "" "User commands"
 .ksh)
 .sh(
-.TH SH 1 "April 12, 2015" "" "User commands"
+.TH SH 1 "August 26, 2018" "" "User commands"
 .sh)
 .\"}}}
 .\"{{{  Name
@@ -43,7 +43,7 @@ sh \- Public domain Bourne shell
 .sh(
 \fBsh\fP
 .sh)
-[\fB\(+-abCefhikmnprsuvxX\fP] [\fB\(+-o\fP \fIoption\fP] [ [ \fB\-c\fP \fIcommand-string\fP [\fIcommand-name\fP] | \fB\-s\fP | \fIfile\fP ] [\fIargument\fP ...] ]
+[\fB\(+-abCefhiklmnprsuvxX\fP] [\fB\(+-o\fP \fIoption\fP] [ [ \fB\-c\fP \fIcommand-string\fP [\fIcommand-name\fP] | \fB\-s\fP | \fIfile\fP ] [\fIargument\fP ...] ]
 .ad b
 .\"}}}
 .\"{{{  Description

Index: src/bin/ln/ln.c
diff -u src/bin/ln/ln.c:1.39 src/bin/ln/ln.c:1.39.4.1
--- src/bin/ln/ln.c:1.39	Sat Apr 22 12:22:31 2017
+++ src/bin/ln/ln.c	Tue Aug 28 13:21:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ln.c,v 1.39 2017/04/22 12:22:31 

CVS commit: [netbsd-7] src/doc

2018-08-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 28 13:17:03 UTC 2018

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

Log Message:
Ticket #1635


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.107 -r1.1.2.108 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.107 src/doc/CHANGES-7.2:1.1.2.108
--- src/doc/CHANGES-7.2:1.1.2.107	Sat Aug 25 17:07:03 2018
+++ src/doc/CHANGES-7.2	Tue Aug 28 13:17:03 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.107 2018/08/25 17:07:03 martin Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.108 2018/08/28 13:17:03 martin Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -6055,3 +6055,17 @@ doc/3RDPARTY	1.1520 (patch)
 
 	Import tzdata2018e
 	[kre, ticket #1634]
+
+xsrc/external/mit/libX11/dist/src/FontNames.	(patch)
+xsrc/external/mit/libX11/dist/src/GetFPath.c	(patch)
+xsrc/external/mit/libX11/dist/src/LiHosts.c	(patch)
+xsrc/external/mit/libX11/dist/src/ListExt.c	(patch)
+
+	Apply fixes from libX11 1.6.5 for the following vulnerabilities:
+	Fixed off-by-one writes (CVE-2018-14599)
+	Validation of server response in XListHosts
+	Fixed out of boundary write (CVE-2018-14600)
+	Fixed crash on invalid reply (CVE-2018-14598)
+	[mrg, ticket #1635]
+
+



CVS commit: [netbsd-7] xsrc/external/mit/libX11/dist/src

2018-08-28 Thread Martin Husemann
Module Name:xsrc
Committed By:   martin
Date:   Tue Aug 28 13:14:50 UTC 2018

Modified Files:
xsrc/external/mit/libX11/dist/src [netbsd-7]: FontNames.c GetFPath.c
LiHosts.c ListExt.c

Log Message:
Apply patch, requested by mrg in ticket #1635:

xsrc/external/mit/libX11/dist/src/FontNames.c
xsrc/external/mit/libX11/dist/src/GetFPath.c
xsrc/external/mit/libX11/dist/src/LiHosts.c
xsrc/external/mit/libX11/dist/src/ListExt.c

Apply fixes from libX11 1.6.5 for the following vulnerabilities:
Fixed off-by-one writes (CVE-2018-14599)
Validation of server response in XListHosts
Fixed out of boundary write (CVE-2018-14600)
Fixed crash on invalid reply (CVE-2018-14598)
(Backport of upstream git commits b469da1430cdcee06e31c6251b83aede072a1ff0,
 d81da209fd4d0c2c9ad0596a8078e58864479d0d,
 dbf72805fd9d7b1846fe9a11b46f3994bfc27fea,
 e83722768fd5c467ef61fa159e8c6278770b45c2 resp.)


To generate a diff of this commit:
cvs rdiff -u -r1.3.2.1 -r1.3.2.2 \
xsrc/external/mit/libX11/dist/src/FontNames.c \
xsrc/external/mit/libX11/dist/src/ListExt.c
cvs rdiff -u -r1.3 -r1.3.2.1 xsrc/external/mit/libX11/dist/src/GetFPath.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.4.1 \
xsrc/external/mit/libX11/dist/src/LiHosts.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/libX11/dist/src/FontNames.c
diff -u xsrc/external/mit/libX11/dist/src/FontNames.c:1.3.2.1 xsrc/external/mit/libX11/dist/src/FontNames.c:1.3.2.2
--- xsrc/external/mit/libX11/dist/src/FontNames.c:1.3.2.1	Wed Oct  5 09:41:45 2016
+++ xsrc/external/mit/libX11/dist/src/FontNames.c	Tue Aug 28 13:14:50 2018
@@ -86,23 +86,16 @@ int *actualCount)	/* RETURN */
 	/*
 	 * unpack into null terminated strings.
 	 */
-	chend = ch + (rlen + 1);
+	chend = ch + rlen;
 	length = *(unsigned char *)ch;
 	*ch = 1; /* make sure it is non-zero for XFreeFontNames */
 	for (i = 0; i < rep.nFonts; i++) {
 	if (ch + length < chend) {
 		flist[i] = ch + 1;  /* skip over length */
 		ch += length + 1;  /* find next length ... */
-		if (ch <= chend) {
-		length = *(unsigned char *)ch;
-		*ch = '\0';  /* and replace with null-termination */
-		count++;
-		} else {
-Xfree(flist);
-flist = NULL;
-count = 0;
-break;
-		}
+		length = *(unsigned char *)ch;
+		*ch = '\0';  /* and replace with null-termination */
+		count++;
 	} else {
 Xfree(flist);
 flist = NULL;
Index: xsrc/external/mit/libX11/dist/src/ListExt.c
diff -u xsrc/external/mit/libX11/dist/src/ListExt.c:1.3.2.1 xsrc/external/mit/libX11/dist/src/ListExt.c:1.3.2.2
--- xsrc/external/mit/libX11/dist/src/ListExt.c:1.3.2.1	Wed Oct  5 09:41:45 2016
+++ xsrc/external/mit/libX11/dist/src/ListExt.c	Tue Aug 28 13:14:50 2018
@@ -74,19 +74,20 @@ char **XListExtensions(
 	/*
 	 * unpack into null terminated strings.
 	 */
-	chend = ch + (rlen + 1);
-	length = *ch;
+	chend = ch + rlen;
+	length = *(unsigned char *)ch;
 	for (i = 0; i < rep.nExtensions; i++) {
 		if (ch + length < chend) {
 		list[i] = ch+1;  /* skip over length */
 		ch += length + 1; /* find next length ... */
-		if (ch <= chend) {
-			length = *ch;
-			*ch = '\0'; /* and replace with null-termination */
-			count++;
-		} else {
-			list[i] = NULL;
-		}
+		length = *(unsigned char *)ch;
+		*ch = '\0'; /* and replace with null-termination */
+		count++;
+		} else if (i == 0) {
+		Xfree(list);
+		Xfree(ch);
+		list = NULL;
+		break;
 		} else
 		list[i] = NULL;
 	}

Index: xsrc/external/mit/libX11/dist/src/GetFPath.c
diff -u xsrc/external/mit/libX11/dist/src/GetFPath.c:1.3 xsrc/external/mit/libX11/dist/src/GetFPath.c:1.3.2.1
--- xsrc/external/mit/libX11/dist/src/GetFPath.c:1.3	Sun Mar 16 22:48:34 2014
+++ xsrc/external/mit/libX11/dist/src/GetFPath.c	Tue Aug 28 13:14:50 2018
@@ -69,15 +69,20 @@ char **XGetFontPath(
 	/*
 	 * unpack into null terminated strings.
 	 */
-	chend = ch + (nbytes + 1);
-	length = *ch;
+	chend = ch + nbytes;
+	length = *(unsigned char *)ch;
 	for (i = 0; i < rep.nPaths; i++) {
 		if (ch + length < chend) {
 		flist[i] = ch+1;  /* skip over length */
 		ch += length + 1; /* find next length ... */
-		length = *ch;
+		length = *(unsigned char *)ch;
 		*ch = '\0'; /* and replace with null-termination */
 		count++;
+		} else if (i == 0) {
+		Xfree(flist);
+		Xfree(ch);
+		flist = NULL;
+		break;
 		} else
 		flist[i] = NULL;
 	}

Index: xsrc/external/mit/libX11/dist/src/LiHosts.c
diff -u xsrc/external/mit/libX11/dist/src/LiHosts.c:1.1.1.5 xsrc/external/mit/libX11/dist/src/LiHosts.c:1.1.1.5.4.1
--- xsrc/external/mit/libX11/dist/src/LiHosts.c:1.1.1.5	Thu May 30 23:04:40 2013
+++ 

CVS commit: src/external/bsd/ntp

2018-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 28 11:11:18 UTC 2018

Modified Files:
src/external/bsd/ntp/dist: configure.ac
src/external/bsd/ntp/dist/libntp: work_fork.c
src/external/bsd/ntp/include: config.h

Log Message:
- use setproctitle if we have it
- emulate setproctitle better


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.11 -r1.2 src/external/bsd/ntp/dist/configure.ac
cvs rdiff -u -r1.11 -r1.12 src/external/bsd/ntp/dist/libntp/work_fork.c
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/ntp/include/config.h

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/ntp/dist/configure.ac
diff -u src/external/bsd/ntp/dist/configure.ac:1.1.1.11 src/external/bsd/ntp/dist/configure.ac:1.2
--- src/external/bsd/ntp/dist/configure.ac:1.1.1.11	Fri Apr  6 20:15:44 2018
+++ src/external/bsd/ntp/dist/configure.ac	Tue Aug 28 07:11:18 2018
@@ -857,7 +857,7 @@ AC_CHECK_FUNCS(
 )]
 )
 
-AC_CHECK_FUNCS([fnmatch getbootfile getuid getrusage nanosleep strsignal])
+AC_CHECK_FUNCS([fnmatch getbootfile getuid getrusage nanosleep strsignal setproctitle])
 
 # kvm_open() is only used by tickadj.  Also see above.
 case "$ac_cv_header_kvm_h" in

Index: src/external/bsd/ntp/dist/libntp/work_fork.c
diff -u src/external/bsd/ntp/dist/libntp/work_fork.c:1.11 src/external/bsd/ntp/dist/libntp/work_fork.c:1.12
--- src/external/bsd/ntp/dist/libntp/work_fork.c:1.11	Thu Apr 13 16:17:42 2017
+++ src/external/bsd/ntp/dist/libntp/work_fork.c	Tue Aug 28 07:11:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: work_fork.c,v 1.11 2017/04/13 20:17:42 christos Exp $	*/
+/*	$NetBSD: work_fork.c,v 1.12 2018/08/28 11:11:18 christos Exp $	*/
 
 /*
  * work_fork.c - fork implementation for blocking worker child.
@@ -432,6 +432,32 @@ fork_deferred_worker(void)
 }
 #endif
 
+#if HAVE_SETPROCTITLE == 0
+static void
+setproctitle(const char *fmt, ...)
+{
+	va_list ap;
+	char b1[128];
+	int argcc, argvlen, l;
+
+	if (saved_argc == 0)
+		return;
+
+	va_start(ap, fmt);
+	vsnprintf(b1, sizeof(b1), fmt, ap);
+	va_end(ap);
+
+	/* Clear argv */
+	for (argvlen = 0, argcc = 0; argcc < saved_argc; argcc++) {
+		l = strlen(saved_argv[argcc]);
+		argvlen += l + 1;
+		memset(saved_argv[argcc], 0, l);
+	}
+	l = snprintf(saved_argv[0], argvlen, "ntpd: %s", b1);
+	for (argcc = 1; argcc < saved_argc; argcc++)
+		saved_argv[argcc] = _argv[0][l];
+}
+#endif
 
 static void
 fork_blocking_child(
@@ -543,17 +569,7 @@ fork_blocking_child(
 	 * Change the process name of the child to avoid confusion
 	 * about ntpd trunning twice.
 	 */
-	if (saved_argc != 0) {
-		int argcc;
-		int argvlen = 0;
-		/* Clear argv */
-		for (argcc = 0; argcc < saved_argc; argcc++) {
-			int l = strlen(saved_argv[argcc]);
-			argvlen += l + 1;
-			memset(saved_argv[argcc], 0, l);
-		}
-		strlcpy(saved_argv[0], "ntpd: asynchronous dns resolver", argvlen);
-	}
+	setproctitle("asynchronous dns resolver");
 
 	/*
 	 * In the child, close all files except stdin, stdout, stderr,

Index: src/external/bsd/ntp/include/config.h
diff -u src/external/bsd/ntp/include/config.h:1.21 src/external/bsd/ntp/include/config.h:1.22
--- src/external/bsd/ntp/include/config.h:1.21	Mon Apr  9 15:33:14 2018
+++ src/external/bsd/ntp/include/config.h	Tue Aug 28 07:11:18 2018
@@ -330,6 +330,8 @@
 /* Define to 1 if you have `alloca', as a function or macro. */
 #define HAVE_ALLOCA 1
 
+#define HAVE_SETPROCTITLE 1
+
 /* Define to 1 if you have  and it should be used (not on Ultrix).
*/
 /* #undef HAVE_ALLOCA_H */



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

2018-08-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 28 09:42:11 UTC 2018

Modified Files:
src/distrib/sets/lists/modules: md.amd64 md.i386

Log Message:
Add drmkms_agp module


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/distrib/sets/lists/modules/md.amd64
cvs rdiff -u -r1.80 -r1.81 src/distrib/sets/lists/modules/md.i386

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/modules/md.amd64
diff -u src/distrib/sets/lists/modules/md.amd64:1.76 src/distrib/sets/lists/modules/md.amd64:1.77
--- src/distrib/sets/lists/modules/md.amd64:1.76	Tue Jul 24 09:47:35 2018
+++ src/distrib/sets/lists/modules/md.amd64	Tue Aug 28 09:42:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: md.amd64,v 1.76 2018/07/24 09:47:35 maxv Exp $
+# $NetBSD: md.amd64,v 1.77 2018/08/28 09:42:10 martin Exp $
 #
 # NOTE that there are two sets of files here:
 # @MODULEDIR@ and amd64-xen
@@ -77,6 +77,8 @@
 ./@MODULEDIR@/drmkms/drmkms.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/drmkms_linux			base-kernel-modules	kmod
 ./@MODULEDIR@/drmkms_linux/drmkms_linux.kmod	base-kernel-modules	kmod
+./@MODULEDIR@/drmkms_agp			base-kernel-modules	kmod
+./@MODULEDIR@/drmkms_agp/drmkms_agp.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/drmkms_pci			base-kernel-modules	kmod
 ./@MODULEDIR@/drmkms_pci/drmkms_pci.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/dtrace_syscall_linux32		base-kernel-modules	kmod,dtrace

Index: src/distrib/sets/lists/modules/md.i386
diff -u src/distrib/sets/lists/modules/md.i386:1.80 src/distrib/sets/lists/modules/md.i386:1.81
--- src/distrib/sets/lists/modules/md.i386:1.80	Tue Jul 24 09:47:35 2018
+++ src/distrib/sets/lists/modules/md.i386	Tue Aug 28 09:42:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: md.i386,v 1.80 2018/07/24 09:47:35 maxv Exp $
+# $NetBSD: md.i386,v 1.81 2018/08/28 09:42:10 martin Exp $
 #
 # NOTE that there are three sets of files here:
 # @MODULEDIR@, i386-xen, and i386pae-xen
@@ -76,6 +76,8 @@
 ./@MODULEDIR@/drmkms/drmkms.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/drmkms_linux			base-kernel-modules	kmod
 ./@MODULEDIR@/drmkms_linux/drmkms_linux.kmod	base-kernel-modules	kmod
+./@MODULEDIR@/drmkms_agp			base-kernel-modules	kmod
+./@MODULEDIR@/drmkms_agp/drmkms_agp.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/drmkms_pci			base-kernel-modules	kmod
 ./@MODULEDIR@/drmkms_pci/drmkms_pci.kmod	base-kernel-modules	kmod
 ./@MODULEDIR@/emdtvbase-kernel-modules	kmod



CVS commit: src/sys/external/bsd/vchiq/dist/interface/compat

2018-08-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 28 09:25:21 UTC 2018

Modified Files:
src/sys/external/bsd/vchiq/dist/interface/compat: vchi_bsd.h

Log Message:
Remove stuff now in sys/external/bsd/common


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h

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

Modified files:

Index: src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h
diff -u src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h:1.14 src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h:1.15
--- src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h:1.14	Sun Nov  5 09:11:43 2017
+++ src/sys/external/bsd/vchiq/dist/interface/compat/vchi_bsd.h	Tue Aug 28 09:25:21 2018
@@ -216,32 +216,6 @@ device_rlprintf(int pps, device_t dev, c
 
 #define vchiq_static_assert(cond) CTASSERT(cond)
 
-#define KERN_EMERG	"<0>"	/* system is unusable			*/
-#define KERN_ALERT	"<1>"	/* action must be taken immediately	*/
-#define KERN_CRIT	"<2>"	/* critical conditions			*/
-#define KERN_ERR	"<3>"	/* error conditions			*/
-#define KERN_WARNING	"<4>"	/* warning conditions			*/
-#define KERN_NOTICE	"<5>"	/* normal but significant condition	*/
-#define KERN_INFO	"<6>"	/* informational			*/
-#define KERN_DEBUG	"<7>"	/* debug-level messages			*/
-#define KERN_CONT	""
-
-#define printk(fmt, args...)		printf(fmt, ##args)
-#define vprintk(fmt, args)		vprintf(fmt, args)
-
-/*
- * Malloc API
- */
-#define GFP_KERNEL	0
-#define GFP_ATOMIC	0
-
-MALLOC_DECLARE(M_VCHI);
-
-#define kmalloc(size, flags)	malloc((size), M_VCHI, M_NOWAIT | M_ZERO)
-#define kcalloc(n, size, flags)	malloc((n) * (size), M_VCHI, M_NOWAIT | M_ZERO)
-#define kzalloc(a, b)		kcalloc(1, (a), (b))
-#define kfree(p)		do { if (p) free(p, M_VCHI); } while (0)
-
 /*
  * Kernel module API
  */



CVS commit: src/crypto/dist/ipsec-tools/src/racoon

2018-08-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Aug 28 09:10:28 UTC 2018

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon: privsep.c

Log Message:
fix memory leaks: https://github.com/NetBSD/src/issues/6


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/crypto/dist/ipsec-tools/src/racoon/privsep.c

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

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/privsep.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/privsep.c:1.24 src/crypto/dist/ipsec-tools/src/racoon/privsep.c:1.25
--- src/crypto/dist/ipsec-tools/src/racoon/privsep.c:1.24	Sat May 19 15:23:15 2018
+++ src/crypto/dist/ipsec-tools/src/racoon/privsep.c	Tue Aug 28 05:10:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: privsep.c,v 1.24 2018/05/19 19:23:15 maxv Exp $	*/
+/*	$NetBSD: privsep.c,v 1.25 2018/08/28 09:10:28 christos Exp $	*/
 
 /* Id: privsep.c,v 1.15 2005/08/08 11:23:44 vanhu Exp */
 
@@ -917,7 +917,7 @@ privsep_eay_get_pkcs1privkey(path) 
 	memcpy(msg + 1, path, msg->bufs.buflen[0]);
 
 	if (privsep_send(privsep_sock[1], msg, len) != 0)
-		return NULL;
+		goto out;
 
 	if (privsep_recv(privsep_sock[1], , ) != 0)
 		return NULL;
@@ -1034,13 +1034,14 @@ privsep_script_exec(script, name, envp)
 	 * And send it!
 	 */
 	if (privsep_send(privsep_sock[1], msg, msg->hdr.ac_len) != 0)
-		return -1;
+		goto out;
 
 	if (privsep_recv(privsep_sock[1], , ) != 0)
 		return -1;
 
 	if (msg->hdr.ac_errno != 0) {
 		errno = msg->hdr.ac_errno;
+out:
 		racoon_free(msg);
 		return -1;
 	}
@@ -1081,7 +1082,7 @@ privsep_getpsk(str, keylen)
 	memcpy(data, , sizeof(keylen));
 
 	if (privsep_send(privsep_sock[1], msg, len) != 0)
-		return NULL;
+		goto out;
 
 	if (privsep_recv(privsep_sock[1], , ) != 0)
 		return NULL;
@@ -1354,12 +1355,13 @@ privsep_xauth_login_system(usr, pwd)
 	
 	/* frees msg */
 	if (privsep_send(privsep_sock[1], msg, len) != 0)
-		return -1;
+		goto out;
 
 	if (privsep_recv(privsep_sock[1], , ) != 0)
 		return -1;
 
 	if (msg->hdr.ac_errno != 0) {
+out:
 		racoon_free(msg);
 		return -1;
 	}
@@ -1416,7 +1418,7 @@ privsep_accounting_system(port, raddr, u
 
 	/* frees msg */
 	if (privsep_send(privsep_sock[1], msg, len) != 0)
-		return -1;
+		goto out;
 
 	if (privsep_recv(privsep_sock[1], , ) != 0)
 		return -1;
@@ -1664,7 +1666,7 @@ privsep_accounting_pam(port, inout)
 
 	/* frees msg */
 	if (privsep_send(privsep_sock[1], msg, len) != 0)
-		return -1;
+		goto out;
 
 	if (privsep_recv(privsep_sock[1], , ) != 0)
 		return -1;
@@ -1734,7 +1736,7 @@ privsep_xauth_login_pam(port, raddr, usr
 
 	/* frees msg */
 	if (privsep_send(privsep_sock[1], msg, len) != 0)
-		return -1;
+		goto out;
 
 	if (privsep_recv(privsep_sock[1], , ) != 0)
 		return -1;
@@ -1786,7 +1788,7 @@ privsep_cleanup_pam(port)
 
 	/* frees msg */
 	if (privsep_send(privsep_sock[1], msg, len) != 0)
-		return;
+		goto out;
 
 	if (privsep_recv(privsep_sock[1], , ) != 0)
 		return;
@@ -1794,6 +1796,7 @@ privsep_cleanup_pam(port)
 	if (msg->hdr.ac_errno != 0)
 		errno = msg->hdr.ac_errno;
 
+out:
 	racoon_free(msg);
 	return;
 }



CVS commit: src/sys/external/bsd/common/include/linux

2018-08-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 28 08:50:46 UTC 2018

Modified Files:
src/sys/external/bsd/common/include/linux: printk.h

Log Message:
Add KERN_{EMERG,ALERT,NOTICE}


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/common/include/linux/printk.h

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

Modified files:

Index: src/sys/external/bsd/common/include/linux/printk.h
diff -u src/sys/external/bsd/common/include/linux/printk.h:1.5 src/sys/external/bsd/common/include/linux/printk.h:1.6
--- src/sys/external/bsd/common/include/linux/printk.h:1.5	Tue Aug 28 08:48:42 2018
+++ src/sys/external/bsd/common/include/linux/printk.h	Tue Aug 28 08:50:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: printk.h,v 1.5 2018/08/28 08:48:42 skrll Exp $	*/
+/*	$NetBSD: printk.h,v 1.6 2018/08/28 08:50:46 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -45,9 +45,12 @@
 #define	pr_warn_once	printf	/* XXX */
 #define	pr_notice	printf	/* XXX */
 #define	pr_debug	printf	/* XXX */
+#define	KERN_EMERG	"kern emerg: "
+#define	KERN_ALERT	"kern alert: "
 #define	KERN_CRIT	"kern crit: "
 #define	KERN_ERR	"kern error: "
 #define	KERN_WARNING	"kern warning: "
+#define	KERN_NOTICE	"kern notice: "
 #define	KERN_INFO	"kern info: "
 #define	KERN_DEBUG	"kern debug: "
 #define	KERN_CONT	""



CVS commit: src/sys/external/bsd/common/include/linux

2018-08-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 28 08:48:43 UTC 2018

Modified Files:
src/sys/external/bsd/common/include/linux: printk.h

Log Message:
Sort KERN_* macros according to severity (worst first)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/common/include/linux/printk.h

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

Modified files:

Index: src/sys/external/bsd/common/include/linux/printk.h
diff -u src/sys/external/bsd/common/include/linux/printk.h:1.4 src/sys/external/bsd/common/include/linux/printk.h:1.5
--- src/sys/external/bsd/common/include/linux/printk.h:1.4	Tue Aug 28 08:37:53 2018
+++ src/sys/external/bsd/common/include/linux/printk.h	Tue Aug 28 08:48:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: printk.h,v 1.4 2018/08/28 08:37:53 skrll Exp $	*/
+/*	$NetBSD: printk.h,v 1.5 2018/08/28 08:48:42 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -45,11 +45,11 @@
 #define	pr_warn_once	printf	/* XXX */
 #define	pr_notice	printf	/* XXX */
 #define	pr_debug	printf	/* XXX */
-#define	KERN_DEBUG	"kern debug: "
-#define	KERN_INFO	"kern info: "
-#define	KERN_WARNING	"kern warning: "
-#define	KERN_ERR	"kern error: "
 #define	KERN_CRIT	"kern crit: "
+#define	KERN_ERR	"kern error: "
+#define	KERN_WARNING	"kern warning: "
+#define	KERN_INFO	"kern info: "
+#define	KERN_DEBUG	"kern debug: "
 #define	KERN_CONT	""
 
 #define	DUMP_PREFIX_NONE	0



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

2018-08-28 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Tue Aug 28 08:45:20 UTC 2018

Modified Files:
xsrc/external/mit/xf86-video-intel/dist/src/sna: kgem.c

Log Message:
set mmap_arg.flags before calling DRM_IOCTL_I915_GEM_MMAP.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
xsrc/external/mit/xf86-video-intel/dist/src/sna/kgem.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-intel/dist/src/sna/kgem.c
diff -u xsrc/external/mit/xf86-video-intel/dist/src/sna/kgem.c:1.5 xsrc/external/mit/xf86-video-intel/dist/src/sna/kgem.c:1.6
--- xsrc/external/mit/xf86-video-intel/dist/src/sna/kgem.c:1.5	Wed Jan 28 09:59:35 2015
+++ xsrc/external/mit/xf86-video-intel/dist/src/sna/kgem.c	Tue Aug 28 08:45:20 2018
@@ -527,6 +527,7 @@ retry:
 	mmap_arg.handle = bo->handle;
 	mmap_arg.offset = 0;
 	mmap_arg.size = bytes(bo);
+	mmap_arg.flags = 0;
 	if ((err = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, _arg))) {
 		assert(err != EINVAL);
 



CVS commit: src/sys/external/bsd/common/include/linux

2018-08-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 28 08:37:53 UTC 2018

Modified Files:
src/sys/external/bsd/common/include/linux: printk.h

Log Message:
s/drm // in the KERN_* macros as this is common


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/common/include/linux/printk.h

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

Modified files:

Index: src/sys/external/bsd/common/include/linux/printk.h
diff -u src/sys/external/bsd/common/include/linux/printk.h:1.3 src/sys/external/bsd/common/include/linux/printk.h:1.4
--- src/sys/external/bsd/common/include/linux/printk.h:1.3	Mon Aug 27 06:56:41 2018
+++ src/sys/external/bsd/common/include/linux/printk.h	Tue Aug 28 08:37:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: printk.h,v 1.3 2018/08/27 06:56:41 riastradh Exp $	*/
+/*	$NetBSD: printk.h,v 1.4 2018/08/28 08:37:53 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -45,11 +45,11 @@
 #define	pr_warn_once	printf	/* XXX */
 #define	pr_notice	printf	/* XXX */
 #define	pr_debug	printf	/* XXX */
-#define	KERN_DEBUG	"drm kern debug: "
-#define	KERN_INFO	"drm kern info: "
-#define	KERN_WARNING	"drm kern warning: "
-#define	KERN_ERR	"drm kern error: "
-#define	KERN_CRIT	"drm kern crit: "
+#define	KERN_DEBUG	"kern debug: "
+#define	KERN_INFO	"kern info: "
+#define	KERN_WARNING	"kern warning: "
+#define	KERN_ERR	"kern error: "
+#define	KERN_CRIT	"kern crit: "
 #define	KERN_CONT	""
 
 #define	DUMP_PREFIX_NONE	0



CVS commit: src/sys/external/bsd/drm2/dist/drm

2018-08-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Aug 28 08:20:27 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/dist/drm: drm_drv.c

Log Message:
Disable drm_debug by default


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/dist/drm/drm_drv.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/external/bsd/drm2/dist/drm/drm_drv.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.9 src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.10
--- src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.9	Mon Aug 27 14:41:41 2018
+++ src/sys/external/bsd/drm2/dist/drm/drm_drv.c	Tue Aug 28 08:20:27 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_drv.c,v 1.9 2018/08/27 14:41:41 riastradh Exp $	*/
+/*	$NetBSD: drm_drv.c,v 1.10 2018/08/28 08:20:27 martin Exp $	*/
 
 /*
  * Created: Fri Jan 19 10:48:35 2001 by fa...@acm.org
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.9 2018/08/27 14:41:41 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.10 2018/08/28 08:20:27 martin Exp $");
 
 #include 
 #include 
@@ -45,7 +45,7 @@ __KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 
 #include "drm_legacy.h"
 #include "drm_internal.h"
 
-unsigned int drm_debug = ~(unsigned int)0;	/* bitmask of DRM_UT_x */
+unsigned int drm_debug = 0;	/* bitmask of DRM_UT_x */
 EXPORT_SYMBOL(drm_debug);
 
 MODULE_AUTHOR(CORE_AUTHOR);



CVS commit: src/sys/external/bsd/dwc2

2018-08-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Aug 28 08:17:10 UTC 2018

Modified Files:
src/sys/external/bsd/dwc2: dwc2.c

Log Message:
Fix non-DIAGNOSTIC build


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/external/bsd/dwc2/dwc2.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/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.53 src/sys/external/bsd/dwc2/dwc2.c:1.54
--- src/sys/external/bsd/dwc2/dwc2.c:1.53	Fri Aug 10 04:24:46 2018
+++ src/sys/external/bsd/dwc2/dwc2.c	Tue Aug 28 08:17:10 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.53 2018/08/10 04:24:46 rin Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.54 2018/08/28 08:17:10 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.53 2018/08/10 04:24:46 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.54 2018/08/28 08:17:10 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -643,7 +643,7 @@ dwc2_root_intr_start(struct usbd_xfer *x
 Static void
 dwc2_root_intr_abort(struct usbd_xfer *xfer)
 {
-	struct dwc2_softc *sc = DWC2_XFER2SC(xfer);
+	struct dwc2_softc *sc __diagused = DWC2_XFER2SC(xfer);
 
 	DPRINTF("xfer=%p\n", xfer);
 



CVS commit: src/sys/netinet

2018-08-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Aug 28 07:28:01 UTC 2018

Modified Files:
src/sys/netinet: cpu_in_cksum.c

Log Message:
No need to update mlen also in the case of (meln & 16) != 0.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/netinet/cpu_in_cksum.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/netinet/cpu_in_cksum.c
diff -u src/sys/netinet/cpu_in_cksum.c:1.1 src/sys/netinet/cpu_in_cksum.c:1.2
--- src/sys/netinet/cpu_in_cksum.c:1.1	Fri Jan 25 21:12:14 2008
+++ src/sys/netinet/cpu_in_cksum.c	Tue Aug 28 07:28:01 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_in_cksum.c,v 1.1 2008/01/25 21:12:14 joerg Exp $	*/
+/*	$NetBSD: cpu_in_cksum.c,v 1.2 2018/08/28 07:28:01 rin Exp $	*/
 /*-
  * Copyright (c) 2008 Joerg Sonnenberger .
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.c,v 1.1 2008/01/25 21:12:14 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_in_cksum.c,v 1.2 2018/08/28 07:28:01 rin Exp $");
 
 #include 
 #include 
@@ -162,6 +162,10 @@ cpu_in_cksum(struct mbuf *m, int len, in
 partial = 0;
 			}
 		}
+		/*
+		 * mlen is not updated below as the remaining tests
+		 * are using bit masks, which are not affected.
+		 */
 		if (mlen & 16) {
 			partial += *(uint16_t *)data;
 			partial += *(uint16_t *)(data + 2);
@@ -172,12 +176,7 @@ cpu_in_cksum(struct mbuf *m, int len, in
 			partial += *(uint16_t *)(data + 12);
 			partial += *(uint16_t *)(data + 14);
 			data += 16;
-			mlen -= 16;
 		}
-		/*
-		 * mlen is not updated below as the remaining tests
-		 * are using bit masks, which are not affected.
-		 */
 		if (mlen & 8) {
 			partial += *(uint16_t *)data;
 			partial += *(uint16_t *)(data + 2);