CVS commit: src/lib/libedit

2018-11-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Nov 29 03:10:20 UTC 2018

Modified Files:
src/lib/libedit: parse.c

Log Message:
Fix off by one 


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/lib/libedit/parse.c

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

Modified files:

Index: src/lib/libedit/parse.c
diff -u src/lib/libedit/parse.c:1.40 src/lib/libedit/parse.c:1.41
--- src/lib/libedit/parse.c:1.40	Mon May  9 17:46:56 2016
+++ src/lib/libedit/parse.c	Wed Nov 28 22:10:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: parse.c,v 1.40 2016/05/09 21:46:56 christos Exp $	*/
+/*	$NetBSD: parse.c,v 1.41 2018/11/29 03:10:20 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)parse.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: parse.c,v 1.40 2016/05/09 21:46:56 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.41 2018/11/29 03:10:20 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -111,7 +111,7 @@ el_wparse(EditLine *el, int argc, const 
 
 		if (ptr == argv[0])
 			return 0;
-		l = (size_t)(ptr - argv[0] - 1);
+		l = (size_t)(ptr - argv[0]);
 		tprog = el_malloc((l + 1) * sizeof(*tprog));
 		if (tprog == NULL)
 			return 0;



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

2018-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 28 22:54:11 UTC 2018

Modified Files:
src/sys/arch/arm/cortex: gicv3_its.c gicv3_its.h

Log Message:
Allow non-power of 2 counts, and support alloc/release/alloc patterns for a 
device as long as the ITT size is sufficient


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/cortex/gicv3_its.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/cortex/gicv3_its.h

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

Modified files:

Index: src/sys/arch/arm/cortex/gicv3_its.c
diff -u src/sys/arch/arm/cortex/gicv3_its.c:1.8 src/sys/arch/arm/cortex/gicv3_its.c:1.9
--- src/sys/arch/arm/cortex/gicv3_its.c:1.8	Sat Nov 24 15:40:57 2018
+++ src/sys/arch/arm/cortex/gicv3_its.c	Wed Nov 28 22:54:11 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.c,v 1.8 2018/11/24 15:40:57 skrll Exp $ */
+/* $NetBSD: gicv3_its.c,v 1.9 2018/11/28 22:54:11 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #define _INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.8 2018/11/24 15:40:57 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3_its.c,v 1.9 2018/11/28 22:54:11 jmcneill Exp $");
 
 #include 
 #include 
@@ -293,22 +293,25 @@ static int
 gicv3_its_device_map(struct gicv3_its *its, uint32_t devid, u_int count)
 {
 	struct gicv3_its_device *dev;
+	u_int vectors;
 
-	LIST_FOREACH(dev, &its->its_devices, dev_list)
-		if (dev->dev_id == devid)
-			return EEXIST;
-
-	const u_int vectors = MAX(2, count);
-	if (!powerof2(vectors))
-		return EINVAL;
+	vectors = MAX(2, count);
+	while (!powerof2(vectors))
+		vectors++;
 
 	const uint64_t typer = gits_read_8(its, GITS_TYPER);
 	const u_int id_bits = __SHIFTOUT(typer, GITS_TYPER_ID_bits) + 1;
 	const u_int itt_entry_size = __SHIFTOUT(typer, GITS_TYPER_ITT_entry_size) + 1;
 	const u_int itt_size = roundup(vectors * itt_entry_size, GITS_ITT_ALIGN);
 
+	LIST_FOREACH(dev, &its->its_devices, dev_list)
+		if (dev->dev_id == devid) {
+			return itt_size <= dev->dev_size ? 0 : EEXIST;
+		}
+
 	dev = kmem_alloc(sizeof(*dev), KM_SLEEP);
 	dev->dev_id = devid;
+	dev->dev_size = itt_size;
 	gicv3_dma_alloc(its->its_gic, &dev->dev_itt, itt_size, GITS_ITT_ALIGN);
 	LIST_INSERT_HEAD(&its->its_devices, dev, dev_list);
 

Index: src/sys/arch/arm/cortex/gicv3_its.h
diff -u src/sys/arch/arm/cortex/gicv3_its.h:1.3 src/sys/arch/arm/cortex/gicv3_its.h:1.4
--- src/sys/arch/arm/cortex/gicv3_its.h:1.3	Sat Nov 24 22:08:53 2018
+++ src/sys/arch/arm/cortex/gicv3_its.h	Wed Nov 28 22:54:11 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3_its.h,v 1.3 2018/11/24 22:08:53 jakllsch Exp $ */
+/* $NetBSD: gicv3_its.h,v 1.4 2018/11/28 22:54:11 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -40,6 +40,7 @@
 
 struct gicv3_its_device {
 	uint32_t		dev_id;
+	u_int			dev_size;
 	struct gicv3_dma	dev_itt;
 
 	LIST_ENTRY(gicv3_its_device) dev_list;



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

2018-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 28 22:29:36 UTC 2018

Modified Files:
src/sys/arch/arm/acpi: acpi_platform.c

Log Message:
Force a matching com@puc by seg/bus/dev/func to be the console device if 
specified in SPCR


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/acpi/acpi_platform.c

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

Modified files:

Index: src/sys/arch/arm/acpi/acpi_platform.c
diff -u src/sys/arch/arm/acpi/acpi_platform.c:1.9 src/sys/arch/arm/acpi/acpi_platform.c:1.10
--- src/sys/arch/arm/acpi/acpi_platform.c:1.9	Wed Nov 28 03:17:13 2018
+++ src/sys/arch/arm/acpi/acpi_platform.c	Wed Nov 28 22:29:36 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_platform.c,v 1.9 2018/11/28 03:17:13 jmcneill Exp $ */
+/* $NetBSD: acpi_platform.c,v 1.10 2018/11/28 22:29:36 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 #include "opt_efi.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.9 2018/11/28 03:17:13 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_platform.c,v 1.10 2018/11/28 22:29:36 jmcneill Exp $");
 
 #include 
 #include 
@@ -64,6 +64,12 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_platfor
 #include 
 #include 
 
+#if NCOM > 0
+#include 
+#include 
+#include 
+#endif
+
 #ifdef EFI_RUNTIME
 #include 
 #endif
@@ -223,6 +229,35 @@ acpi_platform_init_attach_args(struct fd
 static void
 acpi_platform_device_register(device_t self, void *aux)
 {
+#if NCOM > 0
+	prop_dictionary_t prop = device_properties(self);
+
+	if (device_is_a(self, "com") && device_is_a(device_parent(self), "puc")) {
+		const struct puc_attach_args * const paa = aux;
+		ACPI_TABLE_SPCR *spcr;
+		int b, d, f;
+
+		const int s = pci_get_segment(paa->pc);
+		pci_decompose_tag(paa->pc, paa->tag, &b, &d, &f);
+
+		if (ACPI_FAILURE(acpi_table_find(ACPI_SIG_SPCR, (void **)&spcr)))
+			return;
+		if (spcr->SerialPort.SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY)
+			goto spcr_unmap;
+		if (spcr->SerialPort.Address == 0)
+			goto spcr_unmap;
+		if (spcr->InterfaceType != ACPI_DBG2_16550_COMPATIBLE &&
+		spcr->InterfaceType != ACPI_DBG2_16550_SUBSET)
+			goto spcr_unmap;
+
+		if (spcr->PciSegment == s && spcr->PciBus == b &&
+		spcr->PciDevice == d && spcr->PciFunction == f)
+			prop_dictionary_set_bool(prop, "force_console", true);
+
+spcr_unmap:
+		acpi_table_unmap((ACPI_TABLE_HEADER *)spcr);
+	}
+#endif
 }
 
 static void



CVS commit: src/sys/dev/ic

2018-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 28 22:28:46 UTC 2018

Modified Files:
src/sys/dev/ic: com.c

Log Message:
Add support for a "force_console" property, where when set, reuses the console 
dev configuration


To generate a diff of this commit:
cvs rdiff -u -r1.348 -r1.349 src/sys/dev/ic/com.c

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

Modified files:

Index: src/sys/dev/ic/com.c
diff -u src/sys/dev/ic/com.c:1.348 src/sys/dev/ic/com.c:1.349
--- src/sys/dev/ic/com.c:1.348	Sun May 27 17:05:06 2018
+++ src/sys/dev/ic/com.c	Wed Nov 28 22:28:46 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.348 2018/05/27 17:05:06 jmcneill Exp $ */
+/* $NetBSD: com.c,v 1.349 2018/11/28 22:28:46 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.348 2018/05/27 17:05:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.349 2018/11/28 22:28:46 jmcneill Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -388,11 +388,13 @@ com_attach_subr(struct com_softc *sc)
 	const char *fifo_msg = NULL;
 	prop_dictionary_t	dict;
 	bool is_console = true;
+	bool force_console = false;
 
 	aprint_naive("\n");
 
 	dict = device_properties(sc->sc_dev);
 	prop_dictionary_get_bool(dict, "is_console", &is_console);
+	prop_dictionary_get_bool(dict, "force_console", &force_console);
 	callout_init(&sc->sc_diag_callout, 0);
 	mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_HIGH);
 
@@ -414,10 +416,13 @@ com_attach_subr(struct com_softc *sc)
 
 	CSR_WRITE_1(regsp, COM_REG_IER, sc->sc_ier);
 
-	if (bus_space_is_equal(regsp->cr_iot, comcons_info.regs.cr_iot) &&
-	regsp->cr_iobase == comcons_info.regs.cr_iobase) {
+	if ((bus_space_is_equal(regsp->cr_iot, comcons_info.regs.cr_iot) &&
+	regsp->cr_iobase == comcons_info.regs.cr_iobase) || force_console) {
 		comconsattached = 1;
 
+		if (force_console)
+			memcpy(regsp, &comcons_info.regs, sizeof(*regsp));
+
 		if (cn_tab == NULL && comcnreattach() != 0) {
 			printf("can't re-init serial console @%lx\n",
 			(u_long)comcons_info.regs.cr_iobase);



CVS commit: src/sys/dev/pci

2018-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 28 21:31:33 UTC 2018

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

Log Message:
Add calls to if_attach and if_deferred_start_init


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/pci/if_ena.c

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

Modified files:

Index: src/sys/dev/pci/if_ena.c
diff -u src/sys/dev/pci/if_ena.c:1.8 src/sys/dev/pci/if_ena.c:1.9
--- src/sys/dev/pci/if_ena.c:1.8	Wed Nov 28 19:07:49 2018
+++ src/sys/dev/pci/if_ena.c	Wed Nov 28 21:31:32 2018
@@ -31,7 +31,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.8 2018/11/28 19:07:49 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.9 2018/11/28 21:31:32 jmcneill Exp $");
 
 #include 
 #include 
@@ -2546,6 +2546,9 @@ ena_setup_ifnet(device_t pdev, struct en
 	ifmedia_add(&adapter->media, IFM_ETHER | IFM_AUTO, 0, NULL);
 	ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO);
 
+	if_attach(ifp);
+	if_deferred_start_init(ifp, NULL);
+
 	ether_ifattach(ifp, adapter->mac_addr);
 
 	return (0);



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:58:16 UTC 2018

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

Log Message:
Ticket #1659


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.116 -r1.1.2.117 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.116 src/doc/CHANGES-7.0.3:1.1.2.117
--- src/doc/CHANGES-7.0.3:1.1.2.116	Wed Nov 28 19:38:19 2018
+++ src/doc/CHANGES-7.0.3	Wed Nov 28 19:58:15 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.116 2018/11/28 19:38:19 martin Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.117 2018/11/28 19:58:15 martin Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5595,3 +5595,12 @@ sys/kern/kern_exec.c1.462
 	Fix stack info leak.
 	[maxv, ticket #1658]
 
+libexec/httpd/CHANGES1.29,1.30
+libexec/httpd/bozohttpd.c			1.97-1.99
+libexec/httpd/bozohttpd.h			1.57
+libexec/httpd/cgi-bozo.c			1.45
+libexec/httpd/main.c1.22
+
+	Fix -X option parsing and miscelaneous cleanup.
+	[mrg, ticket #1659]
+



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:57:51 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1659):

libexec/httpd/main.c: revision 1.22
libexec/httpd/CHANGES: revision 1.29
libexec/httpd/cgi-bozo.c: revision 1.45
libexec/httpd/bozohttpd.h: revision 1.57
libexec/httpd/CHANGES: revision 1.30
libexec/httpd/bozohttpd.c: revision 1.97
libexec/httpd/bozohttpd.c: revision 1.98
libexec/httpd/bozohttpd.c: revision 1.99

one semicolon is usually enough.

 -

appease lint

- add FALLTHROUGH comment
- one return is usually enough.

 -

avoid c99ism.

 -

fix -X option parsing.  noted by Rajeev V. Pillai.

 -

add option fixes here.

 -

normalise some messages.


To generate a diff of this commit:
cvs rdiff -u -r1.19.2.1.2.4 -r1.19.2.1.2.5 src/libexec/httpd/CHANGES
cvs rdiff -u -r1.56.2.4.2.4 -r1.56.2.4.2.5 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.33.2.2.2.4 -r1.33.2.2.2.5 src/libexec/httpd/bozohttpd.h
cvs rdiff -u -r1.25.2.2.2.6 -r1.25.2.2.2.7 src/libexec/httpd/cgi-bozo.c
cvs rdiff -u -r1.8.4.3 -r1.8.4.4 src/libexec/httpd/main.c

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

Modified files:

Index: src/libexec/httpd/CHANGES
diff -u src/libexec/httpd/CHANGES:1.19.2.1.2.4 src/libexec/httpd/CHANGES:1.19.2.1.2.5
--- src/libexec/httpd/CHANGES:1.19.2.1.2.4	Sat Nov 24 17:23:47 2018
+++ src/libexec/httpd/CHANGES	Wed Nov 28 19:57:50 2018
@@ -1,4 +1,7 @@
-$NetBSD: CHANGES,v 1.19.2.1.2.4 2018/11/24 17:23:47 martin Exp $
+$NetBSD: CHANGES,v 1.19.2.1.2.5 2018/11/28 19:57:50 martin Exp $
+
+changes in bozohttpd 20181125:
+	o  fixes for option parsing introduced in bozohttpd 20181123
 
 changes in bozohttpd 20181121:
 	o  add url remap support via .bzremap file, from mar...@netbsd.org
@@ -9,7 +12,7 @@ changes in bozohttpd 20181121:
 	   initial line, each header, and the total time spent
 	o  add -T option to expose new timeout settings
 	o  minor RFC fixes related to timeout handling
-	o  fix special file (.htpasswd, .bz*) bypass.  reported by JP.
+	o  fix special file (.htpasswd, .bz*) bypass.  reported by JP
 
 changes in bozohttpd 20170201:
 	o  fix an infinite loop in cgi processing
@@ -94,7 +97,7 @@ changes in bozohttpd 20100617:
 
 changes in bozohttpd 20100509:
 	o  major rework and clean up of internal interfaces.  move the main
-	   program into main.c, the remaining parts are useable as library.
+	   program into main.c, the remaining parts are useable as library
 	   add bindings for lua.  by Alistair G. Crooks 
 	o  fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566325
 

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.56.2.4.2.4 src/libexec/httpd/bozohttpd.c:1.56.2.4.2.5
--- src/libexec/httpd/bozohttpd.c:1.56.2.4.2.4	Sat Nov 24 17:23:47 2018
+++ src/libexec/httpd/bozohttpd.c	Wed Nov 28 19:57:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.56.2.4.2.4 2018/11/24 17:23:47 martin Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.56.2.4.2.5 2018/11/28 19:57:50 martin Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -109,7 +109,7 @@
 #define INDEX_HTML		"index.html"
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE		"bozohttpd/20181124"
+#define SERVER_SOFTWARE		"bozohttpd/20181125"
 #endif
 #ifndef PUBLIC_HTML
 #define PUBLIC_HTML		"public_html"
@@ -1018,6 +1018,7 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, 
 		case '"':
 			if (absolute)
 goto leave_it;
+			/*FALLTHROUGH*/
 		case '\n':
 		case '\r':
 		case ' ':
@@ -1026,8 +1027,8 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, 
 			d += 3;
 			len += 3;
 			break;
-		leave_it:
 		default:
+		leave_it:
 			*d++ = *s++;
 			len++;
 			break;
@@ -1477,7 +1478,6 @@ check_bzredirect(bozo_httpreq_t *request
 			 REDIRECT_FILE) >= sizeof(redir)) {
 		return bozo_http_error(httpd, 404, request,
 		"redirectfile path too long");
-		return -1;
 	}
 	if (lstat(redir, &sb) == 0) {
 		if (!S_ISLNK(sb.st_mode))
@@ -1924,8 +1924,9 @@ int
 bozo_check_special_files(bozo_httpreq_t *request, const char *name)
 {
 	bozohttpd_t *httpd = request->hr_httpd;
+	size_t i;
 
-	for (size_t i = 0; specials[i].file; i++)
+	for (i = 0; specials[i].file; i++)
 		if (strcmp(name, specials[i].file) == 0)
 			return bozo_http_error(httpd, 403, request,
 	   specials[i].name);

Index: src/libexec/httpd/bozohttpd.h
diff -u src/libexec/httpd/bozohttpd.h:1.33.2.2.2.4 src/libexec/httpd/bozohttpd.h:1.33.2.2.2.5
--- src/libexec/httpd/bozohttpd.h:1.33.2.2.2.4	Sat Nov 24 17:23:47 2018
+++ src/libexec/httpd/bozohttpd.h	Wed Nov 28 19:57:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.h,v 1.33.2.2.2.4 2018/11/24 17:23:47 martin Exp $	*/
+/*	$NetBSD: bozohttpd.h,v 1.33.2.2.2.5 2018/11/28 19:57:50 martin Exp $	*/
 
 /*	

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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:56:34 UTC 2018

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

Log Message:
Ticket #1659


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.23 -r1.1.2.24 src/doc/CHANGES-7.1.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.1.3
diff -u src/doc/CHANGES-7.1.3:1.1.2.23 src/doc/CHANGES-7.1.3:1.1.2.24
--- src/doc/CHANGES-7.1.3:1.1.2.23	Wed Nov 28 19:39:31 2018
+++ src/doc/CHANGES-7.1.3	Wed Nov 28 19:56:34 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.3,v 1.1.2.23 2018/11/28 19:39:31 martin Exp $
+# $NetBSD: CHANGES-7.1.3,v 1.1.2.24 2018/11/28 19:56:34 martin Exp $
 
 A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3
 release:
@@ -287,3 +287,12 @@ sys/kern/kern_exec.c1.462
 	Fix stack info leak.
 	[maxv, ticket #1658]
 
+libexec/httpd/CHANGES1.29,1.30
+libexec/httpd/bozohttpd.c			1.97-1.99
+libexec/httpd/bozohttpd.h			1.57
+libexec/httpd/cgi-bozo.c			1.45
+libexec/httpd/main.c1.22
+
+	Fix -X option parsing and miscelaneous cleanup.
+	[mrg, ticket #1659]
+



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:56:09 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1659):

libexec/httpd/main.c: revision 1.22
libexec/httpd/CHANGES: revision 1.29
libexec/httpd/cgi-bozo.c: revision 1.45
libexec/httpd/bozohttpd.h: revision 1.57
libexec/httpd/CHANGES: revision 1.30
libexec/httpd/bozohttpd.c: revision 1.97
libexec/httpd/bozohttpd.c: revision 1.98
libexec/httpd/bozohttpd.c: revision 1.99

one semicolon is usually enough.

 -

appease lint

- add FALLTHROUGH comment
- one return is usually enough.

 -

avoid c99ism.

 -

fix -X option parsing.  noted by Rajeev V. Pillai.

 -

add option fixes here.

 -

normalise some messages.


To generate a diff of this commit:
cvs rdiff -u -r1.19.2.5.2.1 -r1.19.2.5.2.2 src/libexec/httpd/CHANGES
cvs rdiff -u -r1.56.2.8.2.1 -r1.56.2.8.2.2 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.33.2.6.2.1 -r1.33.2.6.2.2 src/libexec/httpd/bozohttpd.h
cvs rdiff -u -r1.25.2.7.2.2 -r1.25.2.7.2.3 src/libexec/httpd/cgi-bozo.c
cvs rdiff -u -r1.8.2.2.2.1 -r1.8.2.2.2.2 src/libexec/httpd/main.c

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

Modified files:

Index: src/libexec/httpd/CHANGES
diff -u src/libexec/httpd/CHANGES:1.19.2.5.2.1 src/libexec/httpd/CHANGES:1.19.2.5.2.2
--- src/libexec/httpd/CHANGES:1.19.2.5.2.1	Sat Nov 24 17:23:20 2018
+++ src/libexec/httpd/CHANGES	Wed Nov 28 19:56:09 2018
@@ -1,4 +1,7 @@
-$NetBSD: CHANGES,v 1.19.2.5.2.1 2018/11/24 17:23:20 martin Exp $
+$NetBSD: CHANGES,v 1.19.2.5.2.2 2018/11/28 19:56:09 martin Exp $
+
+changes in bozohttpd 20181125:
+	o  fixes for option parsing introduced in bozohttpd 20181123
 
 changes in bozohttpd 20181121:
 	o  add url remap support via .bzremap file, from mar...@netbsd.org
@@ -9,7 +12,7 @@ changes in bozohttpd 20181121:
 	   initial line, each header, and the total time spent
 	o  add -T option to expose new timeout settings
 	o  minor RFC fixes related to timeout handling
-	o  fix special file (.htpasswd, .bz*) bypass.  reported by JP.
+	o  fix special file (.htpasswd, .bz*) bypass.  reported by JP
 
 changes in bozohttpd 20170201:
 	o  fix an infinite loop in cgi processing
@@ -94,7 +97,7 @@ changes in bozohttpd 20100617:
 
 changes in bozohttpd 20100509:
 	o  major rework and clean up of internal interfaces.  move the main
-	   program into main.c, the remaining parts are useable as library.
+	   program into main.c, the remaining parts are useable as library
 	   add bindings for lua.  by Alistair G. Crooks 
 	o  fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566325
 

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.56.2.8.2.1 src/libexec/httpd/bozohttpd.c:1.56.2.8.2.2
--- src/libexec/httpd/bozohttpd.c:1.56.2.8.2.1	Sat Nov 24 17:23:20 2018
+++ src/libexec/httpd/bozohttpd.c	Wed Nov 28 19:56:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.56.2.8.2.1 2018/11/24 17:23:20 martin Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.56.2.8.2.2 2018/11/28 19:56:09 martin Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -109,7 +109,7 @@
 #define INDEX_HTML		"index.html"
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE		"bozohttpd/20181124"
+#define SERVER_SOFTWARE		"bozohttpd/20181125"
 #endif
 #ifndef PUBLIC_HTML
 #define PUBLIC_HTML		"public_html"
@@ -1018,6 +1018,7 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, 
 		case '"':
 			if (absolute)
 goto leave_it;
+			/*FALLTHROUGH*/
 		case '\n':
 		case '\r':
 		case ' ':
@@ -1026,8 +1027,8 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, 
 			d += 3;
 			len += 3;
 			break;
-		leave_it:
 		default:
+		leave_it:
 			*d++ = *s++;
 			len++;
 			break;
@@ -1477,7 +1478,6 @@ check_bzredirect(bozo_httpreq_t *request
 			 REDIRECT_FILE) >= sizeof(redir)) {
 		return bozo_http_error(httpd, 404, request,
 		"redirectfile path too long");
-		return -1;
 	}
 	if (lstat(redir, &sb) == 0) {
 		if (!S_ISLNK(sb.st_mode))
@@ -1924,8 +1924,9 @@ int
 bozo_check_special_files(bozo_httpreq_t *request, const char *name)
 {
 	bozohttpd_t *httpd = request->hr_httpd;
+	size_t i;
 
-	for (size_t i = 0; specials[i].file; i++)
+	for (i = 0; specials[i].file; i++)
 		if (strcmp(name, specials[i].file) == 0)
 			return bozo_http_error(httpd, 403, request,
 	   specials[i].name);

Index: src/libexec/httpd/bozohttpd.h
diff -u src/libexec/httpd/bozohttpd.h:1.33.2.6.2.1 src/libexec/httpd/bozohttpd.h:1.33.2.6.2.2
--- src/libexec/httpd/bozohttpd.h:1.33.2.6.2.1	Sat Nov 24 17:23:20 2018
+++ src/libexec/httpd/bozohttpd.h	Wed Nov 28 19:56:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.h,v 1.33.2.6.2.1 2018/11/24 17:23:20 martin Exp $	*/
+/*	$NetBSD: bozohttpd.h,v 1.33.2.6.2.2 2018/11/28 19:56:09 martin Exp $	*

CVS commit: [netbsd-7] src/doc

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:54:54 UTC 2018

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

Log Message:
Ticket #1659


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.17 -r1.1.2.18 src/doc/CHANGES-7.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.3
diff -u src/doc/CHANGES-7.3:1.1.2.17 src/doc/CHANGES-7.3:1.1.2.18
--- src/doc/CHANGES-7.3:1.1.2.17	Wed Nov 28 19:40:25 2018
+++ src/doc/CHANGES-7.3	Wed Nov 28 19:54:54 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.3,v 1.1.2.17 2018/11/28 19:40:25 martin Exp $
+# $NetBSD: CHANGES-7.3,v 1.1.2.18 2018/11/28 19:54:54 martin Exp $
 
 A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3
 release:
@@ -296,3 +296,12 @@ sys/kern/kern_exec.c1.462
 	Fix stack info leak.
 	[maxv, ticket #1658]
 
+libexec/httpd/CHANGES1.29,1.30
+libexec/httpd/bozohttpd.c			1.97-1.99
+libexec/httpd/bozohttpd.h			1.57
+libexec/httpd/cgi-bozo.c			1.45
+libexec/httpd/main.c1.22
+
+	Fix -X option parsing and miscelaneous cleanup.
+	[mrg, ticket #1659]
+



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:54:18 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1659):

libexec/httpd/main.c: revision 1.22
libexec/httpd/CHANGES: revision 1.29
libexec/httpd/cgi-bozo.c: revision 1.45
libexec/httpd/bozohttpd.h: revision 1.57
libexec/httpd/CHANGES: revision 1.30
libexec/httpd/bozohttpd.c: revision 1.97
libexec/httpd/bozohttpd.c: revision 1.98
libexec/httpd/bozohttpd.c: revision 1.99

one semicolon is usually enough.

 -

appease lint

- add FALLTHROUGH comment
- one return is usually enough.

 -

avoid c99ism.

 -

fix -X option parsing.  noted by Rajeev V. Pillai.

 -

add option fixes here.

 -

normalise some messages.


To generate a diff of this commit:
cvs rdiff -u -r1.19.2.6 -r1.19.2.7 src/libexec/httpd/CHANGES
cvs rdiff -u -r1.56.2.10 -r1.56.2.11 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.33.2.7 -r1.33.2.8 src/libexec/httpd/bozohttpd.h
cvs rdiff -u -r1.25.2.9 -r1.25.2.10 src/libexec/httpd/cgi-bozo.c
cvs rdiff -u -r1.8.2.3 -r1.8.2.4 src/libexec/httpd/main.c

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

Modified files:

Index: src/libexec/httpd/CHANGES
diff -u src/libexec/httpd/CHANGES:1.19.2.6 src/libexec/httpd/CHANGES:1.19.2.7
--- src/libexec/httpd/CHANGES:1.19.2.6	Sat Nov 24 17:22:57 2018
+++ src/libexec/httpd/CHANGES	Wed Nov 28 19:54:18 2018
@@ -1,4 +1,7 @@
-$NetBSD: CHANGES,v 1.19.2.6 2018/11/24 17:22:57 martin Exp $
+$NetBSD: CHANGES,v 1.19.2.7 2018/11/28 19:54:18 martin Exp $
+
+changes in bozohttpd 20181125:
+	o  fixes for option parsing introduced in bozohttpd 20181123
 
 changes in bozohttpd 20181121:
 	o  add url remap support via .bzremap file, from mar...@netbsd.org
@@ -9,7 +12,7 @@ changes in bozohttpd 20181121:
 	   initial line, each header, and the total time spent
 	o  add -T option to expose new timeout settings
 	o  minor RFC fixes related to timeout handling
-	o  fix special file (.htpasswd, .bz*) bypass.  reported by JP.
+	o  fix special file (.htpasswd, .bz*) bypass.  reported by JP
 
 changes in bozohttpd 20170201:
 	o  fix an infinite loop in cgi processing
@@ -94,7 +97,7 @@ changes in bozohttpd 20100617:
 
 changes in bozohttpd 20100509:
 	o  major rework and clean up of internal interfaces.  move the main
-	   program into main.c, the remaining parts are useable as library.
+	   program into main.c, the remaining parts are useable as library
 	   add bindings for lua.  by Alistair G. Crooks 
 	o  fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566325
 

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.56.2.10 src/libexec/httpd/bozohttpd.c:1.56.2.11
--- src/libexec/httpd/bozohttpd.c:1.56.2.10	Sat Nov 24 17:22:57 2018
+++ src/libexec/httpd/bozohttpd.c	Wed Nov 28 19:54:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.56.2.10 2018/11/24 17:22:57 martin Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.56.2.11 2018/11/28 19:54:18 martin Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -109,7 +109,7 @@
 #define INDEX_HTML		"index.html"
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE		"bozohttpd/20181124"
+#define SERVER_SOFTWARE		"bozohttpd/20181125"
 #endif
 #ifndef PUBLIC_HTML
 #define PUBLIC_HTML		"public_html"
@@ -1018,6 +1018,7 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, 
 		case '"':
 			if (absolute)
 goto leave_it;
+			/*FALLTHROUGH*/
 		case '\n':
 		case '\r':
 		case ' ':
@@ -1026,8 +1027,8 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, 
 			d += 3;
 			len += 3;
 			break;
-		leave_it:
 		default:
+		leave_it:
 			*d++ = *s++;
 			len++;
 			break;
@@ -1477,7 +1478,6 @@ check_bzredirect(bozo_httpreq_t *request
 			 REDIRECT_FILE) >= sizeof(redir)) {
 		return bozo_http_error(httpd, 404, request,
 		"redirectfile path too long");
-		return -1;
 	}
 	if (lstat(redir, &sb) == 0) {
 		if (!S_ISLNK(sb.st_mode))
@@ -1924,8 +1924,9 @@ int
 bozo_check_special_files(bozo_httpreq_t *request, const char *name)
 {
 	bozohttpd_t *httpd = request->hr_httpd;
+	size_t i;
 
-	for (size_t i = 0; specials[i].file; i++)
+	for (i = 0; specials[i].file; i++)
 		if (strcmp(name, specials[i].file) == 0)
 			return bozo_http_error(httpd, 403, request,
 	   specials[i].name);

Index: src/libexec/httpd/bozohttpd.h
diff -u src/libexec/httpd/bozohttpd.h:1.33.2.7 src/libexec/httpd/bozohttpd.h:1.33.2.8
--- src/libexec/httpd/bozohttpd.h:1.33.2.7	Sat Nov 24 17:22:57 2018
+++ src/libexec/httpd/bozohttpd.h	Wed Nov 28 19:54:18 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.h,v 1.33.2.7 2018/11/24 17:22:57 martin Exp $	*/
+/*	$NetBSD: bozohttpd.h,v 1.33.2.8 2018/11/28 19:54:18 martin Exp $	*/
 
 /*	$eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -407,7 +407,7 @@ voi

CVS commit: [netbsd-8] src/doc

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:51:30 UTC 2018

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

Log Message:
Ticket #1109


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.63 -r1.1.2.64 src/doc/CHANGES-8.1

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.63 src/doc/CHANGES-8.1:1.1.2.64
--- src/doc/CHANGES-8.1:1.1.2.63	Wed Nov 28 05:10:54 2018
+++ src/doc/CHANGES-8.1	Wed Nov 28 19:51:30 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.63 2018/11/28 05:10:54 snj Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.64 2018/11/28 19:51:30 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -1816,3 +1816,12 @@ sys/dev/pci/if_wm.c1.599
 	wm(4): Fix a bug that i82578 workarounds didn't work correctly.
 	[msaitoh, ticket #1108]
 
+libexec/httpd/CHANGES1.29,1.30
+libexec/httpd/bozohttpd.c			1.97-1.99
+libexec/httpd/bozohttpd.h			1.57
+libexec/httpd/cgi-bozo.c			1.45
+libexec/httpd/main.c1.22
+
+	Fix -X option parsing and miscelaneous cleanup.
+	[mrg, ticket #1109]
+



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:50:37 UTC 2018

Modified Files:
src/libexec/httpd [netbsd-8]: CHANGES bozohttpd.c bozohttpd.h
cgi-bozo.c main.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1109):

libexec/httpd/main.c: revision 1.22
libexec/httpd/CHANGES: revision 1.29
libexec/httpd/cgi-bozo.c: revision 1.45
libexec/httpd/bozohttpd.h: revision 1.57
libexec/httpd/CHANGES: revision 1.30
libexec/httpd/bozohttpd.c: revision 1.97
libexec/httpd/bozohttpd.c: revision 1.98
libexec/httpd/bozohttpd.c: revision 1.99

one semicolon is usually enough.

 -

appease lint

- add FALLTHROUGH comment
- one return is usually enough.

 -

avoid c99ism.

 -

fix -X option parsing.  noted by Rajeev V. Pillai.

 -

add option fixes here.

 -

normalise some messages.


To generate a diff of this commit:
cvs rdiff -u -r1.25.4.1 -r1.25.4.2 src/libexec/httpd/CHANGES
cvs rdiff -u -r1.86.4.2 -r1.86.4.3 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.47.4.1 -r1.47.4.2 src/libexec/httpd/bozohttpd.h
cvs rdiff -u -r1.37.4.2 -r1.37.4.3 src/libexec/httpd/cgi-bozo.c
cvs rdiff -u -r1.16.6.1 -r1.16.6.2 src/libexec/httpd/main.c

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

Modified files:

Index: src/libexec/httpd/CHANGES
diff -u src/libexec/httpd/CHANGES:1.25.4.1 src/libexec/httpd/CHANGES:1.25.4.2
--- src/libexec/httpd/CHANGES:1.25.4.1	Sat Nov 24 17:13:51 2018
+++ src/libexec/httpd/CHANGES	Wed Nov 28 19:50:37 2018
@@ -1,4 +1,7 @@
-$NetBSD: CHANGES,v 1.25.4.1 2018/11/24 17:13:51 martin Exp $
+$NetBSD: CHANGES,v 1.25.4.2 2018/11/28 19:50:37 martin Exp $
+
+changes in bozohttpd 20181125:
+	o  fixes for option parsing introduced in bozohttpd 20181123
 
 changes in bozohttpd 20181121:
 	o  add url remap support via .bzremap file, from mar...@netbsd.org
@@ -9,7 +12,7 @@ changes in bozohttpd 20181121:
 	   initial line, each header, and the total time spent
 	o  add -T option to expose new timeout settings
 	o  minor RFC fixes related to timeout handling
-	o  fix special file (.htpasswd, .bz*) bypass.  reported by JP.
+	o  fix special file (.htpasswd, .bz*) bypass.  reported by JP
 
 changes in bozohttpd 20170201:
 	o  fix an infinite loop in cgi processing
@@ -94,7 +97,7 @@ changes in bozohttpd 20100617:
 
 changes in bozohttpd 20100509:
 	o  major rework and clean up of internal interfaces.  move the main
-	   program into main.c, the remaining parts are useable as library.
+	   program into main.c, the remaining parts are useable as library
 	   add bindings for lua.  by Alistair G. Crooks 
 	o  fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566325
 

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.86.4.2 src/libexec/httpd/bozohttpd.c:1.86.4.3
--- src/libexec/httpd/bozohttpd.c:1.86.4.2	Sat Nov 24 17:13:51 2018
+++ src/libexec/httpd/bozohttpd.c	Wed Nov 28 19:50:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.86.4.2 2018/11/24 17:13:51 martin Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.86.4.3 2018/11/28 19:50:37 martin Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -109,7 +109,7 @@
 #define INDEX_HTML		"index.html"
 #endif
 #ifndef SERVER_SOFTWARE
-#define SERVER_SOFTWARE		"bozohttpd/20181124"
+#define SERVER_SOFTWARE		"bozohttpd/20181125"
 #endif
 #ifndef PUBLIC_HTML
 #define PUBLIC_HTML		"public_html"
@@ -1018,6 +1018,7 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, 
 		case '"':
 			if (absolute)
 goto leave_it;
+			/*FALLTHROUGH*/
 		case '\n':
 		case '\r':
 		case ' ':
@@ -1026,8 +1027,8 @@ bozo_escape_rfc3986(bozohttpd_t *httpd, 
 			d += 3;
 			len += 3;
 			break;
-		leave_it:
 		default:
+		leave_it:
 			*d++ = *s++;
 			len++;
 			break;
@@ -1477,7 +1478,6 @@ check_bzredirect(bozo_httpreq_t *request
 			 REDIRECT_FILE) >= sizeof(redir)) {
 		return bozo_http_error(httpd, 404, request,
 		"redirectfile path too long");
-		return -1;
 	}
 	if (lstat(redir, &sb) == 0) {
 		if (!S_ISLNK(sb.st_mode))
@@ -1924,8 +1924,9 @@ int
 bozo_check_special_files(bozo_httpreq_t *request, const char *name)
 {
 	bozohttpd_t *httpd = request->hr_httpd;
+	size_t i;
 
-	for (size_t i = 0; specials[i].file; i++)
+	for (i = 0; specials[i].file; i++)
 		if (strcmp(name, specials[i].file) == 0)
 			return bozo_http_error(httpd, 403, request,
 	   specials[i].name);

Index: src/libexec/httpd/bozohttpd.h
diff -u src/libexec/httpd/bozohttpd.h:1.47.4.1 src/libexec/httpd/bozohttpd.h:1.47.4.2
--- src/libexec/httpd/bozohttpd.h:1.47.4.1	Sat Nov 24 17:13:51 2018
+++ src/libexec/httpd/bozohttpd.h	Wed Nov 28 19:50:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.h,v 1.47.4.1 2018/11/24 17:13:51 martin Exp $	*/
+/*	$NetBSD: bozohttpd.h,v 1.47.4.2 2018/11/28 19:50:37 martin Exp $	*/
 
 /*	$eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -407,7 +407,7 @@ void	bozo

CVS commit: src/sys

2018-11-28 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Nov 28 19:46:23 UTC 2018

Modified Files:
src/sys/kern: kern_synch.c
src/sys/sys: lwp.h

Log Message:
Move counting involuntary switches into mi_switch. preempt() passes that
information by setting a new LWP flag.

While here, don't even try to switch when the scheduler has no other LWP
to run. This check is currently spread over all callers of preempt()
and will be removed there.

ok mrg@.


To generate a diff of this commit:
cvs rdiff -u -r1.320 -r1.321 src/sys/kern/kern_synch.c
cvs rdiff -u -r1.179 -r1.180 src/sys/sys/lwp.h

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

Modified files:

Index: src/sys/kern/kern_synch.c
diff -u src/sys/kern/kern_synch.c:1.320 src/sys/kern/kern_synch.c:1.321
--- src/sys/kern/kern_synch.c:1.320	Wed Nov 28 19:36:43 2018
+++ src/sys/kern/kern_synch.c	Wed Nov 28 19:46:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.320 2018/11/28 19:36:43 mlelstv Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.321 2018/11/28 19:46:22 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.320 2018/11/28 19:36:43 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.321 2018/11/28 19:46:22 mlelstv Exp $");
 
 #include "opt_kstack.h"
 #include "opt_dtrace.h"
@@ -286,12 +286,16 @@ preempt(void)
 {
 	struct lwp *l = curlwp;
 
+	/* check if the scheduler has another LWP to run */
+	if ((l->l_cpu->ci_schedstate.spc_flags & SPCF_SHOULDYIELD) == 0)
+		return;
+
 	KERNEL_UNLOCK_ALL(l, &l->l_biglocks);
 	lwp_lock(l);
 	KASSERT(lwp_locked(l, l->l_cpu->ci_schedstate.spc_lwplock));
 	KASSERT(l->l_stat == LSONPROC);
 	l->l_kpriority = false;
-	l->l_nivcsw++;
+	l->l_pflag |= LP_PREEMPTING;
 	(void)mi_switch(l);
 	KERNEL_LOCK(l->l_biglocks, l);
 }
@@ -649,6 +653,9 @@ mi_switch(lwp_t *l)
 		KASSERT(l->l_ctxswtch == 0);
 		l->l_ctxswtch = 1;
 		l->l_ncsw++;
+		if ((l->l_pflag & LP_PREEMPTING) != 0)
+			l->l_nivcsw++;
+		l->l_pflag &= ~LP_PREEMPTING;
 		KASSERT((l->l_pflag & LP_RUNNING) != 0);
 		l->l_pflag &= ~LP_RUNNING;
 
@@ -752,6 +759,7 @@ mi_switch(lwp_t *l)
 		/* Nothing to do - just unlock and return. */
 		pserialize_switchpoint();
 		mutex_spin_exit(spc->spc_mutex);
+		l->l_pflag &= ~LP_PREEMPTING;
 		lwp_unlock(l);
 		retval = 0;
 	}

Index: src/sys/sys/lwp.h
diff -u src/sys/sys/lwp.h:1.179 src/sys/sys/lwp.h:1.180
--- src/sys/sys/lwp.h:1.179	Thu Apr 19 21:19:07 2018
+++ src/sys/sys/lwp.h	Wed Nov 28 19:46:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: lwp.h,v 1.179 2018/04/19 21:19:07 christos Exp $	*/
+/*	$NetBSD: lwp.h,v 1.180 2018/11/28 19:46:22 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2010
@@ -258,6 +258,7 @@ extern int		maxlwp __read_mostly;	/* max
 #define	LP_VFORKWAIT	0x0200 /* Waiting at vfork() for a child */
 #define	LP_SINGLESTEP	0x0400 /* Single step thread in ptrace(2) */
 #define	LP_TIMEINTR	0x0001 /* Time this soft interrupt */
+#define	LP_PREEMPTING	0x0002 /* mi_switch called involuntarily */
 #define	LP_RUNNING	0x2000 /* Active on a CPU */
 #define	LP_BOUND	0x8000 /* Bound to a CPU */
 



CVS commit: [netbsd-7] src/doc

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:40:25 UTC 2018

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

Log Message:
Ticket #1658


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.16 -r1.1.2.17 src/doc/CHANGES-7.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.3
diff -u src/doc/CHANGES-7.3:1.1.2.16 src/doc/CHANGES-7.3:1.1.2.17
--- src/doc/CHANGES-7.3:1.1.2.16	Wed Nov 28 16:30:37 2018
+++ src/doc/CHANGES-7.3	Wed Nov 28 19:40:25 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.3,v 1.1.2.16 2018/11/28 16:30:37 martin Exp $
+# $NetBSD: CHANGES-7.3,v 1.1.2.17 2018/11/28 19:40:25 martin Exp $
 
 A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3
 release:
@@ -291,3 +291,8 @@ sys/net/rtsock.c1.244 (adapted)
 	Fix kernel info leak (2 bytes of padding in struct if_msghdr)
 	[maxv, ticket #1657]
 
+sys/kern/kern_exec.c1.462
+
+	Fix stack info leak.
+	[maxv, ticket #1658]
+



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:39:56 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1658):

sys/kern/kern_exec.c: revision 1.462

Fix stack info leak. There are 2x4 bytes of padding in struct ps_strings.

[  223.896199] kleak: Possible leak in copyout: [len=32, leaked=8]
[  223.906430] #0 0x80224d0a in kleak_note 
[  223.906430] #1 0x80224d8a in kleak_copyout 
[  223.918363] #2 0x80b1e26c in copyoutpsstrs 
[  223.926560] #3 0x80b1e331 in copyoutargs 
[  223.936216] #4 0x80b21768 in execve_runproc 
[  223.946225] #5 0x80b21cc9 in execve1 
[  223.946225] #6 0x8025a89c in sy_call 
[  223.956225] #7 0x8025aace in sy_invoke 
[  223.966232] #8 0x8025ab54 in syscall 


To generate a diff of this commit:
cvs rdiff -u -r1.408.2.5 -r1.408.2.6 src/sys/kern/kern_exec.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/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.408.2.5 src/sys/kern/kern_exec.c:1.408.2.6
--- src/sys/kern/kern_exec.c:1.408.2.5	Sun Feb 25 21:16:07 2018
+++ src/sys/kern/kern_exec.c	Wed Nov 28 19:39:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.408.2.5 2018/02/25 21:16:07 snj Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.408.2.6 2018/11/28 19:39:56 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.408.2.5 2018/02/25 21:16:07 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.408.2.6 2018/11/28 19:39:56 martin Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -1391,6 +1391,8 @@ copyoutargs(struct execve_data * restric
 	struct proc		*p = l->l_proc;
 	int			error;
 
+	memset(&data->ed_arginfo, 0, sizeof(data->ed_arginfo));
+
 	/* remember information about the process */
 	data->ed_arginfo.ps_nargvstr = data->ed_argc;
 	data->ed_arginfo.ps_nenvstr = data->ed_envc;



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:39:31 UTC 2018

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

Log Message:
Ticket #1658


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.22 -r1.1.2.23 src/doc/CHANGES-7.1.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.1.3
diff -u src/doc/CHANGES-7.1.3:1.1.2.22 src/doc/CHANGES-7.1.3:1.1.2.23
--- src/doc/CHANGES-7.1.3:1.1.2.22	Wed Nov 28 16:31:54 2018
+++ src/doc/CHANGES-7.1.3	Wed Nov 28 19:39:31 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.3,v 1.1.2.22 2018/11/28 16:31:54 martin Exp $
+# $NetBSD: CHANGES-7.1.3,v 1.1.2.23 2018/11/28 19:39:31 martin Exp $
 
 A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3
 release:
@@ -282,3 +282,8 @@ sys/net/rtsock.c1.244 (adapted)
 	Fix kernel info leak (2 bytes of padding in struct if_msghdr)
 	[maxv, ticket #1657]
 
+sys/kern/kern_exec.c1.462
+
+	Fix stack info leak.
+	[maxv, ticket #1658]
+



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:38:48 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1658):

sys/kern/kern_exec.c: revision 1.462

Fix stack info leak. There are 2x4 bytes of padding in struct ps_strings.

[  223.896199] kleak: Possible leak in copyout: [len=32, leaked=8]
[  223.906430] #0 0x80224d0a in kleak_note 
[  223.906430] #1 0x80224d8a in kleak_copyout 
[  223.918363] #2 0x80b1e26c in copyoutpsstrs 
[  223.926560] #3 0x80b1e331 in copyoutargs 
[  223.936216] #4 0x80b21768 in execve_runproc 
[  223.946225] #5 0x80b21cc9 in execve1 
[  223.946225] #6 0x8025a89c in sy_call 
[  223.956225] #7 0x8025aace in sy_invoke 
[  223.966232] #8 0x8025ab54 in syscall 


To generate a diff of this commit:
cvs rdiff -u -r1.408.2.4.4.1 -r1.408.2.4.4.2 src/sys/kern/kern_exec.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/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.408.2.4.4.1 src/sys/kern/kern_exec.c:1.408.2.4.4.2
--- src/sys/kern/kern_exec.c:1.408.2.4.4.1	Sun Feb 25 21:15:39 2018
+++ src/sys/kern/kern_exec.c	Wed Nov 28 19:38:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.408.2.4.4.1 2018/02/25 21:15:39 snj Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.408.2.4.4.2 2018/11/28 19:38:48 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.408.2.4.4.1 2018/02/25 21:15:39 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.408.2.4.4.2 2018/11/28 19:38:48 martin Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -1391,6 +1391,8 @@ copyoutargs(struct execve_data * restric
 	struct proc		*p = l->l_proc;
 	int			error;
 
+	memset(&data->ed_arginfo, 0, sizeof(data->ed_arginfo));
+
 	/* remember information about the process */
 	data->ed_arginfo.ps_nargvstr = data->ed_argc;
 	data->ed_arginfo.ps_nenvstr = data->ed_envc;



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:38:20 UTC 2018

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

Log Message:
Ticket #1658


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.115 -r1.1.2.116 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.115 src/doc/CHANGES-7.0.3:1.1.2.116
--- src/doc/CHANGES-7.0.3:1.1.2.115	Wed Nov 28 16:32:40 2018
+++ src/doc/CHANGES-7.0.3	Wed Nov 28 19:38:19 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.115 2018/11/28 16:32:40 martin Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.116 2018/11/28 19:38:19 martin Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5590,3 +5590,8 @@ sys/net/rtsock.c1.244 (adapted)
 	Fix kernel info leak (2 bytes of padding in struct if_msghdr)
 	[maxv, ticket #1657]
 
+sys/kern/kern_exec.c1.462
+
+	Fix stack info leak.
+	[maxv, ticket #1658]
+



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 19:37:46 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1658):

sys/kern/kern_exec.c: revision 1.462

Fix stack info leak. There are 2x4 bytes of padding in struct ps_strings.

[  223.896199] kleak: Possible leak in copyout: [len=32, leaked=8]
[  223.906430] #0 0x80224d0a in kleak_note 
[  223.906430] #1 0x80224d8a in kleak_copyout 
[  223.918363] #2 0x80b1e26c in copyoutpsstrs 
[  223.926560] #3 0x80b1e331 in copyoutargs 
[  223.936216] #4 0x80b21768 in execve_runproc 
[  223.946225] #5 0x80b21cc9 in execve1 
[  223.946225] #6 0x8025a89c in sy_call 
[  223.956225] #7 0x8025aace in sy_invoke 
[  223.966232] #8 0x8025ab54 in syscall 


To generate a diff of this commit:
cvs rdiff -u -r1.408.2.3.2.2 -r1.408.2.3.2.3 src/sys/kern/kern_exec.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/kern_exec.c
diff -u src/sys/kern/kern_exec.c:1.408.2.3.2.2 src/sys/kern/kern_exec.c:1.408.2.3.2.3
--- src/sys/kern/kern_exec.c:1.408.2.3.2.2	Sun Feb 25 21:15:20 2018
+++ src/sys/kern/kern_exec.c	Wed Nov 28 19:37:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.408.2.3.2.2 2018/02/25 21:15:20 snj Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.408.2.3.2.3 2018/11/28 19:37:46 martin Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.408.2.3.2.2 2018/02/25 21:15:20 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.408.2.3.2.3 2018/11/28 19:37:46 martin Exp $");
 
 #include "opt_exec.h"
 #include "opt_execfmt.h"
@@ -1391,6 +1391,8 @@ copyoutargs(struct execve_data * restric
 	struct proc		*p = l->l_proc;
 	int			error;
 
+	memset(&data->ed_arginfo, 0, sizeof(data->ed_arginfo));
+
 	/* remember information about the process */
 	data->ed_arginfo.ps_nargvstr = data->ed_argc;
 	data->ed_arginfo.ps_nenvstr = data->ed_envc;



CVS commit: src/sys/kern

2018-11-28 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Nov 28 19:36:43 UTC 2018

Modified Files:
src/sys/kern: kern_synch.c

Log Message:
Revert previous for a better fix.


To generate a diff of this commit:
cvs rdiff -u -r1.319 -r1.320 src/sys/kern/kern_synch.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/kern_synch.c
diff -u src/sys/kern/kern_synch.c:1.319 src/sys/kern/kern_synch.c:1.320
--- src/sys/kern/kern_synch.c:1.319	Wed Nov 28 09:44:49 2018
+++ src/sys/kern/kern_synch.c	Wed Nov 28 19:36:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.319 2018/11/28 09:44:49 mlelstv Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.320 2018/11/28 19:36:43 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.319 2018/11/28 09:44:49 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.320 2018/11/28 19:36:43 mlelstv Exp $");
 
 #include "opt_kstack.h"
 #include "opt_dtrace.h"
@@ -292,12 +292,7 @@ preempt(void)
 	KASSERT(l->l_stat == LSONPROC);
 	l->l_kpriority = false;
 	l->l_nivcsw++;
-	if (mi_switch(l) == 0) {
-		/* we didn't switch */
-		lwp_lock(l);
-		l->l_nivcsw--;
-		lwp_unlock(l);
-	}
+	(void)mi_switch(l);
 	KERNEL_LOCK(l->l_biglocks, l);
 }
 



CVS commit: src/sys/external/bsd/ena-com

2018-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 28 19:15:33 UTC 2018

Modified Files:
src/sys/external/bsd/ena-com: ena_plat.h

Log Message:
Avoid kpause while cold


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/ena-com/ena_plat.h

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

Modified files:

Index: src/sys/external/bsd/ena-com/ena_plat.h
diff -u src/sys/external/bsd/ena-com/ena_plat.h:1.3 src/sys/external/bsd/ena-com/ena_plat.h:1.4
--- src/sys/external/bsd/ena-com/ena_plat.h:1.3	Sat Jun 16 15:00:35 2018
+++ src/sys/external/bsd/ena-com/ena_plat.h	Wed Nov 28 19:15:32 2018
@@ -38,7 +38,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/contrib/ena-com/ena_plat.h 333453 2018-05-10 09:25:51Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ena_plat.h,v 1.3 2018/06/16 15:00:35 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ena_plat.h,v 1.4 2018/11/28 19:15:32 jmcneill Exp $");
 
 #include 
 #include 
@@ -171,7 +171,22 @@ static inline long PTR_ERR(const void *p
 #define	ENA_COM_PERMISSION	EPERM
 #define ENA_COM_TIMER_EXPIRED	ETIMEDOUT
 
-#define ENA_MSLEEP(x) 		kpause("enaw", false, mstohz(x), NULL)
+static inline int
+ENA_MSLEEP(int x)
+{
+	if (cold) {
+		while (x >= 100) {
+			delay(100);
+			x -= 100;
+		}
+		if (x > 0)
+			delay(x);
+		return EWOULDBLOCK;
+	} else {
+		return kpause("enaw", false, mstohz(x), NULL);
+	}
+}
+
 #define ENA_UDELAY(x) 		DELAY(x)
 #define ENA_GET_SYSTEM_TIMEOUT(timeout_us) \
 	mstohz(timeout_us * (1000 / 100))	/* XXX assumes 100 ms sleep */



CVS commit: src/sys/arch/aarch64/aarch64

2018-11-28 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Nov 28 19:13:15 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: db_machdep.c

Log Message:
Comment out implementation specific registers to avoid illegal instruction trap 
on ThunderX


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/aarch64/aarch64/db_machdep.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/db_machdep.c
diff -u src/sys/arch/aarch64/aarch64/db_machdep.c:1.10 src/sys/arch/aarch64/aarch64/db_machdep.c:1.11
--- src/sys/arch/aarch64/aarch64/db_machdep.c:1.10	Wed Nov 28 08:16:46 2018
+++ src/sys/arch/aarch64/aarch64/db_machdep.c	Wed Nov 28 19:13:15 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.c,v 1.10 2018/11/28 08:16:46 ryo Exp $ */
+/* $NetBSD: db_machdep.c,v 1.11 2018/11/28 19:13:15 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.10 2018/11/28 08:16:46 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.11 2018/11/28 19:13:15 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd32.h"
@@ -357,7 +357,7 @@ db_md_sysreg_cmd(db_expr_t addr, bool ha
 #define SHOW_ARMREG(x)	\
 	db_printf("%-16s = %016" PRIx64 "\n", #x, reg_ ## x ## _read())
 
-	SHOW_ARMREG(cbar_el1);
+//	SHOW_ARMREG(cbar_el1);	/* Cortex */
 	SHOW_ARMREG(ccsidr_el1);
 	SHOW_ARMREG(clidr_el1);
 	SHOW_ARMREG(cntfrq_el0);
@@ -397,7 +397,7 @@ db_md_sysreg_cmd(db_expr_t addr, bool ha
 	SHOW_ARMREG(id_aa64pfr0_el1);
 	SHOW_ARMREG(id_aa64pfr1_el1);
 	SHOW_ARMREG(isr_el1);
-	SHOW_ARMREG(l2ctlr_el1);
+//	SHOW_ARMREG(l2ctlr_el1);	/* Cortex */
 	SHOW_ARMREG(mair_el1);
 	SHOW_ARMREG(mdscr_el1);
 	SHOW_ARMREG(midr_el1);



CVS commit: src/sys/dev/pci

2018-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 28 19:07:49 UTC 2018

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

Log Message:
Our softc is the private data of self, not parent. Spotted by mlelstv@


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/pci/if_ena.c

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

Modified files:

Index: src/sys/dev/pci/if_ena.c
diff -u src/sys/dev/pci/if_ena.c:1.7 src/sys/dev/pci/if_ena.c:1.8
--- src/sys/dev/pci/if_ena.c:1.7	Wed Nov 28 16:51:41 2018
+++ src/sys/dev/pci/if_ena.c	Wed Nov 28 19:07:49 2018
@@ -31,7 +31,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.7 2018/11/28 16:51:41 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.8 2018/11/28 19:07:49 jmcneill Exp $");
 
 #include 
 #include 
@@ -3626,7 +3626,7 @@ ena_attach(device_t parent, device_t sel
 	struct pci_attach_args *pa = aux;
 	struct ena_com_dev_get_features_ctx get_feat_ctx;
 	static int version_printed;
-	struct ena_adapter *adapter = device_private(parent);
+	struct ena_adapter *adapter = device_private(self);
 	struct ena_com_dev *ena_dev = NULL;
 	uint16_t tx_sgl_size = 0;
 	uint16_t rx_sgl_size = 0;



CVS commit: src/sys/dev/pci

2018-11-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Nov 28 19:06:54 UTC 2018

Modified Files:
src/sys/dev/pci: if_enavar.h

Log Message:
Use correct PCI BAR offsets


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/if_enavar.h

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

Modified files:

Index: src/sys/dev/pci/if_enavar.h
diff -u src/sys/dev/pci/if_enavar.h:1.4 src/sys/dev/pci/if_enavar.h:1.5
--- src/sys/dev/pci/if_enavar.h:1.4	Mon Sep  3 16:29:32 2018
+++ src/sys/dev/pci/if_enavar.h	Wed Nov 28 19:06:54 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_enavar.h,v 1.4 2018/09/03 16:29:32 riastradh Exp $	*/
+/*	$NetBSD: if_enavar.h,v 1.5 2018/11/28 19:06:54 jmcneill Exp $	*/
 
 /*-
  * BSD LICENSE
@@ -63,8 +63,8 @@
 #define	ENA_ADMIN_MSIX_VEC		1
 #define	ENA_MAX_MSIX_VEC(io_queues)	(ENA_ADMIN_MSIX_VEC + (io_queues))
 
-#define	ENA_REG_BAR			0
-#define	ENA_MEM_BAR			2
+#define	ENA_REG_BAR			PCI_BAR(0)
+#define	ENA_MEM_BAR			PCI_BAR(2)
 
 #define	ENA_BUS_DMA_SEGS		32
 



CVS commit: src/sys/dev/pci

2018-11-28 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Wed Nov 28 16:51:41 UTC 2018

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

Log Message:
whitespace fix, NFC


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/if_ena.c

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

Modified files:

Index: src/sys/dev/pci/if_ena.c
diff -u src/sys/dev/pci/if_ena.c:1.6 src/sys/dev/pci/if_ena.c:1.7
--- src/sys/dev/pci/if_ena.c:1.6	Wed Nov 28 11:50:48 2018
+++ src/sys/dev/pci/if_ena.c	Wed Nov 28 16:51:41 2018
@@ -31,7 +31,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.6 2018/11/28 11:50:48 bad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.7 2018/11/28 16:51:41 jdolecek Exp $");
 
 #include 
 #include 
@@ -1889,8 +1889,8 @@ ena_enable_msix(struct ena_adapter *adap
 	max_type) != 0) {
 		aprint_error_dev(adapter->pdev,
 		"failed to allocate interrupt\n");
-return ENOSPC;
-}
+		return ENOSPC;
+	}
 
 	adapter->sc_nintrs = counts[PCI_INTR_TYPE_MSIX];
 



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 16:32:40 UTC 2018

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

Log Message:
Ticket #1657


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.114 -r1.1.2.115 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.114 src/doc/CHANGES-7.0.3:1.1.2.115
--- src/doc/CHANGES-7.0.3:1.1.2.114	Sat Nov 24 17:24:31 2018
+++ src/doc/CHANGES-7.0.3	Wed Nov 28 16:32:40 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.114 2018/11/24 17:24:31 martin Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.115 2018/11/28 16:32:40 martin Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5585,3 +5585,8 @@ libexec/httpd/testsuite/test-simple 
 	Fix access checks for special files.
 	[mrg, ticket #1655]
 
+sys/net/rtsock.c1.244 (adapted)
+
+	Fix kernel info leak (2 bytes of padding in struct if_msghdr)
+	[maxv, ticket #1657]
+



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 16:32:14 UTC 2018

Modified Files:
src/sys/net [netbsd-7-0]: rtsock.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1657):

sys/net/rtsock.c: revision 1.244 (adapted)

Fix kernel info leak. There are 2 bytes of padding in struct if_msghdr.
[  944.607323] kleak: Possible leak in copyout: [len=176, leaked=2]
[  944.617335] #0 0x80b7c44a in kleak_note 
[  944.627332] #1 0x80b7c4ca in kleak_copyout 
[  944.627332] #2 0x80c91698 in sysctl_iflist_if 
[  944.637336] #3 0x80c91d3c in sysctl_iflist 
[  944.647343] #4 0x80c93855 in sysctl_rtable 
[  944.647343] #5 0x80b5b328 in sysctl_dispatch 
[  944.657346] #6 0x80b5b62e in sys___sysctl 
[  944.667354] #7 0x8025ab3c in sy_call 
[  944.667354] #8 0x8025ad6e in sy_invoke 
[  944.677365] #9 0x8025adf4 in syscall 


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.163.4.1 src/sys/net/rtsock.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/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.163 src/sys/net/rtsock.c:1.163.4.1
--- src/sys/net/rtsock.c:1.163	Sat Aug  9 05:33:01 2014
+++ src/sys/net/rtsock.c	Wed Nov 28 16:32:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.163 2014/08/09 05:33:01 rtr Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.163.4.1 2018/11/28 16:32:14 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.163 2014/08/09 05:33:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.163.4.1 2018/11/28 16:32:14 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -968,7 +968,7 @@ again:
 			if (rw->w_tmemsize < len) {
 if (rw->w_tmem)
 	free(rw->w_tmem, M_RTABLE);
-rw->w_tmem = malloc(len, M_RTABLE, M_NOWAIT);
+rw->w_tmem = malloc(len, M_RTABLE, M_NOWAIT|M_ZERO);
 if (rw->w_tmem)
 	rw->w_tmemsize = len;
 else
@@ -1398,7 +1398,7 @@ sysctl_rtable(SYSCTLFN_ARGS)
 again:
 	/* we may return here if a later [re]alloc of the t_mem buffer fails */
 	if (w.w_tmemneeded) {
-		w.w_tmem = malloc(w.w_tmemneeded, M_RTABLE, M_WAITOK);
+		w.w_tmem = malloc(w.w_tmemneeded, M_RTABLE, M_WAITOK|M_ZERO);
 		w.w_tmemsize = w.w_tmemneeded;
 		w.w_tmemneeded = 0;
 	}



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 16:31:54 UTC 2018

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

Log Message:
Ticket #1657


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.21 -r1.1.2.22 src/doc/CHANGES-7.1.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.1.3
diff -u src/doc/CHANGES-7.1.3:1.1.2.21 src/doc/CHANGES-7.1.3:1.1.2.22
--- src/doc/CHANGES-7.1.3:1.1.2.21	Sat Nov 24 17:25:01 2018
+++ src/doc/CHANGES-7.1.3	Wed Nov 28 16:31:54 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.3,v 1.1.2.21 2018/11/24 17:25:01 martin Exp $
+# $NetBSD: CHANGES-7.1.3,v 1.1.2.22 2018/11/28 16:31:54 martin Exp $
 
 A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3
 release:
@@ -277,3 +277,8 @@ libexec/httpd/testsuite/test-simple 
 	Fix access checks for special files.
 	[mrg, ticket #1655]
 
+sys/net/rtsock.c1.244 (adapted)
+
+	Fix kernel info leak (2 bytes of padding in struct if_msghdr)
+	[maxv, ticket #1657]
+



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 16:30:57 UTC 2018

Modified Files:
src/sys/net [netbsd-7-1]: rtsock.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1657):

sys/net/rtsock.c: revision 1.244 (adapted)

Fix kernel info leak. There are 2 bytes of padding in struct if_msghdr.
[  944.607323] kleak: Possible leak in copyout: [len=176, leaked=2]
[  944.617335] #0 0x80b7c44a in kleak_note 
[  944.627332] #1 0x80b7c4ca in kleak_copyout 
[  944.627332] #2 0x80c91698 in sysctl_iflist_if 
[  944.637336] #3 0x80c91d3c in sysctl_iflist 
[  944.647343] #4 0x80c93855 in sysctl_rtable 
[  944.647343] #5 0x80b5b328 in sysctl_dispatch 
[  944.657346] #6 0x80b5b62e in sys___sysctl 
[  944.667354] #7 0x8025ab3c in sy_call 
[  944.667354] #8 0x8025ad6e in sy_invoke 
[  944.677365] #9 0x8025adf4 in syscall 


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.163.8.1 src/sys/net/rtsock.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/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.163 src/sys/net/rtsock.c:1.163.8.1
--- src/sys/net/rtsock.c:1.163	Sat Aug  9 05:33:01 2014
+++ src/sys/net/rtsock.c	Wed Nov 28 16:30:57 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.163 2014/08/09 05:33:01 rtr Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.163.8.1 2018/11/28 16:30:57 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.163 2014/08/09 05:33:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.163.8.1 2018/11/28 16:30:57 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -968,7 +968,7 @@ again:
 			if (rw->w_tmemsize < len) {
 if (rw->w_tmem)
 	free(rw->w_tmem, M_RTABLE);
-rw->w_tmem = malloc(len, M_RTABLE, M_NOWAIT);
+rw->w_tmem = malloc(len, M_RTABLE, M_NOWAIT|M_ZERO);
 if (rw->w_tmem)
 	rw->w_tmemsize = len;
 else
@@ -1398,7 +1398,7 @@ sysctl_rtable(SYSCTLFN_ARGS)
 again:
 	/* we may return here if a later [re]alloc of the t_mem buffer fails */
 	if (w.w_tmemneeded) {
-		w.w_tmem = malloc(w.w_tmemneeded, M_RTABLE, M_WAITOK);
+		w.w_tmem = malloc(w.w_tmemneeded, M_RTABLE, M_WAITOK|M_ZERO);
 		w.w_tmemsize = w.w_tmemneeded;
 		w.w_tmemneeded = 0;
 	}



CVS commit: [netbsd-7] src/doc

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 16:30:37 UTC 2018

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

Log Message:
Tickets #1656 and #1657


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/doc/CHANGES-7.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.3
diff -u src/doc/CHANGES-7.3:1.1.2.15 src/doc/CHANGES-7.3:1.1.2.16
--- src/doc/CHANGES-7.3:1.1.2.15	Sat Nov 24 17:25:39 2018
+++ src/doc/CHANGES-7.3	Wed Nov 28 16:30:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.3,v 1.1.2.15 2018/11/24 17:25:39 martin Exp $
+# $NetBSD: CHANGES-7.3,v 1.1.2.16 2018/11/28 16:30:37 martin Exp $
 
 A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3
 release:
@@ -280,3 +280,14 @@ libexec/httpd/testsuite/test-simple 
 	Fix access checks for special files.
 	[mrg, ticket #1655]
 
+sys/dev/pci/if_wm.c1.599
+
+	- Fix a bug that i82578 PHY can't detect correctly.
+	- Print PHY OUI and model number if a PHY's can't be identified.
+	[msaitoh, ticket #1656]
+
+sys/net/rtsock.c1.244 (adapted)
+
+	Fix kernel info leak (2 bytes of padding in struct if_msghdr)
+	[maxv, ticket #1657]
+



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 16:30:06 UTC 2018

Modified Files:
src/sys/net [netbsd-7]: rtsock.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #1657):

sys/net/rtsock.c: revision 1.244 (adapted)

Fix kernel info leak. There are 2 bytes of padding in struct if_msghdr.
[  944.607323] kleak: Possible leak in copyout: [len=176, leaked=2]
[  944.617335] #0 0x80b7c44a in kleak_note 
[  944.627332] #1 0x80b7c4ca in kleak_copyout 
[  944.627332] #2 0x80c91698 in sysctl_iflist_if 
[  944.637336] #3 0x80c91d3c in sysctl_iflist 
[  944.647343] #4 0x80c93855 in sysctl_rtable 
[  944.647343] #5 0x80b5b328 in sysctl_dispatch 
[  944.657346] #6 0x80b5b62e in sys___sysctl 
[  944.667354] #7 0x8025ab3c in sy_call 
[  944.667354] #8 0x8025ad6e in sy_invoke 
[  944.677365] #9 0x8025adf4 in syscall 


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.163.2.1 src/sys/net/rtsock.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/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.163 src/sys/net/rtsock.c:1.163.2.1
--- src/sys/net/rtsock.c:1.163	Sat Aug  9 05:33:01 2014
+++ src/sys/net/rtsock.c	Wed Nov 28 16:30:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.163 2014/08/09 05:33:01 rtr Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.163.2.1 2018/11/28 16:30:06 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.163 2014/08/09 05:33:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.163.2.1 2018/11/28 16:30:06 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -968,7 +968,7 @@ again:
 			if (rw->w_tmemsize < len) {
 if (rw->w_tmem)
 	free(rw->w_tmem, M_RTABLE);
-rw->w_tmem = malloc(len, M_RTABLE, M_NOWAIT);
+rw->w_tmem = malloc(len, M_RTABLE, M_NOWAIT|M_ZERO);
 if (rw->w_tmem)
 	rw->w_tmemsize = len;
 else
@@ -1398,7 +1398,7 @@ sysctl_rtable(SYSCTLFN_ARGS)
 again:
 	/* we may return here if a later [re]alloc of the t_mem buffer fails */
 	if (w.w_tmemneeded) {
-		w.w_tmem = malloc(w.w_tmemneeded, M_RTABLE, M_WAITOK);
+		w.w_tmem = malloc(w.w_tmemneeded, M_RTABLE, M_WAITOK|M_ZERO);
 		w.w_tmemsize = w.w_tmemneeded;
 		w.w_tmemneeded = 0;
 	}



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

2018-11-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 28 16:26:31 UTC 2018

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

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1656):

sys/dev/pci/if_wm.c: revision 1.599

- Fix a bug that i82578 PHY can't detect correctly.
- Print PHY OUI and model number if a PHY's can't be identified.

XXX pullup-[78]


To generate a diff of this commit:
cvs rdiff -u -r1.289.2.17 -r1.289.2.18 src/sys/dev/pci/if_wm.c

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.289.2.17 src/sys/dev/pci/if_wm.c:1.289.2.18
--- src/sys/dev/pci/if_wm.c:1.289.2.17	Fri Nov  9 11:28:39 2018
+++ src/sys/dev/pci/if_wm.c	Wed Nov 28 16:26:31 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.289.2.17 2018/11/09 11:28:39 sborrill Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.289.2.18 2018/11/28 16:26:31 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.289.2.17 2018/11/09 11:28:39 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.289.2.18 2018/11/28 16:26:31 martin Exp $");
 
 #include 
 #include 
@@ -7300,7 +7300,7 @@ wm_gmii_setup_phytype(struct wm_softc *s
 	} else {
 		/* It's not the first call. Use PHY OUI and model */
 		switch (phy_oui) {
-		case MII_OUI_ATHEROS: /* XXX ??? */
+		case MII_OUI_ATTANSIC: /* XXX ??? */
 			switch (phy_model) {
 			case 0x0004: /* XXX */
 new_phytype = WMPHY_82578;
@@ -7377,8 +7377,9 @@ wm_gmii_setup_phytype(struct wm_softc *s
 			break;
 		}
 		if (new_phytype == WMPHY_UNKNOWN)
-			aprint_verbose_dev(dev, "%s: unknown PHY model\n",
-			__func__);
+			aprint_verbose_dev(dev,
+			"%s: unknown PHY model. OUI=%06x, model=%04x\n",
+			__func__, phy_oui, phy_model);
 
 		if ((sc->sc_phytype != WMPHY_UNKNOWN)
 		&& (sc->sc_phytype != new_phytype )) {



CVS commit: src/sys/kern

2018-11-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Nov 28 15:10:40 UTC 2018

Modified Files:
src/sys/kern: kern_time.c

Log Message:
Fix kernel info leak.

+ Possible info leak: [len=32, leaked=16]
| #0 0x80baf3a7 in kleak_copyout
| #1 0x80b940f8 in sys___timer_settime50
| #2 0x80259c42 in syscall


To generate a diff of this commit:
cvs rdiff -u -r1.191 -r1.192 src/sys/kern/kern_time.c

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

Modified files:

Index: src/sys/kern/kern_time.c
diff -u src/sys/kern/kern_time.c:1.191 src/sys/kern/kern_time.c:1.192
--- src/sys/kern/kern_time.c:1.191	Tue Nov 13 07:16:33 2018
+++ src/sys/kern/kern_time.c	Wed Nov 28 15:10:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time.c,v 1.191 2018/11/13 07:16:33 maxv Exp $	*/
+/*	$NetBSD: kern_time.c,v 1.192 2018/11/28 15:10:40 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.191 2018/11/13 07:16:33 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.192 2018/11/28 15:10:40 maxv Exp $");
 
 #include 
 #include 
@@ -603,6 +603,7 @@ timer_create1(timer_t *tid, clockid_t id
 		pts = timers_alloc(p);
 
 	pt = pool_get(&ptimer_pool, PR_WAITOK);
+	memset(pt, 0, sizeof(*pt));
 	if (evp != NULL) {
 		if (((error =
 		(*fetch_event)(evp, &pt->pt_ev, sizeof(pt->pt_ev))) != 0) ||



CVS commit: src/sys/dev/pci

2018-11-28 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Wed Nov 28 11:50:48 UTC 2018

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

Log Message:
Adapt ena_rx_checksum() to NetBSD.
It wasn't ported to the NetBSD conventions of indicating hardware checkum
status.

Compile tested only.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/if_ena.c

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

Modified files:

Index: src/sys/dev/pci/if_ena.c
diff -u src/sys/dev/pci/if_ena.c:1.5 src/sys/dev/pci/if_ena.c:1.6
--- src/sys/dev/pci/if_ena.c:1.5	Tue Jun 26 06:48:01 2018
+++ src/sys/dev/pci/if_ena.c	Wed Nov 28 11:50:48 2018
@@ -31,7 +31,7 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/dev/ena/ena.c 333456 2018-05-10 09:37:54Z mw $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.5 2018/06/26 06:48:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ena.c,v 1.6 2018/11/28 11:50:48 bad Exp $");
 
 #include 
 #include 
@@ -1593,26 +1593,41 @@ ena_rx_checksum(struct ena_ring *rx_ring
 struct mbuf *mbuf)
 {
 
-	/* if IP and error */
-	if (unlikely((ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4) &&
-	ena_rx_ctx->l3_csum_err)) {
-		/* ipv4 checksum error */
-		mbuf->m_pkthdr.csum_flags = 0;
-		counter_u64_add(rx_ring->rx_stats.bad_csum, 1);
-		ena_trace(ENA_DBG, "RX IPv4 header checksum error");
-		return;
-	}
-
-	/* if TCP/UDP */
-	if ((ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP) ||
-	(ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_UDP)) {
-		if (ena_rx_ctx->l4_csum_err) {
-			/* TCP/UDP checksum error */
-			mbuf->m_pkthdr.csum_flags = M_CSUM_IPv4_BAD;
+	/* IPv4 */
+	if ((ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4)) {
+		mbuf->m_pkthdr.csum_flags |= M_CSUM_IPv4;
+		if (ena_rx_ctx->l3_csum_err) {
+			/* ipv4 checksum error */
+			mbuf->m_pkthdr.csum_flags |= M_CSUM_IPv4_BAD;
 			counter_u64_add(rx_ring->rx_stats.bad_csum, 1);
-			ena_trace(ENA_DBG, "RX L4 checksum error");
-		} else {
-			mbuf->m_pkthdr.csum_flags = M_CSUM_IPv4;
+			ena_trace(ENA_DBG, "RX IPv4 header checksum error");
+			return;
+		}
+
+		/*  TCP/UDP */
+		if ((ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP) ||
+		(ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_UDP)) {
+			mbuf->m_pkthdr.csum_flags |= (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP) ? M_CSUM_TCPv4 : M_CSUM_UDPv4;
+			if (ena_rx_ctx->l4_csum_err) {
+/* TCP/UDP checksum error */
+mbuf->m_pkthdr.csum_flags |= M_CSUM_TCP_UDP_BAD;
+counter_u64_add(rx_ring->rx_stats.bad_csum, 1);
+ena_trace(ENA_DBG, "RX L4 checksum error");
+			}
+		}
+	}
+	/* IPv6 */
+	else if ((ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV6)) {
+		/*  TCP/UDP */
+		if ((ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP) ||
+		(ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_UDP)) {
+			mbuf->m_pkthdr.csum_flags |= (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP) ? M_CSUM_TCPv6 : M_CSUM_UDPv6;
+			if (ena_rx_ctx->l4_csum_err) {
+/* TCP/UDP checksum error */
+mbuf->m_pkthdr.csum_flags |= M_CSUM_TCP_UDP_BAD;
+counter_u64_add(rx_ring->rx_stats.bad_csum, 1);
+ena_trace(ENA_DBG, "RX L4 checksum error");
+			}
 		}
 	}
 }



CVS commit: src

2018-11-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Nov 28 10:01:28 UTC 2018

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c
src/tests/fs/vfs: t_unpriv.c

Log Message:
Redo the access check for setting va_flags in zfs_netbsd_setattr().

Use user flag UF_NODUMP instead of UF_IMMUTABLE for the test as it
is the only user flag supported by all tested file systems.

PR kern/47656 test zfs_flags.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
cvs rdiff -u -r1.15 -r1.16 src/tests/fs/vfs/t_unpriv.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.34 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.35
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.34	Wed Nov 28 09:58:58 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c	Wed Nov 28 10:01:28 2018
@@ -5345,9 +5345,11 @@ zfs_netbsd_setattr(void *v)
 	cred_t *cred = ap->a_cred;
 	znode_t *zp = VTOZ(vp);
 	xvattr_t xvap;
-	u_long fflags;
+	kauth_action_t action;
+	u_long fflags, sfflags = 0;
 	uint64_t zflags;
 	int error, flags = 0;
+	bool changing_sysflags;
 
 	vattr_init_mask(vap);
 	vap->va_mask &= ~AT_NOSET;
@@ -5365,40 +5367,14 @@ zfs_netbsd_setattr(void *v)
 		fflags = vap->va_flags;
 		if ((fflags & ~(SF_IMMUTABLE|SF_APPEND|SF_NOUNLINK|UF_NODUMP)) != 0)
 			return (EOPNOTSUPP);
-		/*
-		 * Callers may only modify the file flags on objects they
-		 * have VADMIN rights for.
-		 */
-		if ((error = VOP_ACCESS(vp, VWRITE, cred)) != 0)
-			return (error);
-		/*
-		 * Unprivileged processes are not permitted to unset system
-		 * flags, or modify flags if any system flags are set.
-		 * Privileged non-jail processes may not modify system flags
-		 * if securelevel > 0 and any existing system flags are set.
-		 * Privileged jail processes behave like privileged non-jail
-		 * processes if the security.jail.chflags_allowed sysctl is
-		 * is non-zero; otherwise, they behave like unprivileged
-		 * processes.
-		 */
-		if (kauth_authorize_system(cred, KAUTH_SYSTEM_CHSYSFLAGS, 0,
-			NULL, NULL, NULL) != 0) {
-
-			if (zflags &
-			(ZFS_IMMUTABLE | ZFS_APPENDONLY | ZFS_NOUNLINK)) {
-return (EPERM);
-			}
-			if (fflags &
-			(SF_IMMUTABLE | SF_APPEND | SF_NOUNLINK)) {
-return (EPERM);
-			}
-		}
 
 #define	FLAG_CHANGE(fflag, zflag, xflag, xfield)	do {		\
 	if (((fflags & (fflag)) && !(zflags & (zflag))) ||		\
 	((zflags & (zflag)) && !(fflags & (fflag {		\
 		XVA_SET_REQ(&xvap, (xflag));\
 		(xfield) = ((fflags & (fflag)) != 0);			\
+		if (((fflag) & SF_SETTABLE) != 0)			\
+			sfflags |= (fflag);\
 	}\
 } while (0)
 		/* Convert chflags into ZFS-type flags. */
@@ -5412,6 +5388,23 @@ zfs_netbsd_setattr(void *v)
 		FLAG_CHANGE(UF_NODUMP, ZFS_NODUMP, XAT_NODUMP,
 		xvap.xva_xoptattrs.xoa_nodump);
 #undef	FLAG_CHANGE
+
+		action = KAUTH_VNODE_WRITE_FLAGS;
+		changing_sysflags = false;
+
+		if (zflags & (ZFS_IMMUTABLE|ZFS_APPENDONLY|ZFS_NOUNLINK)) {
+			action |= KAUTH_VNODE_HAS_SYSFLAGS;
+		}
+		if (sfflags != 0) {
+			action |= KAUTH_VNODE_WRITE_SYSFLAGS;
+			changing_sysflags = true;
+		}
+
+		error = kauth_authorize_vnode(cred, action, vp, NULL,
+		genfs_can_chflags(cred, vp->v_type, zp->z_uid,
+		changing_sysflags));
+		if (error)
+			return error;
 	}
 
 	if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL ||

Index: src/tests/fs/vfs/t_unpriv.c
diff -u src/tests/fs/vfs/t_unpriv.c:1.15 src/tests/fs/vfs/t_unpriv.c:1.16
--- src/tests/fs/vfs/t_unpriv.c:1.15	Wed Nov 28 09:58:58 2018
+++ src/tests/fs/vfs/t_unpriv.c	Wed Nov 28 10:01:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_unpriv.c,v 1.15 2018/11/28 09:58:58 hannken Exp $	*/
+/*	$NetBSD: t_unpriv.c,v 1.16 2018/11/28 10:01:28 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -187,20 +187,18 @@ flags(const atf_tc_t *tc, const char *mp
 
 	if (rump_sys_stat(name, &st) == -1)
 		atf_tc_fail_errno("stat");
-	if (FSTYPE_ZFS(tc))
-		atf_tc_expect_fail("PR kern/47656: Test known to be broken");
 	if (rump_sys_chflags(name, st.st_flags) == -1) {
 		if (errno == EOPNOTSUPP)
 			atf_tc_skip("file flags not supported by file system");
 		atf_tc_fail_errno("chflags");
 	}
 
-	fflags = st.st_flags | UF_IMMUTABLE;
+	fflags = st.st_flags | UF_NODUMP;
 
 	rump_pub_lwproc_rfork(RUMP_RFCFDG);
 	if (rump_sys_setuid(1) == -1)
 		atf_tc_fail_errno("setuid");
-	fflags |= UF_IMMUTABLE;
+	fflags |= UF_NODUMP;
 	if (rump_sys_chflags(name, fflags) != -1 || errno != EPERM)
 		atf_tc_fail_errno("chflags");
 	rump_pub_lwproc_releaselwp();
@@ -208,7 +206,7 @@ flags(const atf_tc_t *tc, const char *mp
 	if (rump_sys_chflags(name, fflags) == -1)
 		atf_tc_fail_errno("chflag

CVS commit: src

2018-11-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Nov 28 09:58:58 UTC 2018

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c
src/tests/fs/vfs: t_unpriv.c

Log Message:
Add missing access check for REMOVE into zfs_netbsd_lookup().

PR kern/47656 test zfs_dirperms.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
cvs rdiff -u -r1.14 -r1.15 src/tests/fs/vfs/t_unpriv.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.33 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.34
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.33	Wed Nov 28 09:57:59 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c	Wed Nov 28 09:58:58 2018
@@ -5128,8 +5128,15 @@ zfs_netbsd_lookup(void *v)
 error = EJUSTRETURN;
 break;
 			}
-			/* FALLTHROUGH */
+			break;
 		case DELETE:
+			if (error == 0) {
+error = VOP_ACCESS(dvp, VWRITE, cnp->cn_cred);
+if (error) {
+	VN_RELE(*vpp);
+	*vpp = NULL;
+}
+			}
 			break;
 		}
 	}

Index: src/tests/fs/vfs/t_unpriv.c
diff -u src/tests/fs/vfs/t_unpriv.c:1.14 src/tests/fs/vfs/t_unpriv.c:1.15
--- src/tests/fs/vfs/t_unpriv.c:1.14	Wed Nov 28 09:57:59 2018
+++ src/tests/fs/vfs/t_unpriv.c	Wed Nov 28 09:58:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_unpriv.c,v 1.14 2018/11/28 09:57:59 hannken Exp $	*/
+/*	$NetBSD: t_unpriv.c,v 1.15 2018/11/28 09:58:58 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -94,8 +94,6 @@ dirperms(const atf_tc_t *tc, const char 
 	rump_pub_lwproc_rfork(RUMP_RFCFDG);
 	if (rump_sys_setuid(1) == -1)
 		atf_tc_fail_errno("setuid");
-	if (FSTYPE_ZFS(tc))
-		atf_tc_expect_fail("PR kern/47656: Test known to be broken");
 if (rump_sys_open(name, O_RDWR|O_CREAT, 0666) != -1 || errno != EACCES)
 		atf_tc_fail_errno("open");
 	rump_pub_lwproc_releaselwp();



CVS commit: src

2018-11-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Nov 28 09:57:59 UTC 2018

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c
src/tests/fs/vfs: t_unpriv.c

Log Message:
Add missing access check for setting va_Xtime into zfs_netbsd_setattr().

PR kern/47656 test zfs_times.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
cvs rdiff -u -r1.13 -r1.14 src/tests/fs/vfs/t_unpriv.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.32 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.33
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.32	Wed Nov 28 09:57:16 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c	Wed Nov 28 09:57:59 2018
@@ -5336,10 +5336,11 @@ zfs_netbsd_setattr(void *v)
 	vnode_t *vp = ap->a_vp;
 	vattr_t *vap = ap->a_vap;
 	cred_t *cred = ap->a_cred;
+	znode_t *zp = VTOZ(vp);
 	xvattr_t xvap;
 	u_long fflags;
 	uint64_t zflags;
-	int flags = 0;
+	int error, flags = 0;
 
 	vattr_init_mask(vap);
 	vap->va_mask &= ~AT_NOSET;
@@ -5405,6 +5406,16 @@ zfs_netbsd_setattr(void *v)
 		xvap.xva_xoptattrs.xoa_nodump);
 #undef	FLAG_CHANGE
 	}
+
+	if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL ||
+	vap->va_birthtime.tv_sec != VNOVAL) {
+		error = kauth_authorize_vnode(cred, KAUTH_VNODE_WRITE_TIMES, vp,
+		 NULL, genfs_can_chtimes(vp, vap->va_vaflags, zp->z_uid,
+		 cred));
+		if (error)
+			return error;
+	}
+
 	return (zfs_setattr(vp, (vattr_t *)&xvap, flags, cred, NULL));
 }
 

Index: src/tests/fs/vfs/t_unpriv.c
diff -u src/tests/fs/vfs/t_unpriv.c:1.13 src/tests/fs/vfs/t_unpriv.c:1.14
--- src/tests/fs/vfs/t_unpriv.c:1.13	Fri Jan 13 21:30:40 2017
+++ src/tests/fs/vfs/t_unpriv.c	Wed Nov 28 09:57:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_unpriv.c,v 1.13 2017/01/13 21:30:40 christos Exp $	*/
+/*	$NetBSD: t_unpriv.c,v 1.14 2018/11/28 09:57:59 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -144,8 +144,6 @@ times(const atf_tc_t *tc, const char *mp
 	rump_pub_lwproc_rfork(RUMP_RFCFDG);
 	if (rump_sys_setuid(1) == -1)
 		atf_tc_fail_errno("setuid");
-	if (FSTYPE_ZFS(tc))
-		atf_tc_expect_fail("PR kern/47656: Test known to be broken");
 	if (rump_sys_utimes(name, NULL) != -1 || errno != EACCES)
 		atf_tc_fail_errno("utimes");
 	rump_pub_lwproc_releaselwp();



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2018-11-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Nov 28 09:57:16 UTC 2018

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c

Log Message:
We expect VOP_ACCESS() to return EACCESS as general error.

Change zfs_netbsd_access() to translate the common EPERM to EACCES.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.31 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.32
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.31	Wed Nov 28 09:56:40 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c	Wed Nov 28 09:57:16 2018
@@ -5053,6 +5053,10 @@ zfs_netbsd_access(void *v)
 	KASSERT(VOP_ISLOCKED(vp));
 	error = zfs_access(vp, zfs_mode, 0, cred, NULL);
 
+	/* We expect EACCES as common error. */
+	if (error == EPERM)
+		error = EACCES;
+
 	return (error);
 }
 



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2018-11-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Nov 28 09:56:40 UTC 2018

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c

Log Message:
Don't try to release a NULL vnode in zfs_netbsd_rename().


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.30 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.31
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.30	Wed Nov 28 09:56:09 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c	Wed Nov 28 09:56:40 2018
@@ -5467,7 +5467,8 @@ zfs_netbsd_rename(void *v)
 
 	VN_RELE(fdvp);
 	VN_RELE(tdvp);
-	VN_RELE(fvp);
+	if (fvp != NULL)
+		VN_RELE(fvp);
 	if (tvp != NULL)
 		VN_RELE(tvp);
 



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2018-11-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Nov 28 09:56:09 UTC 2018

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c

Log Message:
Remove an early test for "source and target are equal" from zfs_rename()
that broke BSD semantics.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.29 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.30
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.29	Wed Nov 28 09:55:06 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c	Wed Nov 28 09:56:09 2018
@@ -4191,11 +4191,13 @@ zfs_rename(vnode_t *sdvp, vnode_t **svpp
 		goto unlockout;
 	}
 
+#ifndef __NetBSD__
 	/* If source and target are the same file, there is nothing to do. */
 	if ((*svpp) == (*tvpp)) {
 		error = 0;
 		goto unlockout;
 	}
+#endif
 
 	if (((*svpp)->v_type == VDIR && (*svpp)->v_mountedhere != NULL) ||
 	((*tvpp) != NULL && (*tvpp)->v_type == VDIR &&



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2018-11-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Nov 28 09:55:36 UTC 2018

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_znode.c

Log Message:
Add missing sa_buf_rele() into zfs_zget_cleaner().


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c:1.21 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c:1.22
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c:1.21	Tue Jul 31 09:33:50 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_znode.c	Wed Nov 28 09:55:36 2018
@@ -1204,6 +1204,7 @@ zfs_zget_cleaner(zfsvfs_t *zfsvfs, uint6
 	hdl = dmu_buf_get_user(db);
 	KASSERT(hdl != NULL);
 	zp = sa_get_userdata(hdl);
+	sa_buf_rele(db, NULL);
 	*zpp = zp;
 	return (0);
 }



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2018-11-28 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Wed Nov 28 09:55:06 UTC 2018

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: zfs_vnops.c

Log Message:
Always unbusy pages in zfs_putapage() after the data has been written
into the DMU.  Running fsx no longer hangs the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c

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

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.28 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.29
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.28	Thu Nov 15 04:55:49 2018
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c	Wed Nov 28 09:55:06 2018
@@ -5826,13 +5826,11 @@ zfs_putapage(vnode_t *vp, page_t **pp, i
 	}
 	dmu_tx_commit(tx);
 
-	if (async) {
-		mutex_enter(mtx);
-		mutex_enter(&uvm_pageqlock);
-		uvm_page_unbusy(pp, count);
-		mutex_exit(&uvm_pageqlock);
-		mutex_exit(mtx);
-	}
+	mutex_enter(mtx);
+	mutex_enter(&uvm_pageqlock);
+	uvm_page_unbusy(pp, count);
+	mutex_exit(&uvm_pageqlock);
+	mutex_exit(mtx);
 
 out:
 	return (err);



CVS commit: src/sys/kern

2018-11-28 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Nov 28 09:44:49 UTC 2018

Modified Files:
src/sys/kern: kern_synch.c

Log Message:
Fix statistics in case mi_switch didn't actually switch LWPs.


To generate a diff of this commit:
cvs rdiff -u -r1.318 -r1.319 src/sys/kern/kern_synch.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/kern_synch.c
diff -u src/sys/kern/kern_synch.c:1.318 src/sys/kern/kern_synch.c:1.319
--- src/sys/kern/kern_synch.c:1.318	Tue Aug 14 01:06:01 2018
+++ src/sys/kern/kern_synch.c	Wed Nov 28 09:44:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.318 2018/08/14 01:06:01 ozaki-r Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.319 2018/11/28 09:44:49 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.318 2018/08/14 01:06:01 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.319 2018/11/28 09:44:49 mlelstv Exp $");
 
 #include "opt_kstack.h"
 #include "opt_dtrace.h"
@@ -292,7 +292,12 @@ preempt(void)
 	KASSERT(l->l_stat == LSONPROC);
 	l->l_kpriority = false;
 	l->l_nivcsw++;
-	(void)mi_switch(l);
+	if (mi_switch(l) == 0) {
+		/* we didn't switch */
+		lwp_lock(l);
+		l->l_nivcsw--;
+		lwp_unlock(l);
+	}
 	KERNEL_LOCK(l->l_biglocks, l);
 }
 



CVS commit: src/sys/arch

2018-11-28 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Nov 28 09:16:19 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: aarch64_machdep.c cpu.c
src/sys/arch/evbarm/fdt: fdt_machdep.c

Log Message:
support boot option "-1" to disable multiprocessor boot, and "-z" to set 
AB_SILENT flag.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/aarch64/aarch64/aarch64_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/aarch64/aarch64/cpu.c
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/evbarm/fdt/fdt_machdep.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/aarch64_machdep.c
diff -u src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.22 src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.23
--- src/sys/arch/aarch64/aarch64/aarch64_machdep.c:1.22	Tue Nov 20 01:59:51 2018
+++ src/sys/arch/aarch64/aarch64/aarch64_machdep.c	Wed Nov 28 09:16:19 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: aarch64_machdep.c,v 1.22 2018/11/20 01:59:51 mrg Exp $ */
+/* $NetBSD: aarch64_machdep.c,v 1.23 2018/11/28 09:16:19 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.22 2018/11/20 01:59:51 mrg Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aarch64_machdep.c,v 1.23 2018/11/28 09:16:19 ryo Exp $");
 
 #include "opt_arm_debug.h"
 #include "opt_ddb.h"
@@ -389,6 +389,8 @@ parse_mi_bootargs(char *args)
 {
 	int val;
 
+	if (get_bootconf_option(args, "-1", BOOTOPT_TYPE_BOOLEAN, &val) && val)
+		boothowto |= RB_MD1;
 	if (get_bootconf_option(args, "-s", BOOTOPT_TYPE_BOOLEAN, &val) && val)
 		boothowto |= RB_SINGLE;
 	if (get_bootconf_option(args, "-d", BOOTOPT_TYPE_BOOLEAN, &val) && val)
@@ -401,6 +403,8 @@ parse_mi_bootargs(char *args)
 		boothowto |= AB_VERBOSE;
 	if (get_bootconf_option(args, "-x", BOOTOPT_TYPE_BOOLEAN, &val) && val)
 		boothowto |= AB_DEBUG;
+	if (get_bootconf_option(args, "-z", BOOTOPT_TYPE_BOOLEAN, &val) && val)
+		boothowto |= AB_SILENT;
 }
 
 void

Index: src/sys/arch/aarch64/aarch64/cpu.c
diff -u src/sys/arch/aarch64/aarch64/cpu.c:1.13 src/sys/arch/aarch64/aarch64/cpu.c:1.14
--- src/sys/arch/aarch64/aarch64/cpu.c:1.13	Tue Nov 20 01:59:51 2018
+++ src/sys/arch/aarch64/aarch64/cpu.c	Wed Nov 28 09:16:19 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.13 2018/11/20 01:59:51 mrg Exp $ */
+/* $NetBSD: cpu.c,v 1.14 2018/11/28 09:16:19 ryo Exp $ */
 
 /*
  * Copyright (c) 2017 Ryo Shimizu 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.13 2018/11/20 01:59:51 mrg Exp $");
+__KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.14 2018/11/28 09:16:19 ryo Exp $");
 
 #include "locators.h"
 #include "opt_arm_debug.h"
@@ -40,6 +40,7 @@ __KERNEL_RCSID(1, "$NetBSD: cpu.c,v 1.13
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -109,6 +110,12 @@ cpu_attach(device_t dv, cpuid_t id)
 		cpu_setup_id(ci);
 	} else {
 #ifdef MULTIPROCESSOR
+		if ((boothowto & RB_MD1) != 0) {
+			aprint_naive("\n");
+			aprint_normal(": multiprocessor boot disabled\n");
+			return;
+		}
+
 		KASSERT(unit < MAXCPUS);
 		ci = &cpu_info_store[unit];
 
@@ -485,6 +492,9 @@ cpu_setup_sysctl(device_t dv, struct cpu
 void
 cpu_boot_secondary_processors(void)
 {
+	if ((boothowto & RB_MD1) != 0)
+		return;
+
 	mutex_init(&cpu_hatch_lock, MUTEX_DEFAULT, IPL_NONE);
 
 	VPRINTF("%s: writing mbox with %#x\n", __func__, arm_cpu_hatched);

Index: src/sys/arch/evbarm/fdt/fdt_machdep.c
diff -u src/sys/arch/evbarm/fdt/fdt_machdep.c:1.55 src/sys/arch/evbarm/fdt/fdt_machdep.c:1.56
--- src/sys/arch/evbarm/fdt/fdt_machdep.c:1.55	Thu Nov 15 23:53:40 2018
+++ src/sys/arch/evbarm/fdt/fdt_machdep.c	Wed Nov 28 09:16:19 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_machdep.c,v 1.55 2018/11/15 23:53:40 jmcneill Exp $ */
+/* $NetBSD: fdt_machdep.c,v 1.56 2018/11/28 09:16:19 ryo Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.55 2018/11/15 23:53:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_machdep.c,v 1.56 2018/11/28 09:16:19 ryo Exp $");
 
 #include "opt_machdep.h"
 #include "opt_bootconfig.h"
@@ -545,9 +545,11 @@ initarm(void *arg)
 	u_int sp = initarm_common(KERNEL_VM_BASE, KERNEL_VM_SIZE, fdt_physmem,
 	 nfdt_physmem);
 
-	VPRINTF("mpstart\n");
-	if (plat->ap_mpstart)
-		plat->ap_mpstart();
+	if ((boothowto & RB_MD1) == 0) {
+		VPRINTF("mpstart\n");
+		if (plat->ap_mpstart)
+			plat->ap_mpstart();
+	}
 
 	/*
 	 * Now we have APs started the pages used for stacks and L1PT can



CVS commit: src/sys/dev/pckbport

2018-11-28 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Wed Nov 28 09:14:03 UTC 2018

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
* Increase minimum finger width to prevent entering scroll mode erroneously
* Attempt to clarify what the sysctl variables for finger scroll do
* Add hysteresis to validity check so changing it does not get rejected

Thanks to Martin Husemann and Michael van Elst for reporting the issues.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pckbport/synaptics.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.44 src/sys/dev/pckbport/synaptics.c:1.45
--- src/sys/dev/pckbport/synaptics.c:1.44	Tue Nov  6 09:13:17 2018
+++ src/sys/dev/pckbport/synaptics.c	Wed Nov 28 09:14:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.44 2018/11/06 09:13:17 blymn Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.45 2018/11/28 09:14:03 blymn Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.44 2018/11/06 09:13:17 blymn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.45 2018/11/28 09:14:03 blymn Exp $");
 
 #include 
 #include 
@@ -120,8 +120,8 @@ static int synaptics_max_speed_x = 32;
 static int synaptics_max_speed_y = 32;
 static int synaptics_max_speed_z = 2;
 static int synaptics_movement_threshold = 4;
-static int synaptics_fscroll_min = 5;
-static int synaptics_fscroll_max = 12;
+static int synaptics_fscroll_min = 13;
+static int synaptics_fscroll_max = 14;
 static int synaptics_dz_hold = 30;
 static int synaptics_movement_enable = 1;
 
@@ -793,7 +793,7 @@ pms_sysctl_synaptics(struct sysctllog **
 	if ((rc = sysctl_createv(clog, 0, NULL, &node,
 	CTLFLAG_PERMANENT | CTLFLAG_READWRITE,
 	CTLTYPE_INT, "finger_scroll-min",
-	SYSCTL_DESCR("Minimum width for finger scrolling detection"),
+	SYSCTL_DESCR("Minimum width at which y cursor movements will be converted to scroll wheel events"),
 	pms_sysctl_synaptics_verify, 0,
 	&synaptics_fscroll_min,
 	0, CTL_HW, root_num, CTL_CREATE,
@@ -805,7 +805,7 @@ pms_sysctl_synaptics(struct sysctllog **
 	if ((rc = sysctl_createv(clog, 0, NULL, &node,
 	CTLFLAG_PERMANENT | CTLFLAG_READWRITE,
 	CTLTYPE_INT, "finger_scroll-max",
-	SYSCTL_DESCR("Maximum width for finger scrolling detection"),
+	SYSCTL_DESCR("Maximum width at which y cursor movements will be converted to scroll wheel events"),
 	pms_sysctl_synaptics_verify, 0,
 	&synaptics_fscroll_max,
 	0, CTL_HW, root_num, CTL_CREATE,
@@ -817,7 +817,7 @@ pms_sysctl_synaptics(struct sysctllog **
 	if ((rc = sysctl_createv(clog, 0, NULL, &node,
 	CTLFLAG_PERMANENT | CTLFLAG_READWRITE,
 	CTLTYPE_INT, "finger_scroll-hysteresis",
-	SYSCTL_DESCR("Number of packets to stay in finger scroll mode"),
+	SYSCTL_DESCR("Number of packets to keep reporting y cursor movements as scroll wheel events"),
 	pms_sysctl_synaptics_verify, 0,
 	&synaptics_dz_hold,
 	0, CTL_HW, root_num, CTL_CREATE,
@@ -903,6 +903,10 @@ pms_sysctl_synaptics_verify(SYSCTLFN_ARG
 		if ((t < 5) || (t > 14))
 			return (EINVAL);
 	} else
+	if (node.sysctl_num == synaptics_dz_hold_nodenum) {
+		if (t < 0)
+			return (EINVAL);
+	} else
 	if (node.sysctl_num == synaptics_movement_enable_nodenum) {
 		if (t < 0 || t > 1)
 			return (EINVAL);



CVS commit: src/sys/dev/pci

2018-11-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 28 08:26:07 UTC 2018

Modified Files:
src/sys/dev/pci: pcireg.h

Log Message:
 The register offset of the mask and pending register is depend on the 64bit
address capable bit, so fix the definition of PCI MSI vector mask and pending
register. This problem was not a real bug because PCI_MSI{MASK,PENDING} were
not used from anywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/dev/pci/pcireg.h

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

Modified files:

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.143 src/sys/dev/pci/pcireg.h:1.144
--- src/sys/dev/pci/pcireg.h:1.143	Mon Nov  5 03:51:31 2018
+++ src/sys/dev/pci/pcireg.h	Wed Nov 28 08:26:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.143 2018/11/05 03:51:31 msaitoh Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.144 2018/11/28 08:26:07 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -671,8 +671,12 @@ typedef u_int8_t pci_revision_t;
 #define	PCI_MSI_MDATA64		0xc	/* 64-bit Message Data Register
 	 * offset
 	 */
-#define	PCI_MSI_MASK		0x10	/* Vector Mask register */
-#define	PCI_MSI_PENDING		0x14	/* Vector Pending register */
+
+#define	PCI_MSI_MASK		0x0c	/* Vector Mask register */
+#define	PCI_MSI_MASK64		0x10	/* 64-bit Vector Mask register */
+
+#define	PCI_MSI_PENDING		0x10	/* Vector Pending register */
+#define	PCI_MSI_PENDING64	0x14	/* 64-bit Vector Pending register */
 
 #define	PCI_MSI_CTL_MASK	__BITS(31, 16)
 #define	PCI_MSI_CTL_EXTMDATA_EN	__SHIFTIN(__BIT(10), PCI_MSI_CTL_MASK)



CVS commit: src/sys/dev/pci

2018-11-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 28 08:19:19 UTC 2018

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

Log Message:
 Fix comment. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.601 -r1.602 src/sys/dev/pci/if_wm.c

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.601 src/sys/dev/pci/if_wm.c:1.602
--- src/sys/dev/pci/if_wm.c:1.601	Thu Nov 22 15:09:46 2018
+++ src/sys/dev/pci/if_wm.c	Wed Nov 28 08:19:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.601 2018/11/22 15:09:46 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.602 2018/11/28 08:19:19 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.601 2018/11/22 15:09:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.602 2018/11/28 08:19:19 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -14733,7 +14733,7 @@ wm_k1_gig_workaround_hv(struct wm_softc 
 }
 
 /*
- *  wm_k1_gig_workaround_lv - K1 Si workaround
+ *  wm_k1_workaround_lv - K1 Si workaround
  *  @sc:   pointer to the HW structure
  *
  *  Workaround to set the K1 beacon duration for 82579 parts in 10Mbps



CVS commit: src/sys/arch/aarch64/aarch64

2018-11-28 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Nov 28 08:16:46 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: db_machdep.c

Log Message:
don't pass illegal cpu index to cpu_lookup(). it may cause KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/aarch64/aarch64/db_machdep.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/db_machdep.c
diff -u src/sys/arch/aarch64/aarch64/db_machdep.c:1.9 src/sys/arch/aarch64/aarch64/db_machdep.c:1.10
--- src/sys/arch/aarch64/aarch64/db_machdep.c:1.9	Fri Oct 12 01:28:57 2018
+++ src/sys/arch/aarch64/aarch64/db_machdep.c	Wed Nov 28 08:16:46 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.c,v 1.9 2018/10/12 01:28:57 ryo Exp $ */
+/* $NetBSD: db_machdep.c,v 1.10 2018/11/28 08:16:46 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.9 2018/10/12 01:28:57 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.10 2018/11/28 08:16:46 ryo Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd32.h"
@@ -761,14 +761,16 @@ void
 db_md_switch_cpu_cmd(db_expr_t addr, bool have_addr, db_expr_t count,
 const char *modif)
 {
-	if (addr >= ncpu) {
-		db_printf("cpu %"DDB_EXPR_FMT"d out of range", addr);
+	u_int cpuno = (u_int)addr;
+
+	if (!have_addr || (cpuno >= ncpu)) {
+		db_printf("cpu: 0..%d\n", ncpu - 1);
 		return;
 	}
 
-	struct cpu_info *new_ci = cpu_lookup(addr);
+	struct cpu_info *new_ci = cpu_lookup(cpuno);
 	if (new_ci == NULL) {
-		db_printf("cpu %"DDB_EXPR_FMT"d does not exist", addr);
+		db_printf("cpu %u does not exist", cpuno);
 		return;
 	}
 



CVS commit: src/sys/arch/aarch64/aarch64

2018-11-28 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Wed Nov 28 08:12:16 UTC 2018

Modified Files:
src/sys/arch/aarch64/aarch64: exec_machdep.c

Log Message:
don't exec 32bit binary on the cpu that has no aarch32.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/aarch64/aarch64/exec_machdep.c

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

Modified files:

Index: src/sys/arch/aarch64/aarch64/exec_machdep.c
diff -u src/sys/arch/aarch64/aarch64/exec_machdep.c:1.3 src/sys/arch/aarch64/aarch64/exec_machdep.c:1.4
--- src/sys/arch/aarch64/aarch64/exec_machdep.c:1.3	Fri Oct 12 01:28:57 2018
+++ src/sys/arch/aarch64/aarch64/exec_machdep.c	Wed Nov 28 08:12:15 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_machdep.c,v 1.3 2018/10/12 01:28:57 ryo Exp $ */
+/* $NetBSD: exec_machdep.c,v 1.4 2018/11/28 08:12:15 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: exec_machdep.c,v 1.3 2018/10/12 01:28:57 ryo Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exec_machdep.c,v 1.4 2018/11/28 08:12:15 ryo Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_compat_netbsd32.h"
@@ -75,6 +75,14 @@ aarch64_netbsd_elf32_probe(struct lwp *l
 	if (!elf_aapcs_p)
 		return ENOEXEC;
 
+	/*
+	 * require aarch32 feature.
+	 * XXX should consider some cluster may have no aarch32?
+	 */
+	if (__SHIFTOUT(l->l_cpu->ci_id.ac_aa64pfr0, ID_AA64PFR0_EL1_EL0) !=
+	ID_AA64PFR0_EL1_EL0_64_32)
+		return ENOEXEC;
+
 	return 0;
 }
 #endif