CVS commit: src/usr.sbin/npf/npfctl

2016-05-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Tue May 24 05:46:57 UTC 2016

Modified Files:
src/usr.sbin/npf/npfctl: npfctl.8

Log Message:
Fix typo. From Michael Scherer in PR 51162.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/npf/npfctl/npfctl.8

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

Modified files:

Index: src/usr.sbin/npf/npfctl/npfctl.8
diff -u src/usr.sbin/npf/npfctl/npfctl.8:1.17 src/usr.sbin/npf/npfctl/npfctl.8:1.18
--- src/usr.sbin/npf/npfctl/npfctl.8:1.17	Sun Aug  3 00:02:56 2014
+++ src/usr.sbin/npf/npfctl/npfctl.8	Tue May 24 05:46:57 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: npfctl.8,v 1.17 2014/08/03 00:02:56 rmind Exp $
+.\"	$NetBSD: npfctl.8,v 1.18 2016/05/24 05:46:57 wiz Exp $
 .\"
 .\" Copyright (c) 2009-2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -138,7 +138,7 @@ List all entries in the currently loaded
 This operation is expensive and should be used with caution.
 .\" ---
 .It Ic save
-Save the active configuration and a spanshot of the current connections.
+Save the active configuration and a snapshot of the current connections.
 The data will be stored in the
 .Pa /var/db/npf.db
 file.



CVS commit: src/external/gpl3/gdb/dist

2016-05-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 24 00:50:54 UTC 2016

Modified Files:
src/external/gpl3/gdb/dist/bfd: elf.c
src/external/gpl3/gdb/dist/include/elf: common.h

Log Message:
Read and load the aux vector from a core file


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gdb/dist/bfd/elf.c
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/gpl3/gdb/dist/include/elf/common.h

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

Modified files:

Index: src/external/gpl3/gdb/dist/bfd/elf.c
diff -u src/external/gpl3/gdb/dist/bfd/elf.c:1.6 src/external/gpl3/gdb/dist/bfd/elf.c:1.7
--- src/external/gpl3/gdb/dist/bfd/elf.c:1.6	Tue Feb  2 22:23:27 2016
+++ src/external/gpl3/gdb/dist/bfd/elf.c	Mon May 23 20:50:53 2016
@@ -9241,6 +9241,20 @@ elfcore_grok_netbsd_note (bfd *abfd, Elf
   return elfcore_grok_netbsd_procinfo (abfd, note);
 }
 
+  if (note->type == NT_NETBSDCORE_AUXV)
+{
+  asection *sect = bfd_make_section_anyway_with_flags (abfd, ".auxv",
+			   SEC_HAS_CONTENTS);
+
+  if (sect == NULL)
+	return FALSE;
+  sect->size = note->descsz;
+  sect->filepos = note->descpos;
+  sect->alignment_power = 1 + bfd_get_arch_size (abfd) / 32;
+
+  return TRUE;
+}
+
   /* As of Jan 2002 there are no other machine-independent notes
  defined for NetBSD core files.  If the note type is less
  than the start of the machine-dependent note types, we don't

Index: src/external/gpl3/gdb/dist/include/elf/common.h
diff -u src/external/gpl3/gdb/dist/include/elf/common.h:1.1.1.5 src/external/gpl3/gdb/dist/include/elf/common.h:1.2
--- src/external/gpl3/gdb/dist/include/elf/common.h:1.1.1.5	Tue Feb  2 21:59:34 2016
+++ src/external/gpl3/gdb/dist/include/elf/common.h	Mon May 23 20:50:54 2016
@@ -598,6 +598,7 @@
must start with "NetBSD-CORE".  */
 
 #define NT_NETBSDCORE_PROCINFO	1	/* Has a struct procinfo */
+#define NT_NETBSDCORE_AUXV	2	/* Has a copy of Elfxx_auxv_t */
 #define NT_NETBSDCORE_FIRSTMACH	32	/* start of machdep note types */
 
 



CVS commit: src/sys

2016-05-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 24 00:49:56 UTC 2016

Modified Files:
src/sys/kern: core_elf32.c
src/sys/sys: exec_elf.h

Log Message:
Add a note for the auxv array so we can find our load location from a
core file of a PIE binary.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/kern/core_elf32.c
cvs rdiff -u -r1.153 -r1.154 src/sys/sys/exec_elf.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/core_elf32.c
diff -u src/sys/kern/core_elf32.c:1.45 src/sys/kern/core_elf32.c:1.46
--- src/sys/kern/core_elf32.c:1.45	Wed Apr  2 13:19:49 2014
+++ src/sys/kern/core_elf32.c	Mon May 23 20:49:56 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: core_elf32.c,v 1.45 2014/04/02 17:19:49 matt Exp $	*/
+/*	$NetBSD: core_elf32.c,v 1.46 2016/05/24 00:49:56 christos Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.45 2014/04/02 17:19:49 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.46 2016/05/24 00:49:56 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_coredump.h"
@@ -343,12 +343,11 @@ ELFNAMEEND(coredump_getseghdrs)(struct u
 	return (0);
 }
 
-static int
-ELFNAMEEND(coredump_notes)(struct lwp *l, struct note_state *ns)
+static void
+coredump_note_procinfo(struct lwp *l, struct note_state *ns)
 {
 	struct proc *p;
 	struct netbsd_elfcore_procinfo cpi;
-	int error;
 	struct lwp *l0;
 	sigset_t ss1, ss2;
 
@@ -398,6 +397,54 @@ ELFNAMEEND(coredump_notes)(struct lwp *l
 
 	ELFNAMEEND(coredump_savenote)(ns, ELF_NOTE_NETBSD_CORE_PROCINFO,
 	ELF_NOTE_NETBSD_CORE_NAME, , sizeof(cpi));
+}
+
+static int
+coredump_note_auxv(struct lwp *l, struct note_state *ns)
+{
+	struct ps_strings pss;
+	int error;
+	struct proc *p = l->l_proc;
+	struct vmspace *vm;
+	void *uauxv, *kauxv;
+	size_t len;
+
+	if ((error = copyin_psstrings(p, )) != 0)
+		return error;
+
+	if (pss.ps_envstr == NULL)
+		return EIO;
+
+vm = p->p_vmspace;
+	uvmspace_addref(vm);
+
+	len = p->p_execsw->es_arglen * sizeof(char *);
+	uauxv = (void *)(pss.ps_envstr + pss.ps_nenvstr + 1);
+	kauxv = kmem_alloc(len, KM_SLEEP);
+	error = copyin_vmspace(vm, uauxv, kauxv, len);
+
+	uvmspace_free(vm);
+
+	if (error == 0) {
+		ELFNAMEEND(coredump_savenote)(ns, ELF_NOTE_NETBSD_CORE_AUXV,
+		ELF_NOTE_NETBSD_CORE_NAME, kauxv, len);
+	}
+	
+	kmem_free(kauxv, len);
+	return error;
+}
+
+static int
+ELFNAMEEND(coredump_notes)(struct lwp *l, struct note_state *ns)
+{
+	int error;
+	struct lwp *l0;
+	struct proc *p = l->l_proc;
+
+	coredump_note_procinfo(l, ns);
+	error = coredump_note_auxv(l, ns);
+	if (error)
+		return error;
 
 	/* XXX Add hook for machdep per-proc notes. */
 
@@ -407,7 +454,7 @@ ELFNAMEEND(coredump_notes)(struct lwp *l
 	 */
 	error = ELFNAMEEND(coredump_note)(l, ns);
 	if (error)
-		return (error);
+		return error;
 
 	/*
 	 * Now, for each LWP, write the register info and any other

Index: src/sys/sys/exec_elf.h
diff -u src/sys/sys/exec_elf.h:1.153 src/sys/sys/exec_elf.h:1.154
--- src/sys/sys/exec_elf.h:1.153	Fri Feb 19 15:45:21 2016
+++ src/sys/sys/exec_elf.h	Mon May 23 20:49:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec_elf.h,v 1.153 2016/02/19 20:45:21 christos Exp $	*/
+/*	$NetBSD: exec_elf.h,v 1.154 2016/05/24 00:49:55 christos Exp $	*/
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -975,6 +975,8 @@ typedef struct {
  *
  *	ELF_NOTE_NETBSD_CORE_PROCINFO
  *		Note is a "netbsd_elfcore_procinfo" structure.
+ *	ELF_NOTE_NETBSD_CORE_AUXV
+ *		Note is an array of AuxInfo structures.
  *
  * We also use ptrace(2) request numbers (the ones that exist in
  * machine-dependent space) to identify register info notes.  The
@@ -988,6 +990,7 @@ typedef struct {
 #define ELF_NOTE_NETBSD_CORE_NAME	"NetBSD-CORE"
 
 #define ELF_NOTE_NETBSD_CORE_PROCINFO	1
+#define ELF_NOTE_NETBSD_CORE_AUXV	2
 
 #define NETBSD_ELFCORE_PROCINFO_VERSION 1
 



CVS commit: src/sys/dev/pci

2016-05-23 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Mon May 23 23:36:02 UTC 2016

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

Log Message:
Update TODO: evcnt


To generate a diff of this commit:
cvs rdiff -u -r1.409 -r1.410 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.409 src/sys/dev/pci/if_wm.c:1.410
--- src/sys/dev/pci/if_wm.c:1.409	Mon May 23 04:07:29 2016
+++ src/sys/dev/pci/if_wm.c	Mon May 23 23:36:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.409 2016/05/23 04:07:29 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.410 2016/05/23 23:36:02 knakahara Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -81,10 +81,11 @@
  *	- Set LED correctly (based on contents in EEPROM)
  *	- Rework how parameters are loaded from the EEPROM.
  *	- Image Unique ID
+ *	- restructure evcnt
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.409 2016/05/23 04:07:29 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.410 2016/05/23 23:36:02 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"



CVS commit: src/sys/arch/i386/stand/misc

2016-05-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon May 23 18:36:06 UTC 2016

Modified Files:
src/sys/arch/i386/stand/misc: rawr32.exe.uue

Log Message:
New Rawrite32 release


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/misc/rawr32.exe.uue

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

diffs are larger than 1MB and have been omitted


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

2016-05-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon May 23 18:21:14 UTC 2016

Modified Files:
src/sys/arch/arm/nvidia: tegra_ehci.c

Log Message:
IST_MPSAFE is not a valid flag for fdtbus_intr_establish; use
FDT_INTR_MPSAFE instead.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/nvidia/tegra_ehci.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/nvidia/tegra_ehci.c
diff -u src/sys/arch/arm/nvidia/tegra_ehci.c:1.13 src/sys/arch/arm/nvidia/tegra_ehci.c:1.14
--- src/sys/arch/arm/nvidia/tegra_ehci.c:1.13	Sat Apr 23 10:15:28 2016
+++ src/sys/arch/arm/nvidia/tegra_ehci.c	Mon May 23 18:21:14 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_ehci.c,v 1.13 2016/04/23 10:15:28 skrll Exp $ */
+/* $NetBSD: tegra_ehci.c,v 1.14 2016/05/23 18:21:14 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_ehci.c,v 1.13 2016/04/23 10:15:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_ehci.c,v 1.14 2016/05/23 18:21:14 jmcneill Exp $");
 
 #include 
 #include 
@@ -126,8 +126,8 @@ tegra_ehci_attach(device_t parent, devic
 		return;
 	}
 
-	sc->sc_ih = fdtbus_intr_establish(faa->faa_phandle, 0, IPL_USB, IST_MPSAFE,
-	ehci_intr, >sc);
+	sc->sc_ih = fdtbus_intr_establish(faa->faa_phandle, 0, IPL_USB,
+	FDT_INTR_MPSAFE, ehci_intr, >sc);
 	if (sc->sc_ih == NULL) {
 		aprint_error_dev(self, "couldn't establish interrupt on %s\n",
 		intrstr);



CVS commit: src/sys/kern

2016-05-23 Thread Thor Lancelot Simon
Module Name:src
Committed By:   tls
Date:   Mon May 23 13:54:34 UTC 2016

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

Log Message:
Fix a longstanding problem with accept filters noticed by Timo Buhrmester:
sockets sitting in the accept filter can consume the entire listen queue,
such that the application is never able to handle any connections.  Handle
this by simply passing through the oldest queued cxn when the queue is full.

This is fair because the longer a cxn lingers in the queue (stays connected
but does not meet the requirements of the filter for passage) the more likely
it is to be passed through, at which point the application can dispose of it.

Works because none of our accept filters actually allocate private state
per-cxn.  If they did, we'd have to fix the API bug that there is presently
no way to tell an accf to finish/deallocate for a single cxn (accf_destroy
kills off the entire filter instance for a given listen socket).


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/kern/uipc_socket2.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/uipc_socket2.c
diff -u src/sys/kern/uipc_socket2.c:1.122 src/sys/kern/uipc_socket2.c:1.123
--- src/sys/kern/uipc_socket2.c:1.122	Mon Aug 24 22:21:26 2015
+++ src/sys/kern/uipc_socket2.c	Mon May 23 13:54:34 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket2.c,v 1.122 2015/08/24 22:21:26 pooka Exp $	*/
+/*	$NetBSD: uipc_socket2.c,v 1.123 2016/05/23 13:54:34 tls Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.122 2015/08/24 22:21:26 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket2.c,v 1.123 2016/05/23 13:54:34 tls Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -262,8 +262,37 @@ sonewconn(struct socket *head, bool sore
 	KASSERT(solocked(head));
 
 	if (head->so_qlen + head->so_q0len > 3 * head->so_qlimit / 2) {
-		/* Listen queue overflow. */
-		return NULL;
+		/*
+		 * Listen queue overflow.  If there is an accept filter
+		 * active, pass through the oldest cxn it's handling.
+		 */
+		if (head->so_accf == NULL) {
+			return NULL;
+		} else {
+			struct socket *so2, *next;
+
+			/* Pass the oldest connection waiting in the
+			   accept filter */
+			for (so2 = TAILQ_FIRST(>so_q0);
+			 so2 != NULL; so2 = next) {
+next = TAILQ_NEXT(so2, so_qe);
+if (so2->so_upcall == NULL) {
+	continue;
+}
+so2->so_upcall = NULL;
+so2->so_upcallarg = NULL;
+so2->so_options &= ~SO_ACCEPTFILTER;
+so2->so_rcv.sb_flags &= ~SB_UPCALL;
+soisconnected(so2);
+break;
+			}
+
+			/* If nothing was nudged out of the acept filter, bail
+			 * out; otherwise proceed allocating the socket. */
+			if (so2 == NULL) {
+return NULL;
+			}
+		}
 	}
 	if ((head->so_options & SO_ACCEPTFILTER) != 0) {
 		soready = false;



CVS commit: src/share/misc

2016-05-23 Thread Guilherme Salazar
Module Name:src
Committed By:   salazar
Date:   Mon May 23 11:41:06 UTC 2016

Modified Files:
src/share/misc: style

Log Message:
fix spelling mistakes


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/share/misc/style

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

Modified files:

Index: src/share/misc/style
diff -u src/share/misc/style:1.52 src/share/misc/style:1.53
--- src/share/misc/style:1.52	Sat Oct 24 15:46:09 2015
+++ src/share/misc/style	Mon May 23 11:41:06 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: style,v 1.52 2015/10/24 15:46:09 christos Exp $ */
+/* $NetBSD: style,v 1.53 2016/05/23 11:41:06 salazar Exp $ */
 
 /*
  * The revision control tag appears first, with a blank line after it.
@@ -30,7 +30,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: style,v 1.52 2015/10/24 15:46:09 christos Exp $");
+__RCSID("$NetBSD: style,v 1.53 2016/05/23 11:41:06 salazar Exp $");
 
 /*
  * VERY important single-line comments look like this.
@@ -367,7 +367,7 @@ function(int a1, int a2, float fl, int a
 	 * where we don't have control over the NULL definition (on NetBSD
 	 * it is defined as ((void *)0), but on other systems it can be
 	 * defined as (0) and both definitions are valid under ANSI C), it
-	 * it advised to cast NULL to a pointer on varyadic functions,
+	 * it advised to cast NULL to a pointer on variadic functions,
 	 * because on machines where sizeof(pointer) != sizeof(int) and in
 	 * the absence of a prototype in scope, passing an un-casted NULL,
 	 * will result in passing an int on the stack instead of a pointer.
@@ -414,7 +414,7 @@ dirinfo(const char *p, struct stat *sb, 
 		err(1, "Unable to stat %s", p);
 
 	/*
-	 * To printf quantities that might be larger that "long", include
+	 * To printf quantities that might be larger than "long", include
 	 * , cast quantities to intmax_t or uintmax_t and use
 	 * PRI?MAX constants.
 	 */