CVS commit: src

2018-01-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  4 01:42:26 UTC 2018

Modified Files:
src/share/man/man9: sockopt.9
src/sys/kern: uipc_socket.c uipc_syscalls.c
src/sys/sys: param.h socketvar.h

Log Message:
Add a new sockopt member to keep track of the actual size of the option
that should be returned to the caller in getsockopt(2).

(Tom Ivar Helbekkmo)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/sockopt.9
cvs rdiff -u -r1.258 -r1.259 src/sys/kern/uipc_socket.c
cvs rdiff -u -r1.189 -r1.190 src/sys/kern/uipc_syscalls.c
cvs rdiff -u -r1.555 -r1.556 src/sys/sys/param.h
cvs rdiff -u -r1.145 -r1.146 src/sys/sys/socketvar.h

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

Modified files:

Index: src/share/man/man9/sockopt.9
diff -u src/share/man/man9/sockopt.9:1.10 src/share/man/man9/sockopt.9:1.11
--- src/share/man/man9/sockopt.9:1.10	Mon Jan 16 07:54:25 2017
+++ src/share/man/man9/sockopt.9	Wed Jan  3 20:42:25 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sockopt.9,v 1.10 2017/01/16 12:54:25 njoly Exp $
+.\"	$NetBSD: sockopt.9,v 1.11 2018/01/04 01:42:25 christos Exp $
 .\"
 .\" Copyright (c) 2008 Iain Hibbert
 .\" All rights reserved.
@@ -23,7 +23,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 4, 2009
+.Dd January 3, 2018
 .Dt SOCKOPT 9
 .Os
 .Sh NAME
@@ -57,6 +57,7 @@ struct sockopt {
 	int		sopt_level;		/* option level */
 	int		sopt_name;		/* option name */
 	size_t		sopt_size;		/* data length */
+	size_t		sopt_retsize;		/* returned data length */
 	void *		sopt_data;		/* data pointer */
 	uint8_t		sopt_buf[sizeof(int)];	/* internal storage */
 };
@@ -133,7 +134,7 @@ context using
 which will not fail.
 .It Fn sockopt_setint "sopt" "value"
 Common case of set sockopt integer value.
-The sockpt structure must contain an int sized data field or be previously
+The sockopt structure must contain an int sized data field or be previously
 unset, in which case the data pointer will be set to the internal storage.
 .El
 .Sh CODE REFERENCES

Index: src/sys/kern/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.258 src/sys/kern/uipc_socket.c:1.259
--- src/sys/kern/uipc_socket.c:1.258	Sun Dec 31 19:45:12 2017
+++ src/sys/kern/uipc_socket.c	Wed Jan  3 20:42:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.258 2018/01/01 00:45:12 christos Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.259 2018/01/04 01:42:25 christos Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.258 2018/01/01 00:45:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.259 2018/01/04 01:42:25 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -2113,6 +2113,8 @@ sockopt_set(struct sockopt *sopt, const 
 		return EINVAL;
 	
 	memcpy(sopt->sopt_data, buf, len);
+	sopt->sopt_retsize = len;
+
 	return 0;
 }
 
@@ -2176,6 +2178,7 @@ sockopt_setmbuf(struct sockopt *sopt, st
 	
 	m_copydata(m, 0, len, sopt->sopt_data);
 	m_freem(m);
+	sopt->sopt_retsize = len;
 
 	return 0;
 }

Index: src/sys/kern/uipc_syscalls.c
diff -u src/sys/kern/uipc_syscalls.c:1.189 src/sys/kern/uipc_syscalls.c:1.190
--- src/sys/kern/uipc_syscalls.c:1.189	Sun Dec 31 14:39:57 2017
+++ src/sys/kern/uipc_syscalls.c	Wed Jan  3 20:42:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls.c,v 1.189 2017/12/31 19:39:57 christos Exp $	*/
+/*	$NetBSD: uipc_syscalls.c,v 1.190 2018/01/04 01:42:25 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.189 2017/12/31 19:39:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.190 2018/01/04 01:42:25 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pipe.h"
@@ -1249,7 +1249,7 @@ sys_getsockopt(struct lwp *l, const stru
 		goto out;
 
 	if (valsize > 0) {
-		len = min(valsize, sopt.sopt_size);
+		len = min(valsize, sopt.sopt_retsize);
 		error = copyout(sopt.sopt_data, SCARG(uap, val), len);
 		if (error)
 			goto out;

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.555 src/sys/sys/param.h:1.556
--- src/sys/sys/param.h:1.555	Sun Dec 31 19:51:36 2017
+++ src/sys/sys/param.h	Wed Jan  3 20:42:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.555 2018/01/01 00:51:36 christos Exp $	*/
+/*	$NetBSD: param.h,v 1.556 2018/01/04 01:42:25 christos Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	899001000	/* NetBSD 8.99.10 */
+#define	__NetBSD_Version__	899001100	/* NetBSD 8.99.11 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)

Index: 

CVS commit: src

2018-01-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  4 01:42:26 UTC 2018

Modified Files:
src/share/man/man9: sockopt.9
src/sys/kern: uipc_socket.c uipc_syscalls.c
src/sys/sys: param.h socketvar.h

Log Message:
Add a new sockopt member to keep track of the actual size of the option
that should be returned to the caller in getsockopt(2).

(Tom Ivar Helbekkmo)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man9/sockopt.9
cvs rdiff -u -r1.258 -r1.259 src/sys/kern/uipc_socket.c
cvs rdiff -u -r1.189 -r1.190 src/sys/kern/uipc_syscalls.c
cvs rdiff -u -r1.555 -r1.556 src/sys/sys/param.h
cvs rdiff -u -r1.145 -r1.146 src/sys/sys/socketvar.h

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



CVS commit: src/sys/arch/x86

2018-01-03 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Jan  4 01:01:59 UTC 2018

Modified Files:
src/sys/arch/x86/include: intr.h
src/sys/arch/x86/pci: pci_intr_machdep.c
src/sys/arch/x86/x86: intr.c

Log Message:
fix "intrctl list" panic when ACPI is disabled.

reviewed by cherry@n.o and tested by msaitoh@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/x86/include/intr.h
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/x86/pci/pci_intr_machdep.c
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/x86/x86/intr.c

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



CVS commit: src/sys/arch/x86

2018-01-03 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Jan  4 01:01:59 UTC 2018

Modified Files:
src/sys/arch/x86/include: intr.h
src/sys/arch/x86/pci: pci_intr_machdep.c
src/sys/arch/x86/x86: intr.c

Log Message:
fix "intrctl list" panic when ACPI is disabled.

reviewed by cherry@n.o and tested by msaitoh@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/x86/include/intr.h
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/x86/pci/pci_intr_machdep.c
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/x86/x86/intr.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/x86/include/intr.h
diff -u src/sys/arch/x86/include/intr.h:1.52 src/sys/arch/x86/include/intr.h:1.53
--- src/sys/arch/x86/include/intr.h:1.52	Sat Nov  4 14:56:48 2017
+++ src/sys/arch/x86/include/intr.h	Thu Jan  4 01:01:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.52 2017/11/04 14:56:48 cherry Exp $	*/
+/*	$NetBSD: intr.h,v 1.53 2018/01/04 01:01:59 knakahara Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -222,6 +222,9 @@ int intr_find_mpmapping(int, int, intr_h
 struct pic *intr_findpic(int);
 void intr_printconfig(void);
 
+#if !defined(XEN)
+const char *intr_create_intrid(int, struct pic *, int, char *, size_t);
+#endif /* XEN */
 struct intrsource *intr_allocate_io_intrsource(const char *);
 void intr_free_io_intrsource(const char *);
 

Index: src/sys/arch/x86/pci/pci_intr_machdep.c
diff -u src/sys/arch/x86/pci/pci_intr_machdep.c:1.41 src/sys/arch/x86/pci/pci_intr_machdep.c:1.42
--- src/sys/arch/x86/pci/pci_intr_machdep.c:1.41	Fri Jul 28 14:26:50 2017
+++ src/sys/arch/x86/pci/pci_intr_machdep.c	Thu Jan  4 01:01:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_intr_machdep.c,v 1.41 2017/07/28 14:26:50 maxv Exp $	*/
+/*	$NetBSD: pci_intr_machdep.c,v 1.42 2018/01/04 01:01:59 knakahara Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2009 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.41 2017/07/28 14:26:50 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_intr_machdep.c,v 1.42 2018/01/04 01:01:59 knakahara Exp $");
 
 #include 
 #include 
@@ -273,15 +273,42 @@ pci_intr_setattr(pci_chipset_tag_t pc, p
 	}
 }
 
+static int
+pci_intr_find_intx_irq(pci_intr_handle_t ih, int *irq, struct pic **pic,
+int *pin)
+{
+
+	KASSERT(irq != NULL);
+	KASSERT(pic != NULL);
+	KASSERT(pin != NULL);
+
+	*pic = _pic;
+	*pin = *irq = APIC_IRQ_LEGACY_IRQ(ih);
+
+#if NIOAPIC > 0
+	if (ih & APIC_INT_VIA_APIC) {
+		struct ioapic_softc *ioapic;
+
+		ioapic = ioapic_find(APIC_IRQ_APIC(ih));
+		if (ioapic == NULL)
+			return ENOENT;
+		*pic = >sc_pic;
+		*pin = APIC_IRQ_PIN(ih);
+		*irq = APIC_IRQ_LEGACY_IRQ(ih);
+		if (*irq < 0 || *irq >= NUM_LEGACY_IRQS)
+			*irq = -1;
+	}
+#endif
+
+	return 0;
+}
+
 static void *
 pci_intr_establish_xname_internal(pci_chipset_tag_t pc, pci_intr_handle_t ih,
 int level, int (*func)(void *), void *arg, const char *xname)
 {
 	int pin, irq;
 	struct pic *pic;
-#if NIOAPIC > 0
-	struct ioapic_softc *ioapic;
-#endif
 	bool mpsafe;
 	pci_chipset_tag_t ipc;
 
@@ -301,25 +328,13 @@ pci_intr_establish_xname_internal(pci_ch
 			xname);
 	}
 
-	pic = _pic;
-	pin = irq = APIC_IRQ_LEGACY_IRQ(ih);
-	mpsafe = ((ih & MPSAFE_MASK) != 0);
-
-#if NIOAPIC > 0
-	if (ih & APIC_INT_VIA_APIC) {
-		ioapic = ioapic_find(APIC_IRQ_APIC(ih));
-		if (ioapic == NULL) {
-			aprint_normal("pci_intr_establish: bad ioapic %d\n",
-			APIC_IRQ_APIC(ih));
-			return NULL;
-		}
-		pic = >sc_pic;
-		pin = APIC_IRQ_PIN(ih);
-		irq = APIC_IRQ_LEGACY_IRQ(ih);
-		if (irq < 0 || irq >= NUM_LEGACY_IRQS)
-			irq = -1;
+	if (pci_intr_find_intx_irq(ih, , , )) {
+		aprint_normal("%s: bad pic %d\n", __func__,
+		APIC_IRQ_APIC(ih));
+		return NULL;
 	}
-#endif
+
+	mpsafe = ((ih & MPSAFE_MASK) != 0);
 
 	return intr_establish_xname(irq, pic, pin, IST_LEVEL, level, func, arg,
 	mpsafe, xname);
@@ -376,6 +391,31 @@ pci_intr_type(pci_chipset_tag_t pc, pci_
 	}
 }
 
+static const char *
+x86_pci_intx_create_intrid(pci_chipset_tag_t pc, pci_intr_handle_t ih, char *buf,
+size_t len)
+{
+#if !defined(XEN)
+	int pin, irq;
+	struct pic *pic;
+
+	KASSERT(!INT_VIA_MSI(ih));
+
+	pic = _pic;
+	pin = irq = APIC_IRQ_LEGACY_IRQ(ih);
+
+	if (pci_intr_find_intx_irq(ih, , , )) {
+		aprint_normal("%s: bad pic %d\n", __func__,
+		APIC_IRQ_APIC(ih));
+		return NULL;
+	}
+
+	return intr_create_intrid(irq, pic, pin, buf, len);
+#else
+	return pci_intr_string(pc, ih, buf, len);
+#endif /* !XEN */
+}
+
 static void
 x86_pci_intx_release(pci_chipset_tag_t pc, pci_intr_handle_t *pih)
 {
@@ -406,8 +446,11 @@ pci_intx_alloc(const struct pci_attach_a
 		goto error;
 	}
 
-	intrstr = pci_intr_string(pa->pa_pc, *handle,
-	intrstr_buf, sizeof(intrstr_buf));
+	/*
+	 * must be the same intrstr as intr_establish_xname()
+	 */
+	

CVS commit: src/sys/dev/hdaudio

2018-01-03 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Jan  4 00:09:12 UTC 2018

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Fix off-by-one when calling snprintf(9) in hdafg_getdev()

This is actually harmless, since:
- the offset is too short rather than too long (no overflow)
- the struct audio_device comes from userland (no information leak)

"looks good to me" nat@


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/hdaudio/hdafg.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/hdaudio/hdafg.c
diff -u src/sys/dev/hdaudio/hdafg.c:1.13 src/sys/dev/hdaudio/hdafg.c:1.14
--- src/sys/dev/hdaudio/hdafg.c:1.13	Fri Aug  4 00:25:23 2017
+++ src/sys/dev/hdaudio/hdafg.c	Thu Jan  4 00:09:12 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.13 2017/08/04 00:25:23 mrg Exp $ */
+/* $NetBSD: hdafg.c,v 1.14 2018/01/04 00:09:12 khorben Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.13 2017/08/04 00:25:23 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.14 2018/01/04 00:09:12 khorben Exp $");
 
 #include 
 #include 
@@ -4058,7 +4058,7 @@ hdafg_getdev(void *opaque, struct audio_
 	sc->sc_vendor);
 	hdaudio_findproduct(audiodev->version, sizeof(audiodev->version),
 	sc->sc_vendor, sc->sc_product);
-	snprintf(audiodev->config, sizeof(audiodev->config) - 1,
+	snprintf(audiodev->config, sizeof(audiodev->config),
 	"%02Xh", sc->sc_nid);
 
 	return 0;



CVS commit: src/sys/dev/hdaudio

2018-01-03 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Jan  4 00:09:12 UTC 2018

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Fix off-by-one when calling snprintf(9) in hdafg_getdev()

This is actually harmless, since:
- the offset is too short rather than too long (no overflow)
- the struct audio_device comes from userland (no information leak)

"looks good to me" nat@


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/hdaudio/hdafg.c

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



CVS commit: [netbsd-7] src/doc

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:59:19 UTC 2018

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

Log Message:
1525-1534, 1536, 1537, 1539, 1541-1544, 1546, 1547, 1549


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

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



CVS commit: [netbsd-7] src/doc

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:59:19 UTC 2018

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

Log Message:
1525-1534, 1536, 1537, 1539, 1541-1544, 1546, 1547, 1549


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.57 -r1.1.2.58 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.57 src/doc/CHANGES-7.2:1.1.2.58
--- src/doc/CHANGES-7.2:1.1.2.57	Tue Dec 12 09:14:27 2017
+++ src/doc/CHANGES-7.2	Wed Jan  3 21:59:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.2,v 1.1.2.57 2017/12/12 09:14:27 snj Exp $
+# $NetBSD: CHANGES-7.2,v 1.1.2.58 2018/01/03 21:59:19 snj Exp $
 
 A complete list of changes from the NetBSD 7.1 release to the NetBSD 7.2
 release:
@@ -4903,3 +4903,147 @@ sys/arch/x86/x86/fpu.c1.19 via patch
 	Properly mask mxcsr to prevent faults.
 	[maxv, ticket #1540]
 
+sys/external/bsd/ipf/netinet/ip_state.c		1.9-1.10
+
+	Stop a kernel panic when altering the ipf state table size at
+	runtime due to unallocated memory.
+	[sborrill, ticket #1525]
+
+sys/dev/usb/xhci.c1.76
+
+	Wait 1ms first. Existing Intel xHCI requies 1ms delay to
+	prevent system hang (Errata).
+	[msaitoh, ticket #1526]
+
+sys/arch/amd64/include/i82093reg.h		1.9
+sys/arch/i386/include/i82093reg.h		1.11
+sys/arch/x86/x86/ioapic.c			1.54
+
+	Don't write a 1 to the read only RIRR bit in the IOAPIC
+	redirection register to fix "tlp0: filter setup and transmit
+	timeout" observed on Hyper-V VMs with the Legacy Network Adapter.
+
+	From OpenBSD via PR kern/49323:
+ 	https://marc.info/?l=openbsd-cvs=146718035432599=2
+	[nakayama, ticket #1527]
+
+sys/dev/usb/if_urtwn.c1.55
+
+	Malicious USB devices attaching as urtwn(4) can corrupt kernel
+	memory.
+	[skrll, ticket #1528]
+
+sys/dev/usb/ehci.c1.257
+sys/dev/usb/motg.c1.19
+sys/dev/usb/ohci.c1.276
+sys/dev/usb/uhci.c1.279
+sys/dev/usb/xhci.c1.77
+sys/external/bsd/dwc2/dwc2.c			1.47
+
+	Improve USB device insertion support.
+	[skrll, ticket #1529]
+
+sys/arch/sparc/sparc/locore.s			1.269
+
+	Avoid an instruction requiring a higher alignment than we
+	are guaranteed.  Fixes PR port-sparc/52721: ddb errors on
+	ps command
+	[maya, ticket #1530]
+
+sys/arch/x86/x86/pmap.cpatch
+
+	amd64: Make the direct map non executable.
+	[maxv, ticket #1531]
+
+sys/arch/arm/broadcom/bcm2835_space.c		1.12-1.13
+
+	- KNF
+	- BE support (probably not needed)
+	- a4x subreagion/mmap support
+	- fix some a4x stream methods
+	- add UVM_KMF_COLORMATCH in bs_map when allocating KVA
+	- support BUS_SPACE_MAP_PREFETCHABLE
+	[skrll, ticket #1532]
+
+libexec/httpd/cgi-bozo.c			1.39
+
+	bozohttpd fails to exec scripts via the -C mechanism
+	sometimes with EFAULT due to not NULL terminated environment.
+	PR bin/52194
+	[martin, ticket #1533]
+
+usr.sbin/inetd/inetd.c1.125
+
+	Bump MAXARGV from 20 to 64 - with bozohttpd and all config on
+	the command line it is easy to hit the (silent) limit.
+	[martin, ticket #1534]
+
+sys/external/bsd/drm2/drm/drm_drv.c		1.20
+
+	drm_stat: fix device minor calculation.  Fixes bug where
+	libdrm couldn't find any devices beyond the first one.
+	[jmcneill, ticket #1536]
+
+etc/MAKEDEV.tmpl1.188
+
+	make a few more drm nodes
+	[jmcneill, ticket #1537]
+
+sys/kern/subr_kobj.c1.52
+
+	Compare names of duplicate symbols properly, so we correctly
+	return an error status.  PR kern/45125
+	[pgoyette, ticket #1539]
+
+sys/dev/usb/usb_subr.c1.222
+
+	Be more defensive towards malicious USB devices.  This avoids
+	potential panics due to 0-sized memory allocation attempts,
+	which could be triggered by malicious USB devices.  PR 52383
+	[khorben, ticket #1541]
+
+sbin/route/route.c1.157
+
+	Fix typo in flag name.  PR bin/52815
+	[uwe, ticket #1542]
+
+dist/pf/etc/pf.os1.4-1.5
+
+	Synchronise with r1.27 from OpenBSD
+	Add DragonFly BSD fingerprints.
+	[sevan, ticket #1543]
+
+sys/arch/i386/conf/INSTALL			1.332
+
+	install/52845: Enable vga@isa and pcdisplay for INSTALL.
+	[rin, ticket #1544]
+
+sys/arch/macppc/conf/GENERIC			1.337 via patch
+
+	Without RADEONFB_ALWAYS_ACCEL_PUTCHAR, there are display
+	issues on the PowerBook5,2 (G4 FW-800) Radeon 9600, where
+	console is garbled.  PR port-macppc/52712
+	[sevan, ticket #1546]
+
+sys/dev/pci/pcidevs1.1278
+sys/dev/pci/pcidevs.hregen
+sys/dev/pci/pcidevs_data.h			regen
+sys/dev/pci/pucdata.c1.99-1.100
+
+	pcidevs: Add Intel 200 series chipset devices from "Table 2-2.
+	PCH-H Device and Revision ID Table, Intel 200 Series Chipset
+	Family Platform Controller Hub(PCI) Datasheet Volume 1 of 2
+	(335192-001)".
+
+	puc(4):
+	- Add Intel 200 series devices.
+	- Add support for Manhattan 158220 card. PR/52868
+	[maya, ticket #1547]
+
+sys/dev/fss.c	1.101-1.103
+
+	- Bounds check against media size for non-persistent snapshots.
+	- Treat partial read from backing store as I/O 

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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:56:04 UTC 2018

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

Log Message:
1525, 1527, 1530, 1531, 1533, 1536, 1537, 1539.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/doc/CHANGES-7.1.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.1.2
diff -u src/doc/CHANGES-7.1.2:1.1.2.1 src/doc/CHANGES-7.1.2:1.1.2.2
--- src/doc/CHANGES-7.1.2:1.1.2.1	Wed Jan  3 19:27:04 2018
+++ src/doc/CHANGES-7.1.2	Wed Jan  3 21:56:04 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.2,v 1.1.2.1 2018/01/03 19:27:04 snj Exp $
+# $NetBSD: CHANGES-7.1.2,v 1.1.2.2 2018/01/03 21:56:04 snj Exp $
 
 A complete list of changes from the NetBSD 7.1.1 release to the NetBSD 7.1.2
 release:
@@ -10,3 +10,57 @@ sys/sys/param.h	patched by hand
 	Welcome to 7.1.1_PATCH.
 	[snj]
 
+sys/external/bsd/ipf/netinet/ip_state.c		1.9-1.10
+
+	Stop a kernel panic when altering the ipf state table size at
+	runtime due to unallocated memory.
+	[sborrill, ticket #1525]
+
+sys/arch/amd64/include/i82093reg.h		1.9
+sys/arch/i386/include/i82093reg.h		1.11
+sys/arch/x86/x86/ioapic.c			1.54
+
+	Don't write a 1 to the read only RIRR bit in the IOAPIC
+	redirection register to fix "tlp0: filter setup and transmit
+	timeout" observed on Hyper-V VMs with the Legacy Network Adapter.
+
+	From OpenBSD via PR kern/49323:
+ 	https://marc.info/?l=openbsd-cvs=146718035432599=2
+	[nakayama, ticket #1527]
+
+sys/arch/sparc/sparc/locore.s			1.269
+
+	Avoid an instruction requiring a higher alignment than we
+	are guaranteed.  Fixes PR port-sparc/52721: ddb errors on
+	ps command.
+	[maya, ticket #1530]
+
+sys/arch/x86/x86/pmap.cpatch
+
+	amd64: Make the direct map non executable.
+	[maxv, ticket #1531]
+
+libexec/httpd/cgi-bozo.c			1.39
+
+	bozohttpd fails to exec scripts via the -C mechanism
+	sometimes with EFAULT due to not NULL terminated environment.
+	PR bin/52194
+	[martin, ticket #1533]
+
+sys/external/bsd/drm2/drm/drm_drv.c		1.20
+
+	drm_stat: fix device minor calculation.  Fixes bug where
+	libdrm couldn't find any devices beyond the first one.
+	[jmcneill, ticket #1536]
+
+etc/MAKEDEV.tmpl1.188
+
+	make a few more drm nodes
+	[jmcneill, ticket #1537]
+
+sys/kern/subr_kobj.c1.52
+
+	Compare names of duplicate symbols properly, so we correctly
+	return an error status.  PR kern/45125
+	[pgoyette, ticket #1539]
+



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:56:04 UTC 2018

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

Log Message:
1525, 1527, 1530, 1531, 1533, 1536, 1537, 1539.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/doc/CHANGES-7.1.2

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:53:50 UTC 2018

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

Log Message:
1525, 1527, 1530, 1531, 1533, 1536, 1537, 1539


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.71 -r1.1.2.72 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.



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:53:50 UTC 2018

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

Log Message:
1525, 1527, 1530, 1531, 1533, 1536, 1537, 1539


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.71 -r1.1.2.72 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.71 src/doc/CHANGES-7.0.3:1.1.2.72
--- src/doc/CHANGES-7.0.3:1.1.2.71	Tue Dec 12 09:15:39 2017
+++ src/doc/CHANGES-7.0.3	Wed Jan  3 21:53:50 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.71 2017/12/12 09:15:39 snj Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.72 2018/01/03 21:53:50 snj Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5122,3 +5122,57 @@ sys/arch/x86/x86/fpu.c1.19 via patch
 	Properly mask mxcsr to prevent faults.
 	[maxv, ticket #1540]
 
+sys/external/bsd/ipf/netinet/ip_state.c		1.9-1.10
+
+	Stop a kernel panic when altering the ipf state table size at
+	runtime due to unallocated memory.
+	[sborrill, ticket #1525]
+
+sys/arch/amd64/include/i82093reg.h		1.9
+sys/arch/i386/include/i82093reg.h		1.11
+sys/arch/x86/x86/ioapic.c			1.54
+
+	Don't write a 1 to the read only RIRR bit in the IOAPIC
+	redirection register to fix "tlp0: filter setup and transmit
+	timeout" observed on Hyper-V VMs with the Legacy Network Adapter.
+
+	From OpenBSD via PR kern/49323:
+ 	https://marc.info/?l=openbsd-cvs=146718035432599=2
+	[nakayama, ticket #1527]
+
+sys/arch/sparc/sparc/locore.s			1.269
+
+	Avoid an instruction requiring a higher alignment than we
+	are guaranteed.  Fixes PR port-sparc/52721: ddb errors on
+	ps command
+	[maya, ticket #1530]
+
+sys/arch/x86/x86/pmap.cpatch
+
+	amd64: Make the direct map non executable.
+	[maxv, ticket #1531]
+
+libexec/httpd/cgi-bozo.c			1.39
+
+	bozohttpd fails to exec scripts via the -C mechanism
+	sometimes with EFAULT due to not NULL terminated environment.
+	PR bin/52194
+	[martin, ticket #1533]
+
+sys/external/bsd/drm2/drm/drm_drv.c		1.20
+
+	drm_stat: fix device minor calculation.  Fixes bug where
+	libdrm couldn't find any devices beyond the first one.
+	[jmcneill, ticket #1536]
+
+etc/MAKEDEV.tmpl1.188
+
+	make a few more drm nodes
+	[jmcneill, ticket #1537]
+
+sys/kern/subr_kobj.c1.52
+
+	Compare names of duplicate symbols properly, so we correctly
+	return an error status.  PR kern/45125
+	[pgoyette, ticket #1539]
+



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:47:45 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1549):
sys/dev/fss.c: revision 1.101-1.103
Bounds check against media size for non-persistent snapshots.
--
Treat partial read from backing store as I/O error.
--
Pass residual back to b_resid for persistent snapshots.


To generate a diff of this commit:
cvs rdiff -u -r1.91.2.1 -r1.91.2.2 src/sys/dev/fss.c

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:47:45 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by hannken in ticket #1549):
sys/dev/fss.c: revision 1.101-1.103
Bounds check against media size for non-persistent snapshots.
--
Treat partial read from backing store as I/O error.
--
Pass residual back to b_resid for persistent snapshots.


To generate a diff of this commit:
cvs rdiff -u -r1.91.2.1 -r1.91.2.2 src/sys/dev/fss.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/fss.c
diff -u src/sys/dev/fss.c:1.91.2.1 src/sys/dev/fss.c:1.91.2.2
--- src/sys/dev/fss.c:1.91.2.1	Sat Aug 27 15:09:22 2016
+++ src/sys/dev/fss.c	Wed Jan  3 21:47:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: fss.c,v 1.91.2.1 2016/08/27 15:09:22 bouyer Exp $	*/
+/*	$NetBSD: fss.c,v 1.91.2.2 2018/01/03 21:47:45 snj Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.91.2.1 2016/08/27 15:09:22 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fss.c,v 1.91.2.2 2018/01/03 21:47:45 snj Exp $");
 
 #include 
 #include 
@@ -89,7 +89,7 @@ static void fss_softc_free(struct fss_so
 static int fss_read_cluster(struct fss_softc *, u_int32_t);
 static void fss_bs_thread(void *);
 static int fss_bs_io(struct fss_softc *, fss_io_type,
-u_int32_t, off_t, int, void *);
+u_int32_t, off_t, int, void *, size_t *);
 static u_int32_t *fss_bs_indir(struct fss_softc *, u_int32_t);
 
 static kmutex_t fss_device_lock;	/* Protect all units. */
@@ -281,20 +281,26 @@ fss_strategy(struct buf *bp)
 	mutex_enter(>sc_slock);
 
 	if (write || !FSS_ISVALID(sc)) {
-
-		mutex_exit(>sc_slock);
-
 		bp->b_error = (write ? EROFS : ENXIO);
-		bp->b_resid = bp->b_bcount;
-		biodone(bp);
-		return;
+		goto done;
 	}
+	/* Check bounds for non-persistent snapshots. */
+	if ((sc->sc_flags & FSS_PERSISTENT) == 0 &&
+	bounds_check_with_mediasize(bp, DEV_BSIZE,
+	btodb(FSS_CLTOB(sc, sc->sc_clcount - 1) + sc->sc_clresid)) <= 0)
+		goto done;
 
 	bp->b_rawblkno = bp->b_blkno;
 	bufq_put(sc->sc_bufq, bp);
 	cv_signal(>sc_work_cv);
 
 	mutex_exit(>sc_slock);
+	return;
+
+done:
+	mutex_exit(>sc_slock);
+	bp->b_resid = bp->b_bcount;
+	biodone(bp);
 }
 
 int
@@ -991,6 +997,8 @@ restart:
 		todo -= len;
 	}
 	error = biowait(mbp);
+	if (error == 0 && mbp->b_resid != 0)
+		error = EIO;
 	putiobuf(mbp);
 
 	mutex_enter(>sc_slock);
@@ -1012,7 +1020,7 @@ restart:
  */
 static int
 fss_bs_io(struct fss_softc *sc, fss_io_type rw,
-u_int32_t cl, off_t off, int len, void *data)
+u_int32_t cl, off_t off, int len, void *data, size_t *resid)
 {
 	int error;
 
@@ -1023,7 +1031,7 @@ fss_bs_io(struct fss_softc *sc, fss_io_t
 	error = vn_rdwr((rw == FSS_READ ? UIO_READ : UIO_WRITE), sc->sc_bs_vp,
 	data, len, off, UIO_SYSSPACE,
 	IO_ADV_ENCODE(POSIX_FADV_NOREUSE) | IO_NODELOCKED,
-	sc->sc_bs_lwp->l_cred, NULL, NULL);
+	sc->sc_bs_lwp->l_cred, resid, NULL);
 	if (error == 0) {
 		mutex_enter(sc->sc_bs_vp->v_interlock);
 		error = VOP_PUTPAGES(sc->sc_bs_vp, trunc_page(off),
@@ -1052,7 +1060,7 @@ fss_bs_indir(struct fss_softc *sc, u_int
 
 	if (sc->sc_indir_dirty) {
 		if (fss_bs_io(sc, FSS_WRITE, sc->sc_indir_cur, 0,
-		FSS_CLSIZE(sc), (void *)sc->sc_indir_data) != 0)
+		FSS_CLSIZE(sc), (void *)sc->sc_indir_data, NULL) != 0)
 			return NULL;
 		setbit(sc->sc_indir_valid, sc->sc_indir_cur);
 	}
@@ -1062,7 +1070,7 @@ fss_bs_indir(struct fss_softc *sc, u_int
 
 	if (isset(sc->sc_indir_valid, sc->sc_indir_cur)) {
 		if (fss_bs_io(sc, FSS_READ, sc->sc_indir_cur, 0,
-		FSS_CLSIZE(sc), (void *)sc->sc_indir_data) != 0)
+		FSS_CLSIZE(sc), (void *)sc->sc_indir_data, NULL) != 0)
 			return NULL;
 	} else
 		memset(sc->sc_indir_data, 0, FSS_CLSIZE(sc));
@@ -1083,6 +1091,7 @@ fss_bs_thread(void *arg)
 	long off;
 	char *addr;
 	u_int32_t c, cl, ch, *indirp;
+	size_t resid;
 	struct buf *bp, *nbp;
 	struct fss_softc *sc;
 	struct fss_cache *scp, *scl;
@@ -1119,14 +1128,18 @@ fss_bs_thread(void *arg)
 disk_busy(sc->sc_dkdev);
 error = fss_bs_io(sc, FSS_READ, 0,
 dbtob(bp->b_blkno), bp->b_bcount,
-bp->b_data);
+bp->b_data, );
+if (error)
+	resid = bp->b_bcount;
 disk_unbusy(sc->sc_dkdev,
 (error ? 0 : bp->b_bcount), is_read);
-			} else
+			} else {
 error = ENXIO;
+resid = bp->b_bcount;
+			}
 
 			bp->b_error = error;
-			bp->b_resid = (error ? bp->b_bcount : 0);
+			bp->b_resid = resid;
 			biodone(bp);
 
 			mutex_enter(>sc_slock);
@@ -1147,7 +1160,7 @@ fss_bs_thread(void *arg)
 			indirp = fss_bs_indir(sc, scp->fc_cluster);
 			if (indirp != NULL) {
 error = fss_bs_io(sc, FSS_WRITE, sc->sc_clnext,
-0, FSS_CLSIZE(sc), scp->fc_data);
+0, FSS_CLSIZE(sc), scp->fc_data, NULL);
 			} else
 error = EIO;
 
@@ 

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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:40:49 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-7]: pcidevs.h pcidevs_data.h

Log Message:
regen for ticket 1547


To generate a diff of this commit:
cvs rdiff -u -r1.1192.2.10 -r1.1192.2.11 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1191.2.10 -r1.1191.2.11 src/sys/dev/pci/pcidevs_data.h

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:37:36 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by maya in ticket #1547):
sys/dev/pci/pucdata.c: revision 1.99-1.100
sys/dev/pci/pcidevs: revision 1.1278
Add Intel 200 series chipset devices from "Table 2-2. PCH-H Device and
Revision ID Table, Intel 200 Series Chipset Family Platform Controller
Hub(PCI) Datasheet Volume 1 of 2 (335192-001)".
--
Add Intel 200 series devices.
--
PR/52868: Petar Bogdanovic: Add support for Manhattan 158220 card


To generate a diff of this commit:
cvs rdiff -u -r1.1199.2.10 -r1.1199.2.11 src/sys/dev/pci/pcidevs
cvs rdiff -u -r1.93.4.2 -r1.93.4.3 src/sys/dev/pci/pucdata.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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1199.2.10 src/sys/dev/pci/pcidevs:1.1199.2.11
--- src/sys/dev/pci/pcidevs:1.1199.2.10	Tue Jul 25 19:43:03 2017
+++ src/sys/dev/pci/pcidevs	Wed Jan  3 21:37:36 2018
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1199.2.10 2017/07/25 19:43:03 snj Exp $
+$NetBSD: pcidevs,v 1.1199.2.11 2018/01/03 21:37:36 snj Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -3567,10 +3567,10 @@ product INTEL 82801HO_LPC 	0x2814	82801H
 product INTEL 82801HBM_LPC  0x2815  82801HBM LPC Interface Bridge
 product INTEL 82801H_SATA_1	0x2820	82801H SATA Controller
 product INTEL 82801H_SATA_AHCI6	0x2821	82801H AHCI SATA Controller w/ 6 ports
-product INTEL 82801H_SATA_RAID	0x2822	82801H/C61x/X99/Z170 RAID SATA Controller
+product INTEL 82801H_SATA_RAID	0x2822	82801H/C61x/X99/Z170/[ZQH]270 RAID SATA Controller
 product INTEL 82801H_SATA_AHCI4	0x2824	82801H AHCI SATA Controller w/ 4 ports
 product INTEL 82801H_SATA_2	0x2825	82801H SATA Controller
-product INTEL C610_SATA_RAID_3	0x2826	C61x/X99 SATA Controller (RAID)
+product INTEL C610_SATA_RAID_3	0x2826	C61x/X99/[ZQH]270 SATA Controller (RAID)
 product INTEL C610_SSATA_RAID_2	0x2827	C61x/X99 sSATA Controller (RAID)
 product INTEL 82801HEM_SATA	0x2828	82801HEM SATA Controller
 product INTEL 82801HBM_SATA_AHCI 0x2829  82801HBM AHCI SATA Controller
@@ -4531,6 +4531,62 @@ product INTEL 100SERIES_PCIE_18	0xa168	1
 product INTEL 100SERIES_PCIE_19	0xa169	100 Series PCIE
 product INTEL 100SERIES_PCIE_20	0xa16a	100 Series PCIE
 product INTEL 100SERIES_HDA	0xa170	100 Series HD Audio
+product INTEL 2HS_AHCI		0xa282	200 Series SATA (AHCI)
+product INTEL 2HS_RAID		0xa286	200 Series SATA (RAID)
+product INTEL 2HS_RAID_RST_OPTANE 0xa28e 200 Series SATA (Acceleration with Optane)
+product INTEL 2HS_PCIE_1	0xa290	200 Series PCIE
+product INTEL 2HS_PCIE_2	0xa291	200 Series PCIE
+product INTEL 2HS_PCIE_3	0xa292	200 Series PCIE
+product INTEL 2HS_PCIE_4	0xa293	200 Series PCIE
+product INTEL 2HS_PCIE_5	0xa294	200 Series PCIE
+product INTEL 2HS_PCIE_6	0xa295	200 Series PCIE
+product INTEL 2HS_PCIE_7	0xa296	200 Series PCIE
+product INTEL 2HS_PCIE_8	0xa297	200 Series PCIE
+product INTEL 2HS_PCIE_9	0xa298	200 Series PCIE
+product INTEL 2HS_PCIE_10	0xa299	200 Series PCIE
+product INTEL 2HS_PCIE_11	0xa29a	200 Series PCIE
+product INTEL 2HS_PCIE_12	0xa29b	200 Series PCIE
+product INTEL 2HS_PCIE_13	0xa29c	200 Series PCIE
+product INTEL 2HS_PCIE_14	0xa29d	200 Series PCIE
+product INTEL 2HS_PCIE_15	0xa29e	200 Series PCIE
+product INTEL 2HS_PCIE_16	0xa29f	200 Series PCIE
+product INTEL 2HS_P2SB		0xa2a0	200 Series P2SB
+product INTEL 2HS_PMC		0xa2a1	200 Series PMC
+product INTEL 2HS_SMB		0xa2a3	200 Series SMBus
+product INTEL 2HS_SPI		0xa2a4	200 Series SPI
+product INTEL 2HS_TRACE		0xa2a6	200 Series Trace Hub
+product INTEL 2HS_UART_0	0xa2a7	200 Series UART 0
+product INTEL 2HS_UART_1	0xa2a8	200 Series UART 1
+product INTEL 2HS_GSPI_0	0xa2a9	200 Series GSPI 0
+product INTEL 2HS_GSPI_1	0xa2aa	200 Series GSPI 1
+product INTEL 2HS_XHCI		0xa2af	200 Series xHCI
+product INTEL 2HS_USBOTG	0xa2b0	200 Series USB (OTG)
+product INTEL 2HS_THERM		0xa2b1	200 Series Thermal
+product INTEL 2HS_ISH		0xa2b5	200 Series ISH
+product INTEL 2HS_MEI_1		0xa2ba	200 Series MEI
+product INTEL 2HS_MEI_2		0xa2bb	200 Series MEI
+product INTEL 2HS_IDER		0xa2bc	200 Series IDER
+product INTEL 2HS_KT		0xa2bd	200 Series KT
+product INTEL 2HS_MEI_3		0xa2be	200 Series MEI
+product INTEL 2HS_LPC_H27	0xa2c4	H270 LPC
+product INTEL 2HS_LPC_Z27	0xa2c5	Z270 LPC
+product INTEL 2HS_LPC_Q27	0xa2c6	Q270 LPC
+product INTEL 2HS_LPC_Q25	0xa2c7	Q250 LPC
+product INTEL 2HS_LPC_B25	0xa2c8	B250 LPC
+product INTEL 2HS_I2C_0		0xa2e0	200 Series I2C 0
+product INTEL 2HS_I2C_1		0xa2e1	200 Series I2C 1
+product INTEL 2HS_I2C_2		0xa2e2	200 Series I2C 2
+product INTEL 2HS_I2C_3		0xa2e3	200 Series I2C 3
+product INTEL 2HS_UART_2	0xa2e6	200 Series UART 2
+product INTEL 2HS_PCIE_17	0xa2e7	200 Series PCIE
+product INTEL 2HS_PCIE_18	0xa2e8	200 Series PCIE
+product INTEL 2HS_PCIE_19	0xa2e9	200 Series 

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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:37:36 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by maya in ticket #1547):
sys/dev/pci/pucdata.c: revision 1.99-1.100
sys/dev/pci/pcidevs: revision 1.1278
Add Intel 200 series chipset devices from "Table 2-2. PCH-H Device and
Revision ID Table, Intel 200 Series Chipset Family Platform Controller
Hub(PCI) Datasheet Volume 1 of 2 (335192-001)".
--
Add Intel 200 series devices.
--
PR/52868: Petar Bogdanovic: Add support for Manhattan 158220 card


To generate a diff of this commit:
cvs rdiff -u -r1.1199.2.10 -r1.1199.2.11 src/sys/dev/pci/pcidevs
cvs rdiff -u -r1.93.4.2 -r1.93.4.3 src/sys/dev/pci/pucdata.c

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



CVS commit: [netbsd-7] src/sys/arch/macppc/conf

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:30:59 UTC 2018

Modified Files:
src/sys/arch/macppc/conf [netbsd-7]: GENERIC

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1546):
sys/arch/macppc/conf/GENERIC: revision 1.337 via patch
Without RADEONFB_ALWAYS_ACCEL_PUTCHAR, there are display issues on the
PowerBook5,2 (G4 FW-800)
Radeon 9600, where console is garbled.
Thanks to  for the pointer.
Closes PR port-macppc/52712


To generate a diff of this commit:
cvs rdiff -u -r1.312.4.3 -r1.312.4.4 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.312.4.3 src/sys/arch/macppc/conf/GENERIC:1.312.4.4
--- src/sys/arch/macppc/conf/GENERIC:1.312.4.3	Fri May 15 03:44:18 2015
+++ src/sys/arch/macppc/conf/GENERIC	Wed Jan  3 21:30:59 2018
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.312.4.3 2015/05/15 03:44:18 snj Exp $
+# $NetBSD: GENERIC,v 1.312.4.4 2018/01/03 21:30:59 snj 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.312.4.3 $"
+#ident 		"GENERIC-$Revision: 1.312.4.4 $"
 
 maxusers	32
 
@@ -297,6 +297,7 @@ voodoofb*	at pci? function ?	# 3Dfx Vood
 # ATI Radeon. Still has problems on some hardware
 radeonfb*	at pci? function ?
 options 	RADEONFB_MMAP_BARS	# allow mmap()ing BARs - needed for X
+options 	RADEONFB_ALWAYS_ACCEL_PUTCHAR
 
 # generic PCI framebuffer, should work with everything supported by OF
 genfb*		at pci? function ?



CVS commit: [netbsd-7] src/sys/arch/macppc/conf

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:30:59 UTC 2018

Modified Files:
src/sys/arch/macppc/conf [netbsd-7]: GENERIC

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1546):
sys/arch/macppc/conf/GENERIC: revision 1.337 via patch
Without RADEONFB_ALWAYS_ACCEL_PUTCHAR, there are display issues on the
PowerBook5,2 (G4 FW-800)
Radeon 9600, where console is garbled.
Thanks to  for the pointer.
Closes PR port-macppc/52712


To generate a diff of this commit:
cvs rdiff -u -r1.312.4.3 -r1.312.4.4 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.



CVS commit: [netbsd-7] src/sys/arch/i386/conf

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:26:39 UTC 2018

Modified Files:
src/sys/arch/i386/conf [netbsd-7]: INSTALL

Log Message:
Pull up following revision(s) (requested by rin in ticket #1544):
sys/arch/i386/conf/INSTALL: revision 1.332
install/52845: Enable vga@isa and pcdisplay for INSTALL. Otherwise, install
media do not boot on pre-PCI machines.


To generate a diff of this commit:
cvs rdiff -u -r1.330.30.2 -r1.330.30.3 src/sys/arch/i386/conf/INSTALL

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/i386/conf/INSTALL
diff -u src/sys/arch/i386/conf/INSTALL:1.330.30.2 src/sys/arch/i386/conf/INSTALL:1.330.30.3
--- src/sys/arch/i386/conf/INSTALL:1.330.30.2	Wed Mar 18 03:57:15 2015
+++ src/sys/arch/i386/conf/INSTALL	Wed Jan  3 21:26:39 2018
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.330.30.2 2015/03/18 03:57:15 snj Exp $
+# $NetBSD: INSTALL,v 1.330.30.3 2018/01/03 21:26:39 snj Exp $
 #
 #	INSTALL - Installation kernel.
 #
@@ -7,7 +7,7 @@
 
 include	"arch/i386/conf/MONOLITHIC"
 
-#ident 		"INSTALL-$Revision: 1.330.30.2 $"
+#ident 		"INSTALL-$Revision: 1.330.30.3 $"
 
 no options	MEMORY_DISK_DYNAMIC
 options 	MEMORY_DISK_IS_ROOT	# force root on memory disk
@@ -19,3 +19,8 @@ options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	#
 no i915drmkms* at pci?
 no radeon* at pci?
 #no nouveau*	   at pci?
+
+# pre-PCI graphics drivers, not enabled in GENERIC
+vga0		at isa?
+pcdisplay0	at isa?			# CGA, MDA, EGA, HGA
+wsdisplay*	at pcdisplay? console ?



CVS commit: [netbsd-7] src/sys/arch/i386/conf

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:26:39 UTC 2018

Modified Files:
src/sys/arch/i386/conf [netbsd-7]: INSTALL

Log Message:
Pull up following revision(s) (requested by rin in ticket #1544):
sys/arch/i386/conf/INSTALL: revision 1.332
install/52845: Enable vga@isa and pcdisplay for INSTALL. Otherwise, install
media do not boot on pre-PCI machines.


To generate a diff of this commit:
cvs rdiff -u -r1.330.30.2 -r1.330.30.3 src/sys/arch/i386/conf/INSTALL

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



CVS commit: [netbsd-7] src/dist/pf/etc

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:23:28 UTC 2018

Modified Files:
src/dist/pf/etc [netbsd-7]: pf.os

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1543):
dist/pf/etc/pf.os: 1.4-1.5
Synchronise with r1.27 from OpenBSD
--
Add DragonFly BSD fingerprints.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.40.1 src/dist/pf/etc/pf.os

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

Modified files:

Index: src/dist/pf/etc/pf.os
diff -u src/dist/pf/etc/pf.os:1.3 src/dist/pf/etc/pf.os:1.3.40.1
--- src/dist/pf/etc/pf.os:1.3	Wed Jun 18 09:06:25 2008
+++ src/dist/pf/etc/pf.os	Wed Jan  3 21:23:28 2018
@@ -1,5 +1,5 @@
-# $NetBSD: pf.os,v 1.3 2008/06/18 09:06:25 yamt Exp $
-# $OpenBSD: pf.os,v 1.21 2006/07/28 21:51:12 david Exp $
+# $NetBSD: pf.os,v 1.3.40.1 2018/01/03 21:23:28 snj Exp $
+# $OpenBSD: pf.os,v 1.27 2016/09/03 17:08:57 sthen Exp $
 # passive OS fingerprinting
 # -
 #
@@ -226,7 +226,13 @@ S2:64:1:60:M*,S,T,N,W0:		Linux:2.4::Linu
 S3:64:1:60:M*,S,T,N,W0:		Linux:2.4:.18-21:Linux 2.4.18 and newer
 S4:64:1:60:M*,S,T,N,W0:		Linux:2.4::Linux 2.4/2.6 <= 2.6.7
 S4:64:1:60:M*,S,T,N,W0:		Linux:2.6:.1-7:Linux 2.4/2.6 <= 2.6.7
-S4:64:1:60:M*,S,T,N,W7:		Linux:2.6:8:Linux 2.6.8 and newer (?)
+
+S4:64:1:60:M*,S,T,N,W5:		Linux:2.6::Linux 2.6 (newer, 1)
+S4:64:1:60:M*,S,T,N,W6:		Linux:2.6::Linux 2.6 (newer, 2)
+S4:64:1:60:M*,S,T,N,W7:		Linux:2.6::Linux 2.6 (newer, 3)
+T4:64:1:60:M*,S,T,N,W7:		Linux:2.6::Linux 2.6 (newer, 4)
+
+S10:64:1:60:M*,S,T,N,W4:	Linux:3.0::Linux 3.0
 
 S3:64:1:60:M*,S,T,N,W1:		Linux:2.5::Linux 2.5 (sometimes 2.4)
 S4:64:1:60:M*,S,T,N,W1:		Linux:2.5-2.6::Linux 2.5/2.6
@@ -299,13 +305,27 @@ S22:64:1:52:M*,N,N,S,N,W0:	Linux:2.2:ts:
 # - OpenBSD -
 
 16384:64:0:60:M*,N,W0,N,N,T:		OpenBSD:2.6::NetBSD 1.3 (or OpenBSD 2.6)
-16384:64:1:64:M*,N,N,S,N,W0,N,N,T:	OpenBSD:3.0-4.0::OpenBSD 3.0-4.0
-16384:64:0:64:M*,N,N,S,N,W0,N,N,T:	OpenBSD:3.0-4.0:no-df:OpenBSD 3.0-4.0 (scrub no-df)
+16384:64:1:64:M*,N,N,S,N,W0,N,N,T:	OpenBSD:3.0-4.8::OpenBSD 3.0-4.8
+16384:64:0:64:M*,N,N,S,N,W0,N,N,T:	OpenBSD:3.0-4.8:no-df:OpenBSD 3.0-4.8 (scrub no-df)
 57344:64:1:64:M*,N,N,S,N,W0,N,N,T:	OpenBSD:3.3-4.0::OpenBSD 3.3-4.0
 57344:64:0:64:M*,N,N,S,N,W0,N,N,T:	OpenBSD:3.3-4.0:no-df:OpenBSD 3.3-4.0 (scrub no-df)
 
 65535:64:1:64:M*,N,N,S,N,W0,N,N,T:	OpenBSD:3.0-4.0:opera:OpenBSD 3.0-4.0 (Opera)
 
+16384:64:1:64:M*,N,N,S,N,W3,N,N,T:	OpenBSD:4.9::OpenBSD 4.9
+16384:64:0:64:M*,N,N,S,N,W3,N,N,T:	OpenBSD:4.9:no-df:OpenBSD 4.9 (scrub no-df)
+
+16384:64:1:64:M*,N,N,S,N,W6,N,N,T:  OpenBSD:6.1::OpenBSD 6.1
+16384:64:0:64:M*,N,N,S,N,W6,N,N,T:  OpenBSD:6.1:no-df:OpenBSD 6.1 (scrub no-df)
+
+# - DragonFly BSD -
+
+57344:64:1:60:M*,N,W0,N,N,T:		DragonFly:1.0:A:DragonFly 1.0A
+57344:64:0:64:M*,N,W0,N,N,S,N,N,T:	DragonFly:1.2-1.12::DragonFly 1.2-1.12
+5840:64:1:60:M*,S,T,N,W4:		DragonFly:2.0-2.1::DragonFly 2.0-2.1
+57344:64:0:64:M*,N,W0,N,N,S,N,N,T:	DragonFly:2.2-2.3::DragonFly 2.2-2.3
+57344:64:0:64:M*,N,W5,N,N,S,N,N,T:	DragonFly:2.4-2.7::DragonFly 2.4-2.7
+
 # - Solaris -
 
 S17:64:1:64:N,W3,N,N,T0,N,N,S,M*:	Solaris:8:RFC1323:Solaris 8 RFC1323
@@ -362,7 +382,7 @@ S34:64:1:52:M*,N,W0,N,N,S:		Solaris:10:b
 # - Windows -
 
 # Windows TCP/IP stack is a mess. For most recent XP, 2000 and
-# even 98, the pathlevel, not the actual OS version, is more
+# even 98, the patchlevel, not the actual OS version, is more
 # relevant to the signature. They share the same code, so it would
 # seem. Luckily for us, almost all Windows 9x boxes have an
 # awkward MSS of 536, which I use to tell one from another
@@ -426,6 +446,8 @@ S44:128:1:48:M*,N,N,S:			Windows:XP:SP1:
 32767:128:1:48:M*,N,N,S:		Windows:2000:SP4:Windows SP1, 2000 SP4
 32767:128:1:48:M*,N,N,S:		Windows:XP:SP1:Windows SP1, 2000 SP4
 
+8192:128:1:52:M*,N,W2,N,N,S:		Windows:Vista::Windows Vista/7
+
 # Odds, ends, mods:
 
 S52:128:1:48:M1260,N,N,S:		Windows:2000:cisco:Windows XP/2000 via Cisco



CVS commit: [netbsd-7] src/dist/pf/etc

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:23:28 UTC 2018

Modified Files:
src/dist/pf/etc [netbsd-7]: pf.os

Log Message:
Pull up following revision(s) (requested by sevan in ticket #1543):
dist/pf/etc/pf.os: 1.4-1.5
Synchronise with r1.27 from OpenBSD
--
Add DragonFly BSD fingerprints.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.40.1 src/dist/pf/etc/pf.os

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



CVS commit: [netbsd-7] src/sbin/route

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:21:16 UTC 2018

Modified Files:
src/sbin/route [netbsd-7]: route.c

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1542):
sbin/route/route.c: revision 1.157
Fix typo in flag name.  We should probably just use IFFBITS string
that  defines.
PR bin/52815


To generate a diff of this commit:
cvs rdiff -u -r1.144.4.2 -r1.144.4.3 src/sbin/route/route.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/route/route.c
diff -u src/sbin/route/route.c:1.144.4.2 src/sbin/route/route.c:1.144.4.3
--- src/sbin/route/route.c:1.144.4.2	Thu Jan  8 11:01:01 2015
+++ src/sbin/route/route.c	Wed Jan  3 21:21:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.144.4.2 2015/01/08 11:01:01 martin Exp $	*/
+/*	$NetBSD: route.c,v 1.144.4.3 2018/01/03 21:21:16 snj Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)route.c	8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.144.4.2 2015/01/08 11:01:01 martin Exp $");
+__RCSID("$NetBSD: route.c,v 1.144.4.3 2018/01/03 21:21:16 snj Exp $");
 #endif
 #endif /* not lint */
 
@@ -1287,7 +1287,7 @@ const char metricnames[] =
 const char routeflags[] =
 "\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE\010MASK_PRESENT\011CLONING\012XRESOLVE\013LLINFO\014STATIC\015BLACKHOLE\016CLONED\017PROTO2\020PROTO1";
 const char ifnetflags[] =
-"\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5PTP\6NOTRAILERS\7RUNNING\010NOARP\011PPROMISC\012ALLMULTI\013OACTIVE\014SIMPLEX\015LINK0\016LINK1\017LINK2\020MULTICAST";
+"\1UP\2BROADCAST\3DEBUG\4LOOPBACK\5PTP\6NOTRAILERS\7RUNNING\010NOARP\011PROMISC\012ALLMULTI\013OACTIVE\014SIMPLEX\015LINK0\016LINK1\017LINK2\020MULTICAST";
 const char addrnames[] =
 "\1DST\2GATEWAY\3NETMASK\4GENMASK\5IFP\6IFA\7AUTHOR\010BRD\011TAG";
 



CVS commit: [netbsd-7] src/sbin/route

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:21:16 UTC 2018

Modified Files:
src/sbin/route [netbsd-7]: route.c

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1542):
sbin/route/route.c: revision 1.157
Fix typo in flag name.  We should probably just use IFFBITS string
that  defines.
PR bin/52815


To generate a diff of this commit:
cvs rdiff -u -r1.144.4.2 -r1.144.4.3 src/sbin/route/route.c

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:18:03 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-7]: usb_subr.c

Log Message:
Pull up following revision(s) (requested by khorben in ticket #1541):
sys/dev/usb/usb_subr.c: revision 1.222
Be more defensive towards malicious USB devices
This avoids potential panics due to 0-sized memory allocation attempts,
which could be triggered by malicious USB devices.
Tested on NetBSD/amd64 with a Sony Xperia X (SailfishOS).
Based on an initial patch by Nick Hudson , thanks!
Fixes PR kern/52383.


To generate a diff of this commit:
cvs rdiff -u -r1.196.4.3 -r1.196.4.4 src/sys/dev/usb/usb_subr.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/usb/usb_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.196.4.3 src/sys/dev/usb/usb_subr.c:1.196.4.4
--- src/sys/dev/usb/usb_subr.c:1.196.4.3	Wed Apr  5 19:54:20 2017
+++ src/sys/dev/usb/usb_subr.c	Wed Jan  3 21:18:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.196.4.3 2017/04/05 19:54:20 snj Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.196.4.4 2018/01/03 21:18:03 snj Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.196.4.3 2017/04/05 19:54:20 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.196.4.4 2018/01/03 21:18:03 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -644,6 +644,10 @@ usbd_set_config_index(struct usbd_device
 		return err;
 	}
 	len = UGETW(cd.wTotalLength);
+	if (len == 0) {
+		DPRINTF("empty short descriptor", 0, 0, 0, 0);
+		return USBD_INVAL;
+	}
 	cdp = kmem_alloc(len, KM_SLEEP);
 	if (cdp == NULL)
 		return USBD_NOMEM;
@@ -672,6 +676,11 @@ usbd_set_config_index(struct usbd_device
 		err = usbd_get_bos_desc(dev, index, );
 		if (!err) {
 			int blen = UGETW(bd.wTotalLength);
+			if (blen == 0) {
+DPRINTF("empty bos descriptor", 0, 0, 0, 0);
+err = USBD_INVAL;
+goto bad;
+			}
 			bdp = kmem_alloc(blen, KM_SLEEP);
 			if (bdp == NULL) {
 err = USBD_NOMEM;
@@ -765,6 +774,11 @@ usbd_set_config_index(struct usbd_device
 
 	/* Allocate and fill interface data. */
 	nifc = cdp->bNumInterface;
+	if (nifc == 0) {
+		DPRINTF("no interfaces", 0, 0, 0, 0);
+		err = USBD_INVAL;
+		goto bad;
+	}
 	dev->ud_ifaces = kmem_alloc(nifc * sizeof(struct usbd_interface),
 	KM_SLEEP);
 	if (dev->ud_ifaces == NULL) {



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:18:03 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-7]: usb_subr.c

Log Message:
Pull up following revision(s) (requested by khorben in ticket #1541):
sys/dev/usb/usb_subr.c: revision 1.222
Be more defensive towards malicious USB devices
This avoids potential panics due to 0-sized memory allocation attempts,
which could be triggered by malicious USB devices.
Tested on NetBSD/amd64 with a Sony Xperia X (SailfishOS).
Based on an initial patch by Nick Hudson , thanks!
Fixes PR kern/52383.


To generate a diff of this commit:
cvs rdiff -u -r1.196.4.3 -r1.196.4.4 src/sys/dev/usb/usb_subr.c

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:11:39 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1539):
sys/kern/subr_kobj.c: revision 1.52
Compare names of duplicate symbols properly, so we correctly return
an error status.
Fixes PR kern/45125 with patch supplied by Akinobu  Mita


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.50.10.1 src/sys/kern/subr_kobj.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/subr_kobj.c
diff -u src/sys/kern/subr_kobj.c:1.50 src/sys/kern/subr_kobj.c:1.50.10.1
--- src/sys/kern/subr_kobj.c:1.50	Wed Jul 16 13:26:33 2014
+++ src/sys/kern/subr_kobj.c	Wed Jan  3 21:11:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kobj.c,v 1.50 2014/07/16 13:26:33 maxv Exp $	*/
+/*	$NetBSD: subr_kobj.c,v 1.50.10.1 2018/01/03 21:11:38 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.50 2014/07/16 13:26:33 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.50.10.1 2018/01/03 21:11:38 snj Exp $");
 
 #include "opt_modular.h"
 
@@ -904,7 +904,7 @@ kobj_checksyms(kobj_t ko, bool undefined
 		strcmp(name, "__end") == 0 ||
 		strcmp(name, "__end__") == 0 ||
 		strncmp(name, "__start_link_set_", 17) == 0 ||
-		strncmp(name, "__stop_link_set_", 16)) {
+		strncmp(name, "__stop_link_set_", 16) == 0) {
 			continue;
 		}
 		kobj_error(ko, "global symbol `%s' redefined",



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:11:37 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1539):
sys/kern/subr_kobj.c: revision 1.52
Compare names of duplicate symbols properly, so we correctly return
an error status.
Fixes PR kern/45125 with patch supplied by Akinobu  Mita


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.50.6.1 src/sys/kern/subr_kobj.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/subr_kobj.c
diff -u src/sys/kern/subr_kobj.c:1.50 src/sys/kern/subr_kobj.c:1.50.6.1
--- src/sys/kern/subr_kobj.c:1.50	Wed Jul 16 13:26:33 2014
+++ src/sys/kern/subr_kobj.c	Wed Jan  3 21:11:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kobj.c,v 1.50 2014/07/16 13:26:33 maxv Exp $	*/
+/*	$NetBSD: subr_kobj.c,v 1.50.6.1 2018/01/03 21:11:37 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.50 2014/07/16 13:26:33 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.50.6.1 2018/01/03 21:11:37 snj Exp $");
 
 #include "opt_modular.h"
 
@@ -904,7 +904,7 @@ kobj_checksyms(kobj_t ko, bool undefined
 		strcmp(name, "__end") == 0 ||
 		strcmp(name, "__end__") == 0 ||
 		strncmp(name, "__start_link_set_", 17) == 0 ||
-		strncmp(name, "__stop_link_set_", 16)) {
+		strncmp(name, "__stop_link_set_", 16) == 0) {
 			continue;
 		}
 		kobj_error(ko, "global symbol `%s' redefined",



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:11:37 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1539):
sys/kern/subr_kobj.c: revision 1.52
Compare names of duplicate symbols properly, so we correctly return
an error status.
Fixes PR kern/45125 with patch supplied by Akinobu  Mita


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

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:11:41 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1539):
sys/kern/subr_kobj.c: revision 1.52
Compare names of duplicate symbols properly, so we correctly return
an error status.
Fixes PR kern/45125 with patch supplied by Akinobu  Mita


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

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:11:39 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1539):
sys/kern/subr_kobj.c: revision 1.52
Compare names of duplicate symbols properly, so we correctly return
an error status.
Fixes PR kern/45125 with patch supplied by Akinobu  Mita


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

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 21:11:41 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1539):
sys/kern/subr_kobj.c: revision 1.52
Compare names of duplicate symbols properly, so we correctly return
an error status.
Fixes PR kern/45125 with patch supplied by Akinobu  Mita


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.50.2.1 src/sys/kern/subr_kobj.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/subr_kobj.c
diff -u src/sys/kern/subr_kobj.c:1.50 src/sys/kern/subr_kobj.c:1.50.2.1
--- src/sys/kern/subr_kobj.c:1.50	Wed Jul 16 13:26:33 2014
+++ src/sys/kern/subr_kobj.c	Wed Jan  3 21:11:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_kobj.c,v 1.50 2014/07/16 13:26:33 maxv Exp $	*/
+/*	$NetBSD: subr_kobj.c,v 1.50.2.1 2018/01/03 21:11:40 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.50 2014/07/16 13:26:33 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kobj.c,v 1.50.2.1 2018/01/03 21:11:40 snj Exp $");
 
 #include "opt_modular.h"
 
@@ -904,7 +904,7 @@ kobj_checksyms(kobj_t ko, bool undefined
 		strcmp(name, "__end") == 0 ||
 		strcmp(name, "__end__") == 0 ||
 		strncmp(name, "__start_link_set_", 17) == 0 ||
-		strncmp(name, "__stop_link_set_", 16)) {
+		strncmp(name, "__stop_link_set_", 16) == 0) {
 			continue;
 		}
 		kobj_error(ko, "global symbol `%s' redefined",



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:50:44 UTC 2018

Modified Files:
src/etc [netbsd-7-1]: MAKEDEV.tmpl

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1537):
etc/MAKEDEV.tmpl: revision 1.188
make a few more drm nodes


To generate a diff of this commit:
cvs rdiff -u -r1.172.4.1 -r1.172.4.1.4.1 src/etc/MAKEDEV.tmpl

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

Modified files:

Index: src/etc/MAKEDEV.tmpl
diff -u src/etc/MAKEDEV.tmpl:1.172.4.1 src/etc/MAKEDEV.tmpl:1.172.4.1.4.1
--- src/etc/MAKEDEV.tmpl:1.172.4.1	Mon Nov 16 14:38:03 2015
+++ src/etc/MAKEDEV.tmpl	Wed Jan  3 20:50:43 2018
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: MAKEDEV.tmpl,v 1.172.4.1 2015/11/16 14:38:03 msaitoh Exp $
+#	$NetBSD: MAKEDEV.tmpl,v 1.172.4.1.4.1 2018/01/03 20:50:43 snj Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -835,7 +835,7 @@ all)
 	makedev drvctl
 	makedev video
 	makedev dtv
-	makedev drm0
+	makedev drm0 drm1 drm2 drm3
 	makedev altmem
 	makedev zfs
 	makedev lua



CVS commit: [netbsd-7] src/etc

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:50:46 UTC 2018

Modified Files:
src/etc [netbsd-7]: MAKEDEV.tmpl

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1537):
etc/MAKEDEV.tmpl: revision 1.188
make a few more drm nodes


To generate a diff of this commit:
cvs rdiff -u -r1.172.4.2 -r1.172.4.3 src/etc/MAKEDEV.tmpl

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



CVS commit: [netbsd-7] src/etc

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:50:46 UTC 2018

Modified Files:
src/etc [netbsd-7]: MAKEDEV.tmpl

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1537):
etc/MAKEDEV.tmpl: revision 1.188
make a few more drm nodes


To generate a diff of this commit:
cvs rdiff -u -r1.172.4.2 -r1.172.4.3 src/etc/MAKEDEV.tmpl

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

Modified files:

Index: src/etc/MAKEDEV.tmpl
diff -u src/etc/MAKEDEV.tmpl:1.172.4.2 src/etc/MAKEDEV.tmpl:1.172.4.3
--- src/etc/MAKEDEV.tmpl:1.172.4.2	Sun Oct  1 17:07:04 2017
+++ src/etc/MAKEDEV.tmpl	Wed Jan  3 20:50:45 2018
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: MAKEDEV.tmpl,v 1.172.4.2 2017/10/01 17:07:04 snj Exp $
+#	$NetBSD: MAKEDEV.tmpl,v 1.172.4.3 2018/01/03 20:50:45 snj Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -835,7 +835,7 @@ all)
 	makedev drvctl
 	makedev video
 	makedev dtv
-	makedev drm0
+	makedev drm0 drm1 drm2 drm3
 	makedev altmem
 	makedev zfs
 	makedev lua



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:50:42 UTC 2018

Modified Files:
src/etc [netbsd-7-0]: MAKEDEV.tmpl

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1537):
etc/MAKEDEV.tmpl: revision 1.188
make a few more drm nodes


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.172.6.1 src/etc/MAKEDEV.tmpl

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

Modified files:

Index: src/etc/MAKEDEV.tmpl
diff -u src/etc/MAKEDEV.tmpl:1.172 src/etc/MAKEDEV.tmpl:1.172.6.1
--- src/etc/MAKEDEV.tmpl:1.172	Mon Oct 28 18:33:20 2013
+++ src/etc/MAKEDEV.tmpl	Wed Jan  3 20:50:42 2018
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: MAKEDEV.tmpl,v 1.172 2013/10/28 18:33:20 mbalmer Exp $
+#	$NetBSD: MAKEDEV.tmpl,v 1.172.6.1 2018/01/03 20:50:42 snj Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -835,7 +835,7 @@ all)
 	makedev drvctl
 	makedev video
 	makedev dtv
-	makedev drm0
+	makedev drm0 drm1 drm2 drm3
 	makedev altmem
 	makedev zfs
 	makedev lua



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:50:42 UTC 2018

Modified Files:
src/etc [netbsd-7-0]: MAKEDEV.tmpl

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1537):
etc/MAKEDEV.tmpl: revision 1.188
make a few more drm nodes


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.172.6.1 src/etc/MAKEDEV.tmpl

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:50:44 UTC 2018

Modified Files:
src/etc [netbsd-7-1]: MAKEDEV.tmpl

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1537):
etc/MAKEDEV.tmpl: revision 1.188
make a few more drm nodes


To generate a diff of this commit:
cvs rdiff -u -r1.172.4.1 -r1.172.4.1.4.1 src/etc/MAKEDEV.tmpl

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



CVS commit: [netbsd-7-0] src/sys/external/bsd/drm2/drm

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:46:44 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/drm [netbsd-7-0]: drm_drv.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1536):
sys/external/bsd/drm2/drm/drm_drv.c: 1.20
drm_stat: fix device minor calculation, ok riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.9.2.4 -r1.9.2.4.2.1 src/sys/external/bsd/drm2/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/drm/drm_drv.c
diff -u src/sys/external/bsd/drm2/drm/drm_drv.c:1.9.2.4 src/sys/external/bsd/drm2/drm/drm_drv.c:1.9.2.4.2.1
--- src/sys/external/bsd/drm2/drm/drm_drv.c:1.9.2.4	Tue Mar 17 17:52:49 2015
+++ src/sys/external/bsd/drm2/drm/drm_drv.c	Wed Jan  3 20:46:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_drv.c,v 1.9.2.4 2015/03/17 17:52:49 riz Exp $	*/
+/*	$NetBSD: drm_drv.c,v 1.9.2.4.2.1 2018/01/03 20:46:43 snj Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.9.2.4 2015/03/17 17:52:49 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.9.2.4.2.1 2018/01/03 20:46:43 snj Exp $");
 
 #include 
 #include 
@@ -578,7 +578,7 @@ drm_stat(struct file *fp, struct stat *s
 	struct drm_file *const file = fp->f_data;
 	struct drm_minor *const dminor = file->minor;
 	const dev_t devno = makedev(cdevsw_lookup_major(_cdevsw),
-	64*dminor->index + dminor->type);
+	64*dminor->type + dminor->index);
 
 	(void)memset(st, 0, sizeof(*st));
 



CVS commit: [netbsd-7-0] src/sys/external/bsd/drm2/drm

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:46:44 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/drm [netbsd-7-0]: drm_drv.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1536):
sys/external/bsd/drm2/drm/drm_drv.c: 1.20
drm_stat: fix device minor calculation, ok riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.9.2.4 -r1.9.2.4.2.1 src/sys/external/bsd/drm2/drm/drm_drv.c

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



CVS commit: [netbsd-7] src/sys/external/bsd/drm2/drm

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:46:48 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/drm [netbsd-7]: drm_drv.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1536):
sys/external/bsd/drm2/drm/drm_drv.c: 1.20
drm_stat: fix device minor calculation, ok riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.9.2.5 -r1.9.2.6 src/sys/external/bsd/drm2/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/drm/drm_drv.c
diff -u src/sys/external/bsd/drm2/drm/drm_drv.c:1.9.2.5 src/sys/external/bsd/drm2/drm/drm_drv.c:1.9.2.6
--- src/sys/external/bsd/drm2/drm/drm_drv.c:1.9.2.5	Thu Feb 11 23:14:41 2016
+++ src/sys/external/bsd/drm2/drm/drm_drv.c	Wed Jan  3 20:46:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_drv.c,v 1.9.2.5 2016/02/11 23:14:41 snj Exp $	*/
+/*	$NetBSD: drm_drv.c,v 1.9.2.6 2018/01/03 20:46:47 snj Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.9.2.5 2016/02/11 23:14:41 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.9.2.6 2018/01/03 20:46:47 snj Exp $");
 
 #include 
 #include 
@@ -579,7 +579,7 @@ drm_stat(struct file *fp, struct stat *s
 	struct drm_file *const file = fp->f_data;
 	struct drm_minor *const dminor = file->minor;
 	const dev_t devno = makedev(cdevsw_lookup_major(_cdevsw),
-	64*dminor->index + dminor->type);
+	64*dminor->type + dminor->index);
 
 	(void)memset(st, 0, sizeof(*st));
 



CVS commit: [netbsd-7-1] src/sys/external/bsd/drm2/drm

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:46:46 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/drm [netbsd-7-1]: drm_drv.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1536):
sys/external/bsd/drm2/drm/drm_drv.c: 1.20
drm_stat: fix device minor calculation, ok riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.9.2.5 -r1.9.2.5.4.1 src/sys/external/bsd/drm2/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/drm/drm_drv.c
diff -u src/sys/external/bsd/drm2/drm/drm_drv.c:1.9.2.5 src/sys/external/bsd/drm2/drm/drm_drv.c:1.9.2.5.4.1
--- src/sys/external/bsd/drm2/drm/drm_drv.c:1.9.2.5	Thu Feb 11 23:14:41 2016
+++ src/sys/external/bsd/drm2/drm/drm_drv.c	Wed Jan  3 20:46:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_drv.c,v 1.9.2.5 2016/02/11 23:14:41 snj Exp $	*/
+/*	$NetBSD: drm_drv.c,v 1.9.2.5.4.1 2018/01/03 20:46:45 snj Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.9.2.5 2016/02/11 23:14:41 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.9.2.5.4.1 2018/01/03 20:46:45 snj Exp $");
 
 #include 
 #include 
@@ -579,7 +579,7 @@ drm_stat(struct file *fp, struct stat *s
 	struct drm_file *const file = fp->f_data;
 	struct drm_minor *const dminor = file->minor;
 	const dev_t devno = makedev(cdevsw_lookup_major(_cdevsw),
-	64*dminor->index + dminor->type);
+	64*dminor->type + dminor->index);
 
 	(void)memset(st, 0, sizeof(*st));
 



CVS commit: [netbsd-7-1] src/sys/external/bsd/drm2/drm

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:46:46 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/drm [netbsd-7-1]: drm_drv.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1536):
sys/external/bsd/drm2/drm/drm_drv.c: 1.20
drm_stat: fix device minor calculation, ok riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.9.2.5 -r1.9.2.5.4.1 src/sys/external/bsd/drm2/drm/drm_drv.c

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



CVS commit: [netbsd-7] src/sys/external/bsd/drm2/drm

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:46:48 UTC 2018

Modified Files:
src/sys/external/bsd/drm2/drm [netbsd-7]: drm_drv.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #1536):
sys/external/bsd/drm2/drm/drm_drv.c: 1.20
drm_stat: fix device minor calculation, ok riastradh@


To generate a diff of this commit:
cvs rdiff -u -r1.9.2.5 -r1.9.2.6 src/sys/external/bsd/drm2/drm/drm_drv.c

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



CVS commit: [netbsd-7] src/usr.sbin/inetd

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:40:21 UTC 2018

Modified Files:
src/usr.sbin/inetd [netbsd-7]: inetd.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1534):
usr.sbin/inetd/inetd.c: revision 1.125
Bump MAXARGV from 20 to 64 - with bozohttpd and all config on the command
line it is easy to hit the (silent) limit.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.122.2.1 src/usr.sbin/inetd/inetd.c

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



CVS commit: [netbsd-7] src/usr.sbin/inetd

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:40:21 UTC 2018

Modified Files:
src/usr.sbin/inetd [netbsd-7]: inetd.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1534):
usr.sbin/inetd/inetd.c: revision 1.125
Bump MAXARGV from 20 to 64 - with bozohttpd and all config on the command
line it is easy to hit the (silent) limit.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.122.2.1 src/usr.sbin/inetd/inetd.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/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.122 src/usr.sbin/inetd/inetd.c:1.122.2.1
--- src/usr.sbin/inetd/inetd.c:1.122	Sat Apr  5 23:36:10 2014
+++ src/usr.sbin/inetd/inetd.c	Wed Jan  3 20:40:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.122 2014/04/05 23:36:10 khorben Exp $	*/
+/*	$NetBSD: inetd.c,v 1.122.2.1 2018/01/03 20:40:21 snj Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)inetd.c	8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.122 2014/04/05 23:36:10 khorben Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.122.2.1 2018/01/03 20:40:21 snj Exp $");
 #endif
 #endif /* not lint */
 
@@ -101,7 +101,7 @@ __RCSID("$NetBSD: inetd.c,v 1.122 2014/0
  *	wait/nowait[:max]		single-threaded/multi-threaded, max #
  *	user[:group]			user/group to run daemon as
  *	server program			full path name
- *	server program arguments	maximum of MAXARGS (20)
+ *	server program arguments	maximum of MAXARGV (64)
  *
  * For RPC services
  *  service name/versionmust be in /etc/rpc
@@ -110,7 +110,7 @@ __RCSID("$NetBSD: inetd.c,v 1.122 2014/0
  *	wait/nowait[:max]		single-threaded/multi-threaded
  *	user[:group]			user to run daemon as
  *	server program			full path name
- *	server program arguments	maximum of MAXARGS (20)
+ *	server program arguments	maximum of MAXARGV (64)
  *
  * For non-RPC services, the "service name" can be of the form
  * hostaddress:servicename, in which case the hostaddress is used
@@ -298,7 +298,7 @@ struct	servtab {
 	char	*se_group;		/* group name to run as */
 	struct	biltin *se_bi;		/* if built-in, description */
 	char	*se_server;		/* server program */
-#define	MAXARGV 20
+#define	MAXARGV 64
 	char	*se_argv[MAXARGV+1];	/* program arguments */
 #ifdef IPSEC
 	char	*se_policy;		/* IPsec poilcy string */



CVS commit: [netbsd-7-1] src/libexec/httpd

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:30:08 UTC 2018

Modified Files:
src/libexec/httpd [netbsd-7-1]: cgi-bozo.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1533):
libexec/httpd/cgi-bozo.c: revision 1.39
PR bin/52194: bozohttpd fails to exec scripts via the -C mechanism
sometimes with EFAULT due to not NULL terminated environment.


To generate a diff of this commit:
cvs rdiff -u -r1.25.2.7 -r1.25.2.7.2.1 src/libexec/httpd/cgi-bozo.c

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



CVS commit: [netbsd-7-1] src/libexec/httpd

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:30:08 UTC 2018

Modified Files:
src/libexec/httpd [netbsd-7-1]: cgi-bozo.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1533):
libexec/httpd/cgi-bozo.c: revision 1.39
PR bin/52194: bozohttpd fails to exec scripts via the -C mechanism
sometimes with EFAULT due to not NULL terminated environment.


To generate a diff of this commit:
cvs rdiff -u -r1.25.2.7 -r1.25.2.7.2.1 src/libexec/httpd/cgi-bozo.c

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

Modified files:

Index: src/libexec/httpd/cgi-bozo.c
diff -u src/libexec/httpd/cgi-bozo.c:1.25.2.7 src/libexec/httpd/cgi-bozo.c:1.25.2.7.2.1
--- src/libexec/httpd/cgi-bozo.c:1.25.2.7	Sun Feb 12 22:07:17 2017
+++ src/libexec/httpd/cgi-bozo.c	Wed Jan  3 20:30:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgi-bozo.c,v 1.25.2.7 2017/02/12 22:07:17 snj Exp $	*/
+/*	$NetBSD: cgi-bozo.c,v 1.25.2.7.2.1 2018/01/03 20:30:07 snj Exp $	*/
 
 /*	$eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -587,6 +587,8 @@ bozo_process_cgi(bozo_httpreq_t *request
 		bozoerr(httpd, 1, "child socketpair failed: %s",
 strerror(errno));
 
+	*curenvp = 0;
+
 	/*
 	 * We create 2 procs: one to become the CGI, one read from
 	 * the CGI and output to the network, and this parent will



CVS commit: [netbsd-7] src/libexec/httpd

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:30:10 UTC 2018

Modified Files:
src/libexec/httpd [netbsd-7]: cgi-bozo.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1533):
libexec/httpd/cgi-bozo.c: revision 1.39
PR bin/52194: bozohttpd fails to exec scripts via the -C mechanism
sometimes with EFAULT due to not NULL terminated environment.


To generate a diff of this commit:
cvs rdiff -u -r1.25.2.7 -r1.25.2.8 src/libexec/httpd/cgi-bozo.c

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



CVS commit: [netbsd-7] src/libexec/httpd

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:30:10 UTC 2018

Modified Files:
src/libexec/httpd [netbsd-7]: cgi-bozo.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1533):
libexec/httpd/cgi-bozo.c: revision 1.39
PR bin/52194: bozohttpd fails to exec scripts via the -C mechanism
sometimes with EFAULT due to not NULL terminated environment.


To generate a diff of this commit:
cvs rdiff -u -r1.25.2.7 -r1.25.2.8 src/libexec/httpd/cgi-bozo.c

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

Modified files:

Index: src/libexec/httpd/cgi-bozo.c
diff -u src/libexec/httpd/cgi-bozo.c:1.25.2.7 src/libexec/httpd/cgi-bozo.c:1.25.2.8
--- src/libexec/httpd/cgi-bozo.c:1.25.2.7	Sun Feb 12 22:07:17 2017
+++ src/libexec/httpd/cgi-bozo.c	Wed Jan  3 20:30:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgi-bozo.c,v 1.25.2.7 2017/02/12 22:07:17 snj Exp $	*/
+/*	$NetBSD: cgi-bozo.c,v 1.25.2.8 2018/01/03 20:30:09 snj Exp $	*/
 
 /*	$eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -587,6 +587,8 @@ bozo_process_cgi(bozo_httpreq_t *request
 		bozoerr(httpd, 1, "child socketpair failed: %s",
 strerror(errno));
 
+	*curenvp = 0;
+
 	/*
 	 * We create 2 procs: one to become the CGI, one read from
 	 * the CGI and output to the network, and this parent will



CVS commit: [netbsd-7-0] src/libexec/httpd

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:30:06 UTC 2018

Modified Files:
src/libexec/httpd [netbsd-7-0]: cgi-bozo.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1533):
libexec/httpd/cgi-bozo.c: revision 1.39
PR bin/52194: bozohttpd fails to exec scripts via the -C mechanism
sometimes with EFAULT due to not NULL terminated environment.


To generate a diff of this commit:
cvs rdiff -u -r1.25.2.2.2.4 -r1.25.2.2.2.5 src/libexec/httpd/cgi-bozo.c

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



CVS commit: [netbsd-7-0] src/libexec/httpd

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:30:06 UTC 2018

Modified Files:
src/libexec/httpd [netbsd-7-0]: cgi-bozo.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1533):
libexec/httpd/cgi-bozo.c: revision 1.39
PR bin/52194: bozohttpd fails to exec scripts via the -C mechanism
sometimes with EFAULT due to not NULL terminated environment.


To generate a diff of this commit:
cvs rdiff -u -r1.25.2.2.2.4 -r1.25.2.2.2.5 src/libexec/httpd/cgi-bozo.c

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

Modified files:

Index: src/libexec/httpd/cgi-bozo.c
diff -u src/libexec/httpd/cgi-bozo.c:1.25.2.2.2.4 src/libexec/httpd/cgi-bozo.c:1.25.2.2.2.5
--- src/libexec/httpd/cgi-bozo.c:1.25.2.2.2.4	Sun Feb 12 21:59:44 2017
+++ src/libexec/httpd/cgi-bozo.c	Wed Jan  3 20:30:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cgi-bozo.c,v 1.25.2.2.2.4 2017/02/12 21:59:44 snj Exp $	*/
+/*	$NetBSD: cgi-bozo.c,v 1.25.2.2.2.5 2018/01/03 20:30:06 snj Exp $	*/
 
 /*	$eterna: cgi-bozo.c,v 1.40 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -587,6 +587,8 @@ bozo_process_cgi(bozo_httpreq_t *request
 		bozoerr(httpd, 1, "child socketpair failed: %s",
 strerror(errno));
 
+	*curenvp = 0;
+
 	/*
 	 * We create 2 procs: one to become the CGI, one read from
 	 * the CGI and output to the network, and this parent will



CVS commit: [netbsd-7] src/sys/arch/arm/broadcom

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:23:43 UTC 2018

Modified Files:
src/sys/arch/arm/broadcom [netbsd-7]: bcm2835_space.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1532):
sys/arch/arm/broadcom/bcm2835_space.c: 1.12-1.13
KNF
--
Sync with armv7_generic_space.c
- BE support (probably not needed)
- a4x subreagion/mmap support
- fix some a4x stream methods
- add UVM_KMF_COLORMATCH in bs_map when allocating KVA
- support BUS_SPACE_MAP_PREFETCHABLE


To generate a diff of this commit:
cvs rdiff -u -r1.6.10.3 -r1.6.10.4 src/sys/arch/arm/broadcom/bcm2835_space.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/bcm2835_space.c
diff -u src/sys/arch/arm/broadcom/bcm2835_space.c:1.6.10.3 src/sys/arch/arm/broadcom/bcm2835_space.c:1.6.10.4
--- src/sys/arch/arm/broadcom/bcm2835_space.c:1.6.10.3	Fri Feb 26 22:52:53 2016
+++ src/sys/arch/arm/broadcom/bcm2835_space.c	Wed Jan  3 20:23:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_space.c,v 1.6.10.3 2016/02/26 22:52:53 snj Exp $	*/
+/*	$NetBSD: bcm2835_space.c,v 1.6.10.4 2018/01/03 20:23:43 snj Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_space.c,v 1.6.10.3 2016/02/26 22:52:53 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_space.c,v 1.6.10.4 2018/01/03 20:23:43 snj Exp $");
 
 #include 
 #include 
@@ -51,6 +51,12 @@ bs_protos(generic_armv4);
 bs_protos(a4x);
 bs_protos(bs_notimpl);
 
+#if __ARMEB__
+#define NSWAP(n)	n ## _swap
+#else
+#define NSWAP(n)	n
+#endif
+
 struct bus_space bcm2835_bs_tag = {
 	/* cookie */
 	(void *) 0,
@@ -75,38 +81,38 @@ struct bus_space bcm2835_bs_tag = {
 
 	/* read (single) */
 	generic_bs_r_1,
-	generic_armv4_bs_r_2,
-	generic_bs_r_4,
+	NSWAP(generic_armv4_bs_r_2),
+	NSWAP(generic_bs_r_4),
 	bs_notimpl_bs_r_8,
 
 	/* read multiple */
 	generic_bs_rm_1,
-	generic_armv4_bs_rm_2,
-	generic_bs_rm_4,
+	NSWAP(generic_armv4_bs_rm_2),
+	NSWAP(generic_bs_rm_4),
 	bs_notimpl_bs_rm_8,
 
 	/* read region */
 	generic_bs_rr_1,
-	generic_armv4_bs_rr_2,
-	generic_bs_rr_4,
+	NSWAP(generic_armv4_bs_rr_2),
+	NSWAP(generic_bs_rr_4),
 	bs_notimpl_bs_rr_8,
 
 	/* write (single) */
 	generic_bs_w_1,
-	generic_armv4_bs_w_2,
-	generic_bs_w_4,
+	NSWAP(generic_armv4_bs_w_2),
+	NSWAP(generic_bs_w_4),
 	bs_notimpl_bs_w_8,
 
 	/* write multiple */
 	generic_bs_wm_1,
-	generic_armv4_bs_wm_2,
-	generic_bs_wm_4,
+	NSWAP(generic_armv4_bs_wm_2),
+	NSWAP(generic_bs_wm_4),
 	bs_notimpl_bs_wm_8,
 
 	/* write region */
 	generic_bs_wr_1,
-	generic_armv4_bs_wr_2,
-	generic_bs_wr_4,
+	NSWAP(generic_armv4_bs_wr_2),
+	NSWAP(generic_bs_wr_4),
 	bs_notimpl_bs_wr_8,
 
 	/* set multiple */
@@ -117,8 +123,8 @@ struct bus_space bcm2835_bs_tag = {
 
 	/* set region */
 	generic_bs_sr_1,
-	generic_armv4_bs_sr_2,
-	bs_notimpl_bs_sr_4,
+	NSWAP(generic_armv4_bs_sr_2),
+	NSWAP(generic_bs_sr_4),
 	bs_notimpl_bs_sr_8,
 
 	/* copy */
@@ -130,38 +136,38 @@ struct bus_space bcm2835_bs_tag = {
 #ifdef __BUS_SPACE_HAS_STREAM_METHODS
 	/* read (single) */
 	generic_bs_r_1,
-	generic_armv4_bs_r_2,
-	generic_bs_r_4,
+	NSWAP(generic_armv4_bs_r_2),
+	NSWAP(generic_bs_r_4),
 	bs_notimpl_bs_r_8,
 
 	/* read multiple */
 	generic_bs_rm_1,
-	generic_armv4_bs_rm_2,
-	generic_bs_rm_4,
+	NSWAP(generic_armv4_bs_rm_2),
+	NSWAP(generic_bs_rm_4),
 	bs_notimpl_bs_rm_8,
 
 	/* read region */
 	generic_bs_rr_1,
-	generic_armv4_bs_rr_2,
-	generic_bs_rr_4,
+	NSWAP(generic_armv4_bs_rr_2),
+	NSWAP(generic_bs_rr_4),
 	bs_notimpl_bs_rr_8,
 
 	/* write (single) */
 	generic_bs_w_1,
-	generic_armv4_bs_w_2,
-	generic_bs_w_4,
+	NSWAP(generic_armv4_bs_w_2),
+	NSWAP(generic_bs_w_4),
 	bs_notimpl_bs_w_8,
 
 	/* write multiple */
 	generic_bs_wm_1,
-	generic_armv4_bs_wm_2,
-	generic_bs_wm_4,
+	NSWAP(generic_armv4_bs_wm_2),
+	NSWAP(generic_bs_wm_4),
 	bs_notimpl_bs_wm_8,
 
 	/* write region */
 	generic_bs_wr_1,
-	generic_armv4_bs_wr_2,
-	generic_bs_wr_4,
+	NSWAP(generic_armv4_bs_wr_2),
+	NSWAP(generic_bs_wr_4),
 	bs_notimpl_bs_wr_8,
 #endif
 };
@@ -173,7 +179,7 @@ struct bus_space bcm2835_a4x_bs_tag = {
 	/* mapping/unmapping */
 	bcm2835_bs_map,
 	bcm2835_bs_unmap,
-	bcm2835_bs_subregion,
+	bcm2835_a4x_bs_subregion,
 
 	/* allocation/deallocation */
 	bcm2835_bs_alloc,	/* not implemented */
@@ -183,21 +189,21 @@ struct bus_space bcm2835_a4x_bs_tag = {
 	bcm2835_bs_vaddr,
 
 	/* mmap */
-	bs_notimpl_bs_mmap,
+	bcm2835_a4x_bs_mmap,
 
 	/* barrier */
 	bcm2835_bs_barrier,
 
 	/* read (single) */
 	a4x_bs_r_1,
-	a4x_bs_r_2,
-	a4x_bs_r_4,
+	NSWAP(a4x_bs_r_2),
+	NSWAP(a4x_bs_r_4),
 	bs_notimpl_bs_r_8,
 
 	/* read multiple */
 	a4x_bs_rm_1,
-	a4x_bs_rm_2,
-	a4x_bs_rm_4,
+	NSWAP(a4x_bs_rm_2),
+	NSWAP(a4x_bs_rm_4),
 	bs_notimpl_bs_rm_8,
 
 	/* read region */
@@ -208,15 +214,16 @@ struct bus_space bcm2835_a4x_bs_tag = {
 
 	/* write (single) */
 	a4x_bs_w_1,
-	

CVS commit: [netbsd-7] src/sys/arch/arm/broadcom

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:23:43 UTC 2018

Modified Files:
src/sys/arch/arm/broadcom [netbsd-7]: bcm2835_space.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1532):
sys/arch/arm/broadcom/bcm2835_space.c: 1.12-1.13
KNF
--
Sync with armv7_generic_space.c
- BE support (probably not needed)
- a4x subreagion/mmap support
- fix some a4x stream methods
- add UVM_KMF_COLORMATCH in bs_map when allocating KVA
- support BUS_SPACE_MAP_PREFETCHABLE


To generate a diff of this commit:
cvs rdiff -u -r1.6.10.3 -r1.6.10.4 src/sys/arch/arm/broadcom/bcm2835_space.c

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:17:40 UTC 2018

Modified Files:
src/sys/arch/x86/x86 [netbsd-7]: pmap.c

Log Message:
Apply patch (requested by maxv in ticket #1531):
amd64: Make the direct map non executable.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.6 -r1.183.2.7 src/sys/arch/x86/x86/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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.183.2.6 src/sys/arch/x86/x86/pmap.c:1.183.2.7
--- src/sys/arch/x86/x86/pmap.c:1.183.2.6	Mon Mar  6 03:27:19 2017
+++ src/sys/arch/x86/x86/pmap.c	Wed Jan  3 20:17:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.183.2.6 2017/03/06 03:27:19 snj Exp $	*/
+/*	$NetBSD: pmap.c,v 1.183.2.7 2018/01/03 20:17:40 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.183.2.6 2017/03/06 03:27:19 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.183.2.7 2018/01/03 20:17:40 snj Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1523,7 +1523,7 @@ pmap_bootstrap(vaddr_t kva_start)
 		}
 	}
 
-	kpm->pm_pdir[PDIR_SLOT_DIRECT] = dmpdp | PG_KW | PG_V | PG_U;
+	kpm->pm_pdir[PDIR_SLOT_DIRECT] = dmpdp | PG_KW | PG_V | PG_U | pg_nx;
 
 	tlbflush();
 



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:17:36 UTC 2018

Modified Files:
src/sys/arch/x86/x86 [netbsd-7-0]: pmap.c

Log Message:
Apply patch (requested by maxv in ticket #1531):
amd64: Make the direct map non executable.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.2.2.3 -r1.183.2.2.2.4 src/sys/arch/x86/x86/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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.183.2.2.2.3 src/sys/arch/x86/x86/pmap.c:1.183.2.2.2.4
--- src/sys/arch/x86/x86/pmap.c:1.183.2.2.2.3	Mon Mar  6 03:32:45 2017
+++ src/sys/arch/x86/x86/pmap.c	Wed Jan  3 20:17:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.183.2.2.2.3 2017/03/06 03:32:45 snj Exp $	*/
+/*	$NetBSD: pmap.c,v 1.183.2.2.2.4 2018/01/03 20:17:36 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.183.2.2.2.3 2017/03/06 03:32:45 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.183.2.2.2.4 2018/01/03 20:17:36 snj Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1517,7 +1517,7 @@ pmap_bootstrap(vaddr_t kva_start)
 		}
 	}
 
-	kpm->pm_pdir[PDIR_SLOT_DIRECT] = dmpdp | PG_KW | PG_V | PG_U;
+	kpm->pm_pdir[PDIR_SLOT_DIRECT] = dmpdp | PG_KW | PG_V | PG_U | pg_nx;
 
 	tlbflush();
 



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:17:38 UTC 2018

Modified Files:
src/sys/arch/x86/x86 [netbsd-7-1]: pmap.c

Log Message:
Apply patch (requested by maxv in ticket #1531):
amd64: Make the direct map non executable.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.6 -r1.183.2.6.2.1 src/sys/arch/x86/x86/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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.183.2.6 src/sys/arch/x86/x86/pmap.c:1.183.2.6.2.1
--- src/sys/arch/x86/x86/pmap.c:1.183.2.6	Mon Mar  6 03:27:19 2017
+++ src/sys/arch/x86/x86/pmap.c	Wed Jan  3 20:17:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.183.2.6 2017/03/06 03:27:19 snj Exp $	*/
+/*	$NetBSD: pmap.c,v 1.183.2.6.2.1 2018/01/03 20:17:38 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.183.2.6 2017/03/06 03:27:19 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.183.2.6.2.1 2018/01/03 20:17:38 snj Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -1523,7 +1523,7 @@ pmap_bootstrap(vaddr_t kva_start)
 		}
 	}
 
-	kpm->pm_pdir[PDIR_SLOT_DIRECT] = dmpdp | PG_KW | PG_V | PG_U;
+	kpm->pm_pdir[PDIR_SLOT_DIRECT] = dmpdp | PG_KW | PG_V | PG_U | pg_nx;
 
 	tlbflush();
 



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:17:36 UTC 2018

Modified Files:
src/sys/arch/x86/x86 [netbsd-7-0]: pmap.c

Log Message:
Apply patch (requested by maxv in ticket #1531):
amd64: Make the direct map non executable.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.2.2.3 -r1.183.2.2.2.4 src/sys/arch/x86/x86/pmap.c

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:17:40 UTC 2018

Modified Files:
src/sys/arch/x86/x86 [netbsd-7]: pmap.c

Log Message:
Apply patch (requested by maxv in ticket #1531):
amd64: Make the direct map non executable.


To generate a diff of this commit:
cvs rdiff -u -r1.183.2.6 -r1.183.2.7 src/sys/arch/x86/x86/pmap.c

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:06:06 UTC 2018

Modified Files:
src/sys/arch/sparc/sparc [netbsd-7]: locore.s

Log Message:
Pull up following revision(s) (requested by maya in ticket #1530):
sys/arch/sparc/sparc/locore.s: revision 1.269
Avoid an instruction requiring a higher alignment than we are guaranteed
Fixes PR port-sparc/52721: ddb errors on ps command
Thanks to mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.268.12.1 src/sys/arch/sparc/sparc/locore.s

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:06:02 UTC 2018

Modified Files:
src/sys/arch/sparc/sparc [netbsd-7-0]: locore.s

Log Message:
Pull up following revision(s) (requested by maya in ticket #1530):
sys/arch/sparc/sparc/locore.s: revision 1.269
Avoid an instruction requiring a higher alignment than we are guaranteed
Fixes PR port-sparc/52721: ddb errors on ps command
Thanks to mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.268.16.1 src/sys/arch/sparc/sparc/locore.s

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:06:06 UTC 2018

Modified Files:
src/sys/arch/sparc/sparc [netbsd-7]: locore.s

Log Message:
Pull up following revision(s) (requested by maya in ticket #1530):
sys/arch/sparc/sparc/locore.s: revision 1.269
Avoid an instruction requiring a higher alignment than we are guaranteed
Fixes PR port-sparc/52721: ddb errors on ps command
Thanks to mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.268.12.1 src/sys/arch/sparc/sparc/locore.s

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/sparc/sparc/locore.s
diff -u src/sys/arch/sparc/sparc/locore.s:1.268 src/sys/arch/sparc/sparc/locore.s:1.268.12.1
--- src/sys/arch/sparc/sparc/locore.s:1.268	Sun Nov  4 00:32:47 2012
+++ src/sys/arch/sparc/sparc/locore.s	Wed Jan  3 20:06:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.268 2012/11/04 00:32:47 chs Exp $	*/
+/*	$NetBSD: locore.s,v 1.268.12.1 2018/01/03 20:06:06 snj Exp $	*/
 
 /*
  * Copyright (c) 1996 Paul Kranenburg
@@ -6288,8 +6288,9 @@ ENTRY(longjmp)
 	cmp	%fp, %g7	! compare against desired frame
 	bl,a	1b		! if below,
 	 restore		!pop frame and loop
-	be,a	2f		! if there,
-	 ldd	[%g1+0], %o2	!fetch return %sp and pc, and get out
+	ld	[%g1+0], %o2	! fetch return %sp
+	be,a	2f		! we're there, get out
+	 ld	[%g1+4], %o3	! fetch return pc
 
 Llongjmpbotch:
 ! otherwise, went too far; bomb out



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:06:04 UTC 2018

Modified Files:
src/sys/arch/sparc/sparc [netbsd-7-1]: locore.s

Log Message:
Pull up following revision(s) (requested by maya in ticket #1530):
sys/arch/sparc/sparc/locore.s: revision 1.269
Avoid an instruction requiring a higher alignment than we are guaranteed
Fixes PR port-sparc/52721: ddb errors on ps command
Thanks to mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.268.24.1 src/sys/arch/sparc/sparc/locore.s

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:06:04 UTC 2018

Modified Files:
src/sys/arch/sparc/sparc [netbsd-7-1]: locore.s

Log Message:
Pull up following revision(s) (requested by maya in ticket #1530):
sys/arch/sparc/sparc/locore.s: revision 1.269
Avoid an instruction requiring a higher alignment than we are guaranteed
Fixes PR port-sparc/52721: ddb errors on ps command
Thanks to mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.268.24.1 src/sys/arch/sparc/sparc/locore.s

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/sparc/sparc/locore.s
diff -u src/sys/arch/sparc/sparc/locore.s:1.268 src/sys/arch/sparc/sparc/locore.s:1.268.24.1
--- src/sys/arch/sparc/sparc/locore.s:1.268	Sun Nov  4 00:32:47 2012
+++ src/sys/arch/sparc/sparc/locore.s	Wed Jan  3 20:06:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.268 2012/11/04 00:32:47 chs Exp $	*/
+/*	$NetBSD: locore.s,v 1.268.24.1 2018/01/03 20:06:04 snj Exp $	*/
 
 /*
  * Copyright (c) 1996 Paul Kranenburg
@@ -6288,8 +6288,9 @@ ENTRY(longjmp)
 	cmp	%fp, %g7	! compare against desired frame
 	bl,a	1b		! if below,
 	 restore		!pop frame and loop
-	be,a	2f		! if there,
-	 ldd	[%g1+0], %o2	!fetch return %sp and pc, and get out
+	ld	[%g1+0], %o2	! fetch return %sp
+	be,a	2f		! we're there, get out
+	 ld	[%g1+4], %o3	! fetch return pc
 
 Llongjmpbotch:
 ! otherwise, went too far; bomb out



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:06:02 UTC 2018

Modified Files:
src/sys/arch/sparc/sparc [netbsd-7-0]: locore.s

Log Message:
Pull up following revision(s) (requested by maya in ticket #1530):
sys/arch/sparc/sparc/locore.s: revision 1.269
Avoid an instruction requiring a higher alignment than we are guaranteed
Fixes PR port-sparc/52721: ddb errors on ps command
Thanks to mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.268 -r1.268.16.1 src/sys/arch/sparc/sparc/locore.s

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/sparc/sparc/locore.s
diff -u src/sys/arch/sparc/sparc/locore.s:1.268 src/sys/arch/sparc/sparc/locore.s:1.268.16.1
--- src/sys/arch/sparc/sparc/locore.s:1.268	Sun Nov  4 00:32:47 2012
+++ src/sys/arch/sparc/sparc/locore.s	Wed Jan  3 20:06:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.268 2012/11/04 00:32:47 chs Exp $	*/
+/*	$NetBSD: locore.s,v 1.268.16.1 2018/01/03 20:06:02 snj Exp $	*/
 
 /*
  * Copyright (c) 1996 Paul Kranenburg
@@ -6288,8 +6288,9 @@ ENTRY(longjmp)
 	cmp	%fp, %g7	! compare against desired frame
 	bl,a	1b		! if below,
 	 restore		!pop frame and loop
-	be,a	2f		! if there,
-	 ldd	[%g1+0], %o2	!fetch return %sp and pc, and get out
+	ld	[%g1+0], %o2	! fetch return %sp
+	be,a	2f		! we're there, get out
+	 ld	[%g1+4], %o3	! fetch return pc
 
 Llongjmpbotch:
 ! otherwise, went too far; bomb out



CVS commit: [netbsd-7] src/sys

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:02:37 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-7]: ehci.c motg.c ohci.c uhci.c xhci.c
src/sys/external/bsd/dwc2 [netbsd-7]: dwc2.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1529):
sys/dev/usb/ehci.c: revision 1.257
sys/dev/usb/motg.c: revision 1.19
sys/dev/usb/ohci.c: revision 1.276
sys/dev/usb/uhci.c: revision 1.279
sys/dev/usb/xhci.c: revision 1.77
sys/external/bsd/dwc2/dwc2.c: revision 1.47
s/PR_NOWAIT/PR_WAITOK/ in HCD allocx (allocate xfer) method


To generate a diff of this commit:
cvs rdiff -u -r1.228.2.1 -r1.228.2.2 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.6.4.3 -r1.6.4.4 src/sys/dev/usb/motg.c
cvs rdiff -u -r1.253.2.3 -r1.253.2.4 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.264.2.2 -r1.264.2.3 src/sys/dev/usb/uhci.c
cvs rdiff -u -r1.23.2.6 -r1.23.2.7 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.31.2.2 -r1.31.2.3 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.



CVS commit: [netbsd-7] src/sys

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:02:37 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-7]: ehci.c motg.c ohci.c uhci.c xhci.c
src/sys/external/bsd/dwc2 [netbsd-7]: dwc2.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1529):
sys/dev/usb/ehci.c: revision 1.257
sys/dev/usb/motg.c: revision 1.19
sys/dev/usb/ohci.c: revision 1.276
sys/dev/usb/uhci.c: revision 1.279
sys/dev/usb/xhci.c: revision 1.77
sys/external/bsd/dwc2/dwc2.c: revision 1.47
s/PR_NOWAIT/PR_WAITOK/ in HCD allocx (allocate xfer) method


To generate a diff of this commit:
cvs rdiff -u -r1.228.2.1 -r1.228.2.2 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.6.4.3 -r1.6.4.4 src/sys/dev/usb/motg.c
cvs rdiff -u -r1.253.2.3 -r1.253.2.4 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.264.2.2 -r1.264.2.3 src/sys/dev/usb/uhci.c
cvs rdiff -u -r1.23.2.6 -r1.23.2.7 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.31.2.2 -r1.31.2.3 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/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.228.2.1 src/sys/dev/usb/ehci.c:1.228.2.2
--- src/sys/dev/usb/ehci.c:1.228.2.1	Wed Apr  5 19:54:19 2017
+++ src/sys/dev/usb/ehci.c	Wed Jan  3 20:02:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.228.2.1 2017/04/05 19:54:19 snj Exp $ */
+/*	$NetBSD: ehci.c,v 1.228.2.2 2018/01/03 20:02:37 snj Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.228.2.1 2017/04/05 19:54:19 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.228.2.2 2018/01/03 20:02:37 snj Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -1508,7 +1508,7 @@ ehci_allocx(struct usbd_bus *bus, unsign
 	struct ehci_softc *sc = EHCI_BUS2SC(bus);
 	struct usbd_xfer *xfer;
 
-	xfer = pool_cache_get(sc->sc_xferpool, PR_NOWAIT);
+	xfer = pool_cache_get(sc->sc_xferpool, PR_WAITOK);
 	if (xfer != NULL) {
 		memset(xfer, 0, sizeof(struct ehci_xfer));
 #ifdef DIAGNOSTIC

Index: src/sys/dev/usb/motg.c
diff -u src/sys/dev/usb/motg.c:1.6.4.3 src/sys/dev/usb/motg.c:1.6.4.4
--- src/sys/dev/usb/motg.c:1.6.4.3	Wed Apr  5 19:54:19 2017
+++ src/sys/dev/usb/motg.c	Wed Jan  3 20:02:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: motg.c,v 1.6.4.3 2017/04/05 19:54:19 snj Exp $	*/
+/*	$NetBSD: motg.c,v 1.6.4.4 2018/01/03 20:02:37 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012, 2014 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.6.4.3 2017/04/05 19:54:19 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: motg.c,v 1.6.4.4 2018/01/03 20:02:37 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_motg.h"
@@ -752,7 +752,7 @@ motg_allocx(struct usbd_bus *bus, unsign
 	struct motg_softc *sc = MOTG_BUS2SC(bus);
 	struct usbd_xfer *xfer;
 
-	xfer = pool_cache_get(sc->sc_xferpool, PR_NOWAIT);
+	xfer = pool_cache_get(sc->sc_xferpool, PR_WAITOK);
 	if (xfer != NULL) {
 		memset(xfer, 0, sizeof(struct motg_xfer));
 #ifdef DIAGNOSTIC

Index: src/sys/dev/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.253.2.3 src/sys/dev/usb/ohci.c:1.253.2.4
--- src/sys/dev/usb/ohci.c:1.253.2.3	Wed Apr  5 19:54:19 2017
+++ src/sys/dev/usb/ohci.c	Wed Jan  3 20:02:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.253.2.3 2017/04/05 19:54:19 snj Exp $	*/
+/*	$NetBSD: ohci.c,v 1.253.2.4 2018/01/03 20:02:37 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.253.2.3 2017/04/05 19:54:19 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.253.2.4 2018/01/03 20:02:37 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1065,7 +1065,7 @@ ohci_allocx(struct usbd_bus *bus, unsign
 	ohci_softc_t *sc = OHCI_BUS2SC(bus);
 	struct usbd_xfer *xfer;
 
-	xfer = pool_cache_get(sc->sc_xferpool, PR_NOWAIT);
+	xfer = pool_cache_get(sc->sc_xferpool, PR_WAITOK);
 	if (xfer != NULL) {
 		memset(xfer, 0, sizeof(struct ohci_xfer));
 #ifdef DIAGNOSTIC

Index: src/sys/dev/usb/uhci.c
diff -u src/sys/dev/usb/uhci.c:1.264.2.2 src/sys/dev/usb/uhci.c:1.264.2.3
--- src/sys/dev/usb/uhci.c:1.264.2.2	Sun Jul 23 06:11:47 2017
+++ src/sys/dev/usb/uhci.c	Wed Jan  3 20:02:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci.c,v 1.264.2.2 2017/07/23 06:11:47 snj Exp $	*/
+/*	$NetBSD: uhci.c,v 1.264.2.3 2018/01/03 20:02:37 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.264.2.2 2017/07/23 06:11:47 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.264.2.3 2018/01/03 20:02:37 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -657,7 +657,7 @@ uhci_allocx(struct usbd_bus *bus, unsign
 	struct uhci_softc *sc = UHCI_BUS2SC(bus);
 	struct usbd_xfer *xfer;
 
-	xfer = 

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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:00:23 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-7]: if_urtwn.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1528):
sys/dev/usb/if_urtwn.c: revision 1.55
PR/52702 Malicious USB devices attaching as urtwn(4) can corrupt kernel memory
Patch from PR slighly updated by me


To generate a diff of this commit:
cvs rdiff -u -r1.34.2.1 -r1.34.2.2 src/sys/dev/usb/if_urtwn.c

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 20:00:23 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-7]: if_urtwn.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1528):
sys/dev/usb/if_urtwn.c: revision 1.55
PR/52702 Malicious USB devices attaching as urtwn(4) can corrupt kernel memory
Patch from PR slighly updated by me


To generate a diff of this commit:
cvs rdiff -u -r1.34.2.1 -r1.34.2.2 src/sys/dev/usb/if_urtwn.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/usb/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.34.2.1 src/sys/dev/usb/if_urtwn.c:1.34.2.2
--- src/sys/dev/usb/if_urtwn.c:1.34.2.1	Wed Apr  5 19:54:19 2017
+++ src/sys/dev/usb/if_urtwn.c	Wed Jan  3 20:00:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.34.2.1 2017/04/05 19:54:19 snj Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.34.2.2 2018/01/03 20:00:23 snj Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.34.2.1 2017/04/05 19:54:19 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.34.2.2 2018/01/03 20:00:23 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -588,8 +588,8 @@ static int
 urtwn_open_pipes(struct urtwn_softc *sc)
 {
 	/* Bulk-out endpoints addresses (from highest to lowest prio). */
-	static uint8_t epaddr[3];
-	static uint8_t rxepaddr[3];
+	static uint8_t epaddr[R92C_MAX_EPOUT];
+	static uint8_t rxepaddr[R92C_MAX_EPIN];
 	usb_interface_descriptor_t *id;
 	usb_endpoint_descriptor_t *ed;
 	size_t i, ntx = 0, nrx = 0;
@@ -601,26 +601,32 @@ urtwn_open_pipes(struct urtwn_softc *sc)
 	id = usbd_get_interface_descriptor(sc->sc_iface);
 	for (i = 0; i < id->bNumEndpoints; i++) {
 		ed = usbd_interface2endpoint_descriptor(sc->sc_iface, i);
-		if (ed != NULL &&
-		UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK &&
-		UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT) {
-			epaddr[ntx] = ed->bEndpointAddress;
+		if (ed == NULL || UE_GET_XFERTYPE(ed->bmAttributes) != UE_BULK) {
+			continue;
+		}
+		if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT) {
+			if (ntx < sizeof(epaddr))
+epaddr[ntx] = ed->bEndpointAddress;
 			ntx++;
 		}
-		if (ed != NULL &&
-		UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK &&
-		UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN) {
-			rxepaddr[nrx] = ed->bEndpointAddress;
+		if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN) {
+			if (nrx < sizeof(rxepaddr))
+rxepaddr[nrx] = ed->bEndpointAddress;
 			nrx++;
 		}
 	}
-	DPRINTFN(DBG_INIT, ("%s: %s: found %zd bulk-out pipes\n",
-	device_xname(sc->sc_dev), __func__, ntx));
+	if (nrx == 0 || nrx > R92C_MAX_EPIN) {
+		aprint_error_dev(sc->sc_dev,
+		"%zd: invalid number of Rx bulk pipes\n", nrx);
+		return EIO;
+	}
 	if (ntx == 0 || ntx > R92C_MAX_EPOUT) {
 		aprint_error_dev(sc->sc_dev,
 		"%zd: invalid number of Tx bulk pipes\n", ntx);
 		return EIO;
 	}
+	DPRINTFN(DBG_INIT, ("%s: %s: found %zd/%zd bulk-in/out pipes\n",
+	device_xname(sc->sc_dev), __func__, nrx, ntx));
 	sc->rx_npipe = nrx;
 	sc->tx_npipe = ntx;
 



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:58:12 UTC 2018

Modified Files:
src/sys/arch/amd64/include [netbsd-7-1]: i82093reg.h
src/sys/arch/i386/include [netbsd-7-1]: i82093reg.h
src/sys/arch/x86/x86 [netbsd-7-1]: ioapic.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1527):
sys/arch/amd64/include/i82093reg.h: revision 1.9
sys/arch/i386/include/i82093reg.h: revision 1.11
sys/arch/x86/x86/ioapic.c: revision 1.54
Don't write a 1 to the read only RIRR bit in the IOAPIC redirection
register to fix "tlp0: filter setup and transmit timeout" observed
on Hyper-V VMs with the Legacy Network Adapter.
>From OpenBSD via PR kern/49323:
 https://marc.info/?l=openbsd-cvs=146718035432599=2


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.68.1 src/sys/arch/amd64/include/i82093reg.h
cvs rdiff -u -r1.8 -r1.8.68.1 src/sys/arch/i386/include/i82093reg.h
cvs rdiff -u -r1.48 -r1.48.16.1 src/sys/arch/x86/x86/ioapic.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/include/i82093reg.h
diff -u src/sys/arch/amd64/include/i82093reg.h:1.5 src/sys/arch/amd64/include/i82093reg.h:1.5.68.1
--- src/sys/arch/amd64/include/i82093reg.h:1.5	Thu Jul  3 14:02:25 2008
+++ src/sys/arch/amd64/include/i82093reg.h	Wed Jan  3 19:58:12 2018
@@ -1,4 +1,4 @@
-/*	 $NetBSD: i82093reg.h,v 1.5 2008/07/03 14:02:25 drochner Exp $ */
+/*	 $NetBSD: i82093reg.h,v 1.5.68.1 2018/01/03 19:58:12 snj Exp $ */
 
 #include 
 
@@ -50,6 +50,7 @@
 	movq	IOAPIC_SC_DATA(%rdi),%r15			;\
 	movl	(%r15),%esi	;\
 	orl	$IOAPIC_REDLO_MASK,%esi;\
+	andl	$~IOAPIC_REDLO_RIRR,%esi			;\
 	movl	%esi,(%r15)	;\
 	movq	IS_PIC(%r14),%rdi;\
 	ioapic_asm_unlock(num)
@@ -66,7 +67,7 @@
 	movq	IOAPIC_SC_DATA(%rdi),%r13			;\
 	movl	%esi, (%r15)	;\
 	movl	(%r13),%r12d	;\
-	andl	$~IOAPIC_REDLO_MASK,%r12d			;\
+	andl	$~(IOAPIC_REDLO_MASK|IOAPIC_REDLO_RIRR),%r12d	;\
 	movl	%esi,(%r15)	;\
 	movl	%r12d,(%r13)	;\
 	movq	IS_PIC(%r14),%rdi;\

Index: src/sys/arch/i386/include/i82093reg.h
diff -u src/sys/arch/i386/include/i82093reg.h:1.8 src/sys/arch/i386/include/i82093reg.h:1.8.68.1
--- src/sys/arch/i386/include/i82093reg.h:1.8	Thu Jul  3 14:02:25 2008
+++ src/sys/arch/i386/include/i82093reg.h	Wed Jan  3 19:58:12 2018
@@ -1,4 +1,4 @@
-/*	 $NetBSD: i82093reg.h,v 1.8 2008/07/03 14:02:25 drochner Exp $ */
+/*	 $NetBSD: i82093reg.h,v 1.8.68.1 2018/01/03 19:58:12 snj Exp $ */
 
 #include 
 
@@ -41,6 +41,7 @@
 	movl	IOAPIC_SC_DATA(%edi),%ebx			;\
 	movl	(%ebx),%esi	;\
 	orl	$IOAPIC_REDLO_MASK,%esi;\
+	andl	$~IOAPIC_REDLO_RIRR,%esi			;\
 	movl	%esi,(%ebx)	;\
 	movl	IS_PIC(%ebp),%edi;\
 	ioapic_asm_unlock(num)
@@ -64,7 +65,7 @@
 	movl	IOAPIC_SC_DATA(%edi),%eax			;\
 	movl	%esi, (%ebx)	;\
 	movl	(%eax),%edx	;\
-	andl	$~IOAPIC_REDLO_MASK,%edx			;\
+	andl	$~(IOAPIC_REDLO_MASK|IOAPIC_REDLO_RIRR),%edx	;\
 	movl	%esi, (%ebx)	;\
 	movl	%edx,(%eax)	;\
 	movl	IS_PIC(%ebp),%edi;\

Index: src/sys/arch/x86/x86/ioapic.c
diff -u src/sys/arch/x86/x86/ioapic.c:1.48 src/sys/arch/x86/x86/ioapic.c:1.48.16.1
--- src/sys/arch/x86/x86/ioapic.c:1.48	Fri Jun 28 14:31:49 2013
+++ src/sys/arch/x86/x86/ioapic.c	Wed Jan  3 19:58:12 2018
@@ -1,4 +1,4 @@
-/* 	$NetBSD: ioapic.c,v 1.48 2013/06/28 14:31:49 jakllsch Exp $	*/
+/* 	$NetBSD: ioapic.c,v 1.48.16.1 2018/01/03 19:58:12 snj Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.48 2013/06/28 14:31:49 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.48.16.1 2018/01/03 19:58:12 snj Exp $");
 
 #include "opt_ddb.h"
 
@@ -506,6 +506,7 @@ ioapic_hwmask(struct pic *pic, int pin)
 	flags = ioapic_lock(sc);
 	redlo = ioapic_read_ul(sc, IOAPIC_REDLO(pin));
 	redlo |= IOAPIC_REDLO_MASK;
+	redlo &= ~IOAPIC_REDLO_RIRR;
 	ioapic_write_ul(sc, IOAPIC_REDLO(pin), redlo);
 	ioapic_unlock(sc, flags);
 }
@@ -546,7 +547,7 @@ ioapic_hwunmask(struct pic *pic, int pin
 
 	flags = ioapic_lock(sc);
 	redlo = ioapic_read_ul(sc, IOAPIC_REDLO(pin));
-	redlo &= ~IOAPIC_REDLO_MASK;
+	redlo &= ~(IOAPIC_REDLO_MASK | IOAPIC_REDLO_RIRR);
 	ioapic_write_ul(sc, IOAPIC_REDLO(pin), redlo);
 	ioapic_unlock(sc, flags);
 }



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:58:14 UTC 2018

Modified Files:
src/sys/arch/amd64/include [netbsd-7]: i82093reg.h
src/sys/arch/i386/include [netbsd-7]: i82093reg.h
src/sys/arch/x86/x86 [netbsd-7]: ioapic.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1527):
sys/arch/amd64/include/i82093reg.h: revision 1.9
sys/arch/i386/include/i82093reg.h: revision 1.11
sys/arch/x86/x86/ioapic.c: revision 1.54
Don't write a 1 to the read only RIRR bit in the IOAPIC redirection
register to fix "tlp0: filter setup and transmit timeout" observed
on Hyper-V VMs with the Legacy Network Adapter.
>From OpenBSD via PR kern/49323:
 https://marc.info/?l=openbsd-cvs=146718035432599=2


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.58.1 src/sys/arch/amd64/include/i82093reg.h
cvs rdiff -u -r1.8 -r1.8.58.1 src/sys/arch/i386/include/i82093reg.h
cvs rdiff -u -r1.48 -r1.48.8.1 src/sys/arch/x86/x86/ioapic.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/include/i82093reg.h
diff -u src/sys/arch/amd64/include/i82093reg.h:1.5 src/sys/arch/amd64/include/i82093reg.h:1.5.58.1
--- src/sys/arch/amd64/include/i82093reg.h:1.5	Thu Jul  3 14:02:25 2008
+++ src/sys/arch/amd64/include/i82093reg.h	Wed Jan  3 19:58:14 2018
@@ -1,4 +1,4 @@
-/*	 $NetBSD: i82093reg.h,v 1.5 2008/07/03 14:02:25 drochner Exp $ */
+/*	 $NetBSD: i82093reg.h,v 1.5.58.1 2018/01/03 19:58:14 snj Exp $ */
 
 #include 
 
@@ -50,6 +50,7 @@
 	movq	IOAPIC_SC_DATA(%rdi),%r15			;\
 	movl	(%r15),%esi	;\
 	orl	$IOAPIC_REDLO_MASK,%esi;\
+	andl	$~IOAPIC_REDLO_RIRR,%esi			;\
 	movl	%esi,(%r15)	;\
 	movq	IS_PIC(%r14),%rdi;\
 	ioapic_asm_unlock(num)
@@ -66,7 +67,7 @@
 	movq	IOAPIC_SC_DATA(%rdi),%r13			;\
 	movl	%esi, (%r15)	;\
 	movl	(%r13),%r12d	;\
-	andl	$~IOAPIC_REDLO_MASK,%r12d			;\
+	andl	$~(IOAPIC_REDLO_MASK|IOAPIC_REDLO_RIRR),%r12d	;\
 	movl	%esi,(%r15)	;\
 	movl	%r12d,(%r13)	;\
 	movq	IS_PIC(%r14),%rdi;\

Index: src/sys/arch/i386/include/i82093reg.h
diff -u src/sys/arch/i386/include/i82093reg.h:1.8 src/sys/arch/i386/include/i82093reg.h:1.8.58.1
--- src/sys/arch/i386/include/i82093reg.h:1.8	Thu Jul  3 14:02:25 2008
+++ src/sys/arch/i386/include/i82093reg.h	Wed Jan  3 19:58:14 2018
@@ -1,4 +1,4 @@
-/*	 $NetBSD: i82093reg.h,v 1.8 2008/07/03 14:02:25 drochner Exp $ */
+/*	 $NetBSD: i82093reg.h,v 1.8.58.1 2018/01/03 19:58:14 snj Exp $ */
 
 #include 
 
@@ -41,6 +41,7 @@
 	movl	IOAPIC_SC_DATA(%edi),%ebx			;\
 	movl	(%ebx),%esi	;\
 	orl	$IOAPIC_REDLO_MASK,%esi;\
+	andl	$~IOAPIC_REDLO_RIRR,%esi			;\
 	movl	%esi,(%ebx)	;\
 	movl	IS_PIC(%ebp),%edi;\
 	ioapic_asm_unlock(num)
@@ -64,7 +65,7 @@
 	movl	IOAPIC_SC_DATA(%edi),%eax			;\
 	movl	%esi, (%ebx)	;\
 	movl	(%eax),%edx	;\
-	andl	$~IOAPIC_REDLO_MASK,%edx			;\
+	andl	$~(IOAPIC_REDLO_MASK|IOAPIC_REDLO_RIRR),%edx	;\
 	movl	%esi, (%ebx)	;\
 	movl	%edx,(%eax)	;\
 	movl	IS_PIC(%ebp),%edi;\

Index: src/sys/arch/x86/x86/ioapic.c
diff -u src/sys/arch/x86/x86/ioapic.c:1.48 src/sys/arch/x86/x86/ioapic.c:1.48.8.1
--- src/sys/arch/x86/x86/ioapic.c:1.48	Fri Jun 28 14:31:49 2013
+++ src/sys/arch/x86/x86/ioapic.c	Wed Jan  3 19:58:14 2018
@@ -1,4 +1,4 @@
-/* 	$NetBSD: ioapic.c,v 1.48 2013/06/28 14:31:49 jakllsch Exp $	*/
+/* 	$NetBSD: ioapic.c,v 1.48.8.1 2018/01/03 19:58:14 snj Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.48 2013/06/28 14:31:49 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.48.8.1 2018/01/03 19:58:14 snj Exp $");
 
 #include "opt_ddb.h"
 
@@ -506,6 +506,7 @@ ioapic_hwmask(struct pic *pic, int pin)
 	flags = ioapic_lock(sc);
 	redlo = ioapic_read_ul(sc, IOAPIC_REDLO(pin));
 	redlo |= IOAPIC_REDLO_MASK;
+	redlo &= ~IOAPIC_REDLO_RIRR;
 	ioapic_write_ul(sc, IOAPIC_REDLO(pin), redlo);
 	ioapic_unlock(sc, flags);
 }
@@ -546,7 +547,7 @@ ioapic_hwunmask(struct pic *pic, int pin
 
 	flags = ioapic_lock(sc);
 	redlo = ioapic_read_ul(sc, IOAPIC_REDLO(pin));
-	redlo &= ~IOAPIC_REDLO_MASK;
+	redlo &= ~(IOAPIC_REDLO_MASK | IOAPIC_REDLO_RIRR);
 	ioapic_write_ul(sc, IOAPIC_REDLO(pin), redlo);
 	ioapic_unlock(sc, flags);
 }



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:58:14 UTC 2018

Modified Files:
src/sys/arch/amd64/include [netbsd-7]: i82093reg.h
src/sys/arch/i386/include [netbsd-7]: i82093reg.h
src/sys/arch/x86/x86 [netbsd-7]: ioapic.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1527):
sys/arch/amd64/include/i82093reg.h: revision 1.9
sys/arch/i386/include/i82093reg.h: revision 1.11
sys/arch/x86/x86/ioapic.c: revision 1.54
Don't write a 1 to the read only RIRR bit in the IOAPIC redirection
register to fix "tlp0: filter setup and transmit timeout" observed
on Hyper-V VMs with the Legacy Network Adapter.
>From OpenBSD via PR kern/49323:
 https://marc.info/?l=openbsd-cvs=146718035432599=2


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.58.1 src/sys/arch/amd64/include/i82093reg.h
cvs rdiff -u -r1.8 -r1.8.58.1 src/sys/arch/i386/include/i82093reg.h
cvs rdiff -u -r1.48 -r1.48.8.1 src/sys/arch/x86/x86/ioapic.c

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:58:10 UTC 2018

Modified Files:
src/sys/arch/amd64/include [netbsd-7-0]: i82093reg.h
src/sys/arch/i386/include [netbsd-7-0]: i82093reg.h
src/sys/arch/x86/x86 [netbsd-7-0]: ioapic.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1527):
sys/arch/amd64/include/i82093reg.h: revision 1.9
sys/arch/i386/include/i82093reg.h: revision 1.11
sys/arch/x86/x86/ioapic.c: revision 1.54
Don't write a 1 to the read only RIRR bit in the IOAPIC redirection
register to fix "tlp0: filter setup and transmit timeout" observed
on Hyper-V VMs with the Legacy Network Adapter.
>From OpenBSD via PR kern/49323:
 https://marc.info/?l=openbsd-cvs=146718035432599=2


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.62.1 src/sys/arch/amd64/include/i82093reg.h
cvs rdiff -u -r1.8 -r1.8.62.1 src/sys/arch/i386/include/i82093reg.h
cvs rdiff -u -r1.48 -r1.48.12.1 src/sys/arch/x86/x86/ioapic.c

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:58:12 UTC 2018

Modified Files:
src/sys/arch/amd64/include [netbsd-7-1]: i82093reg.h
src/sys/arch/i386/include [netbsd-7-1]: i82093reg.h
src/sys/arch/x86/x86 [netbsd-7-1]: ioapic.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1527):
sys/arch/amd64/include/i82093reg.h: revision 1.9
sys/arch/i386/include/i82093reg.h: revision 1.11
sys/arch/x86/x86/ioapic.c: revision 1.54
Don't write a 1 to the read only RIRR bit in the IOAPIC redirection
register to fix "tlp0: filter setup and transmit timeout" observed
on Hyper-V VMs with the Legacy Network Adapter.
>From OpenBSD via PR kern/49323:
 https://marc.info/?l=openbsd-cvs=146718035432599=2


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.68.1 src/sys/arch/amd64/include/i82093reg.h
cvs rdiff -u -r1.8 -r1.8.68.1 src/sys/arch/i386/include/i82093reg.h
cvs rdiff -u -r1.48 -r1.48.16.1 src/sys/arch/x86/x86/ioapic.c

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:58:10 UTC 2018

Modified Files:
src/sys/arch/amd64/include [netbsd-7-0]: i82093reg.h
src/sys/arch/i386/include [netbsd-7-0]: i82093reg.h
src/sys/arch/x86/x86 [netbsd-7-0]: ioapic.c

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #1527):
sys/arch/amd64/include/i82093reg.h: revision 1.9
sys/arch/i386/include/i82093reg.h: revision 1.11
sys/arch/x86/x86/ioapic.c: revision 1.54
Don't write a 1 to the read only RIRR bit in the IOAPIC redirection
register to fix "tlp0: filter setup and transmit timeout" observed
on Hyper-V VMs with the Legacy Network Adapter.
>From OpenBSD via PR kern/49323:
 https://marc.info/?l=openbsd-cvs=146718035432599=2


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.62.1 src/sys/arch/amd64/include/i82093reg.h
cvs rdiff -u -r1.8 -r1.8.62.1 src/sys/arch/i386/include/i82093reg.h
cvs rdiff -u -r1.48 -r1.48.12.1 src/sys/arch/x86/x86/ioapic.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/include/i82093reg.h
diff -u src/sys/arch/amd64/include/i82093reg.h:1.5 src/sys/arch/amd64/include/i82093reg.h:1.5.62.1
--- src/sys/arch/amd64/include/i82093reg.h:1.5	Thu Jul  3 14:02:25 2008
+++ src/sys/arch/amd64/include/i82093reg.h	Wed Jan  3 19:58:10 2018
@@ -1,4 +1,4 @@
-/*	 $NetBSD: i82093reg.h,v 1.5 2008/07/03 14:02:25 drochner Exp $ */
+/*	 $NetBSD: i82093reg.h,v 1.5.62.1 2018/01/03 19:58:10 snj Exp $ */
 
 #include 
 
@@ -50,6 +50,7 @@
 	movq	IOAPIC_SC_DATA(%rdi),%r15			;\
 	movl	(%r15),%esi	;\
 	orl	$IOAPIC_REDLO_MASK,%esi;\
+	andl	$~IOAPIC_REDLO_RIRR,%esi			;\
 	movl	%esi,(%r15)	;\
 	movq	IS_PIC(%r14),%rdi;\
 	ioapic_asm_unlock(num)
@@ -66,7 +67,7 @@
 	movq	IOAPIC_SC_DATA(%rdi),%r13			;\
 	movl	%esi, (%r15)	;\
 	movl	(%r13),%r12d	;\
-	andl	$~IOAPIC_REDLO_MASK,%r12d			;\
+	andl	$~(IOAPIC_REDLO_MASK|IOAPIC_REDLO_RIRR),%r12d	;\
 	movl	%esi,(%r15)	;\
 	movl	%r12d,(%r13)	;\
 	movq	IS_PIC(%r14),%rdi;\

Index: src/sys/arch/i386/include/i82093reg.h
diff -u src/sys/arch/i386/include/i82093reg.h:1.8 src/sys/arch/i386/include/i82093reg.h:1.8.62.1
--- src/sys/arch/i386/include/i82093reg.h:1.8	Thu Jul  3 14:02:25 2008
+++ src/sys/arch/i386/include/i82093reg.h	Wed Jan  3 19:58:10 2018
@@ -1,4 +1,4 @@
-/*	 $NetBSD: i82093reg.h,v 1.8 2008/07/03 14:02:25 drochner Exp $ */
+/*	 $NetBSD: i82093reg.h,v 1.8.62.1 2018/01/03 19:58:10 snj Exp $ */
 
 #include 
 
@@ -41,6 +41,7 @@
 	movl	IOAPIC_SC_DATA(%edi),%ebx			;\
 	movl	(%ebx),%esi	;\
 	orl	$IOAPIC_REDLO_MASK,%esi;\
+	andl	$~IOAPIC_REDLO_RIRR,%esi			;\
 	movl	%esi,(%ebx)	;\
 	movl	IS_PIC(%ebp),%edi;\
 	ioapic_asm_unlock(num)
@@ -64,7 +65,7 @@
 	movl	IOAPIC_SC_DATA(%edi),%eax			;\
 	movl	%esi, (%ebx)	;\
 	movl	(%eax),%edx	;\
-	andl	$~IOAPIC_REDLO_MASK,%edx			;\
+	andl	$~(IOAPIC_REDLO_MASK|IOAPIC_REDLO_RIRR),%edx	;\
 	movl	%esi, (%ebx)	;\
 	movl	%edx,(%eax)	;\
 	movl	IS_PIC(%ebp),%edi;\

Index: src/sys/arch/x86/x86/ioapic.c
diff -u src/sys/arch/x86/x86/ioapic.c:1.48 src/sys/arch/x86/x86/ioapic.c:1.48.12.1
--- src/sys/arch/x86/x86/ioapic.c:1.48	Fri Jun 28 14:31:49 2013
+++ src/sys/arch/x86/x86/ioapic.c	Wed Jan  3 19:58:10 2018
@@ -1,4 +1,4 @@
-/* 	$NetBSD: ioapic.c,v 1.48 2013/06/28 14:31:49 jakllsch Exp $	*/
+/* 	$NetBSD: ioapic.c,v 1.48.12.1 2018/01/03 19:58:10 snj Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2009 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.48 2013/06/28 14:31:49 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ioapic.c,v 1.48.12.1 2018/01/03 19:58:10 snj Exp $");
 
 #include "opt_ddb.h"
 
@@ -506,6 +506,7 @@ ioapic_hwmask(struct pic *pic, int pin)
 	flags = ioapic_lock(sc);
 	redlo = ioapic_read_ul(sc, IOAPIC_REDLO(pin));
 	redlo |= IOAPIC_REDLO_MASK;
+	redlo &= ~IOAPIC_REDLO_RIRR;
 	ioapic_write_ul(sc, IOAPIC_REDLO(pin), redlo);
 	ioapic_unlock(sc, flags);
 }
@@ -546,7 +547,7 @@ ioapic_hwunmask(struct pic *pic, int pin
 
 	flags = ioapic_lock(sc);
 	redlo = ioapic_read_ul(sc, IOAPIC_REDLO(pin));
-	redlo &= ~IOAPIC_REDLO_MASK;
+	redlo &= ~(IOAPIC_REDLO_MASK | IOAPIC_REDLO_RIRR);
 	ioapic_write_ul(sc, IOAPIC_REDLO(pin), redlo);
 	ioapic_unlock(sc, flags);
 }



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:48:46 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-7]: xhci.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1526):
sys/dev/usb/xhci.c: revision 1.76
Wait 1ms first. Existing Intel xHCI requies 1ms delay to prevent system hang
(Errata).


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.5 -r1.23.2.6 src/sys/dev/usb/xhci.c

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



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

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:48:46 UTC 2018

Modified Files:
src/sys/dev/usb [netbsd-7]: xhci.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1526):
sys/dev/usb/xhci.c: revision 1.76
Wait 1ms first. Existing Intel xHCI requies 1ms delay to prevent system hang
(Errata).


To generate a diff of this commit:
cvs rdiff -u -r1.23.2.5 -r1.23.2.6 src/sys/dev/usb/xhci.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/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.23.2.5 src/sys/dev/usb/xhci.c:1.23.2.6
--- src/sys/dev/usb/xhci.c:1.23.2.5	Wed Apr  5 19:54:21 2017
+++ src/sys/dev/usb/xhci.c	Wed Jan  3 19:48:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.23.2.5 2017/04/05 19:54:21 snj Exp $	*/
+/*	$NetBSD: xhci.c,v 1.23.2.6 2018/01/03 19:48:45 snj Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.23.2.5 2017/04/05 19:54:21 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.23.2.6 2018/01/03 19:48:45 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -689,10 +689,14 @@ xhci_hc_reset(struct xhci_softc * const 
 	usbcmd = XHCI_CMD_HCRST;
 	xhci_op_write_4(sc, XHCI_USBCMD, usbcmd);
 	for (i = 0; i < XHCI_WAIT_HCRST; i++) {
+		/*
+		 * Wait 1ms first. Existing Intel xHCI requies 1ms delay to
+		 * prevent system hang (Errata).
+		 */
+		usb_delay_ms(>sc_bus, 1);
 		usbcmd = xhci_op_read_4(sc, XHCI_USBCMD);
 		if ((usbcmd & XHCI_CMD_HCRST) == 0)
 			break;
-		usb_delay_ms(>sc_bus, 1);
 	}
 	if (i >= XHCI_WAIT_HCRST) {
 		aprint_error_dev(sc->sc_dev, "host controller reset timeout\n");



CVS commit: [netbsd-7-1] src/sys/external/bsd/ipf/netinet

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:30:43 UTC 2018

Modified Files:
src/sys/external/bsd/ipf/netinet [netbsd-7-1]: ip_state.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1525):
sys/external/bsd/ipf/netinet/ip_state.c: 1.9-1.10
When growing the state, remember to grow the seed array, otherwise we'll end
up accessing memory we did not allocate.
--
put back the cast.


To generate a diff of this commit:
cvs rdiff -u -r1.6.16.1 -r1.6.16.2 \
src/sys/external/bsd/ipf/netinet/ip_state.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/ipf/netinet/ip_state.c
diff -u src/sys/external/bsd/ipf/netinet/ip_state.c:1.6.16.1 src/sys/external/bsd/ipf/netinet/ip_state.c:1.6.16.2
--- src/sys/external/bsd/ipf/netinet/ip_state.c:1.6.16.1	Wed Jul 12 18:50:44 2017
+++ src/sys/external/bsd/ipf/netinet/ip_state.c	Wed Jan  3 19:30:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_state.c,v 1.6.16.1 2017/07/12 18:50:44 sborrill Exp $	*/
+/*	$NetBSD: ip_state.c,v 1.6.16.2 2018/01/03 19:30:43 snj Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -100,7 +100,7 @@ struct file;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.6.16.1 2017/07/12 18:50:44 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.6.16.2 2018/01/03 19:30:43 snj Exp $");
 #else
 static const char sccsid[] = "@(#)ip_state.c	1.8 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_state.c,v 1.1.1.2 2012/07/22 13:45:37 darrenr Exp";
@@ -298,6 +298,32 @@ ipf_state_soft_destroy(ipf_main_softc_t 
 	KFREE(softs);
 }
 
+static void *
+ipf_state_seed_alloc(u_int state_size, u_int state_max)
+{
+	u_int i;
+	u_long *state_seed;
+	KMALLOCS(state_seed, u_long *, state_size * sizeof(*state_seed));
+	if (state_seed == NULL)
+		return NULL;
+
+	for (i = 0; i < state_size; i++) {
+		/*
+		 * XXX - ipf_state_seed[X] should be a random number of sorts.
+		 */
+#if !defined(NEED_LOCAL_RAND) && defined(_KERNEL)
+		state_seed[i] = cprng_fast32();
+#else
+		state_seed[i] = ((u_long)state_seed + i) * state_size;
+		state_seed[i] ^= 0xa5a55a5a;
+		state_seed[i] *= (u_long)state_seed;
+		state_seed[i] ^= 0x5a5aa5a5;
+		state_seed[i] *= state_max;
+#endif
+	}
+	return state_seed;
+}
+
 
 /*  */
 /* Function:ipf_state_soft_init */
@@ -328,27 +354,11 @@ ipf_state_soft_init(ipf_main_softc_t *so
 	bzero((char *)softs->ipf_state_table,
 	  softs->ipf_state_size * sizeof(ipstate_t *));
 
-	KMALLOCS(softs->ipf_state_seed, u_long *,
-		 softs->ipf_state_size * sizeof(*softs->ipf_state_seed));
+	softs->ipf_state_seed = ipf_state_seed_alloc(softs->ipf_state_size,
+	softs->ipf_state_max);
 	if (softs->ipf_state_seed == NULL)
 		return -2;
 
-	for (i = 0; i < softs->ipf_state_size; i++) {
-		/*
-		 * XXX - ipf_state_seed[X] should be a random number of sorts.
-		 */
-#if !defined(NEED_LOCAL_RAND) && defined(_KERNEL)
-		softs->ipf_state_seed[i] = cprng_fast32();
-#else
-		softs->ipf_state_seed[i] = ((u_long)softs->ipf_state_seed + i) *
-softs->ipf_state_size;
-		softs->ipf_state_seed[i] ^= 0xa5a55a5a;
-		softs->ipf_state_seed[i] *= (u_long)softs->ipf_state_seed;
-		softs->ipf_state_seed[i] ^= 0x5a5aa5a5;
-		softs->ipf_state_seed[i] *= softs->ipf_state_max;
-#endif
-	}
-
 	KMALLOCS(softs->ipf_state_stats.iss_bucketlen, u_int *,
 		 softs->ipf_state_size * sizeof(u_int));
 	if (softs->ipf_state_stats.iss_bucketlen == NULL)
@@ -5137,6 +5147,7 @@ ipf_state_rehash(ipf_main_softc_t *softc
 {
 	ipf_state_softc_t *softs = softc->ipf_state_soft;
 	ipstate_t **newtab, *is;
+	u_long *newseed;
 	u_int *bucketlens;
 	u_int maxbucket;
 	u_int newsize;
@@ -5163,6 +5174,14 @@ ipf_state_rehash(ipf_main_softc_t *softc
 		return ENOMEM;
 	}
 
+	newseed = ipf_state_seed_alloc(newsize, softs->ipf_state_max);
+	if (newseed == NULL) {
+		KFREES(bucketlens, newsize * sizeof(*bucketlens));
+		KFREES(newtab, newsize * sizeof(*newtab));
+		IPFERROR(100037);
+		return ENOMEM;
+	}
+
 	for (maxbucket = 0, i = newsize; i > 0; i >>= 1)
 		maxbucket++;
 	maxbucket *= 2;
@@ -5178,6 +5197,12 @@ ipf_state_rehash(ipf_main_softc_t *softc
 	}
 	softs->ipf_state_table = newtab;
 
+	if (softs->ipf_state_seed != NULL) {
+		KFREES(softs->ipf_state_seed,
+		   softs->ipf_state_size * sizeof(*softs->ipf_state_seed));
+	}
+	softs->ipf_state_seed = newseed;
+
 	if (softs->ipf_state_stats.iss_bucketlen != NULL) {
 		KFREES(softs->ipf_state_stats.iss_bucketlen,
 		   softs->ipf_state_size * sizeof(u_int));



CVS commit: [netbsd-7-0] src/sys/external/bsd/ipf/netinet

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:30:41 UTC 2018

Modified Files:
src/sys/external/bsd/ipf/netinet [netbsd-7-0]: ip_state.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1525):
sys/external/bsd/ipf/netinet/ip_state.c: 1.9-1.10
When growing the state, remember to grow the seed array, otherwise we'll end
up accessing memory we did not allocate.
--
put back the cast.


To generate a diff of this commit:
cvs rdiff -u -r1.6.8.1 -r1.6.8.2 src/sys/external/bsd/ipf/netinet/ip_state.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/ipf/netinet/ip_state.c
diff -u src/sys/external/bsd/ipf/netinet/ip_state.c:1.6.8.1 src/sys/external/bsd/ipf/netinet/ip_state.c:1.6.8.2
--- src/sys/external/bsd/ipf/netinet/ip_state.c:1.6.8.1	Fri Aug 25 05:31:36 2017
+++ src/sys/external/bsd/ipf/netinet/ip_state.c	Wed Jan  3 19:30:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_state.c,v 1.6.8.1 2017/08/25 05:31:36 snj Exp $	*/
+/*	$NetBSD: ip_state.c,v 1.6.8.2 2018/01/03 19:30:41 snj Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -100,7 +100,7 @@ struct file;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.6.8.1 2017/08/25 05:31:36 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.6.8.2 2018/01/03 19:30:41 snj Exp $");
 #else
 static const char sccsid[] = "@(#)ip_state.c	1.8 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_state.c,v 1.1.1.2 2012/07/22 13:45:37 darrenr Exp";
@@ -298,6 +298,32 @@ ipf_state_soft_destroy(ipf_main_softc_t 
 	KFREE(softs);
 }
 
+static void *
+ipf_state_seed_alloc(u_int state_size, u_int state_max)
+{
+	u_int i;
+	u_long *state_seed;
+	KMALLOCS(state_seed, u_long *, state_size * sizeof(*state_seed));
+	if (state_seed == NULL)
+		return NULL;
+
+	for (i = 0; i < state_size; i++) {
+		/*
+		 * XXX - ipf_state_seed[X] should be a random number of sorts.
+		 */
+#if !defined(NEED_LOCAL_RAND) && defined(_KERNEL)
+		state_seed[i] = cprng_fast32();
+#else
+		state_seed[i] = ((u_long)state_seed + i) * state_size;
+		state_seed[i] ^= 0xa5a55a5a;
+		state_seed[i] *= (u_long)state_seed;
+		state_seed[i] ^= 0x5a5aa5a5;
+		state_seed[i] *= state_max;
+#endif
+	}
+	return state_seed;
+}
+
 
 /*  */
 /* Function:ipf_state_soft_init */
@@ -328,27 +354,11 @@ ipf_state_soft_init(ipf_main_softc_t *so
 	bzero((char *)softs->ipf_state_table,
 	  softs->ipf_state_size * sizeof(ipstate_t *));
 
-	KMALLOCS(softs->ipf_state_seed, u_long *,
-		 softs->ipf_state_size * sizeof(*softs->ipf_state_seed));
+	softs->ipf_state_seed = ipf_state_seed_alloc(softs->ipf_state_size,
+	softs->ipf_state_max);
 	if (softs->ipf_state_seed == NULL)
 		return -2;
 
-	for (i = 0; i < softs->ipf_state_size; i++) {
-		/*
-		 * XXX - ipf_state_seed[X] should be a random number of sorts.
-		 */
-#if !defined(NEED_LOCAL_RAND) && defined(_KERNEL)
-		softs->ipf_state_seed[i] = cprng_fast32();
-#else
-		softs->ipf_state_seed[i] = ((u_long)softs->ipf_state_seed + i) *
-softs->ipf_state_size;
-		softs->ipf_state_seed[i] ^= 0xa5a55a5a;
-		softs->ipf_state_seed[i] *= (u_long)softs->ipf_state_seed;
-		softs->ipf_state_seed[i] ^= 0x5a5aa5a5;
-		softs->ipf_state_seed[i] *= softs->ipf_state_max;
-#endif
-	}
-
 	KMALLOCS(softs->ipf_state_stats.iss_bucketlen, u_int *,
 		 softs->ipf_state_size * sizeof(u_int));
 	if (softs->ipf_state_stats.iss_bucketlen == NULL)
@@ -5137,6 +5147,7 @@ ipf_state_rehash(ipf_main_softc_t *softc
 {
 	ipf_state_softc_t *softs = softc->ipf_state_soft;
 	ipstate_t **newtab, *is;
+	u_long *newseed;
 	u_int *bucketlens;
 	u_int maxbucket;
 	u_int newsize;
@@ -5163,6 +5174,14 @@ ipf_state_rehash(ipf_main_softc_t *softc
 		return ENOMEM;
 	}
 
+	newseed = ipf_state_seed_alloc(newsize, softs->ipf_state_max);
+	if (newseed == NULL) {
+		KFREES(bucketlens, newsize * sizeof(*bucketlens));
+		KFREES(newtab, newsize * sizeof(*newtab));
+		IPFERROR(100037);
+		return ENOMEM;
+	}
+
 	for (maxbucket = 0, i = newsize; i > 0; i >>= 1)
 		maxbucket++;
 	maxbucket *= 2;
@@ -5178,6 +5197,12 @@ ipf_state_rehash(ipf_main_softc_t *softc
 	}
 	softs->ipf_state_table = newtab;
 
+	if (softs->ipf_state_seed != NULL) {
+		KFREES(softs->ipf_state_seed,
+		   softs->ipf_state_size * sizeof(*softs->ipf_state_seed));
+	}
+	softs->ipf_state_seed = newseed;
+
 	if (softs->ipf_state_stats.iss_bucketlen != NULL) {
 		KFREES(softs->ipf_state_stats.iss_bucketlen,
 		   softs->ipf_state_size * sizeof(u_int));



CVS commit: [netbsd-7] src/sys/external/bsd/ipf/netinet

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:30:45 UTC 2018

Modified Files:
src/sys/external/bsd/ipf/netinet [netbsd-7]: ip_state.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1525):
sys/external/bsd/ipf/netinet/ip_state.c: 1.9-1.10
When growing the state, remember to grow the seed array, otherwise we'll end
up accessing memory we did not allocate.
--
put back the cast.


To generate a diff of this commit:
cvs rdiff -u -r1.6.4.1 -r1.6.4.2 src/sys/external/bsd/ipf/netinet/ip_state.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/ipf/netinet/ip_state.c
diff -u src/sys/external/bsd/ipf/netinet/ip_state.c:1.6.4.1 src/sys/external/bsd/ipf/netinet/ip_state.c:1.6.4.2
--- src/sys/external/bsd/ipf/netinet/ip_state.c:1.6.4.1	Thu Jun 29 12:24:10 2017
+++ src/sys/external/bsd/ipf/netinet/ip_state.c	Wed Jan  3 19:30:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_state.c,v 1.6.4.1 2017/06/29 12:24:10 sborrill Exp $	*/
+/*	$NetBSD: ip_state.c,v 1.6.4.2 2018/01/03 19:30:45 snj Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -100,7 +100,7 @@ struct file;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.6.4.1 2017/06/29 12:24:10 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_state.c,v 1.6.4.2 2018/01/03 19:30:45 snj Exp $");
 #else
 static const char sccsid[] = "@(#)ip_state.c	1.8 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_state.c,v 1.1.1.2 2012/07/22 13:45:37 darrenr Exp";
@@ -298,6 +298,32 @@ ipf_state_soft_destroy(ipf_main_softc_t 
 	KFREE(softs);
 }
 
+static void *
+ipf_state_seed_alloc(u_int state_size, u_int state_max)
+{
+	u_int i;
+	u_long *state_seed;
+	KMALLOCS(state_seed, u_long *, state_size * sizeof(*state_seed));
+	if (state_seed == NULL)
+		return NULL;
+
+	for (i = 0; i < state_size; i++) {
+		/*
+		 * XXX - ipf_state_seed[X] should be a random number of sorts.
+		 */
+#if !defined(NEED_LOCAL_RAND) && defined(_KERNEL)
+		state_seed[i] = cprng_fast32();
+#else
+		state_seed[i] = ((u_long)state_seed + i) * state_size;
+		state_seed[i] ^= 0xa5a55a5a;
+		state_seed[i] *= (u_long)state_seed;
+		state_seed[i] ^= 0x5a5aa5a5;
+		state_seed[i] *= state_max;
+#endif
+	}
+	return state_seed;
+}
+
 
 /*  */
 /* Function:ipf_state_soft_init */
@@ -328,27 +354,11 @@ ipf_state_soft_init(ipf_main_softc_t *so
 	bzero((char *)softs->ipf_state_table,
 	  softs->ipf_state_size * sizeof(ipstate_t *));
 
-	KMALLOCS(softs->ipf_state_seed, u_long *,
-		 softs->ipf_state_size * sizeof(*softs->ipf_state_seed));
+	softs->ipf_state_seed = ipf_state_seed_alloc(softs->ipf_state_size,
+	softs->ipf_state_max);
 	if (softs->ipf_state_seed == NULL)
 		return -2;
 
-	for (i = 0; i < softs->ipf_state_size; i++) {
-		/*
-		 * XXX - ipf_state_seed[X] should be a random number of sorts.
-		 */
-#if !defined(NEED_LOCAL_RAND) && defined(_KERNEL)
-		softs->ipf_state_seed[i] = cprng_fast32();
-#else
-		softs->ipf_state_seed[i] = ((u_long)softs->ipf_state_seed + i) *
-softs->ipf_state_size;
-		softs->ipf_state_seed[i] ^= 0xa5a55a5a;
-		softs->ipf_state_seed[i] *= (u_long)softs->ipf_state_seed;
-		softs->ipf_state_seed[i] ^= 0x5a5aa5a5;
-		softs->ipf_state_seed[i] *= softs->ipf_state_max;
-#endif
-	}
-
 	KMALLOCS(softs->ipf_state_stats.iss_bucketlen, u_int *,
 		 softs->ipf_state_size * sizeof(u_int));
 	if (softs->ipf_state_stats.iss_bucketlen == NULL)
@@ -5137,6 +5147,7 @@ ipf_state_rehash(ipf_main_softc_t *softc
 {
 	ipf_state_softc_t *softs = softc->ipf_state_soft;
 	ipstate_t **newtab, *is;
+	u_long *newseed;
 	u_int *bucketlens;
 	u_int maxbucket;
 	u_int newsize;
@@ -5163,6 +5174,14 @@ ipf_state_rehash(ipf_main_softc_t *softc
 		return ENOMEM;
 	}
 
+	newseed = ipf_state_seed_alloc(newsize, softs->ipf_state_max);
+	if (newseed == NULL) {
+		KFREES(bucketlens, newsize * sizeof(*bucketlens));
+		KFREES(newtab, newsize * sizeof(*newtab));
+		IPFERROR(100037);
+		return ENOMEM;
+	}
+
 	for (maxbucket = 0, i = newsize; i > 0; i >>= 1)
 		maxbucket++;
 	maxbucket *= 2;
@@ -5178,6 +5197,12 @@ ipf_state_rehash(ipf_main_softc_t *softc
 	}
 	softs->ipf_state_table = newtab;
 
+	if (softs->ipf_state_seed != NULL) {
+		KFREES(softs->ipf_state_seed,
+		   softs->ipf_state_size * sizeof(*softs->ipf_state_seed));
+	}
+	softs->ipf_state_seed = newseed;
+
 	if (softs->ipf_state_stats.iss_bucketlen != NULL) {
 		KFREES(softs->ipf_state_stats.iss_bucketlen,
 		   softs->ipf_state_size * sizeof(u_int));



CVS commit: [netbsd-7] src/sys/external/bsd/ipf/netinet

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:30:45 UTC 2018

Modified Files:
src/sys/external/bsd/ipf/netinet [netbsd-7]: ip_state.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1525):
sys/external/bsd/ipf/netinet/ip_state.c: 1.9-1.10
When growing the state, remember to grow the seed array, otherwise we'll end
up accessing memory we did not allocate.
--
put back the cast.


To generate a diff of this commit:
cvs rdiff -u -r1.6.4.1 -r1.6.4.2 src/sys/external/bsd/ipf/netinet/ip_state.c

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



CVS commit: [netbsd-7-1] src/sys/external/bsd/ipf/netinet

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:30:43 UTC 2018

Modified Files:
src/sys/external/bsd/ipf/netinet [netbsd-7-1]: ip_state.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1525):
sys/external/bsd/ipf/netinet/ip_state.c: 1.9-1.10
When growing the state, remember to grow the seed array, otherwise we'll end
up accessing memory we did not allocate.
--
put back the cast.


To generate a diff of this commit:
cvs rdiff -u -r1.6.16.1 -r1.6.16.2 \
src/sys/external/bsd/ipf/netinet/ip_state.c

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



CVS commit: [netbsd-7-0] src/sys/external/bsd/ipf/netinet

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:30:41 UTC 2018

Modified Files:
src/sys/external/bsd/ipf/netinet [netbsd-7-0]: ip_state.c

Log Message:
Pull up following revision(s) (requested by sborrill in ticket #1525):
sys/external/bsd/ipf/netinet/ip_state.c: 1.9-1.10
When growing the state, remember to grow the seed array, otherwise we'll end
up accessing memory we did not allocate.
--
put back the cast.


To generate a diff of this commit:
cvs rdiff -u -r1.6.8.1 -r1.6.8.2 src/sys/external/bsd/ipf/netinet/ip_state.c

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



CVS commit: [netbsd-7-1] src

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:27:04 UTC 2018

Modified Files:
src/doc [netbsd-7-1]: README.files
src/gnu/usr.bin/groff/tmac [netbsd-7-1]: mdoc.local
src/sys/sys [netbsd-7-1]: param.h
Added Files:
src/doc [netbsd-7-1]: CHANGES-7.1.2

Log Message:
7.1.1_PATCH


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/doc/CHANGES-7.1.2
cvs rdiff -u -r1.5.12.3.2.2 -r1.5.12.3.2.3 src/doc/README.files
cvs rdiff -u -r1.75.4.5.2.2 -r1.75.4.5.2.3 \
src/gnu/usr.bin/groff/tmac/mdoc.local
cvs rdiff -u -r1.459.2.10.2.2 -r1.459.2.10.2.3 src/sys/sys/param.h

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

Modified files:

Index: src/doc/README.files
diff -u src/doc/README.files:1.5.12.3.2.2 src/doc/README.files:1.5.12.3.2.3
--- src/doc/README.files:1.5.12.3.2.2	Wed Mar 15 06:21:41 2017
+++ src/doc/README.files	Wed Jan  3 19:27:04 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: README.files,v 1.5.12.3.2.2 2017/03/15 06:21:41 snj Exp $
+#	$NetBSD: README.files,v 1.5.12.3.2.3 2018/01/03 19:27:04 snj Exp $
 
 What's in this directory:
 
@@ -11,6 +11,8 @@ CHANGES-7.1	Changes between the 7.0 and 
 
 CHANGES-7.1.1	Changes between the 7.1 and 7.1.1 releases.
 
+CHANGES-7.1.2	Changes between the 7.1.1 and 7.1.2 releases.
+
 CHANGES.prev	Changes in previous NetBSD releases.
 
 LAST_MINUTE	Last minute changes and notes about the release.
@@ -33,7 +35,7 @@ source/patches/	Post-release source code
 
 In addition to the files and directories listed above, there is one
 directory per architecture, for each of the architectures for which
-NetBSD 7.1.1 has a binary distribution.  The contents of each
+NetBSD 7.1.2 has a binary distribution.  The contents of each
 architecture's directory are described in an "INSTALL" file found in
 that directory.
 

Index: src/gnu/usr.bin/groff/tmac/mdoc.local
diff -u src/gnu/usr.bin/groff/tmac/mdoc.local:1.75.4.5.2.2 src/gnu/usr.bin/groff/tmac/mdoc.local:1.75.4.5.2.3
--- src/gnu/usr.bin/groff/tmac/mdoc.local:1.75.4.5.2.2	Fri Dec 22 19:13:18 2017
+++ src/gnu/usr.bin/groff/tmac/mdoc.local	Wed Jan  3 19:27:04 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: mdoc.local,v 1.75.4.5.2.2 2017/12/22 19:13:18 snj Exp $
+.\" $NetBSD: mdoc.local,v 1.75.4.5.2.3 2018/01/03 19:27:04 snj Exp $
 .\"
 .\" Copyright (c) 2003, 2004 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -44,9 +44,9 @@
 .as doc-str-St--ieee1275-94 " (\*[Lq]\*[doc-Tn-font-size]Open Firmware\*[doc-str-St]\*[Rq])
 .
 .\" Default .Os value
-.ds doc-operating-system NetBSD\~7.1.1
+.ds doc-operating-system NetBSD\~7.1.1_PATCH
 .\" Default footer operating system value
-.ds doc-default-operating-system NetBSD\~7.1.1
+.ds doc-default-operating-system NetBSD\~7.1.1_PATCH
 .\" Other known versions, not yet in groff distribution
 .ds doc-operating-system-NetBSD-1.3.3  1.3.3
 .ds doc-operating-system-NetBSD-1.6.3  1.6.3

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.459.2.10.2.2 src/sys/sys/param.h:1.459.2.10.2.3
--- src/sys/sys/param.h:1.459.2.10.2.2	Fri Dec 22 19:13:18 2017
+++ src/sys/sys/param.h	Wed Jan  3 19:27:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.459.2.10.2.2 2017/12/22 19:13:18 snj Exp $	*/
+/*	$NetBSD: param.h,v 1.459.2.10.2.3 2018/01/03 19:27:04 snj Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -63,7 +63,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	701000100	/* NetBSD 7.1.1 */
+#define	__NetBSD_Version__	701000100	/* NetBSD 7.1.1_PATCH */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)

Added files:

Index: src/doc/CHANGES-7.1.2
diff -u /dev/null src/doc/CHANGES-7.1.2:1.1.2.1
--- /dev/null	Wed Jan  3 19:27:04 2018
+++ src/doc/CHANGES-7.1.2	Wed Jan  3 19:27:04 2018
@@ -0,0 +1,12 @@
+# $NetBSD: CHANGES-7.1.2,v 1.1.2.1 2018/01/03 19:27:04 snj Exp $
+
+A complete list of changes from the NetBSD 7.1.1 release to the NetBSD 7.1.2
+release:
+
+doc/README.filespatched by hand
+gnu/usr.bin/groff/tmac/mdoc.local		patched by hand
+sys/sys/param.h	patched by hand
+
+	Welcome to 7.1.1_PATCH.
+	[snj]
+



CVS commit: [netbsd-7-1] src

2018-01-03 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Jan  3 19:27:04 UTC 2018

Modified Files:
src/doc [netbsd-7-1]: README.files
src/gnu/usr.bin/groff/tmac [netbsd-7-1]: mdoc.local
src/sys/sys [netbsd-7-1]: param.h
Added Files:
src/doc [netbsd-7-1]: CHANGES-7.1.2

Log Message:
7.1.1_PATCH


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/doc/CHANGES-7.1.2
cvs rdiff -u -r1.5.12.3.2.2 -r1.5.12.3.2.3 src/doc/README.files
cvs rdiff -u -r1.75.4.5.2.2 -r1.75.4.5.2.3 \
src/gnu/usr.bin/groff/tmac/mdoc.local
cvs rdiff -u -r1.459.2.10.2.2 -r1.459.2.10.2.3 src/sys/sys/param.h

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



Re: CVS commit: src/sys/kern

2018-01-03 Thread Tom Ivar Helbekkmo
Christos Zoulas  writes:

> Log Message:
> make sure that we have enough space, don't require the exact size
> (Tom Ivar Helbekkmo)

Oops.  That wasn't enough.  If we're going to allow the caller of
getsockopt(2) to supply an oversized buffer for receiving the option
data, we need to keep track of both the size of the allocated kmem
buffer, so we can free it afterwards, and the actual size of the data
written into it, so we can return that to the caller.

As far as I can tell, there's nothing for it but to expand the sockopt
struct, adding either a field for the alloc'ed size, or one for the
actual size of what's being returned to the caller.  I went for the
latter, because it's the simplest change to make.

Here's what I'm running with at the moment:

Index: sys/sys/socketvar.h
===
RCS file: /cvsroot/src/sys/sys/socketvar.h,v
retrieving revision 1.145
diff -u -u -r1.145 socketvar.h
--- sys/sys/socketvar.h 6 Jul 2017 17:08:57 -   1.145
+++ sys/sys/socketvar.h 3 Jan 2018 10:53:17 -
@@ -224,6 +224,7 @@
int sopt_level; /* option level */
int sopt_name;  /* option name */
size_t  sopt_size;  /* data length */
+   size_t  sopt_retsize;   /* returned data length */
void *  sopt_data;  /* data pointer */
uint8_t sopt_buf[sizeof(int)];  /* internal storage */
 };
Index: sys/kern/uipc_socket.c
===
RCS file: /cvsroot/src/sys/kern/uipc_socket.c,v
retrieving revision 1.258
diff -u -u -r1.258 uipc_socket.c
--- sys/kern/uipc_socket.c  1 Jan 2018 00:45:12 -   1.258
+++ sys/kern/uipc_socket.c  3 Jan 2018 10:53:23 -
@@ -2113,6 +2113,8 @@
return EINVAL;

memcpy(sopt->sopt_data, buf, len);
+   sopt->sopt_retsize = len;
+
return 0;
 }
 
@@ -2176,6 +2178,7 @@

m_copydata(m, 0, len, sopt->sopt_data);
m_freem(m);
+   sopt->sopt_retsize = len;
 
return 0;
 }
Index: sys/kern/uipc_syscalls.c
===
RCS file: /cvsroot/src/sys/kern/uipc_syscalls.c,v
retrieving revision 1.189
diff -u -u -r1.189 uipc_syscalls.c
--- sys/kern/uipc_syscalls.c31 Dec 2017 19:39:57 -  1.189
+++ sys/kern/uipc_syscalls.c3 Jan 2018 10:53:24 -
@@ -1249,7 +1249,7 @@
goto out;
 
if (valsize > 0) {
-   len = min(valsize, sopt.sopt_size);
+   len = min(valsize, sopt.sopt_retsize);
error = copyout(sopt.sopt_data, SCARG(uap, val), len);
if (error)
goto out;
Index: share/man/man9/sockopt.9
===
RCS file: /cvsroot/src/share/man/man9/sockopt.9,v
retrieving revision 1.10
diff -u -u -r1.10 sockopt.9
--- share/man/man9/sockopt.916 Jan 2017 12:54:25 -  1.10
+++ share/man/man9/sockopt.93 Jan 2018 10:53:33 -
@@ -57,6 +57,7 @@
int sopt_level; /* option level */
int sopt_name;  /* option name */
size_t  sopt_size;  /* data length */
+   size_t  sopt_retsize;   /* returned data length */
void *  sopt_data;  /* data pointer */
uint8_t sopt_buf[sizeof(int)];  /* internal storage */
 };
@@ -133,7 +134,7 @@
 which will not fail.
 .It Fn sockopt_setint "sopt" "value"
 Common case of set sockopt integer value.
-The sockpt structure must contain an int sized data field or be previously
+The sockopt structure must contain an int sized data field or be previously
 unset, in which case the data pointer will be set to the internal storage.
 .El
 .Sh CODE REFERENCES


-tih
-- 
Most people who graduate with CS degrees don't understand the significance
of Lisp.  Lisp is the most important idea in computer science.  --Alan Kay


CVS commit: src/sys/arch/x86/x86

2018-01-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Jan  3 09:46:41 UTC 2018

Modified Files:
src/sys/arch/x86/x86: pmap.c

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.272 -r1.273 src/sys/arch/x86/x86/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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.272 src/sys/arch/x86/x86/pmap.c:1.273
--- src/sys/arch/x86/x86/pmap.c:1.272	Wed Jan  3 09:38:23 2018
+++ src/sys/arch/x86/x86/pmap.c	Wed Jan  3 09:46:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.272 2018/01/03 09:38:23 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.273 2018/01/03 09:46:41 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -170,7 +170,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.272 2018/01/03 09:38:23 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.273 2018/01/03 09:46:41 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -773,13 +773,14 @@ pmap_map_ptes(struct pmap *pmap, struct 
 	pmap->pm_ncsw = l->l_ncsw;
 	*pmap2 = curpmap;
 	*ptepp = PTE_BASE;
+
 #if defined(XEN) && defined(__x86_64__)
 	KASSERT(ci->ci_normal_pdes[PTP_LEVELS - 2] == L4_BASE);
 	ci->ci_normal_pdes[PTP_LEVELS - 2] = pmap->pm_pdir;
 	*pdeppp = ci->ci_normal_pdes;
-#else /* XEN && __x86_64__ */
+#else
 	*pdeppp = normal_pdes;
-#endif /* XEN && __x86_64__ */
+#endif
 }
 
 /*
@@ -800,11 +801,12 @@ pmap_unmap_ptes(struct pmap *pmap, struc
 	}
 
 	ci = curcpu();
+
 #if defined(XEN) && defined(__x86_64__)
-	/* Reset per-cpu normal_pdes */
 	KASSERT(ci->ci_normal_pdes[PTP_LEVELS - 2] != L4_BASE);
 	ci->ci_normal_pdes[PTP_LEVELS - 2] = L4_BASE;
-#endif /* XEN && __x86_64__ */
+#endif
+
 	/*
 	 * We cannot tolerate context switches while mapped in.
 	 * If it is our own pmap all we have to do is unlock.



CVS commit: src/sys/arch/x86/x86

2018-01-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Jan  3 09:46:41 UTC 2018

Modified Files:
src/sys/arch/x86/x86: pmap.c

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.272 -r1.273 src/sys/arch/x86/x86/pmap.c

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



CVS commit: src/sys/arch/x86/x86

2018-01-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Jan  3 09:38:23 UTC 2018

Modified Files:
src/sys/arch/x86/x86: pmap.c

Log Message:
simplify


To generate a diff of this commit:
cvs rdiff -u -r1.271 -r1.272 src/sys/arch/x86/x86/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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.271 src/sys/arch/x86/x86/pmap.c:1.272
--- src/sys/arch/x86/x86/pmap.c:1.271	Sun Dec 31 15:41:05 2017
+++ src/sys/arch/x86/x86/pmap.c	Wed Jan  3 09:38:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.271 2017/12/31 15:41:05 maxv Exp $	*/
+/*	$NetBSD: pmap.c,v 1.272 2018/01/03 09:38:23 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -170,7 +170,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.271 2017/12/31 15:41:05 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.272 2018/01/03 09:38:23 maxv Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -2002,31 +2002,26 @@ pmap_free_ptp(struct pmap *pmap, struct 
 	do {
 		index = pl_i(va, level + 1);
 		opde = pmap_pte_testset([level - 1][index], 0);
-#if defined(XEN)
-#  if defined(__x86_64__)
+
 		/*
-		 * If ptp is a L3 currently mapped in kernel space,
-		 * on any cpu, clear it before freeing
+		 * On Xen-amd64, we need to sync the top level page
+		 * directory on each CPU.
 		 */
+#if defined(XEN) && defined(__x86_64__)
 		if (level == PTP_LEVELS - 1) {
-			/*
-			 * Update the per-cpu PD on all cpus the current
-			 * pmap is active on
-			 */
 			xen_kpm_sync(pmap, index);
 		}
-#  endif /*__x86_64__ */
+#endif
+
 		invaladdr = level == 1 ? (vaddr_t)ptes :
 		(vaddr_t)pdes[level - 2];
 		pmap_tlb_shootdown(pmap, invaladdr + index * PAGE_SIZE,
 		opde, TLBSHOOT_FREE_PTP1);
+
+#if defined(XEN)
 		pmap_tlb_shootnow();
-#else	/* XEN */
-		invaladdr = level == 1 ? (vaddr_t)ptes :
-		(vaddr_t)pdes[level - 2];
-		pmap_tlb_shootdown(pmap, invaladdr + index * PAGE_SIZE,
-		opde, TLBSHOOT_FREE_PTP1);
-#endif	/* XEN */
+#endif
+
 		pmap_freepage(pmap, ptp, level);
 		if (level < PTP_LEVELS - 1) {
 			ptp = pmap_find_ptp(pmap, va, (paddr_t)-1, level + 1);
@@ -2108,16 +2103,17 @@ pmap_get_ptp(struct pmap *pmap, vaddr_t 
 		pa = VM_PAGE_TO_PHYS(ptp);
 		pmap_pte_set([index], (pd_entry_t)
 		(pmap_pa2pte(pa) | PG_u | PG_RW | PG_V));
+
+		/*
+		 * On Xen-amd64, we need to sync the top level page
+		 * directory on each CPU.
+		 */
 #if defined(XEN) && defined(__x86_64__)
 		if (i == PTP_LEVELS) {
-
-			/*
-			 * Update the per-cpu PD on all cpus the current
-			 * pmap is active on
-			 */
 			xen_kpm_sync(pmap, index);
 		}
 #endif
+
 		pmap_pte_flush();
 		pmap_stats_update(pmap, 1, 0);
 



CVS commit: src/sys/arch/x86/x86

2018-01-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Jan  3 09:38:23 UTC 2018

Modified Files:
src/sys/arch/x86/x86: pmap.c

Log Message:
simplify


To generate a diff of this commit:
cvs rdiff -u -r1.271 -r1.272 src/sys/arch/x86/x86/pmap.c

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