CVS commit: src/crypto/external/bsd/openssh/dist

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:35:16 UTC 2015

Modified Files:
src/crypto/external/bsd/openssh/dist: sftp.c

Log Message:
CID 996110: Fix memory leak


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/crypto/external/bsd/openssh/dist/sftp.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/sftp.c
diff -u src/crypto/external/bsd/openssh/dist/sftp.c:1.14 src/crypto/external/bsd/openssh/dist/sftp.c:1.15
--- src/crypto/external/bsd/openssh/dist/sftp.c:1.14	Fri Apr  3 19:58:19 2015
+++ src/crypto/external/bsd/openssh/dist/sftp.c	Mon Apr 13 13:35:16 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sftp.c,v 1.14 2015/04/03 23:58:19 christos Exp $	*/
+/*	$NetBSD: sftp.c,v 1.15 2015/04/13 17:35:16 christos Exp $	*/
 /* $OpenBSD: sftp.c,v 1.170 2015/01/20 23:14:00 deraadt Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller d...@openbsd.org
@@ -17,7 +17,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: sftp.c,v 1.14 2015/04/03 23:58:19 christos Exp $);
+__RCSID($NetBSD: sftp.c,v 1.15 2015/04/13 17:35:16 christos Exp $);
 #include sys/param.h	/* MIN MAX */
 #include sys/types.h
 #include sys/ioctl.h
@@ -732,6 +732,8 @@ process_put(struct sftp_conn *conn, char
 			fflag || global_fflag) == -1)
 err = -1;
 		}
+		free(abs_dst);
+		abs_dst = NULL;
 	}
 
 out:



CVS commit: src/sys/external/bsd/acpica/conf

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:23:39 UTC 2015

Modified Files:
src/sys/external/bsd/acpica/conf: files.acpica

Log Message:
update for new acpica


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/acpica/conf/files.acpica

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/acpica/conf/files.acpica
diff -u src/sys/external/bsd/acpica/conf/files.acpica:1.7 src/sys/external/bsd/acpica/conf/files.acpica:1.8
--- src/sys/external/bsd/acpica/conf/files.acpica:1.7	Sat Oct 25 17:00:06 2014
+++ src/sys/external/bsd/acpica/conf/files.acpica	Mon Apr 13 13:23:39 2015
@@ -1,11 +1,12 @@
-# $NetBSD: files.acpica,v 1.7 2014/10/25 21:00:06 christos Exp $
+# $NetBSD: files.acpica,v 1.8 2015/04/13 17:23:39 christos Exp $
 
 define		acpica
 makeoptions	acpi	CPPFLAGS+=-I$S/external/bsd/acpica/dist/include
 
 # common/
 file	external/bsd/acpica/dist/common/ahids.c			acpica
-file	external/bsd/acpica/dist/common/ahuuids.c		acpica
+file	external/bsd/acpica/dist/common/ahuuids.c		acpica  acpi_debug  ddb
+
 
 # debugger/
 file	external/bsd/acpica/dist/debugger/dbcmds.c		acpica  acpi_debug  ddb
@@ -24,6 +25,7 @@ file	external/bsd/acpica/dist/debugger/d
 
 # disassembler/
 file	external/bsd/acpica/dist/disassembler/dmbuffer.c	acpica  acpi_debug  ddb
+file	external/bsd/acpica/dist/disassembler/dmcstyle.c	acpica  acpi_debug  ddb
 file	external/bsd/acpica/dist/disassembler/dmdeferred.c	acpica  acpi_debug  ddb
 file	external/bsd/acpica/dist/disassembler/dmnames.c		acpica  acpi_debug  ddb
 file	external/bsd/acpica/dist/disassembler/dmobject.c	acpica  acpi_debug  ddb



CVS commit: src/crypto/external/bsd/openssh/dist

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:54:52 UTC 2015

Modified Files:
src/crypto/external/bsd/openssh/dist: ssh-keyscan.c

Log Message:
CID 1293644: Check returns


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/crypto/external/bsd/openssh/dist/ssh-keyscan.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/ssh-keyscan.c
diff -u src/crypto/external/bsd/openssh/dist/ssh-keyscan.c:1.12 src/crypto/external/bsd/openssh/dist/ssh-keyscan.c:1.13
--- src/crypto/external/bsd/openssh/dist/ssh-keyscan.c:1.12	Sat Apr  4 09:59:20 2015
+++ src/crypto/external/bsd/openssh/dist/ssh-keyscan.c	Mon Apr 13 13:54:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssh-keyscan.c,v 1.12 2015/04/04 13:59:20 christos Exp $	*/
+/*	$NetBSD: ssh-keyscan.c,v 1.13 2015/04/13 17:54:52 christos Exp $	*/
 /* $OpenBSD: ssh-keyscan.c,v 1.99 2015/01/30 10:44:49 djm Exp $ */
 /*
  * Copyright 1995, 1996 by David Mazieres d...@lcs.mit.edu.
@@ -9,7 +9,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: ssh-keyscan.c,v 1.12 2015/04/04 13:59:20 christos Exp $);
+__RCSID($NetBSD: ssh-keyscan.c,v 1.13 2015/04/13 17:54:52 christos Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -284,6 +284,7 @@ static void
 keyprint(con *c, struct sshkey *key)
 {
 	char *host = c-c_output_name ? c-c_output_name : c-c_name;
+	int r;
 
 	if (!key)
 		return;
@@ -291,7 +292,9 @@ keyprint(con *c, struct sshkey *key)
 		fatal(host_hash failed);
 
 	fprintf(stdout, %s , host);
-	sshkey_write(key, stdout);
+	if ((r = sshkey_write(key, stdout)) != 0)
+		fprintf(stderr, key_write failed: %s, ssh_err(r));
+
 	fputs(\n, stdout);
 }
 



CVS commit: src/crypto/external/bsd/openssh/dist

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:59:21 UTC 2015

Modified Files:
src/crypto/external/bsd/openssh/dist: clientloop.c

Log Message:
CID 1293652: Forward NULL deref


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/crypto/external/bsd/openssh/dist/clientloop.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/clientloop.c
diff -u src/crypto/external/bsd/openssh/dist/clientloop.c:1.12 src/crypto/external/bsd/openssh/dist/clientloop.c:1.13
--- src/crypto/external/bsd/openssh/dist/clientloop.c:1.12	Fri Apr  3 19:58:19 2015
+++ src/crypto/external/bsd/openssh/dist/clientloop.c	Mon Apr 13 13:59:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: clientloop.c,v 1.12 2015/04/03 23:58:19 christos Exp $	*/
+/*	$NetBSD: clientloop.c,v 1.13 2015/04/13 17:59:21 christos Exp $	*/
 /* $OpenBSD: clientloop.c,v 1.272 2015/02/25 19:54:02 djm Exp $ */
 /*
  * Author: Tatu Ylonen y...@cs.hut.fi
@@ -61,7 +61,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: clientloop.c,v 1.12 2015/04/03 23:58:19 christos Exp $);
+__RCSID($NetBSD: clientloop.c,v 1.13 2015/04/13 17:59:21 christos Exp $);
 
 #include sys/param.h	/* MIN MAX */
 #include sys/types.h
@@ -1594,7 +1594,8 @@ client_loop(int have_pty, int escape_cha
 			channel_after_select(readset, writeset);
 			if (need_rekeying || packet_need_rekeying()) {
 debug(need rekeying);
-active_state-kex-done = 0;
+if (active_state-kex != NULL)
+	active_state-kex-done = 0;
 if ((r = kex_send_kexinit(active_state)) != 0)
 	fatal(%s: kex_send_kexinit: %s,
 	__func__, ssh_err(r));



CVS commit: src/crypto/external/bsd/openssh/dist

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:38:20 UTC 2015

Modified Files:
src/crypto/external/bsd/openssh/dist: packet.c

Log Message:
CID 1018734: Fix uninit


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/crypto/external/bsd/openssh/dist/packet.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/packet.c
diff -u src/crypto/external/bsd/openssh/dist/packet.c:1.17 src/crypto/external/bsd/openssh/dist/packet.c:1.18
--- src/crypto/external/bsd/openssh/dist/packet.c:1.17	Wed Apr  8 11:49:46 2015
+++ src/crypto/external/bsd/openssh/dist/packet.c	Mon Apr 13 13:38:20 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: packet.c,v 1.17 2015/04/08 15:49:46 christos Exp $	*/
+/*	$NetBSD: packet.c,v 1.18 2015/04/13 17:38:20 christos Exp $	*/
 /* $OpenBSD: packet.c,v 1.208 2015/02/13 18:57:00 markus Exp $ */
 /*
  * Author: Tatu Ylonen y...@cs.hut.fi
@@ -39,7 +39,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: packet.c,v 1.17 2015/04/08 15:49:46 christos Exp $);
+__RCSID($NetBSD: packet.c,v 1.18 2015/04/13 17:38:20 christos Exp $);
 #include sys/param.h	/* MIN roundup */
 #include sys/types.h
 #include sys/queue.h
@@ -1262,7 +1262,7 @@ int
 ssh_packet_read_seqnr(struct ssh *ssh, u_char *typep, u_int32_t *seqnr_p)
 {
 	struct session_state *state = ssh-state;
-	int len, r, ms_remain, cont;
+	int len, r, ms_remain = 0, cont;
 	fd_set *setp;
 	char buf[8192];
 	struct timeval timeout, start, *timeoutp = NULL;



CVS commit: src/external/bsd/acpica/bin/iasl

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:24:24 UTC 2015

Modified Files:
src/external/bsd/acpica/bin/iasl: Makefile

Log Message:
update for newest acpi
XXX: needs recompiled yacc


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/acpica/bin/iasl/Makefile

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

Modified files:

Index: src/external/bsd/acpica/bin/iasl/Makefile
diff -u src/external/bsd/acpica/bin/iasl/Makefile:1.8 src/external/bsd/acpica/bin/iasl/Makefile:1.9
--- src/external/bsd/acpica/bin/iasl/Makefile:1.8	Sat Oct 25 17:01:12 2014
+++ src/external/bsd/acpica/bin/iasl/Makefile	Mon Apr 13 13:24:24 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2014/10/25 21:01:12 christos Exp $
+# $NetBSD: Makefile,v 1.9 2015/04/13 17:24:24 christos Exp $
 
 .if (${MACHINE_ARCH} == i386 || ${MACHINE_ARCH} == x86_64)
 PROG=	iasl
@@ -57,6 +57,8 @@ SRCS+= \
 	asloptions.c \
 	aslpredef.c \
 	aslprepkg.c \
+	aslprintf.c \
+	aslprune.c \
 	aslresource.c \
 	aslrestype1.c \
 	aslrestype1i.c \
@@ -112,6 +114,7 @@ SRCS+=  dbfileio.c
 .PATH: ${TOPDIR}/../disassembler
 SRCS+= \
 	dmbuffer.c \
+	dmcstyle.c \
 	dmdeferred.c \
 	dmnames.c \
 	dmobject.c \



CVS commit: src/doc

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:25:52 UTC 2015

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new acpica


To generate a diff of this commit:
cvs rdiff -u -r1.1218 -r1.1219 src/doc/3RDPARTY
cvs rdiff -u -r1.2066 -r1.2067 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1218 src/doc/3RDPARTY:1.1219
--- src/doc/3RDPARTY:1.1218	Tue Apr  7 13:41:42 2015
+++ src/doc/3RDPARTY	Mon Apr 13 13:25:52 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1218 2015/04/07 17:41:42 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1219 2015/04/13 17:25:52 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -41,7 +41,7 @@
 
 Package:	acpica
 Version:	20140926
-Current Vers:	20140926
+Current Vers:	20150410
 Maintainer:	Intel
 Archive Site:	http://www.acpica.org/downloads/
 Home Page:	http://www.acpica.org/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2066 src/doc/CHANGES:1.2067
--- src/doc/CHANGES:1.2066	Tue Apr  7 13:41:42 2015
+++ src/doc/CHANGES	Mon Apr 13 13:25:52 2015
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.2066 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.2067 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -151,3 +151,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	OpenSSH: Imported 6.8. [christos 20150403]
 	btmagic(4): add Magic Trackpad support [bouyer 20150406]
 	ntp: Import ntp 4.2.8p2. [christos 20150407]
+	acpi(4): Updated ACPICA to 20150410. [christos 20150413]



CVS commit: src/external/bsd/ntp/dist/ntpd

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:45:19 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_shm.c

Log Message:
CID 1269537: Unreachable code


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/ntpd/refclock_shm.c

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

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_shm.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_shm.c:1.4 src/external/bsd/ntp/dist/ntpd/refclock_shm.c:1.5
--- src/external/bsd/ntp/dist/ntpd/refclock_shm.c:1.4	Tue Apr  7 13:34:19 2015
+++ src/external/bsd/ntp/dist/ntpd/refclock_shm.c	Mon Apr 13 13:45:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_shm.c,v 1.4 2015/04/07 17:34:19 christos Exp $	*/
+/*	$NetBSD: refclock_shm.c,v 1.5 2015/04/13 17:45:19 christos Exp $	*/
 
 /*
  * refclock_shm - clock driver for utc via shared memory
@@ -197,9 +197,8 @@ getShmTime(
 		return NULL;
 	}
 
-#endif
-
 	return p;
+#endif
 }
 /*
  * shm_start - attach to shared memory



CVS commit: src/crypto/external/bsd/openssl/dist/apps

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:44:24 UTC 2015

Modified Files:
src/crypto/external/bsd/openssl/dist/apps: s_time.c

Log Message:
CID 1199067: Unchecked return


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/crypto/external/bsd/openssl/dist/apps/s_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/crypto/external/bsd/openssl/dist/apps/s_time.c
diff -u src/crypto/external/bsd/openssl/dist/apps/s_time.c:1.4 src/crypto/external/bsd/openssl/dist/apps/s_time.c:1.5
--- src/crypto/external/bsd/openssl/dist/apps/s_time.c:1.4	Mon Mar 23 06:22:45 2015
+++ src/crypto/external/bsd/openssl/dist/apps/s_time.c	Mon Apr 13 13:44:23 2015
@@ -375,7 +375,11 @@ int MAIN(int argc, char **argv)
 
 if (st_bugs)
 SSL_CTX_set_options(tm_ctx, SSL_OP_ALL);
-SSL_CTX_set_cipher_list(tm_ctx, tm_cipher);
+if (!SSL_CTX_set_cipher_list(tm_ctx, tm_cipher)) {
+	/* BIO_printf(bio_err, Error in cipher list\n); */
+	goto end;
+}
+
 if (!set_cert_stuff(tm_ctx, t_cert_file, t_key_file))
 goto end;
 



CVS commit: src/crypto/external/bsd/openssh/dist

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 18:00:48 UTC 2015

Modified Files:
src/crypto/external/bsd/openssh/dist: serverloop.c

Log Message:
CID 1293655: Forward NULL deref


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/crypto/external/bsd/openssh/dist/serverloop.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/serverloop.c
diff -u src/crypto/external/bsd/openssh/dist/serverloop.c:1.11 src/crypto/external/bsd/openssh/dist/serverloop.c:1.12
--- src/crypto/external/bsd/openssh/dist/serverloop.c:1.11	Mon Apr 13 13:50:31 2015
+++ src/crypto/external/bsd/openssh/dist/serverloop.c	Mon Apr 13 14:00:47 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: serverloop.c,v 1.11 2015/04/13 17:50:31 christos Exp $	*/
+/*	$NetBSD: serverloop.c,v 1.12 2015/04/13 18:00:47 christos Exp $	*/
 /* $OpenBSD: serverloop.c,v 1.178 2015/02/20 22:17:21 djm Exp $ */
 /*
  * Author: Tatu Ylonen y...@cs.hut.fi
@@ -37,7 +37,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: serverloop.c,v 1.11 2015/04/13 17:50:31 christos Exp $);
+__RCSID($NetBSD: serverloop.c,v 1.12 2015/04/13 18:00:47 christos Exp $);
 #include sys/param.h	/* MIN MAX */
 #include sys/types.h
 #include sys/wait.h
@@ -863,8 +863,9 @@ server_loop2(Authctxt *authctxt)
 			if (packet_need_rekeying()) {
 int r;
 debug(need rekeying);
-active_state-kex-done = 0;
- if ((r = kex_send_kexinit(active_state)) != 0)
+if (active_state-kex)
+	active_state-kex-done = 0;
+if ((r = kex_send_kexinit(active_state)) != 0)
 	logit(%s: kex_send_kexinit: %s,
 	__func__, ssh_err(r));
 			}



CVS commit: src/sys/dev/acpi

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 18:32:50 UTC 2015

Modified Files:
src/sys/dev/acpi: acpi_pci.c acpi_resource.c

Log Message:
sync with new acpica struct shuffling.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/acpi/acpi_pci.c
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/acpi/acpi_resource.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/acpi/acpi_pci.c
diff -u src/sys/dev/acpi/acpi_pci.c:1.18 src/sys/dev/acpi/acpi_pci.c:1.19
--- src/sys/dev/acpi/acpi_pci.c:1.18	Fri Dec 31 05:56:39 2010
+++ src/sys/dev/acpi/acpi_pci.c	Mon Apr 13 14:32:50 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_pci.c,v 1.18 2010/12/31 10:56:39 jruoho Exp $ */
+/* $NetBSD: acpi_pci.c,v 1.19 2015/04/13 18:32:50 christos Exp $ */
 
 /*
  * Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_pci.c,v 1.18 2010/12/31 10:56:39 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_pci.c,v 1.19 2015/04/13 18:32:50 christos Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -146,10 +146,10 @@ acpi_pcidev_pciroot_bus_callback(ACPI_RE
 	if (*bus != -1)
 		return AE_ALREADY_EXISTS;
 
-	if (addr64.Minimum  0x)
+	if (addr64.Address.Minimum  0x)
 		return AE_BAD_DATA;
 
-	*bus = (int32_t)addr64.Minimum;
+	*bus = (int32_t)addr64.Address.Minimum;
 
 	return AE_OK;
 }

Index: src/sys/dev/acpi/acpi_resource.c
diff -u src/sys/dev/acpi/acpi_resource.c:1.35 src/sys/dev/acpi/acpi_resource.c:1.36
--- src/sys/dev/acpi/acpi_resource.c:1.35	Thu Jun 30 16:09:39 2011
+++ src/sys/dev/acpi/acpi_resource.c	Mon Apr 13 14:32:50 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi_resource.c,v 1.35 2011/06/30 20:09:39 wiz Exp $	*/
+/*	$NetBSD: acpi_resource.c,v 1.36 2015/04/13 18:32:50 christos Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_resource.c,v 1.35 2011/06/30 20:09:39 wiz Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_resource.c,v 1.36 2015/04/13 18:32:50 christos Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -240,7 +240,7 @@ acpi_resource_parse_callback(ACPI_RESOUR
 
 	case ACPI_RESOURCE_TYPE_ADDRESS32:
 		/* XXX Only fixed size supported for now */
-		if (res-Data.Address32.AddressLength == 0 ||
+		if (res-Data.Address32.Address.AddressLength == 0 ||
 		res-Data.Address32.ProducerConsumer != ACPI_CONSUMER)
 			break;
 #define ADRRESS32_FIXED2(r)		\
@@ -251,30 +251,30 @@ acpi_resource_parse_callback(ACPI_RESOUR
 			if (ADRRESS32_FIXED2(res)) {
 if (ops-memory)
 	(*ops-memory)(arg-dev, arg-context,
-	res-Data.Address32.Minimum,
-	res-Data.Address32.AddressLength);
+	res-Data.Address32.Address.Minimum,
+	res-Data.Address32.Address.AddressLength);
 			} else {
 if (ops-memrange)
 	(*ops-memrange)(arg-dev, arg-context,
-	res-Data.Address32.Minimum,
-	res-Data.Address32.Maximum,
-	res-Data.Address32.AddressLength,
-	res-Data.Address32.Granularity);
+	res-Data.Address32.Address.Minimum,
+	res-Data.Address32.Address.Maximum,
+	res-Data.Address32.Address.AddressLength,
+	res-Data.Address32.Address.Granularity);
 			}
 			break;
 		case ACPI_IO_RANGE:
 			if (ADRRESS32_FIXED2(res)) {
 if (ops-ioport)
 	(*ops-ioport)(arg-dev, arg-context,
-	res-Data.Address32.Minimum,
-	res-Data.Address32.AddressLength);
+	res-Data.Address32.Address.Minimum,
+	res-Data.Address32.Address.AddressLength);
 			} else {
 if (ops-iorange)
 	(*ops-iorange)(arg-dev, arg-context,
-	res-Data.Address32.Minimum,
-	res-Data.Address32.Maximum,
-	res-Data.Address32.AddressLength,
-	res-Data.Address32.Granularity);
+	res-Data.Address32.Address.Minimum,
+	res-Data.Address32.Address.Maximum,
+	res-Data.Address32.Address.AddressLength,
+	res-Data.Address32.Address.Granularity);
 			}
 			break;
 		case ACPI_BUS_NUMBER_RANGE:



CVS commit: src/crypto/external/bsd/openssh/dist

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:50:31 UTC 2015

Modified Files:
src/crypto/external/bsd/openssh/dist: serverloop.c

Log Message:
CID 1293642: Check returns


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/crypto/external/bsd/openssh/dist/serverloop.c

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

Modified files:

Index: src/crypto/external/bsd/openssh/dist/serverloop.c
diff -u src/crypto/external/bsd/openssh/dist/serverloop.c:1.10 src/crypto/external/bsd/openssh/dist/serverloop.c:1.11
--- src/crypto/external/bsd/openssh/dist/serverloop.c:1.10	Fri Apr  3 19:58:19 2015
+++ src/crypto/external/bsd/openssh/dist/serverloop.c	Mon Apr 13 13:50:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: serverloop.c,v 1.10 2015/04/03 23:58:19 christos Exp $	*/
+/*	$NetBSD: serverloop.c,v 1.11 2015/04/13 17:50:31 christos Exp $	*/
 /* $OpenBSD: serverloop.c,v 1.178 2015/02/20 22:17:21 djm Exp $ */
 /*
  * Author: Tatu Ylonen y...@cs.hut.fi
@@ -37,7 +37,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: serverloop.c,v 1.10 2015/04/03 23:58:19 christos Exp $);
+__RCSID($NetBSD: serverloop.c,v 1.11 2015/04/13 17:50:31 christos Exp $);
 #include sys/param.h	/* MIN MAX */
 #include sys/types.h
 #include sys/wait.h
@@ -861,9 +861,12 @@ server_loop2(Authctxt *authctxt)
 		if (!rekeying) {
 			channel_after_select(readset, writeset);
 			if (packet_need_rekeying()) {
+int r;
 debug(need rekeying);
 active_state-kex-done = 0;
-kex_send_kexinit(active_state);
+ if ((r = kex_send_kexinit(active_state)) != 0)
+	logit(%s: kex_send_kexinit: %s,
+	__func__, ssh_err(r));
 			}
 		}
 		process_input(readset);



CVS commit: src/sys/arch/sgimips/mace

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 21:22:34 UTC 2015

Modified Files:
src/sys/arch/sgimips/mace: if_mec.c

Log Message:
Missed a spot: rnd.h - rndsource.h.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/sgimips/mace/if_mec.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/sgimips/mace/if_mec.c
diff -u src/sys/arch/sgimips/mace/if_mec.c:1.50 src/sys/arch/sgimips/mace/if_mec.c:1.51
--- src/sys/arch/sgimips/mace/if_mec.c:1.50	Sun Aug 10 16:44:34 2014
+++ src/sys/arch/sgimips/mace/if_mec.c	Mon Apr 13 21:22:34 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mec.c,v 1.50 2014/08/10 16:44:34 tls Exp $ */
+/* $NetBSD: if_mec.c,v 1.51 2015/04/13 21:22:34 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2004, 2008 Izumi Tsutsui.  All rights reserved.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_mec.c,v 1.50 2014/08/10 16:44:34 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_mec.c,v 1.51 2015/04/13 21:22:34 riastradh Exp $);
 
 #include opt_ddb.h
 
@@ -76,7 +76,7 @@ __KERNEL_RCSID(0, $NetBSD: if_mec.c,v 1
 #include sys/ioctl.h
 #include sys/errno.h
 
-#include sys/rnd.h
+#include sys/rndsource.h
 
 #include net/if.h
 #include net/if_dl.h



CVS commit: src/sys/uvm

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 22:04:44 UTC 2015

Modified Files:
src/sys/uvm: uvm.h

Log Message:
Limit sys/rndsource.h include to kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/uvm/uvm.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/uvm/uvm.h
diff -u src/sys/uvm/uvm.h:1.65 src/sys/uvm/uvm.h:1.66
--- src/sys/uvm/uvm.h:1.65	Mon Apr 13 16:46:33 2015
+++ src/sys/uvm/uvm.h	Mon Apr 13 22:04:44 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm.h,v 1.65 2015/04/13 16:46:33 riastradh Exp $	*/
+/*	$NetBSD: uvm.h,v 1.66 2015/04/13 22:04:44 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -59,10 +59,11 @@
 #include uvm/uvm_pager.h
 #include uvm/uvm_pdaemon.h
 #include uvm/uvm_swap.h
-#include sys/rndsource.h
 
 #ifdef _KERNEL
 
+#include sys/rndsource.h
+
 /*
  * pull in VM_NFREELIST
  */



CVS commit: src/share/man

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 22:23:54 UTC 2015

Modified Files:
src/share/man/man4: rnd.4
src/share/man/man9: rnd.9

Log Message:
Update header file references in rnd man pages.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/share/man/man4/rnd.4
cvs rdiff -u -r1.24 -r1.25 src/share/man/man9/rnd.9

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

Modified files:

Index: src/share/man/man4/rnd.4
diff -u src/share/man/man4/rnd.4:1.21 src/share/man/man4/rnd.4:1.22
--- src/share/man/man4/rnd.4:1.21	Wed Jan  7 18:50:18 2015
+++ src/share/man/man4/rnd.4	Mon Apr 13 22:23:54 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: rnd.4,v 1.21 2015/01/07 18:50:18 riastradh Exp $
+.\	$NetBSD: rnd.4,v 1.22 2015/04/13 22:23:54 riastradh Exp $
 .\
 .\ Copyright (c) 2014 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -244,7 +244,7 @@ The
 and
 .Pa /dev/urandom
 devices support a number of ioctls, defined in the
-.In sys/rnd.h
+.In sys/rndio.h
 header file, for querying and controlling the entropy pool.
 .Pp
 Since timing between hardware events contributes to the entropy pool,

Index: src/share/man/man9/rnd.9
diff -u src/share/man/man9/rnd.9:1.24 src/share/man/man9/rnd.9:1.25
--- src/share/man/man9/rnd.9:1.24	Sun Aug 10 17:17:04 2014
+++ src/share/man/man9/rnd.9	Mon Apr 13 22:23:54 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: rnd.9,v 1.24 2014/08/10 17:17:04 wiz Exp $
+.\	$NetBSD: rnd.9,v 1.25 2015/04/13 22:23:54 riastradh Exp $
 .\
 .\ Copyright (c) 1997 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -38,7 +38,7 @@
 .Nm rnd_add_uint32
 .Nd functions to make a device available for entropy collection
 .Sh SYNOPSIS
-.In sys/rnd.h
+.In sys/rndsource.h
 .Ft void
 .Fn rnd_attach_source krndsource_t *rnd_source char *devname uint32_t source_type uint32_t flags
 .Ft void
@@ -220,7 +220,7 @@ Direct access to the entropy pool is uns
 There is no supported API for direct access to the output of the entropy pool.
 .\ .Sh ERRORS
 .Sh FILES
-These functions are declared in src/sys/sys/rnd.h and defined in
+These functions are declared in src/sys/sys/rndsource.h and defined in
 src/sys/kern/kern_rndq.c.
 .Sh SEE ALSO
 .Xr rnd 4 ,



CVS commit: src/tests/kernel

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 22:24:34 UTC 2015

Modified Files:
src/tests/kernel: t_rnd.c

Log Message:
Use sys/rndio.h for rnd ioctls.


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

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

Modified files:

Index: src/tests/kernel/t_rnd.c
diff -u src/tests/kernel/t_rnd.c:1.5 src/tests/kernel/t_rnd.c:1.6
--- src/tests/kernel/t_rnd.c:1.5	Sun Mar 18 09:46:50 2012
+++ src/tests/kernel/t_rnd.c	Mon Apr 13 22:24:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_rnd.c,v 1.5 2012/03/18 09:46:50 jruoho Exp $	*/
+/*	$NetBSD: t_rnd.c,v 1.6 2015/04/13 22:24:34 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -27,12 +27,12 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: t_rnd.c,v 1.5 2012/03/18 09:46:50 jruoho Exp $);
+__RCSID($NetBSD: t_rnd.c,v 1.6 2015/04/13 22:24:34 riastradh Exp $);
 
 #include sys/types.h
 #include sys/fcntl.h
 #include sys/ioctl.h
-#include sys/rnd.h
+#include sys/rndio.h
 
 #include atf-c.h
 



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

2015-04-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Apr 13 22:24:34 UTC 2015

Modified Files:
src/sys/external/bsd/drm2/drm: drm_module.c
src/sys/external/bsd/drm2/linux: linux_module.c

Log Message:
Update module dependencies:

drmkms does not depend on iic
drmkms_linux depends on i2cexec


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/external/bsd/drm2/drm/drm_module.c
cvs rdiff -u -r1.5 -r1.6 src/sys/external/bsd/drm2/linux/linux_module.c

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

Modified files:

Index: src/sys/external/bsd/drm2/drm/drm_module.c
diff -u src/sys/external/bsd/drm2/drm/drm_module.c:1.10 src/sys/external/bsd/drm2/drm/drm_module.c:1.11
--- src/sys/external/bsd/drm2/drm/drm_module.c:1.10	Thu Mar  5 17:42:48 2015
+++ src/sys/external/bsd/drm2/drm/drm_module.c	Mon Apr 13 22:24:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_module.c,v 1.10 2015/03/05 17:42:48 riastradh Exp $	*/
+/*	$NetBSD: drm_module.c,v 1.11 2015/04/13 22:24:34 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: drm_module.c,v 1.10 2015/03/05 17:42:48 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: drm_module.c,v 1.11 2015/04/13 22:24:34 pgoyette Exp $);
 
 #include sys/types.h
 #include sys/conf.h
@@ -51,7 +51,7 @@ __KERNEL_RCSID(0, $NetBSD: drm_module.c
 /*
  * XXX I2C stuff should be moved to a separate drmkms_i2c module.
  */
-MODULE(MODULE_CLASS_DRIVER, drmkms, iic,drmkms_linux);
+MODULE(MODULE_CLASS_DRIVER, drmkms, drmkms_linux);
 
 struct mutex	drm_global_mutex;
 

Index: src/sys/external/bsd/drm2/linux/linux_module.c
diff -u src/sys/external/bsd/drm2/linux/linux_module.c:1.5 src/sys/external/bsd/drm2/linux/linux_module.c:1.6
--- src/sys/external/bsd/drm2/linux/linux_module.c:1.5	Tue Nov 11 02:37:17 2014
+++ src/sys/external/bsd/drm2/linux/linux_module.c	Mon Apr 13 22:24:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_module.c,v 1.5 2014/11/11 02:37:17 christos Exp $	*/
+/*	$NetBSD: linux_module.c,v 1.6 2015/04/13 22:24:34 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: linux_module.c,v 1.5 2014/11/11 02:37:17 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: linux_module.c,v 1.6 2015/04/13 22:24:34 pgoyette Exp $);
 
 #include sys/module.h
 #ifndef _MODULE
@@ -44,7 +44,7 @@ __KERNEL_RCSID(0, $NetBSD: linux_module
 #include linux/reservation.h
 #include linux/workqueue.h
 
-MODULE(MODULE_CLASS_MISC, drmkms_linux, NULL);
+MODULE(MODULE_CLASS_MISC, drmkms_linux, i2cexec);
 
 DEFINE_WW_CLASS(reservation_ww_class __cacheline_aligned);
 



CVS commit: src/sys/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 21:32:04 UTC 2015

Modified Files:
src/sys/sys: param.h

Log Message:
Fix location of comment for MIN/MAX.


To generate a diff of this commit:
cvs rdiff -u -r1.469 -r1.470 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.469 src/sys/sys/param.h:1.470
--- src/sys/sys/param.h:1.469	Fri Apr  3 20:01:08 2015
+++ src/sys/sys/param.h	Mon Apr 13 21:32:04 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.469 2015/04/03 20:01:08 rtr Exp $	*/
+/*	$NetBSD: param.h,v 1.470 2015/04/13 21:32:04 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -130,13 +130,12 @@
 #endif /* (MAXUPRC - 0)  CHILD_MAX */
 #endif /* !defined(MAXUPRC) */
 
+/* Macros for min/max. */
 #define	MIN(a,b)	((/*CONSTCOND*/(a)(b))?(a):(b))
 #define	MAX(a,b)	((/*CONSTCOND*/(a)(b))?(a):(b))
 
 /* More types and definitions used throughout the kernel. */
 #ifdef _KERNEL
-/* Macros for min/max. */
-
 #include sys/cdefs.h
 #include sys/errno.h
 #include sys/time.h



CVS commit: src/sys/arch

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 21:18:43 UTC 2015

Modified Files:
src/sys/arch/acorn26/ioc: arckbd.c
src/sys/arch/acorn32/eb7500atx: if_cs.c
src/sys/arch/alpha/sableio: fdc_sableio.c
src/sys/arch/arm/allwinner: awin_eth.c
src/sys/arch/arm/amlogic: amlogic_rng.c
src/sys/arch/arm/at91: at91dbgu.c at91usart.c
src/sys/arch/arm/broadcom: bcm2835_rng.c bcm53xx_rng.c
src/sys/arch/arm/clps711x: clpscom.c
src/sys/arch/arm/ep93xx: epcom.c
src/sys/arch/arm/imx: if_enet.c imxuart.c
src/sys/arch/arm/ixp12x0: ixp12x0_com.c
src/sys/arch/arm/s3c2xx0: sscom.c
src/sys/arch/arm/sa11x0: sa_kbc.c sa11x0_com.c
src/sys/arch/arm/samsung: sscom.c
src/sys/arch/arm/xscale: ixp425_if_npe.c
src/sys/arch/arm/zynq: zynq_uart.c
src/sys/arch/emips/ebus: ace_ebus.c flash_ebus.c if_le_ebus.c
src/sys/arch/epoc32/windermere: wmcom.c
src/sys/arch/evbarm/dev: plcom.c plcomvar.h
src/sys/arch/evbarm/smdk2xx0: if_cs_smdk24x0.c
src/sys/arch/evbppc/pmppc/dev: if_cs_mainbus.c
src/sys/arch/hp300/dev: rd.c
src/sys/arch/hppa/gsc: harmony.c
src/sys/arch/macppc/dev: if_gm.c
src/sys/arch/mips/alchemy/dev: if_aumac.c
src/sys/arch/mips/atheros/dev: aevar.h
src/sys/arch/mips/sibyte/dev: sbjcnvar.h sbscn.c sbscnvar.h
src/sys/arch/next68k/dev: mb8795.c mb8795var.h
src/sys/arch/playstation2/dev: if_smap.c
src/sys/arch/prep/pnpbus: fdc_pnpbus.c
src/sys/arch/sgimips/hpc: sqvar.h
src/sys/arch/shark/ofw: if_cs_ofisa_machdep.c
src/sys/arch/sun2/dev: if_ec.c
src/sys/arch/x68k/dev: fd.c
src/sys/arch/xen/xen: if_xennet_xenbus.c xbd_xenbus.c

Log Message:
MD rnd.h cleanups.  Please let me know if I broke anything!


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/acorn26/ioc/arckbd.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/acorn32/eb7500atx/if_cs.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/alpha/sableio/fdc_sableio.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/allwinner/awin_eth.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/amlogic/amlogic_rng.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/at91/at91dbgu.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/arm/at91/at91usart.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/broadcom/bcm2835_rng.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/broadcom/bcm53xx_rng.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/clps711x/clpscom.c
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/arm/ep93xx/epcom.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/if_enet.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/imx/imxuart.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/arm/ixp12x0/ixp12x0_com.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/arm/s3c2xx0/sscom.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/arm/sa11x0/sa_kbc.c
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/arm/sa11x0/sa11x0_com.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/samsung/sscom.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/xscale/ixp425_if_npe.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/zynq/zynq_uart.c
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/emips/ebus/ace_ebus.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/emips/ebus/flash_ebus.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/emips/ebus/if_le_ebus.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/epoc32/windermere/wmcom.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/evbarm/dev/plcom.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/dev/plcomvar.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/smdk2xx0/if_cs_smdk24x0.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbppc/pmppc/dev/if_cs_mainbus.c
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/hp300/dev/rd.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hppa/gsc/harmony.c
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/macppc/dev/if_gm.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/mips/alchemy/dev/if_aumac.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mips/atheros/dev/aevar.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mips/sibyte/dev/sbjcnvar.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/mips/sibyte/dev/sbscn.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/mips/sibyte/dev/sbscnvar.h
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/next68k/dev/mb8795.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/next68k/dev/mb8795var.h
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/playstation2/dev/if_smap.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/prep/pnpbus/fdc_pnpbus.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sgimips/hpc/sqvar.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/shark/ofw/if_cs_ofisa_machdep.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/sun2/dev/if_ec.c
cvs rdiff -u -r1.115 -r1.116 src/sys/arch/x68k/dev/fd.c
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.69 -r1.70 src/sys/arch/xen/xen/xbd_xenbus.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/acorn26/ioc/arckbd.c

CVS commit: src

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 21:55:52 UTC 2015

Modified Files:
src/distrib/sets/lists/comp: mi
src/sys/sys: Makefile

Log Message:
Oops -- install sys/rndio.h now that ioctls live there.


To generate a diff of this commit:
cvs rdiff -u -r1.1951 -r1.1952 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.152 -r1.153 src/sys/sys/Makefile

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1951 src/distrib/sets/lists/comp/mi:1.1952
--- src/distrib/sets/lists/comp/mi:1.1951	Mon Mar 30 01:25:36 2015
+++ src/distrib/sets/lists/comp/mi	Mon Apr 13 21:55:52 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1951 2015/03/30 01:25:36 riastradh Exp $
+#	$NetBSD: mi,v 1.1952 2015/04/13 21:55:52 riastradh Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -3267,6 +3267,7 @@
 ./usr/include/sys/resourcevar.h			comp-c-include
 ./usr/include/sys/rmd160.h			comp-c-include
 ./usr/include/sys/rnd.hcomp-c-include
+./usr/include/sys/rndio.h			comp-c-include
 ./usr/include/sys/rwlock.h			comp-c-include
 ./usr/include/sys/sa.hcomp-obsolete		obsolete
 ./usr/include/sys/satypes.h			comp-obsolete		obsolete

Index: src/sys/sys/Makefile
diff -u src/sys/sys/Makefile:1.152 src/sys/sys/Makefile:1.153
--- src/sys/sys/Makefile:1.152	Mon Nov 17 02:15:49 2014
+++ src/sys/sys/Makefile	Mon Apr 13 21:55:52 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.152 2014/11/17 02:15:49 christos Exp $
+#	$NetBSD: Makefile,v 1.153 2015/04/13 21:55:52 riastradh Exp $
 
 .include bsd.own.mk
 
@@ -32,7 +32,7 @@ INCS=	acct.h agpio.h aio.h ansi.h aout_m
 	protosw.h pset.h ptrace.h ptree.h \
 	queue.h quota.h quotactl.h \
 	ras.h rbtree.h reboot.h radioio.h resource.h resourcevar.h rmd160.h \
-	rnd.h rwlock.h \
+	rnd.h rndio.h rwlock.h \
 	scanio.h sched.h scsiio.h sdt.h select.h selinfo.h sem.h sha1.h \
 	sha2.h shm.h siginfo.h signal.h signalvar.h sigtypes.h \
 	sleepq.h socket.h \



CVS commit: src/sbin/rndctl

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 22:18:50 UTC 2015

Modified Files:
src/sbin/rndctl: rndctl.c

Log Message:
Use sys/rndio.h instead of sys/rnd.h.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sbin/rndctl/rndctl.c

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

Modified files:

Index: src/sbin/rndctl/rndctl.c
diff -u src/sbin/rndctl/rndctl.c:1.29 src/sbin/rndctl/rndctl.c:1.30
--- src/sbin/rndctl/rndctl.c:1.29	Sun Aug 10 17:13:14 2014
+++ src/sbin/rndctl/rndctl.c	Mon Apr 13 22:18:50 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rndctl.c,v 1.29 2014/08/10 17:13:14 wiz Exp $	*/
+/*	$NetBSD: rndctl.c,v 1.30 2015/04/13 22:18:50 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997 Michael Graff.
@@ -33,14 +33,14 @@
 #include sha1.h
 
 #ifndef lint
-__RCSID($NetBSD: rndctl.c,v 1.29 2014/08/10 17:13:14 wiz Exp $);
+__RCSID($NetBSD: rndctl.c,v 1.30 2015/04/13 22:18:50 riastradh Exp $);
 #endif
 
 
 #include sys/types.h
 #include sys/ioctl.h
 #include sys/param.h
-#include sys/rnd.h
+#include sys/rndio.h
 
 #include stdio.h
 #include stdlib.h



CVS commit: src/sys/dev/i2c

2015-04-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Apr 13 22:26:20 UTC 2015

Modified Files:
src/sys/dev/i2c: i2c.c

Log Message:
Add required dependency on i2cexec


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/i2c/i2c.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/i2c/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.48 src/sys/dev/i2c/i2c.c:1.49
--- src/sys/dev/i2c/i2c.c:1.48	Sat Apr  4 15:16:54 2015
+++ src/sys/dev/i2c/i2c.c	Mon Apr 13 22:26:20 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c.c,v 1.48 2015/04/04 15:16:54 christos Exp $	*/
+/*	$NetBSD: i2c.c,v 1.49 2015/04/13 22:26:20 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
 #endif
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: i2c.c,v 1.48 2015/04/04 15:16:54 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: i2c.c,v 1.49 2015/04/13 22:26:20 pgoyette Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -573,7 +573,7 @@ iic_ioctl(dev_t dev, u_long cmd, void *d
 CFATTACH_DECL2_NEW(iic, sizeof(struct iic_softc),
 iic_match, iic_attach, iic_detach, NULL, iic_rescan, iic_child_detach);
 
-MODULE(MODULE_CLASS_DRIVER, iic, NULL);
+MODULE(MODULE_CLASS_DRIVER, iic, i2cexec);
 
 #ifdef _MODULE
 #include ioconf.c



CVS commit: src/sys/net

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 22:46:57 UTC 2015

Modified Files:
src/sys/net: if_ethersubr.c

Log Message:
Include sys/rndsource.h for rnd_add_data.


To generate a diff of this commit:
cvs rdiff -u -r1.206 -r1.207 src/sys/net/if_ethersubr.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/if_ethersubr.c
diff -u src/sys/net/if_ethersubr.c:1.206 src/sys/net/if_ethersubr.c:1.207
--- src/sys/net/if_ethersubr.c:1.206	Fri Apr  3 07:55:18 2015
+++ src/sys/net/if_ethersubr.c	Mon Apr 13 22:46:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ethersubr.c,v 1.206 2015/04/03 07:55:18 ozaki-r Exp $	*/
+/*	$NetBSD: if_ethersubr.c,v 1.207 2015/04/13 22:46:57 riastradh Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_ethersubr.c,v 1.206 2015/04/03 07:55:18 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_ethersubr.c,v 1.207 2015/04/13 22:46:57 riastradh Exp $);
 
 #include opt_inet.h
 #include opt_atalk.h
@@ -94,6 +94,7 @@ __KERNEL_RCSID(0, $NetBSD: if_ethersubr
 #include sys/intr.h
 #include sys/device.h
 #include sys/rnd.h
+#include sys/rndsource.h
 
 #include net/if.h
 #include net/netisr.h



CVS commit: src/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 22:43:41 UTC 2015

Modified Files:
src/sys/crypto/cprng_fast: cprng_fast.c
src/sys/dev: rnd_private.h
src/sys/kern: kern_rndpool.c kern_rndq.c kern_rndsink.c subr_cprng.c

Log Message:
More rnd.h user cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/crypto/cprng_fast/cprng_fast.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/rnd_private.h
cvs rdiff -u -r1.8 -r1.9 src/sys/kern/kern_rndpool.c
cvs rdiff -u -r1.46 -r1.47 src/sys/kern/kern_rndq.c
cvs rdiff -u -r1.12 -r1.13 src/sys/kern/kern_rndsink.c
cvs rdiff -u -r1.26 -r1.27 src/sys/kern/subr_cprng.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/crypto/cprng_fast/cprng_fast.c
diff -u src/sys/crypto/cprng_fast/cprng_fast.c:1.12 src/sys/crypto/cprng_fast/cprng_fast.c:1.13
--- src/sys/crypto/cprng_fast/cprng_fast.c:1.12	Mon Apr 13 15:51:00 2015
+++ src/sys/crypto/cprng_fast/cprng_fast.c	Mon Apr 13 22:43:41 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cprng_fast.c,v 1.12 2015/04/13 15:51:00 riastradh Exp $	*/
+/*	$NetBSD: cprng_fast.c,v 1.13 2015/04/13 22:43:41 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cprng_fast.c,v 1.12 2015/04/13 15:51:00 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: cprng_fast.c,v 1.13 2015/04/13 22:43:41 riastradh Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -39,7 +39,7 @@ __KERNEL_RCSID(0, $NetBSD: cprng_fast.c
 #include sys/cpu.h
 #include sys/intr.h
 #include sys/percpu.h
-#include sys/rnd.h
+#include sys/rnd.h		/* rnd_initial_entropy */
 
 /* ChaCha core */
 

Index: src/sys/dev/rnd_private.h
diff -u src/sys/dev/rnd_private.h:1.7 src/sys/dev/rnd_private.h:1.8
--- src/sys/dev/rnd_private.h:1.7	Mon Apr 13 15:13:50 2015
+++ src/sys/dev/rnd_private.h	Mon Apr 13 22:43:41 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: rnd_private.h,v 1.7 2015/04/13 15:13:50 riastradh Exp $ */
+/*  $NetBSD: rnd_private.h,v 1.8 2015/04/13 22:43:41 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -36,7 +36,9 @@
 #include sys/types.h
 #include sys/mutex.h
 #include sys/queue.h
-#include sys/rnd.h
+#include sys/rndio.h
+#include sys/rndsource.h
+#include sys/rndpool.h
 
 /*
  * Number of bytes returned per hash.  This value is used in both

Index: src/sys/kern/kern_rndpool.c
diff -u src/sys/kern/kern_rndpool.c:1.8 src/sys/kern/kern_rndpool.c:1.9
--- src/sys/kern/kern_rndpool.c:1.8	Wed Apr  8 13:45:01 2015
+++ src/sys/kern/kern_rndpool.c	Mon Apr 13 22:43:41 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: kern_rndpool.c,v 1.8 2015/04/08 13:45:01 riastradh Exp $*/
+/*  $NetBSD: kern_rndpool.c,v 1.9 2015/04/13 22:43:41 riastradh Exp $*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,13 +31,13 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndpool.c,v 1.8 2015/04/08 13:45:01 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndpool.c,v 1.9 2015/04/13 22:43:41 riastradh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
 #include sys/sha1.h
 
-#include sys/rnd.h
+#include sys/rndpool.h
 #include dev/rnd_private.h
 
 /*

Index: src/sys/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.46 src/sys/kern/kern_rndq.c:1.47
--- src/sys/kern/kern_rndq.c:1.46	Mon Apr 13 15:23:01 2015
+++ src/sys/kern/kern_rndq.c	Mon Apr 13 22:43:41 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.46 2015/04/13 15:23:01 riastradh Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.47 2015/04/13 22:43:41 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.46 2015/04/13 15:23:01 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.47 2015/04/13 22:43:41 riastradh Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -49,7 +49,9 @@ __KERNEL_RCSID(0, $NetBSD: kern_rndq.c,
 #include sys/callout.h
 #include sys/intr.h
 #include sys/rnd.h
+#include sys/rndpool.h
 #include sys/rndsink.h
+#include sys/rndsource.h
 #include sys/vnode.h
 #include sys/pool.h
 #include sys/kauth.h

Index: src/sys/kern/kern_rndsink.c
diff -u src/sys/kern/kern_rndsink.c:1.12 src/sys/kern/kern_rndsink.c:1.13
--- src/sys/kern/kern_rndsink.c:1.12	Mon Apr 13 15:13:50 2015
+++ src/sys/kern/kern_rndsink.c	Mon Apr 13 22:43:41 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndsink.c,v 1.12 2015/04/13 15:13:50 riastradh Exp $	*/
+/*	$NetBSD: kern_rndsink.c,v 1.13 2015/04/13 22:43:41 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndsink.c,v 1.12 2015/04/13 15:13:50 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndsink.c,v 1.13 2015/04/13 22:43:41 riastradh Exp $);
 
 #include sys/param.h
 #include 

CVS commit: src/sys/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 22:52:52 UTC 2015

Modified Files:
src/sys/sys: rnd.h

Log Message:
Remove remaining includes from sys/rnd.h.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/sys/rnd.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/sys/rnd.h
diff -u src/sys/sys/rnd.h:1.47 src/sys/sys/rnd.h:1.48
--- src/sys/sys/rnd.h:1.47	Mon Apr 13 15:39:19 2015
+++ src/sys/sys/rnd.h	Mon Apr 13 22:52:52 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rnd.h,v 1.47 2015/04/13 15:39:19 riastradh Exp $	*/
+/*	$NetBSD: rnd.h,v 1.48 2015/04/13 22:52:52 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -33,19 +33,7 @@
 #ifndef _SYS_RND_H_
 #define	_SYS_RND_H_
 
-#ifndef _KERNEL
-#include sys/cdefs.h
-#endif /* !_KERNEL */
-
-#include sys/types.h
-#include sys/rndio.h		/* XXX provisional until users converted */
-
 #ifdef _KERNEL
-#include sys/queue.h
-#include sys/rndpool.h	/* XXX provisional until users converted */
-#include sys/rndsource.h	/* XXX provisional until users converted */
-#include sys/rngtest.h
-#include sys/systm.h
 
 #define	RND_DEV_RANDOM	0	/* minor for blocking until unpredictable */
 #define	RND_DEV_URANDOM	1	/* minor for randomly generating data */



CVS commit: src/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 23:21:03 UTC 2015

Modified Files:
src/sys/kern: kern_rndpool.c
src/sys/sys: rndpool.h

Log Message:
Cull some unused rndpool routines.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/kern/kern_rndpool.c
cvs rdiff -u -r1.1 -r1.2 src/sys/sys/rndpool.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_rndpool.c
diff -u src/sys/kern/kern_rndpool.c:1.9 src/sys/kern/kern_rndpool.c:1.10
--- src/sys/kern/kern_rndpool.c:1.9	Mon Apr 13 22:43:41 2015
+++ src/sys/kern/kern_rndpool.c	Mon Apr 13 23:21:03 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: kern_rndpool.c,v 1.9 2015/04/13 22:43:41 riastradh Exp $*/
+/*  $NetBSD: kern_rndpool.c,v 1.10 2015/04/13 23:21:03 riastradh Exp $*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndpool.c,v 1.9 2015/04/13 22:43:41 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndpool.c,v 1.10 2015/04/13 23:21:03 riastradh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -97,8 +97,8 @@ void rndpool_get_stats(rndpool_t *rp, vo
 	memcpy(rsp, rp-stats, size);
 }
 
-void
-rndpool_increment_entropy_count(rndpool_t *rp, u_int32_t  entropy)
+static void __used		/* XXX soon */
+rndpool_increment_entropy_count(rndpool_t *rp, u_int32_t entropy)
 {
 
 	rp-stats.curentropy += entropy;
@@ -109,20 +109,6 @@ rndpool_increment_entropy_count(rndpool_
 	}
 }
 
-u_int32_t *
-rndpool_get_pool(rndpool_t *rp)
-{
-
-	return (rp-pool);
-}
-
-u_int32_t
-rndpool_get_poolsize(void)
-{
-
-	return (RND_POOLWORDS);
-}
-
 /*
  * The input function treats the contents of the pool as an array of
  * 32 LFSR's of length RND_POOLWORDS, one per bit-plane.  The LFSR's

Index: src/sys/sys/rndpool.h
diff -u src/sys/sys/rndpool.h:1.1 src/sys/sys/rndpool.h:1.2
--- src/sys/sys/rndpool.h:1.1	Mon Apr 13 15:39:19 2015
+++ src/sys/sys/rndpool.h	Mon Apr 13 23:21:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rndpool.h,v 1.1 2015/04/13 15:39:19 riastradh Exp $	*/
+/*	$NetBSD: rndpool.h,v 1.2 2015/04/13 23:21:03 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -57,13 +57,9 @@ typedef struct {
 } rndpool_t;
 
 void		rndpool_init(rndpool_t *);
-void		rndpool_init_global(void);
 uint32_t	rndpool_get_entropy_count(rndpool_t *);
 void		rndpool_set_entropy_count(rndpool_t *, uint32_t);
 void		rndpool_get_stats(rndpool_t *, void *, int);
-void		rndpool_increment_entropy_count(rndpool_t *, uint32_t);
-uint32_t	*rndpool_get_pool(rndpool_t *);
-uint32_t	rndpool_get_poolsize(void);
 void		rndpool_add_data(rndpool_t *,
  const void *const , uint32_t, uint32_t);
 uint32_t	rndpool_extract_data(rndpool_t *, void *, uint32_t, uint32_t);



CVS commit: src/sys/kern

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 23:24:33 UTC 2015

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

Log Message:
Cull another unused rndpool routine.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/kern/kern_rndpool.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_rndpool.c
diff -u src/sys/kern/kern_rndpool.c:1.10 src/sys/kern/kern_rndpool.c:1.11
--- src/sys/kern/kern_rndpool.c:1.10	Mon Apr 13 23:21:03 2015
+++ src/sys/kern/kern_rndpool.c	Mon Apr 13 23:24:33 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: kern_rndpool.c,v 1.10 2015/04/13 23:21:03 riastradh Exp $*/
+/*  $NetBSD: kern_rndpool.c,v 1.11 2015/04/13 23:24:33 riastradh Exp $*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndpool.c,v 1.10 2015/04/13 23:21:03 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndpool.c,v 1.11 2015/04/13 23:24:33 riastradh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -97,18 +97,6 @@ void rndpool_get_stats(rndpool_t *rp, vo
 	memcpy(rsp, rp-stats, size);
 }
 
-static void __used		/* XXX soon */
-rndpool_increment_entropy_count(rndpool_t *rp, u_int32_t entropy)
-{
-
-	rp-stats.curentropy += entropy;
-	rp-stats.added += entropy;
-	if (rp-stats.curentropy  RND_POOLBITS) {
-		rp-stats.discarded += (rp-stats.curentropy - RND_POOLBITS);
-		rp-stats.curentropy = RND_POOLBITS;
-	}
-}
-
 /*
  * The input function treats the contents of the pool as an array of
  * 32 LFSR's of length RND_POOLWORDS, one per bit-plane.  The LFSR's



CVS commit: src/sys/kern

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 23:25:14 UTC 2015

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

Log Message:
Omit needless declaration.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/kern/kern_rndpool.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_rndpool.c
diff -u src/sys/kern/kern_rndpool.c:1.11 src/sys/kern/kern_rndpool.c:1.12
--- src/sys/kern/kern_rndpool.c:1.11	Mon Apr 13 23:24:33 2015
+++ src/sys/kern/kern_rndpool.c	Mon Apr 13 23:25:14 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: kern_rndpool.c,v 1.11 2015/04/13 23:24:33 riastradh Exp $*/
+/*  $NetBSD: kern_rndpool.c,v 1.12 2015/04/13 23:25:14 riastradh Exp $*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndpool.c,v 1.11 2015/04/13 23:24:33 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndpool.c,v 1.12 2015/04/13 23:25:14 riastradh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -49,8 +49,6 @@ __KERNEL_RCSID(0, $NetBSD: kern_rndpool
 #define	TAP4	 9
 #define	TAP5	 7
 
-static inline void rndpool_add_one_word(rndpool_t *, u_int32_t);
-
 void
 rndpool_init(rndpool_t *rp)
 {



CVS commit: [netbsd-7] src

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 04:39:58 UTC 2015

Modified Files:
src/lib/libc/sys [netbsd-7]: kqueue.2
src/sys/kern [netbsd-7]: kern_event.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #677):
lib/libc/sys/kqueue.2: revision 1.34
sys/kern/kern_event.c: revision 1.83
put the exit code of the process in data, like FreeBSD does.
--
say that we put the exit code in data.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.8.1 src/lib/libc/sys/kqueue.2
cvs rdiff -u -r1.80 -r1.80.2.1 src/sys/kern/kern_event.c

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

Modified files:

Index: src/lib/libc/sys/kqueue.2
diff -u src/lib/libc/sys/kqueue.2:1.33 src/lib/libc/sys/kqueue.2:1.33.8.1
--- src/lib/libc/sys/kqueue.2:1.33	Sat Nov 24 15:16:52 2012
+++ src/lib/libc/sys/kqueue.2	Tue Apr 14 04:39:58 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: kqueue.2,v 1.33 2012/11/24 15:16:52 christos Exp $
+.\	$NetBSD: kqueue.2,v 1.33.8.1 2015/04/14 04:39:58 snj Exp $
 .\
 .\ Copyright (c) 2000 Jonathan Lemon
 .\ All rights reserved.
@@ -32,7 +32,7 @@
 .\
 .\ $FreeBSD: src/lib/libc/sys/kqueue.2,v 1.22 2001/06/27 19:55:57 dd Exp $
 .\
-.Dd November 24, 2012
+.Dd March 2, 2015
 .Dt KQUEUE 2
 .Os
 .Sh NAME
@@ -413,6 +413,8 @@ The events to monitor are:
 .Bl -tag -width XXNOTE_TRACKERR
 .It NOTE_EXIT
 The process has exited.
+The exit code of the process is stored in
+.Va data .
 .It NOTE_FORK
 The process has called
 .Fn fork .

Index: src/sys/kern/kern_event.c
diff -u src/sys/kern/kern_event.c:1.80 src/sys/kern/kern_event.c:1.80.2.1
--- src/sys/kern/kern_event.c:1.80	Tue Jun 24 14:42:43 2014
+++ src/sys/kern/kern_event.c	Tue Apr 14 04:39:58 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_event.c,v 1.80 2014/06/24 14:42:43 maxv Exp $	*/
+/*	$NetBSD: kern_event.c,v 1.80.2.1 2015/04/14 04:39:58 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_event.c,v 1.80 2014/06/24 14:42:43 maxv Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_event.c,v 1.80.2.1 2015/04/14 04:39:58 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -548,6 +548,10 @@ filt_proc(struct knote *kn, long hint)
 		fflag |= event;
 
 	if (event == NOTE_EXIT) {
+		struct proc *p = kn-kn_obj;
+
+		if (p != NULL)
+			kn-kn_data = p-p_xstat;
 		/*
 		 * Process is gone, so flag the event as finished.
 		 *



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

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:08:09 UTC 2015

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

Log Message:
Pull up following revision(s) (requested by christos in ticket #684):
usr.sbin/makefs/ffs.c: revision 1.64
PR/49559: Christian Brueffer: Fix typo maxbpf instead of maxbpg.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.63.6.1 src/usr.sbin/makefs/ffs.c

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

Modified files:

Index: src/usr.sbin/makefs/ffs.c
diff -u src/usr.sbin/makefs/ffs.c:1.63 src/usr.sbin/makefs/ffs.c:1.63.6.1
--- src/usr.sbin/makefs/ffs.c:1.63	Sun Jun 23 02:06:06 2013
+++ src/usr.sbin/makefs/ffs.c	Tue Apr 14 05:08:09 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.c,v 1.63 2013/06/23 02:06:06 dholland Exp $	*/
+/*	$NetBSD: ffs.c,v 1.63.6.1 2015/04/14 05:08:09 snj Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
 
 #include sys/cdefs.h
 #if defined(__RCSID)  !defined(__lint)
-__RCSID($NetBSD: ffs.c,v 1.63 2013/06/23 02:06:06 dholland Exp $);
+__RCSID($NetBSD: ffs.c,v 1.63.6.1 2015/04/14 05:08:09 snj Exp $);
 #endif	/* !__lint */
 
 #include sys/param.h
@@ -164,7 +164,7 @@ ffs_prep_opts(fsinfo_t *fsopts)
 	  1, INT_MAX, bytes per inode },
 	{ 'm', minfree, ffs_opts-minfree, OPT_INT32,
 	  0, 99, minfree },
-	{ 'M', maxbpf, ffs_opts-maxbpg, OPT_INT32,
+	{ 'M', maxbpg, ffs_opts-maxbpg, OPT_INT32,
 	  1, INT_MAX, max blocks per file in a cg },
 	{ 'a', avgfilesize, ffs_opts-avgfilesize, OPT_INT32,
 	  1, INT_MAX, expected average file size },



CVS commit: [netbsd-7] src/external/bsd/nvi/dist/ex

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:18:53 UTC 2015

Modified Files:
src/external/bsd/nvi/dist/ex [netbsd-7]: ex_mkexrc.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #690):
external/bsd/nvi/dist/ex/ex_mkexrc.c: revision 1.4
exrc expects 1 argument.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.6.1 src/external/bsd/nvi/dist/ex/ex_mkexrc.c

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

Modified files:

Index: src/external/bsd/nvi/dist/ex/ex_mkexrc.c
diff -u src/external/bsd/nvi/dist/ex/ex_mkexrc.c:1.3 src/external/bsd/nvi/dist/ex/ex_mkexrc.c:1.3.6.1
--- src/external/bsd/nvi/dist/ex/ex_mkexrc.c:1.3	Sun Jan 26 21:43:45 2014
+++ src/external/bsd/nvi/dist/ex/ex_mkexrc.c	Tue Apr 14 05:18:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ex_mkexrc.c,v 1.3 2014/01/26 21:43:45 christos Exp $ */
+/*	$NetBSD: ex_mkexrc.c,v 1.3.6.1 2015/04/14 05:18:53 snj Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *	The Regents of the University of California.  All rights reserved.
@@ -16,7 +16,7 @@
 static const char sccsid[] = Id: ex_mkexrc.c,v 10.13 2001/06/25 15:19:17 skimo Exp  (Berkeley) Date: 2001/06/25 15:19:17 ;
 #endif /* not lint */
 #else
-__RCSID($NetBSD: ex_mkexrc.c,v 1.3 2014/01/26 21:43:45 christos Exp $);
+__RCSID($NetBSD: ex_mkexrc.c,v 1.3.6.1 2015/04/14 05:18:53 snj Exp $);
 #endif
 
 #include sys/types.h
@@ -52,7 +52,7 @@ ex_mkexrc(SCR *sp, EXCMD *cmdp)
 	size_t flen;
 
 	switch (cmdp-argc) {
-	case 0:
+	case 1:
 		fname = _PATH_EXRC;
 		INT2CHAR(sp, cmdp-argv[0]-bp, cmdp-argv[0]-len + 1, 
 			fname, flen);



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

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:06:34 UTC 2015

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

Log Message:
Pull up following revision(s) (requested by christos in ticket #683):
sys/dev/dkwedge/dkwedge_apple.c: revision 1.2
Look at the bzb flags to mark partition as swap. Requested by John D. Baker.
XXX: Pullup-7


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.18.1 src/sys/dev/dkwedge/dkwedge_apple.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/dkwedge/dkwedge_apple.c
diff -u src/sys/dev/dkwedge/dkwedge_apple.c:1.1 src/sys/dev/dkwedge/dkwedge_apple.c:1.1.18.1
--- src/sys/dev/dkwedge/dkwedge_apple.c:1.1	Sat Apr  7 05:36:10 2012
+++ src/sys/dev/dkwedge/dkwedge_apple.c	Tue Apr 14 05:06:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dkwedge_apple.c,v 1.1 2012/04/07 05:36:10 christos Exp $	*/
+/*	$NetBSD: dkwedge_apple.c,v 1.1.18.1 2015/04/14 05:06:34 snj Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dkwedge_apple.c,v 1.1 2012/04/07 05:36:10 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: dkwedge_apple.c,v 1.1.18.1 2015/04/14 05:06:34 snj Exp $);
 
 #include sys/param.h
 #ifdef _KERNEL
@@ -106,6 +106,18 @@ swap_apple_part_map_entry(struct apple_p
 	SWAP32(pmBootCksum);
 }
 
+static void
+swap_apple_blockzeroblock(struct apple_blockzeroblock *ap)
+{
+SWAP32(bzbMagic);
+SWAP16(bzbBadBlockInode);
+SWAP16(bzbFlags);
+SWAP16(bzbReserved);
+SWAP32(bzbCreationTime);
+SWAP32(bzbMountTime);
+SWAP32(bzbUMountTime);
+}
+
 #undef SWAP16
 #undef SWAP32
 
@@ -137,6 +149,8 @@ dkwedge_discover_apple(struct disk *pdk,
 	uint32_t blocksize, offset, rsize;
 	struct apple_drvr_map *am;
 	struct apple_part_map_entry *ae;
+	struct apple_blockzeroblock ab;
+	const char *ptype;
 
 	buf = DKW_MALLOC(ASIZE);
 	if ((error = dkwedge_read(pdk, vp, 0, buf, ASIZE)) != 0) {
@@ -193,9 +207,17 @@ dkwedge_discover_apple(struct disk *pdk,
 		if (i == __arraycount(map))
 			continue;
 
+		ptype = map[i].type;
+		memcpy(ab, ae-pmBootArgs, sizeof(ab));
+		swap_apple_blockzeroblock(ab);
+		if (ab.bzbMagic == APPLE_BZB_MAGIC) {
+			if (ab.bzbType == APPLE_BZB_TYPESWAP)
+ptype = DKW_PTYPE_SWAP;
+		}
+
 		struct dkwedge_info dkw;
 
-		strcpy(dkw.dkw_ptype, map[i].type);
+		strcpy(dkw.dkw_ptype, ptype);
 		strcpy(dkw.dkw_parent, pdk-dk_name);
 		dkw.dkw_offset = ae-pmPyPartStart;
 		dkw.dkw_size = ae-pmPartBlkCnt;



CVS commit: [netbsd-7] src/lib/libc/gen

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:21:26 UTC 2015

Modified Files:
src/lib/libc/gen [netbsd-7]: opendir.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #691):
lib/libc/gen/opendir.c: revision 1.39
- Use O_DIRECTORY to open the file, so that we don't need to stat() after
  that.
- Move the stat() call to fdopendir() and change it's error handling so that
  it does not hide errors.
- According to POSIX, fdopendir() transfers ownership of the fd only on
  success, so don't close it on failure. XXX: We still make it non-blocking
  on failure, but that's nitpicking.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.20.1 src/lib/libc/gen/opendir.c

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

Modified files:

Index: src/lib/libc/gen/opendir.c
diff -u src/lib/libc/gen/opendir.c:1.38 src/lib/libc/gen/opendir.c:1.38.20.1
--- src/lib/libc/gen/opendir.c:1.38	Sat Oct 15 23:00:01 2011
+++ src/lib/libc/gen/opendir.c	Tue Apr 14 05:21:26 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: opendir.c,v 1.38 2011/10/15 23:00:01 christos Exp $	*/
+/*	$NetBSD: opendir.c,v 1.38.20.1 2015/04/14 05:21:26 snj Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)opendir.c	8.7 (Berkeley) 12/10/94;
 #else
-__RCSID($NetBSD: opendir.c,v 1.38 2011/10/15 23:00:01 christos Exp $);
+__RCSID($NetBSD: opendir.c,v 1.38.20.1 2015/04/14 05:21:26 snj Exp $);
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -75,17 +75,36 @@ opendir(const char *name)
 DIR *
 __opendir2(const char *name, int flags)
 {
+	DIR *dirp;
 	int fd;
 
-	if ((fd = open(name, O_RDONLY | O_NONBLOCK | O_CLOEXEC)) == -1)
+	if ((fd = open(name, O_RDONLY|O_DIRECTORY|O_NONBLOCK|O_CLOEXEC)) == -1)
 		return NULL;
-	return __opendir_common(fd, name, flags);
+
+	dirp = __opendir_common(fd, name, flags);
+	if (dirp == NULL) {
+		int serrno = errno;
+		(void)close(fd);
+		errno = serrno;
+	}
+	return dirp;
 }
 
 #ifndef __LIBC12_SOURCE__
 DIR *
 _fdopendir(int fd)
 {
+	struct stat sb;
+
+	if (fstat(fd, sb) == -1)
+		return NULL;
+
+	if (!S_ISDIR(sb.st_mode)) {
+		errno = ENOTDIR;
+		return NULL;
+	}
+
+	/* This is optional according to POSIX, but a good measure */
 	if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
 		return NULL;
 
@@ -96,16 +115,11 @@ _fdopendir(int fd)
 static DIR *
 __opendir_common(int fd, const char *name, int flags)
 {
-	DIR *dirp = NULL;
+	DIR *dirp;
 	int serrno;
-	struct stat sb;
 	struct statvfs sfb;
 	int error;
 
-	if (fstat(fd, sb) || !S_ISDIR(sb.st_mode)) {
-		errno = ENOTDIR;
-		goto error;
-	}
 	if ((dirp = malloc(sizeof(*dirp))) == NULL)
 		goto error;
 	dirp-dd_buf = NULL;
@@ -157,8 +171,6 @@ error:
 		free(dirp-dd_buf);
 	}
 	free(dirp);
-	if (fd != -1)
-		(void)close(fd);
 	errno = serrno;
 	return NULL;
 }



CVS commit: [netbsd-7] src/lib/libedit

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:30:24 UTC 2015

Modified Files:
src/lib/libedit [netbsd-7]: chartype.c chartype.h

Log Message:
Pull up following revision(s) (requested by christos in ticket #679):
lib/libedit/chartype.c: revisions 1.11, 1.12
lib/libedit/chartype.h: revisions 1.12, 1.13
PR/49683: Amir Plivatsky: Off-by-one comparison in ct_decode_string() leading
to out of bounds referrence.
--
split the allocation functions, their mixed usage was too confusing.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.20.1 src/lib/libedit/chartype.c
cvs rdiff -u -r1.10 -r1.10.18.1 src/lib/libedit/chartype.h

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/chartype.c
diff -u src/lib/libedit/chartype.c:1.10 src/lib/libedit/chartype.c:1.10.20.1
--- src/lib/libedit/chartype.c:1.10	Tue Aug 16 16:25:15 2011
+++ src/lib/libedit/chartype.c	Tue Apr 14 05:30:24 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: chartype.c,v 1.10 2011/08/16 16:25:15 christos Exp $	*/
+/*	$NetBSD: chartype.c,v 1.10.20.1 2015/04/14 05:30:24 snj Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 #include config.h
 #if !defined(lint)  !defined(SCCSID)
-__RCSID($NetBSD: chartype.c,v 1.10 2011/08/16 16:25:15 christos Exp $);
+__RCSID($NetBSD: chartype.c,v 1.10.20.1 2015/04/14 05:30:24 snj Exp $);
 #endif /* not lint  not SCCSID */
 #include el.h
 #include stdlib.h
@@ -46,31 +46,46 @@ __RCSID($NetBSD: chartype.c,v 1.10 2011
 #define CT_BUFSIZ ((size_t)1024)
 
 #ifdef WIDECHAR
-protected void
-ct_conv_buff_resize(ct_buffer_t *conv, size_t mincsize, size_t minwsize)
+protected int
+ct_conv_cbuff_resize(ct_buffer_t *conv, size_t csize)
 {
 	void *p;
-	if (mincsize  conv-csize) {
-		conv-csize = mincsize;
-		p = el_realloc(conv-cbuff, conv-csize * sizeof(*conv-cbuff));
-		if (p == NULL) {
-			conv-csize = 0;
-			el_free(conv-cbuff);
-			conv-cbuff = NULL;
-		} else 
-			conv-cbuff = p;
+
+	if (csize = conv-csize)
+		return 0;
+
+	conv-csize = csize;
+
+	p = el_realloc(conv-cbuff, conv-csize * sizeof(*conv-cbuff));
+	if (p == NULL) {
+		conv-csize = 0;
+		el_free(conv-cbuff);
+		conv-cbuff = NULL;
+		return -1;
 	}
+	conv-cbuff = p;
+	return 0;
+}
 
-	if (minwsize  conv-wsize) {
-		conv-wsize = minwsize;
-		p = el_realloc(conv-wbuff, conv-wsize * sizeof(*conv-wbuff));
-		if (p == NULL) {
-			conv-wsize = 0;
-			el_free(conv-wbuff);
-			conv-wbuff = NULL;
-		} else
-			conv-wbuff = p;
+protected int
+ct_conv_wbuff_resize(ct_buffer_t *conv, size_t wsize)
+{
+	void *p;
+
+	if (wsize = conv-wsize) 
+		return 0;
+
+	conv-wsize = wsize;
+
+	p = el_realloc(conv-wbuff, conv-wsize * sizeof(*conv-wbuff));
+	if (p == NULL) {
+		conv-wsize = 0;
+		el_free(conv-wbuff);
+		conv-wbuff = NULL;
+		return -1;
 	}
+	conv-wbuff = p;
+	return 0;
 }
 
 
@@ -78,26 +93,22 @@ public char *
 ct_encode_string(const Char *s, ct_buffer_t *conv)
 {
 	char *dst;
-	ssize_t used = 0;
+	ssize_t used;
 
 	if (!s)
 		return NULL;
-	if (!conv-cbuff)
-		ct_conv_buff_resize(conv, CT_BUFSIZ, (size_t)0);
-	if (!conv-cbuff)
-		return NULL;
 
 	dst = conv-cbuff;
-	while (*s) {
-		used = (ssize_t)(conv-csize - (size_t)(dst - conv-cbuff));
-		if (used  5) {
-			used = dst - conv-cbuff;
-			ct_conv_buff_resize(conv, conv-csize + CT_BUFSIZ,
-			(size_t)0);
-			if (!conv-cbuff)
+	for (;;) {
+		used = (ssize_t)(dst - conv-cbuff);
+		if ((conv-csize - (size_t)used)  5) {
+			if (ct_conv_cbuff_resize(conv,
+			conv-csize + CT_BUFSIZ) == -1)
 return NULL;
 			dst = conv-cbuff + used;
 		}
+		if (!*s)
+			break;
 		used = ct_encode_char(dst, (size_t)5, *s);
 		if (used == -1) /* failed to encode, need more buffer space */
 			abort();
@@ -111,22 +122,19 @@ ct_encode_string(const Char *s, ct_buffe
 public Char *
 ct_decode_string(const char *s, ct_buffer_t *conv)
 {
-	size_t len = 0;
+	size_t len;
 
 	if (!s)
 		return NULL;
-	if (!conv-wbuff)
-		ct_conv_buff_resize(conv, (size_t)0, CT_BUFSIZ);
-	if (!conv-wbuff)
-		return NULL;
 
 	len = ct_mbstowcs(NULL, s, (size_t)0);
 	if (len == (size_t)-1)
 		return NULL;
-	if (len  conv-wsize)
-		ct_conv_buff_resize(conv, (size_t)0, len + 1);
-	if (!conv-wbuff)
-		return NULL;
+
+	if (conv-wsize  ++len)
+		if (ct_conv_wbuff_resize(conv, len + CT_BUFSIZ) == -1)
+			return NULL;
+
 	ct_mbstowcs(conv-wbuff, s, conv-wsize);
 	return conv-wbuff;
 }
@@ -145,9 +153,9 @@ ct_decode_argv(int argc, const char *arg
 	 * the argv strings. */
 	for (i = 0, bufspace = 0; i  argc; ++i)
 		bufspace += argv[i] ? strlen(argv[i]) + 1 : 0;
-	ct_conv_buff_resize(conv, (size_t)0, bufspace);
-	if (!conv-wsize)
-		return NULL;
+	if (conv-wsize  ++bufspace)
+		if (ct_conv_wbuff_resize(conv, bufspace + CT_BUFSIZ) == -1)
+			return NULL;
 
 	wargv = el_malloc((size_t)argc * sizeof(*wargv));
 

Index: src/lib/libedit/chartype.h
diff -u src/lib/libedit/chartype.h:1.10 

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

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 04:24:58 UTC 2015

Modified Files:
src/sys/dev/i2c [netbsd-7]: ds1307.c ds1307reg.h

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #672):
sys/dev/i2c/ds1307.c: revisions 1.19, 1.20
sys/dev/i2c/ds1307reg.h: revision 1.5
- support DS3231 ( more or less a DS3232 without NVRAM it seems )
- support the DS3231's temperature sensor
--
Initialize a variable that gcc thinks might be used uninitialized.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.18.2.1 src/sys/dev/i2c/ds1307.c
cvs rdiff -u -r1.4 -r1.4.14.1 src/sys/dev/i2c/ds1307reg.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/i2c/ds1307.c
diff -u src/sys/dev/i2c/ds1307.c:1.18 src/sys/dev/i2c/ds1307.c:1.18.2.1
--- src/sys/dev/i2c/ds1307.c:1.18	Fri Jul 25 08:10:37 2014
+++ src/sys/dev/i2c/ds1307.c	Tue Apr 14 04:24:58 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ds1307.c,v 1.18 2014/07/25 08:10:37 dholland Exp $	*/
+/*	$NetBSD: ds1307.c,v 1.18.2.1 2015/04/14 04:24:58 snj Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ds1307.c,v 1.18 2014/07/25 08:10:37 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: ds1307.c,v 1.18.2.1 2015/04/14 04:24:58 snj Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -51,6 +51,7 @@ __KERNEL_RCSID(0, $NetBSD: ds1307.c,v 1
 
 #include dev/i2c/i2cvar.h
 #include dev/i2c/ds1307reg.h
+#include dev/sysmon/sysmonvar.h
 
 struct dsrtc_model {
 	uint16_t dm_model;
@@ -63,6 +64,7 @@ struct dsrtc_model {
 	uint8_t dm_flags;
 #define	DSRTC_FLAG_CLOCK_HOLD	1
 #define	DSRTC_FLAG_BCD		2	
+#define	DSRTC_FLAG_TEMP		4	
 };
 
 static const struct dsrtc_model dsrtc_models[] = {
@@ -86,6 +88,16 @@ static const struct dsrtc_model dsrtc_mo
 		.dm_rtc_size = DS1672_RTC_SIZE,
 		.dm_flags = 0,
 	}, {
+		.dm_model = 3231,
+		.dm_rtc_start = DS3232_RTC_START,
+		.dm_rtc_size = DS3232_RTC_SIZE,
+		/*
+		 * XXX
+		 * the DS3232 likely has the temperature sensor too but I can't
+		 * easily verify or test that right now
+		 */
+		.dm_flags = DSRTC_FLAG_BCD | DSRTC_FLAG_TEMP,
+	}, {
 		.dm_model = 3232,
 		.dm_rtc_start = DS3232_RTC_START,
 		.dm_rtc_size = DS3232_RTC_SIZE,
@@ -102,6 +114,8 @@ struct dsrtc_softc {
 	bool sc_open;
 	struct dsrtc_model sc_model;
 	struct todr_chip_handle sc_todr;
+	struct sysmon_envsys *sc_sme;
+	envsys_data_t sc_sensor;
 };
 
 static void	dsrtc_attach(device_t, device_t, void *);
@@ -141,6 +155,9 @@ static int dsrtc_settime_timeval(struct 
 static int dsrtc_clock_read_timeval(struct dsrtc_softc *, time_t *);
 static int dsrtc_clock_write_timeval(struct dsrtc_softc *, time_t);
 
+static int dsrtc_read_temp(struct dsrtc_softc *, uint32_t *);
+static void dsrtc_refresh(struct sysmon_envsys *, envsys_data_t *);
+
 static const struct dsrtc_model *
 dsrtc_model(u_int model)
 {
@@ -202,6 +219,35 @@ dsrtc_attach(device_t parent, device_t s
 	sc-sc_todr.todr_setwen = NULL;
 
 	todr_attach(sc-sc_todr);
+	if ((sc-sc_model.dm_flags  DSRTC_FLAG_TEMP) != 0) {
+		int error;
+
+		sc-sc_sme = sysmon_envsys_create();
+		sc-sc_sme-sme_name = device_xname(self);
+		sc-sc_sme-sme_cookie = sc;
+		sc-sc_sme-sme_refresh = dsrtc_refresh;
+
+		sc-sc_sensor.units =  ENVSYS_STEMP;
+		sc-sc_sensor.state = ENVSYS_SINVALID;
+		sc-sc_sensor.flags = 0;
+		(void)strlcpy(sc-sc_sensor.desc, temperature,
+		sizeof(sc-sc_sensor.desc));
+
+		if (sysmon_envsys_sensor_attach(sc-sc_sme, sc-sc_sensor)) {
+			aprint_error_dev(self, unable to attach sensor\n);
+			goto bad;
+		}
+
+		error = sysmon_envsys_register(sc-sc_sme);
+		if (error) {
+			aprint_error_dev(self, 
+			error %d registering with sysmon\n, error);
+			goto bad;
+		}
+	}
+	return;
+bad:
+	sysmon_envsys_destroy(sc-sc_sme);
 }
 
 /*ARGSUSED*/
@@ -624,3 +670,56 @@ dsrtc_clock_write_timeval(struct dsrtc_s
 
 	return 1;
 }
+
+static int
+dsrtc_read_temp(struct dsrtc_softc *sc, uint32_t *temp)
+{
+	int error, tc;
+	uint8_t reg = DS3232_TEMP_MSB;
+	uint8_t buf[2];
+
+	if ((sc-sc_model.dm_flags  DSRTC_FLAG_TEMP) == 0)
+		return ENOTSUP;
+
+	if ((error = iic_acquire_bus(sc-sc_tag, I2C_F_POLL)) != 0) {
+		aprint_error_dev(sc-sc_dev,
+		%s: failed to acquire I2C bus: %d\n,
+		__func__, error);
+		return 0;
+	}
+
+	/* read temperature registers: */
+	error = iic_exec(sc-sc_tag, I2C_OP_READ_WITH_STOP, sc-sc_address,
+	 reg, 1, buf, 2, I2C_F_POLL);
+
+	/* Done with I2C */
+	iic_release_bus(sc-sc_tag, I2C_F_POLL);
+
+	if (error != 0) {
+		aprint_error_dev(sc-sc_dev,
+		%s: failed to read temperature: %d\n,
+		__func__, error);
+		return 0;
+	}
+
+	/* convert to microkelvin */
+	tc = buf[0] * 100 + (buf[1]  6) * 25;
+	*temp = tc + 27315;
+	return 1;
+}
+
+static void
+dsrtc_refresh(struct sysmon_envsys *sme, envsys_data_t *edata)
+{
+	struct dsrtc_softc *sc = sme-sme_cookie;
+	

CVS commit: [netbsd-7] xsrc/external/mit/xorg-server/dist/include

2015-04-13 Thread Soren Jacobsen
Module Name:xsrc
Committed By:   snj
Date:   Tue Apr 14 05:04:28 UTC 2015

Modified Files:
xsrc/external/mit/xorg-server/dist/include [netbsd-7]: regionstr.h

Log Message:
Pull up following revision(s) (requested by christos in ticket #681):
external/mit/xorg-server/dist/include/regionstr.h: revisions 1.3, 1.4
fix signed/unsigned comparison.
--
fix previous.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3.10.2 -r1.1.1.3.10.3 \
xsrc/external/mit/xorg-server/dist/include/regionstr.h

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/include/regionstr.h
diff -u xsrc/external/mit/xorg-server/dist/include/regionstr.h:1.1.1.3.10.2 xsrc/external/mit/xorg-server/dist/include/regionstr.h:1.1.1.3.10.3
--- xsrc/external/mit/xorg-server/dist/include/regionstr.h:1.1.1.3.10.2	Mon Mar  9 08:38:43 2015
+++ xsrc/external/mit/xorg-server/dist/include/regionstr.h	Tue Apr 14 05:04:28 2015
@@ -108,7 +108,7 @@ static inline BoxPtr RegionEnd(RegionPtr
 }
 
 static inline size_t RegionSizeof(int n) {
-if (n  ((INT_MAX - sizeof(RegDataRec)) / sizeof(BoxRec)))
+if ((size_t)n  ((INT_MAX - sizeof(RegDataRec)) / sizeof(BoxRec)))
 return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)));
 else
 return 0;



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

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:14:18 UTC 2015

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

Log Message:
Pull up following revision(s) (requested by christos in ticket #687):
usr.sbin/nfsd/nfsd.c: revision 1.63
Memset the whole cfg array, not piecemeal because otherwise you'll end
up with random data depending on the options set.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.62.4.1 src/usr.sbin/nfsd/nfsd.c

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

Modified files:

Index: src/usr.sbin/nfsd/nfsd.c
diff -u src/usr.sbin/nfsd/nfsd.c:1.62 src/usr.sbin/nfsd/nfsd.c:1.62.4.1
--- src/usr.sbin/nfsd/nfsd.c:1.62	Sat Mar 29 13:50:53 2014
+++ src/usr.sbin/nfsd/nfsd.c	Tue Apr 14 05:14:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfsd.c,v 1.62 2014/03/29 13:50:53 gson Exp $	*/
+/*	$NetBSD: nfsd.c,v 1.62.4.1 2015/04/14 05:14:17 snj Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT(@(#) Copyright (c) 1989, 19
 #if 0
 static char sccsid[] = @(#)nfsd.c	8.9 (Berkeley) 3/29/95;
 #else
-__RCSID($NetBSD: nfsd.c,v 1.62 2014/03/29 13:50:53 gson Exp $);
+__RCSID($NetBSD: nfsd.c,v 1.62.4.1 2015/04/14 05:14:17 snj Exp $);
 #endif
 #endif /* not lint */
 
@@ -140,7 +140,6 @@ tryconf(struct conf *cfg, int t, int rer
 	struct addrinfo hints;
 	int ecode;
 
-	memset(cfg, 0, sizeof(*cfg));
 	memset(hints, 0, sizeof hints);
 	hints.ai_flags = AI_PASSIVE;
 	hints.ai_family = cfg_family[t];
@@ -473,6 +472,7 @@ main(int argc, char *argv[])
 
 	openlog(nfsd, LOG_PID, LOG_DAEMON);
 
+	memset(cfg, 0, sizeof(cfg));
 	for (i = 0; i  __arraycount(cfg); i++) {
 		if (ip4flag == 0  cfg_family[i] == PF_INET)
 			continue;



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

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:17:31 UTC 2015

Modified Files:
src/sys/netinet [netbsd-7]: in.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #689):
sys/netinet/in.c: revision 1.149
Don't pass junk in sin_family and sin_len for SIOCGIFNETMASK, and explain why.
XXX: pullup 7?


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.147.2.1 src/sys/netinet/in.c

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

Modified files:

Index: src/sys/netinet/in.c
diff -u src/sys/netinet/in.c:1.147 src/sys/netinet/in.c:1.147.2.1
--- src/sys/netinet/in.c:1.147	Tue Jul  1 05:49:18 2014
+++ src/sys/netinet/in.c	Tue Apr 14 05:17:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: in.c,v 1.147 2014/07/01 05:49:18 rtr Exp $	*/
+/*	$NetBSD: in.c,v 1.147.2.1 2015/04/14 05:17:31 snj Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: in.c,v 1.147 2014/07/01 05:49:18 rtr Exp $);
+__KERNEL_RCSID(0, $NetBSD: in.c,v 1.147.2.1 2015/04/14 05:17:31 snj Exp $);
 
 #include opt_inet.h
 #include opt_inet_conf.h
@@ -427,6 +427,7 @@ in_control(struct socket *so, u_long cmd
 			ia-ia_ifa.ifa_getifa = NULL;
 #endif /* IPSELSRC */
 			ia-ia_sockmask.sin_len = 8;
+			ia-ia_sockmask.sin_family = AF_INET;
 			if (ifp-if_flags  IFF_BROADCAST) {
 ia-ia_broadaddr.sin_len = sizeof(ia-ia_addr);
 ia-ia_broadaddr.sin_family = AF_INET;
@@ -473,7 +474,14 @@ in_control(struct socket *so, u_long cmd
 		break;
 
 	case SIOCGIFNETMASK:
-		ifreq_setaddr(cmd, ifr, sintocsa(ia-ia_sockmask));
+		/* 
+		 * We keep the number of trailing zero bytes the sin_len field
+		 * of ia_sockmask, so we fix this before we pass it back to
+		 * userland.
+		 */
+		oldaddr = ia-ia_sockmask;
+		oldaddr.sin_len = sizeof(struct sockaddr_in);
+		ifreq_setaddr(cmd, ifr, (const void *)oldaddr);
 		break;
 
 	case SIOCSIFDSTADDR:



CVS commit: [netbsd-7] src/doc

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:31:17 UTC 2015

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

Log Message:
tickets 675-681, 683-692


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.252 -r1.1.2.253 src/doc/CHANGES-7.0

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
diff -u src/doc/CHANGES-7.0:1.1.2.252 src/doc/CHANGES-7.0:1.1.2.253
--- src/doc/CHANGES-7.0:1.1.2.252	Sat Apr 11 05:47:34 2015
+++ src/doc/CHANGES-7.0	Tue Apr 14 05:31:17 2015
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0,v 1.1.2.252 2015/04/11 05:47:34 snj Exp $
+# $NetBSD: CHANGES-7.0,v 1.1.2.253 2015/04/14 05:31:17 snj Exp $
 
 A complete list of changes from the initial NetBSD 7.0 branch on 11 Aug 2014
 until the 7.0 release:
@@ -19587,3 +19587,107 @@ external/gpl3/gcc.old/*delete
 	Delete GCC 4.5.
 	[mrg, ticket #674]
 
+usr.sbin/makemandb/makemandb.c			1.27
+
+	- handle section numbers that are not single digits
+	- don't allocate and free needlessly
+	[christos, ticket #675]
+
+usr.bin/man/man.conf.51.25
+usr.sbin/makemandb/makemandb.8			1.8
+
+	Adjust documentation to reflect the fact that makemandb has
+	replaced makewhatis.
+	[christos, ticket #676]
+
+lib/libc/sys/kqueue.21.34
+sys/kern/kern_event.c1.83
+
+	kqueue: on NOTE_EXIT, put the exit code of the process in data.
+	[christos, ticket #677]
+
+sys/kern/uipc_usrreq.c1.175
+
+	Replace KASSERT with continue, since the file descriptor can be
+	closed since closef does not pay attention to FDEFER.  PR 39918
+	[christos, ticket #678]
+
+lib/libedit/chartype.c1.11, 1.12
+lib/libedit/chartype.h1.12, 1.13
+
+	Fix an off-by-one comparison in ct_decode_string().  PR 49683.
+	Split the allocation functions for clarity.
+	[christos, ticket #679]
+
+external/bsd/openldap/dist/servers/slapd/filter.c 1.2
+external/bsd/openldap/dist/servers/slapd/overlays/deref.c 1.2
+
+	Fix CVE-2015-1545 and CVE-1546.
+	[christos, ticket #680]
+
+xsrc/external/mit/xorg-server/dist/include/regionstr.h 1.3, 1.4
+
+	Fix signed/unsigned comparison.
+	[christos, ticket #681]
+
+sys/dev/dkwedge/dkwedge_apple.c			1.2
+
+	Look at the bzb flags to mark partition as swap.
+	[christos, ticket #683]
+
+usr.sbin/makefs/ffs.c1.64
+
+	Fix typo: maxbpf instead of maxbpg. PR bin/49559.
+	[christos, ticket #684]
+
+usr.bin/ftp/ftp_var.h1.83
+
+	Increase the buffer limit.
+	[christos, ticket #685]
+
+sys/kern/kern_exec.c1.411
+sys/sys/exec.h	1.147
+
+	Handle exec_script argument vector from the 32 - 64 bit case.
+	PR kern/49287
+	[christos, ticket #686]
+
+usr.sbin/nfsd/nfsd.c1.63
+
+	Memset the whole cfg array, not piecemeal because otherwise
+	you'll end up with random data depending on the options set.
+	[christos, ticket #687]
+
+sbin/fsck_ext2fs/setup.c			1.32
+
+	Instead of zerodivide, give a useful error message.
+	[christos, ticket #688]
+
+sys/netinet/in.c1.149
+
+	Don't pass junk in sin_family and sin_len for SIOCGIFNETMASK, and
+	explain why.
+	[christos, ticket #689]
+
+external/bsd/nvi/dist/ex/ex_mkexrc.c		1.4
+
+	exrc expects 1 argument.
+	[christos, ticket #690]
+
+lib/libc/gen/opendir.c1.39
+
+	- Use O_DIRECTORY to open the file, so that we don't need to
+	  stat() after that.
+	- Move the stat() call to fdopendir() and change it's error
+	  handling so that it does not hide errors.
+	- According to POSIX, fdopendir() transfers ownership of the
+	  fd only on success, so don't close it on failure.
+	[christos, ticket #691]
+
+sbin/ping/ping.c1.108, 1.109
+
+	Fix ping with small packets (e.g., ping -s 20).  PR bin/49423.
+	Adjust default packet size to 56 data bytes (64 total).
+	Make error messages consistent.
+	[christos, ticket #692]
+



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

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 04:26:04 UTC 2015

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

Log Message:
Pull up following revision(s) (requested by christos in ticket #675):
usr.sbin/makemandb/makemandb.c: revision 1.27
- handle section numbers that are not single digits
- don't allocate and free needlessly


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.2 -r1.24.2.3 src/usr.sbin/makemandb/makemandb.c

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

Modified files:

Index: src/usr.sbin/makemandb/makemandb.c
diff -u src/usr.sbin/makemandb/makemandb.c:1.24.2.2 src/usr.sbin/makemandb/makemandb.c:1.24.2.3
--- src/usr.sbin/makemandb/makemandb.c:1.24.2.2	Sun Mar 15 22:44:28 2015
+++ src/usr.sbin/makemandb/makemandb.c	Tue Apr 14 04:26:04 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemandb.c,v 1.24.2.2 2015/03/15 22:44:28 snj Exp $	*/
+/*	$NetBSD: makemandb.c,v 1.24.2.3 2015/04/14 04:26:04 snj Exp $	*/
 /*
  * Copyright (c) 2011 Abhinav Upadhyay er.abhinav.upadh...@gmail.com
  * Copyright (c) 2011 Kristaps Dzonsons krist...@bsd.lv
@@ -17,7 +17,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: makemandb.c,v 1.24.2.2 2015/03/15 22:44:28 snj Exp $);
+__RCSID($NetBSD: makemandb.c,v 1.24.2.3 2015/04/14 04:26:04 snj Exp $);
 
 #include sys/stat.h
 #include sys/types.h
@@ -990,12 +990,11 @@ pmdoc_Nd(const struct mdoc_node *n, mand
 			 * An Xr macro was seen previously, so parse this
 			 * and the next node.
 			 */
-			temp = estrdup(n-string);
+			temp = n-string;
 			n = n-next;
 			easprintf(buf, %s(%s), temp, n-string);
 			concat(rec-name_desc, buf);
 			free(buf);
-			free(temp);
 		} else {
 			nd_text = estrdup(n-string);
 			replace_hyph(nd_text);
@@ -1052,13 +1051,8 @@ pmdoc_macro_handler(const struct mdoc_no
 			n = n-next;
 
 		if (n  n-type == MDOC_TEXT) {
-			size_t len = strlen(sn-string);
-			char *buf = emalloc(len + 4);
-			memcpy(buf, sn-string, len);
-			buf[len] = '(';
-			buf[len + 1] = n-string[0];
-			buf[len + 2] = ')';
-			buf[len + 3] = 0;
+			char *buf;
+			easprintf(buf, %s(%s), sn-string, n-string);
 			mdoc_parse_section(n-sec, buf, rec);
 			free(buf);
 		}



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

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:26:20 UTC 2015

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

Log Message:
Pull up following revision(s) (requested by christos in ticket #692):
sbin/ping/ping.c: revisions 1.108, 1.109
PR/49423: Martin Husemann: ping for small packets does not work in -7 or
-current
--
Adjust default packet size to 56 data bytes (64 total).
Make error messages consistent.


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.107.4.1 src/sbin/ping/ping.c

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

Modified files:

Index: src/sbin/ping/ping.c
diff -u src/sbin/ping/ping.c:1.107 src/sbin/ping/ping.c:1.107.4.1
--- src/sbin/ping/ping.c:1.107	Sat Oct 19 01:08:25 2013
+++ src/sbin/ping/ping.c	Tue Apr 14 05:26:20 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ping.c,v 1.107 2013/10/19 01:08:25 christos Exp $	*/
+/*	$NetBSD: ping.c,v 1.107.4.1 2015/04/14 05:26:20 snj Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -58,7 +58,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: ping.c,v 1.107 2013/10/19 01:08:25 christos Exp $);
+__RCSID($NetBSD: ping.c,v 1.107.4.1 2015/04/14 05:26:20 snj Exp $);
 #endif
 
 #include stdio.h
@@ -252,12 +252,12 @@ main(int argc, char *argv[])
 #endif
 
 	if (prog_init  prog_init() == -1)
-		err(1, init failed);
+		err(EXIT_FAILURE, init failed);
 
 	if ((s = prog_socket(AF_INET, SOCK_RAW, IPPROTO_ICMP))  0)
-		err(1, Cannot create socket);
+		err(EXIT_FAILURE, Cannot create socket);
 	if ((sloop = prog_socket(AF_INET, SOCK_RAW, IPPROTO_ICMP))  0)
-		err(1, Cannot create socket);
+		err(EXIT_FAILURE, Cannot create socket);
 
 	/*
 	 * sloop is never read on.  This prevents packets from
@@ -267,7 +267,7 @@ main(int argc, char *argv[])
 		warn(Cannot shutdown for read);
 
 	if (prog_setuid(prog_getuid()) == -1)
-		err(1, setuid);
+		err(EXIT_FAILURE, setuid);
 
 	setprogname(argv[0]);
 
@@ -293,7 +293,9 @@ main(int argc, char *argv[])
 		case 'c':
 			npackets = strtol(optarg, p, 0);
 			if (*p != '\0' || npackets = 0)
-errx(1, Bad/invalid number of packets);
+errx(EXIT_FAILURE,
+Bad/invalid number of packets: %s,
+optarg);
 			break;
 		case 'D':
 			pingflags |= F_DF;
@@ -310,13 +312,14 @@ main(int argc, char *argv[])
 		case 'i':		/* wait between sending packets */
 			interval = strtod(optarg, p);
 			if (*p != '\0' || interval = 0)
-errx(1, Bad/invalid interval %s, optarg);
+errx(EXIT_FAILURE, Bad/invalid interval: %s,
+optarg);
 			break;
 		case 'l':
 			preload = strtol(optarg, p, 0);
 			if (*p != '\0' || preload  0)
-errx(1, Bad/invalid preload value %s,
- optarg);
+errx(EXIT_FAILURE, Bad/invalid preload value: 
+%s, optarg);
 			break;
 		case 'n':
 			pingflags |= F_NUMERIC;
@@ -326,13 +329,15 @@ main(int argc, char *argv[])
 			break;
 		case 'p':		/* fill buffer with user pattern */
 			if (pingflags  F_PING_RANDOM)
-errx(1, Only one of -P and -p allowed);
+errx(EXIT_FAILURE,
+Only one of -P and -p allowed);
 			pingflags |= F_PING_FILLED;
 			fill_pat = optarg;
 			break;
 		case 'P':
 			if (pingflags  F_PING_FILLED)
-errx(1, Only one of -P and -p allowed);
+errx(EXIT_FAILURE,
+Only one of -P and -p allowed);
 			pingflags |= F_PING_RANDOM;
 			break;
 		case 'q':
@@ -347,9 +352,10 @@ main(int argc, char *argv[])
 		case 's':		/* size of packet to send */
 			l = strtol(optarg, p, 0);
 			if (*p != '\0' || l  0)
-errx(1, Bad/invalid packet size %s, optarg);
+errx(EXIT_FAILURE,
+Bad/invalid packet size: %s, optarg);
 			if (l  MAXPACKET)
-errx(1, packet size is too large);
+errx(EXIT_FAILURE, packet size is too large);
 			len = (int)l;
 			break;
 		case 'v':
@@ -364,12 +370,13 @@ main(int argc, char *argv[])
 		case 't':
 			tos = strtoul(optarg, p, 0);
 			if (*p != '\0' ||  tos  0xFF)
-errx(1, bad tos value: %s, optarg);
+errx(EXIT_FAILURE, bad tos value: %s, optarg);
 			break;
 		case 'T':
 			l = strtol(optarg, p, 0);
 			if (*p != '\0' || l  255 || l = 0)
-errx(1, ttl out of range);
+errx(EXIT_FAILURE, ttl out of range: %s,
+optarg);
 			ttl = (u_char)l;/* cannot check 255 otherwise */
 			break;
 		case 'I':
@@ -383,7 +390,8 @@ main(int argc, char *argv[])
 		case 'w':
 			maxwait = strtod(optarg, p);
 			if (*p != '\0' || maxwait = 0)
-errx(1, Bad/invalid maxwait time %s, optarg);
+errx(EXIT_FAILURE, Bad/invalid maxwait time: 
+%s, optarg);
 			break;
 #ifdef IPSEC
 #ifdef IPSEC_POLICY_IPSEC
@@ -392,13 +400,14 @@ main(int argc, char *argv[])
 			if (!strncmp(in, optarg, 2)) {
 policy_in = strdup(optarg);
 if (!policy_in)
-	err(1, strdup);
+	err(EXIT_FAILURE, strdup);
 			} else if (!strncmp(out, optarg, 3)) {
 policy_out = strdup(optarg);
 if (!policy_out)
-	err(1, strdup);
+	err(EXIT_FAILURE, strdup);
 			} else
-errx(1, 

CVS commit: [netbsd-7] src

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 04:33:46 UTC 2015

Modified Files:
src/usr.bin/man [netbsd-7]: man.conf.5
src/usr.sbin/makemandb [netbsd-7]: makemandb.8

Log Message:
Pull up following revision(s) (requested by christos in ticket #676):
usr.bin/man/man.conf.5: revision 1.25
usr.sbin/makemandb/makemandb.8: revision 1.8
mention that this replaces makewhatis(8)
--
there is no more makewhatis; it has been replaced by makemandb


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.6.1 src/usr.bin/man/man.conf.5
cvs rdiff -u -r1.7 -r1.7.4.1 src/usr.sbin/makemandb/makemandb.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.bin/man/man.conf.5
diff -u src/usr.bin/man/man.conf.5:1.24 src/usr.bin/man/man.conf.5:1.24.6.1
--- src/usr.bin/man/man.conf.5:1.24	Fri Jun 28 10:13:18 2013
+++ src/usr.bin/man/man.conf.5	Tue Apr 14 04:33:46 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: man.conf.5,v 1.24 2013/06/28 10:13:18 wiz Exp $
+.\	$NetBSD: man.conf.5,v 1.24.6.1 2015/04/14 04:33:46 snj Exp $
 .\
 .\ Copyright (c) 1989, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\	@(#)man.conf.5	8.5 (Berkeley) 1/2/94
 .\
-.Dd April 28, 2012
+.Dd March 3, 2015
 .Dt MAN.CONF 5
 .Os
 .Sh NAME
@@ -44,7 +44,7 @@ file contains the default configuration 
 .Xr whatis 1 ,
 .Xr catman 8 ,
 and
-.Xr makewhatis 8
+.Xr makemandb 8
 to find manual pages and information about manual pages (e.g. the
 whatis database).
 .Pp

Index: src/usr.sbin/makemandb/makemandb.8
diff -u src/usr.sbin/makemandb/makemandb.8:1.7 src/usr.sbin/makemandb/makemandb.8:1.7.4.1
--- src/usr.sbin/makemandb/makemandb.8:1.7	Fri Nov 29 23:58:23 2013
+++ src/usr.sbin/makemandb/makemandb.8	Tue Apr 14 04:33:46 2015
@@ -1,4 +1,4 @@
-.\ $NetBSD: makemandb.8,v 1.7 2013/11/29 23:58:23 wiz Exp $
+.\ $NetBSD: makemandb.8,v 1.7.4.1 2015/04/14 04:33:46 snj Exp $
 .\
 .\ Copyright (c) 2011 Abhinav Upadhyay er.abhinav.upadh...@gmail.com
 .\ All rights reserved.
@@ -29,7 +29,7 @@
 .\ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd November 23, 2013
+.Dd March 3, 2015
 .Dt MAKEMANDB 8
 .Os
 .Sh NAME
@@ -83,7 +83,13 @@ This prints the name of every file being
 and a summary at the end of the index update.
 .El
 .Pp
-.Nm .
+The index generated by
+.Nm 
+is also used by the
+.Xr whatis 1
+program, replacing the old
+.Dq makewhatis
+program.
 .Ss DATABASE SCHEMA
 The name of the FTS table is mandb and its schema is as follows:
 .Bl -column -offset indent Column Name Column Description



CVS commit: [netbsd-7] src/sys

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:12:17 UTC 2015

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

Log Message:
Pull up following revision(s) (requested by christos in ticket #686):
sys/kern/kern_exec.c: revision 1.411
sys/sys/exec.h: revision 1.147
PR/49287: Masao Uebayashi: Handle exec_script argument vector from the 32 -
64 bit case. When execing a 64 bit shell from a 32 bit binary the argument
vector was still incorrect.


To generate a diff of this commit:
cvs rdiff -u -r1.408.2.2 -r1.408.2.3 src/sys/kern/kern_exec.c
cvs rdiff -u -r1.145 -r1.145.4.1 src/sys/sys/exec.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_exec.c
diff -u src/sys/kern/kern_exec.c:1.408.2.2 src/sys/kern/kern_exec.c:1.408.2.3
--- src/sys/kern/kern_exec.c:1.408.2.2	Sat Jan 17 12:10:55 2015
+++ src/sys/kern/kern_exec.c	Tue Apr 14 05:12:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_exec.c,v 1.408.2.2 2015/01/17 12:10:55 martin Exp $	*/
+/*	$NetBSD: kern_exec.c,v 1.408.2.3 2015/04/14 05:12:17 snj Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.408.2.2 2015/01/17 12:10:55 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.408.2.3 2015/04/14 05:12:17 snj Exp $);
 
 #include opt_exec.h
 #include opt_execfmt.h
@@ -673,7 +673,7 @@ execve_loadvm(struct lwp *l, const char 
 	epp-ep_emul_arg_free = NULL;
 	memset(epp-ep_vmcmds, 0, sizeof(epp-ep_vmcmds));
 	epp-ep_vap = data-ed_attr;
-	epp-ep_flags = 0;
+	epp-ep_flags = (p-p_flag  PK_32) ? EXEC_FROM32 : 0;
 	MD_TOPDOWN_INIT(epp);
 	epp-ep_emul_root = NULL;
 	epp-ep_interp = NULL;
@@ -1335,9 +1335,15 @@ execve1(struct lwp *l, const char *path,
 }
 
 static size_t
+fromptrsz(const struct exec_package *epp)
+{
+	return (epp-ep_flags  EXEC_FROM32) ? sizeof(int) : sizeof(char *);
+}
+
+static size_t
 ptrsz(const struct exec_package *epp)
 {
-	return (epp-ep_flags  EXEC_32) ?  sizeof(int) : sizeof(char *);
+	return (epp-ep_flags  EXEC_32) ? sizeof(int) : sizeof(char *);
 }
 
 static size_t
@@ -1508,7 +1514,7 @@ copyinargs(struct execve_data * restrict
 		return EINVAL;
 	}
 	if (epp-ep_flags  EXEC_SKIPARG)
-		args = (const void *)((const char *)args + ptrsz(epp));
+		args = (const void *)((const char *)args + fromptrsz(epp));
 	i = 0;
 	error = copyinargstrs(data, args, fetch_element, dp, i, ktr_execarg);
 	if (error != 0) {

Index: src/sys/sys/exec.h
diff -u src/sys/sys/exec.h:1.145 src/sys/sys/exec.h:1.145.4.1
--- src/sys/sys/exec.h:1.145	Thu Mar  6 09:30:37 2014
+++ src/sys/sys/exec.h	Tue Apr 14 05:12:17 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.h,v 1.145 2014/03/06 09:30:37 matt Exp $	*/
+/*	$NetBSD: exec.h,v 1.145.4.1 2015/04/14 05:12:17 snj Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -229,6 +229,7 @@ struct exec_package {
 #define	EXEC_32		0x0020		/* 32-bit binary emulation */
 #define	EXEC_FORCEAUX	0x0040		/* always use ELF AUX vector */
 #define	EXEC_TOPDOWN_VM	0x0080		/* may use top-down VM layout */
+#define	EXEC_FROM32	0x0100		/* exec'ed from 32-bit binary */
 
 struct exec_vmcmd {
 	int	(*ev_proc)(struct lwp *, struct exec_vmcmd *);



CVS commit: [netbsd-7] src/usr.bin/ftp

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:10:38 UTC 2015

Modified Files:
src/usr.bin/ftp [netbsd-7]: ftp_var.h

Log Message:
Pull up following revision(s) (requested by christos in ticket #685):
usr.bin/ftp/ftp_var.h: revision 1.83
Increase the buffer limit; otherwise files in:
http://www.taxdetective.ca/Samples/sampledatafiles.html
fail.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.82.8.1 src/usr.bin/ftp/ftp_var.h

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

Modified files:

Index: src/usr.bin/ftp/ftp_var.h
diff -u src/usr.bin/ftp/ftp_var.h:1.82 src/usr.bin/ftp/ftp_var.h:1.82.8.1
--- src/usr.bin/ftp/ftp_var.h:1.82	Fri Dec 21 18:07:36 2012
+++ src/usr.bin/ftp/ftp_var.h	Tue Apr 14 05:10:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftp_var.h,v 1.82 2012/12/21 18:07:36 christos Exp $	*/
+/*	$NetBSD: ftp_var.h,v 1.82.8.1 2015/04/14 05:10:38 snj Exp $	*/
 
 /*-
  * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -169,7 +169,7 @@ enum {
 /*
  * Global defines
  */
-#define	FTPBUFLEN	MAXPATHLEN + 200
+#define	FTPBUFLEN	(4 * MAXPATHLEN)
 #define	MAX_IN_PORT_T	0xU
 
 #define	HASHBYTES	1024	/* default mark for `hash' command */



CVS commit: [netbsd-7] src/external/bsd/openldap/dist/servers/slapd

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:00:15 UTC 2015

Modified Files:
src/external/bsd/openldap/dist/servers/slapd [netbsd-7]: filter.c
src/external/bsd/openldap/dist/servers/slapd/overlays [netbsd-7]:
deref.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #680):
external/bsd/openldap/dist/servers/slapd/filter.c: revision 1.2
external/bsd/openldap/dist/servers/slapd/overlays/deref.c: revision 1.2
Apply: 
http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=commit;h=c32e74763f77675b9e144126e375977ed6dc562c
The deref overlay in slapd 2.4.13 through 2.4.40 dereferences a NULL
pointer when a search request includes the Deref control with an empty
list of attributes to return (missing input validation). [CVE-2015-1545]
--
Apply: 
http://www.openldap.org/devel/gitweb.cgi?p=openldap.git;a=commit;h=2f1a2dd329b91afe561cd06b872d09630d4edb6a
Certain search queries including the Matched Values control can trigger
a double free in slapd 2.4.40 when freeing operation controls. This is a
regression in 2.4.40, no earlier releases are affected. [CVE-1546]


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.2.1 \
src/external/bsd/openldap/dist/servers/slapd/filter.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.2.1 \
src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c

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

Modified files:

Index: src/external/bsd/openldap/dist/servers/slapd/filter.c
diff -u src/external/bsd/openldap/dist/servers/slapd/filter.c:1.1.1.4 src/external/bsd/openldap/dist/servers/slapd/filter.c:1.1.1.4.2.1
--- src/external/bsd/openldap/dist/servers/slapd/filter.c:1.1.1.4	Wed May 28 09:58:46 2014
+++ src/external/bsd/openldap/dist/servers/slapd/filter.c	Tue Apr 14 05:00:15 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: filter.c,v 1.1.1.4 2014/05/28 09:58:46 tron Exp $	*/
+/*	$NetBSD: filter.c,v 1.1.1.4.2.1 2015/04/14 05:00:15 snj Exp $	*/
 
 /* filter.c - routines for parsing and dealing with filters */
 /* $OpenLDAP$ */
@@ -1160,14 +1160,10 @@ get_vrFilter( Operation *op, BerElement 
 void
 vrFilter_free( Operation *op, ValuesReturnFilter *vrf )
 {
-	ValuesReturnFilter	*p, *next;
+	ValuesReturnFilter	*next;
 
-	if ( vrf == NULL ) {
-		return;
-	}
-
-	for ( p = vrf; p != NULL; p = next ) {
-		next = p-vrf_next;
+	for ( p = vrf; vrf != NULL; vrf = next ) {
+		next = vrf-vrf_next;
 
 		switch ( vrf-vrf_choice  SLAPD_FILTER_MASK ) {
 		case LDAP_FILTER_PRESENT:

Index: src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c
diff -u src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c:1.1.1.3 src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c:1.1.1.3.2.1
--- src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c:1.1.1.3	Wed May 28 09:58:52 2014
+++ src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c	Tue Apr 14 05:00:15 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: deref.c,v 1.1.1.3 2014/05/28 09:58:52 tron Exp $	*/
+/*	$NetBSD: deref.c,v 1.1.1.3.2.1 2015/04/14 05:00:15 snj Exp $	*/
 
 /* deref.c - dereference overlay */
 /* $OpenLDAP$ */
@@ -185,7 +185,8 @@ deref_parseCtrl (
 		ber_len_t cnt = sizeof(struct berval);
 		ber_len_t off = 0;
 
-		if ( ber_scanf( ber, {m{M}}, derefAttr, attributes, cnt, off ) == LBER_ERROR )
+		if ( ber_scanf( ber, {m{M}}, derefAttr, attributes, cnt, off ) == LBER_ERROR
+			|| !cnt )
 		{
 			rs-sr_text = Dereference control: derefSpec decoding error;
 			rs-sr_err = LDAP_PROTOCOL_ERROR;



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

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 05:15:57 UTC 2015

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

Log Message:
Pull up following revision(s) (requested by christos in ticket #688):
sbin/fsck_ext2fs/setup.c: revision 1.32
Instead of zerodivide, give a useful error message.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.31.6.1 src/sbin/fsck_ext2fs/setup.c

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

Modified files:

Index: src/sbin/fsck_ext2fs/setup.c
diff -u src/sbin/fsck_ext2fs/setup.c:1.31 src/sbin/fsck_ext2fs/setup.c:1.31.6.1
--- src/sbin/fsck_ext2fs/setup.c:1.31	Sun Jun 23 02:06:04 2013
+++ src/sbin/fsck_ext2fs/setup.c	Tue Apr 14 05:15:57 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: setup.c,v 1.31 2013/06/23 02:06:04 dholland Exp $	*/
+/*	$NetBSD: setup.c,v 1.31.6.1 2015/04/14 05:15:57 snj Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -58,7 +58,7 @@
 #if 0
 static char sccsid[] = @(#)setup.c	8.5 (Berkeley) 11/23/94;
 #else
-__RCSID($NetBSD: setup.c,v 1.31 2013/06/23 02:06:04 dholland Exp $);
+__RCSID($NetBSD: setup.c,v 1.31.6.1 2015/04/14 05:15:57 snj Exp $);
 #endif
 #endif /* not lint */
 
@@ -490,6 +490,10 @@ calcsb(const char *dev, int devfd, struc
 		fstypenames[pp-p_fstype] : unknown);
 		return 0;
 	}
+	if (pp-p_fsize == 0) {
+		pfatal(%s: PARTITION SIZE IS 0\n, dev);
+		return 0;
+	}
 	memset(fs, 0, sizeof(struct m_ext2fs));
 	fs-e2fs_bsize = pp-p_fsize;
 	fs-e2fs.e2fs_log_bsize = pp-p_fsize / 1024;



CVS commit: src/external/bsd/byacc/bin

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:15:39 UTC 2015

Modified Files:
src/external/bsd/byacc/bin: Makefile

Log Message:
bump table to the max value allowed


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/byacc/bin/Makefile

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

Modified files:

Index: src/external/bsd/byacc/bin/Makefile
diff -u src/external/bsd/byacc/bin/Makefile:1.4 src/external/bsd/byacc/bin/Makefile:1.5
--- src/external/bsd/byacc/bin/Makefile:1.4	Sat Jan  3 18:22:52 2015
+++ src/external/bsd/byacc/bin/Makefile	Mon Apr 13 13:15:39 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2015/01/03 23:22:52 christos Exp $
+#	$NetBSD: Makefile,v 1.5 2015/04/13 17:15:39 christos Exp $
 
 .include bsd.own.mk
 
@@ -6,6 +6,7 @@ PROG=	yacc
 SRCS=	closure.c error.c lalr.c lr0.c main.c mkpar.c output.c reader.c \
 	symtab.c verbose.c warshall.c graph.c mstring.c btyaccpar.c
 
+CPPFLAGS+=	-DMAXTABLE=INT_MAX
 CPPFLAGS+=	-DGCC_NORETURN=__dead
 
 COPTS.output.c += -Wno-format-nonliteral



CVS import: src/sys/external/bsd/acpica/dist

2015-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 13 17:21:11 UTC 2015

Update of /cvsroot/src/sys/external/bsd/acpica/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv1072

Log Message:

10 April 2015. Summary of changes for version 20150410:

Reverted a change introduced in version 20150408 that caused
a regression in the disassembler where incorrect operator
symbols could be emitted.


08 April 2015. Summary of changes for version 20150408:


1) ACPICA kernel-resident subsystem:

Permanently set the return value for the _REV predefined name. It now 
returns 2 (was 5). This matches other ACPI implementations. _REV will be 
deprecated in the future, and is now defined to be 1 for ACPI 1.0, and 2 
for ACPI 2.0 and later. It should never be used to differentiate or 
identify operating systems.

Added the Windows 2015 string to the _OSI support. ACPICA will now 
return TRUE to a query with this string.

Fixed several issues with the local version of the printf function.

Added the C99 compiler option (-std=c99) to the Unix makefiles.

  Current Release:
Non-Debug Version:  99.9K Code, 27.4K Data, 127.3K Total
Debug Version: 195.2K Code, 80.7K Data, 275.9K Total
  Previous Release:
Non-Debug Version:  98.8K Code, 27.3K Data, 126.1K Total
Debug Version: 192.1K Code, 79.8K Data, 271.9K Total


2) iASL Compiler/Disassembler and Tools:

iASL: Implemented an enhancement to the constant folding feature to 
transform the parse tree to a simple Store operation whenever possible:
Add (2, 3, X) == is converted to: Store (5, X)
X = 2 + 3 == is converted to: Store (5, X)

Updated support for the SLIC table (Software Licensing Description Table) 
in both the Data Table compiler and the disassembler. The SLIC table 
support now conforms to Microsoft Software Licensing Tables (SLIC and 
MSDM). November 29, 2011. Copyright 2011 Microsoft. Note: Any SLIC data 
following the ACPI header is now defined to be Proprietary Data, and as 
such, can only be entered or displayed as a hex data block.

Implemented full support for the MSDM table as described in the document 
above. Note: The format of MSDM is similar to SLIC. Any MSDM data 
following the ACPI header is defined to be Proprietary Data, and can 
only be entered or displayed as a hex data block.

Implemented the -Pn option for the iASL Table Compiler (was only 
implemented for the ASL compiler). This option disables the iASL 
preprocessor.

Disassembler: For disassembly of Data Tables, added a comment field 
around the Ascii equivalent data that is emitted as part of the Raw 
Table Data block. This prevents the iASL Preprocessor from possible 
confusion if/when the table is compiled.

Disassembler: Added an option (-df) to force the disassembler to assume 
that the table being disassembled contains valid AML. This feature is 
useful for disassembling AML files that contain ACPI signatures other 
than DSDT or SSDT (such as OEMx or other signatures).

Changes for the EFI version of the tools:
1) Fixed a build error/issue
2) Fixed a cast warning

iASL: Fixed a path issue with the __FILE__ operator by making the 
directory prefix optional within the internal SplitInputFilename 
function.

Debugger: Removed some unused global variables.

Tests: Updated the makefile for proper generation of the AAPITS suite.


04 February 2015. Summary of changes for version 20150204:

ACPICA kernel-resident subsystem:

Updated all ACPICA copyrights and signons to 2014. Added the 2014 
copyright to all module headers and signons, including the standard Linux 
header. This affects virtually every file in the ACPICA core subsystem, 
iASL compiler, all ACPICA utilities, and the test suites.

Events: Introduce ACPI_GPE_DISPATCH_RAW_HANDLER to fix GPE storm issues.
A raw gpe handling mechanism was created to allow better handling of GPE
storms that aren't easily managed by the normal handler. The raw handler
allows disabling/renabling of the the GPE so that interrupt storms can be
avoided in cases where events cannot be timely serviced. In this 
scenario, handlers should use the AcpiSetGpe() API to disable/enable the 
GPE. This API will leave the reference counts undisturbed, thereby 
preventing unintentional clearing of the GPE when the intent in only to 
temporarily disable it. Raw handlers allow enabling and disabling of a 
GPE by removing GPE register locking. As such, raw handlers much provide 
their own locks while using GPE API's to protect access to GPE data 
structures.
Lv Zheng

Events: Always modify GPE registers under the GPE lock.
Applies GPE lock around AcpiFinishGpe() to protect access to GPE register
values. Reported as bug by joe@apple.com.

Unix makefiles: Separate option to disable optimizations and 
_FORTIFY_SOURCE. This change removes the _FORTIFY_SOURCE flag from the 
NOOPT disable option and creates a 

CVS commit: src/sys/dev

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 14:30:05 UTC 2015

Modified Files:
src/sys/dev: rnd_private.h

Log Message:
Omit needless define.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/rnd_private.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/rnd_private.h
diff -u src/sys/dev/rnd_private.h:1.4 src/sys/dev/rnd_private.h:1.5
--- src/sys/dev/rnd_private.h:1.4	Tue Aug 27 19:30:10 2013
+++ src/sys/dev/rnd_private.h	Mon Apr 13 14:30:05 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: rnd_private.h,v 1.4 2013/08/27 19:30:10 riastradh Exp $ */
+/*  $NetBSD: rnd_private.h,v 1.5 2015/04/13 14:30:05 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -40,13 +40,6 @@
 #define RND_ENTROPY_THRESHOLD   10
 
 /*
- * Size of the event queue.  This _MUST_ be a power of 2.
- */
-#ifndef RND_EVENTQSIZE
-#define RND_EVENTQSIZE  128
-#endif
-
-/*
  * Used by rnd_extract_data() and rndpool_extract_data() to describe how
  * good the data has to be.
  */



CVS commit: src/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 14:41:06 UTC 2015

Modified Files:
src/sys/dev: rnd_private.h
src/sys/kern: kern_rndq.c kern_rndsink.c

Log Message:
Move rndpool_(maybe_)extract to rndq, rename to rnd_(try)extract.

Make rnd_extract_data static.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/rnd_private.h
cvs rdiff -u -r1.43 -r1.44 src/sys/kern/kern_rndq.c
cvs rdiff -u -r1.10 -r1.11 src/sys/kern/kern_rndsink.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/rnd_private.h
diff -u src/sys/dev/rnd_private.h:1.5 src/sys/dev/rnd_private.h:1.6
--- src/sys/dev/rnd_private.h:1.5	Mon Apr 13 14:30:05 2015
+++ src/sys/dev/rnd_private.h	Mon Apr 13 14:41:06 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: rnd_private.h,v 1.5 2015/04/13 14:30:05 riastradh Exp $ */
+/*  $NetBSD: rnd_private.h,v 1.6 2015/04/13 14:41:06 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -47,5 +47,6 @@
 #define RND_EXTRACT_GOOD	1  /* return as many good bytes
   (short read ok) */
 
-uint32_trnd_extract_data(void *, uint32_t, uint32_t);
+bool	rnd_extract(void *, size_t);
+bool	rnd_tryextract(void *, size_t);
 #endif

Index: src/sys/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.43 src/sys/kern/kern_rndq.c:1.44
--- src/sys/kern/kern_rndq.c:1.43	Wed Apr  8 14:13:55 2015
+++ src/sys/kern/kern_rndq.c	Mon Apr 13 14:41:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.43 2015/04/08 14:13:55 riastradh Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.44 2015/04/13 14:41:06 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.43 2015/04/08 14:13:55 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.44 2015/04/13 14:41:06 riastradh Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -1148,7 +1148,7 @@ rnd_wake(void *arg)
 	rnd_wakeup_readers();
 }
 
-u_int32_t
+static uint32_t
 rnd_extract_data(void *p, u_int32_t len, u_int32_t flags)
 {
 	static int timed_in;
@@ -1226,6 +1226,67 @@ rnd_extract_data(void *p, u_int32_t len,
 	return retval;
 }
 
+/*
+ * Fill the buffer with as much entropy as we can.  Return true if it
+ * has full entropy and false if not.
+ */
+bool
+rnd_extract(void *buffer, size_t bytes)
+{
+	const size_t extracted = rnd_extract_data(buffer, bytes,
+	RND_EXTRACT_GOOD);
+
+	if (extracted  bytes) {
+		(void)rnd_extract_data((uint8_t *)buffer + extracted,
+		bytes - extracted, RND_EXTRACT_ANY);
+		mutex_spin_enter(rndpool_mtx);
+		rnd_getmore(bytes - extracted);
+		mutex_spin_exit(rndpool_mtx);
+		return false;
+	}
+
+	return true;
+}
+
+/*
+ * If we have as much entropy as is requested, fill the buffer with it
+ * and return true.  Otherwise, leave the buffer alone and return
+ * false.
+ */
+
+CTASSERT(RND_ENTROPY_THRESHOLD = 0xUL);
+CTASSERT(RNDSINK_MAX_BYTES = (0xUL - RND_ENTROPY_THRESHOLD));
+CTASSERT((RNDSINK_MAX_BYTES + RND_ENTROPY_THRESHOLD) =
+	(0xUL / NBBY));
+
+bool
+rnd_tryextract(void *buffer, size_t bytes)
+{
+	bool ok;
+
+	KASSERT(bytes = RNDSINK_MAX_BYTES);
+
+	const uint32_t bits_needed = ((bytes + RND_ENTROPY_THRESHOLD) * NBBY);
+
+	mutex_spin_enter(rndpool_mtx);
+	if (bits_needed = rndpool_get_entropy_count(rnd_pool)) {
+		const uint32_t extracted __diagused =
+		rndpool_extract_data(rnd_pool, buffer, bytes,
+			RND_EXTRACT_GOOD);
+
+		KASSERT(extracted == bytes);
+
+		ok = true;
+	} else {
+		ok = false;
+		rnd_getmore(howmany(bits_needed -
+			rndpool_get_entropy_count(rnd_pool), NBBY));
+	}
+	mutex_spin_exit(rndpool_mtx);
+
+	return ok;
+}
+
 void
 rnd_seed(void *base, size_t len)
 {

Index: src/sys/kern/kern_rndsink.c
diff -u src/sys/kern/kern_rndsink.c:1.10 src/sys/kern/kern_rndsink.c:1.11
--- src/sys/kern/kern_rndsink.c:1.10	Sun Oct 26 18:22:32 2014
+++ src/sys/kern/kern_rndsink.c	Mon Apr 13 14:41:06 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndsink.c,v 1.10 2014/10/26 18:22:32 tls Exp $	*/
+/*	$NetBSD: kern_rndsink.c,v 1.11 2015/04/13 14:41:06 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndsink.c,v 1.10 2014/10/26 18:22:32 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndsink.c,v 1.11 2015/04/13 14:41:06 riastradh Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -86,74 +86,6 @@ rndsinks_init(void)
 	mutex_init(rndsinks_lock, MUTEX_DEFAULT, IPL_VM);
 }
 
-/*
- * XXX Provisional -- rndpool_extract and rndpool_maybe_extract should
- * move into kern_rndpool.c.
- */
-extern rndpool_t rnd_pool;
-extern kmutex_t rndpool_mtx;
-
-/*
- * Fill the buffer with as much entropy as we can.  Return true if it
- * has full entropy and false if not.
- */
-static bool
-rndpool_extract(void *buffer, size_t bytes)

CVS commit: src/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 16:46:34 UTC 2015

Modified Files:
src/sys/kern: subr_autoconf.c subr_prf.c
src/sys/rump/dev/lib/libopencrypto: opencrypto_component.c
src/sys/rump/librump/rumpkern: hyperentropy.c rump.c
src/sys/uvm: uvm.h

Log Message:
Convert remaining MI sys/rnd.h stragglers.  Many MD ones left.


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/kern/subr_autoconf.c
cvs rdiff -u -r1.157 -r1.158 src/sys/kern/subr_prf.c
cvs rdiff -u -r1.1 -r1.2 \
src/sys/rump/dev/lib/libopencrypto/opencrypto_component.c
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/rumpkern/hyperentropy.c
cvs rdiff -u -r1.316 -r1.317 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -u -r1.64 -r1.65 src/sys/uvm/uvm.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/subr_autoconf.c
diff -u src/sys/kern/subr_autoconf.c:1.234 src/sys/kern/subr_autoconf.c:1.235
--- src/sys/kern/subr_autoconf.c:1.234	Fri Mar  6 09:28:15 2015
+++ src/sys/kern/subr_autoconf.c	Mon Apr 13 16:46:33 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_autoconf.c,v 1.234 2015/03/06 09:28:15 mrg Exp $ */
+/* $NetBSD: subr_autoconf.c,v 1.235 2015/04/13 16:46:33 riastradh Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_autoconf.c,v 1.234 2015/03/06 09:28:15 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_autoconf.c,v 1.235 2015/04/13 16:46:33 riastradh Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_ddb.h
@@ -110,7 +110,7 @@ __KERNEL_RCSID(0, $NetBSD: subr_autocon
 
 #include sys/disk.h
 
-#include sys/rnd.h
+#include sys/rndsource.h
 
 #include machine/limits.h
 

Index: src/sys/kern/subr_prf.c
diff -u src/sys/kern/subr_prf.c:1.157 src/sys/kern/subr_prf.c:1.158
--- src/sys/kern/subr_prf.c:1.157	Wed Feb  4 07:10:47 2015
+++ src/sys/kern/subr_prf.c	Mon Apr 13 16:46:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.157 2015/02/04 07:10:47 msaitoh Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.158 2015/04/13 16:46:33 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_prf.c,v 1.157 2015/02/04 07:10:47 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_prf.c,v 1.158 2015/04/13 16:46:33 riastradh Exp $);
 
 #include opt_ddb.h
 #include opt_ipkdb.h
@@ -65,7 +65,7 @@ __KERNEL_RCSID(0, $NetBSD: subr_prf.c,v
 #include sys/kernel.h
 #include sys/cpu.h
 #include sys/sha2.h
-#include sys/rnd.h
+#include sys/rndsource.h
 
 #include dev/cons.h
 

Index: src/sys/rump/dev/lib/libopencrypto/opencrypto_component.c
diff -u src/sys/rump/dev/lib/libopencrypto/opencrypto_component.c:1.1 src/sys/rump/dev/lib/libopencrypto/opencrypto_component.c:1.2
--- src/sys/rump/dev/lib/libopencrypto/opencrypto_component.c:1.1	Thu Mar 13 01:51:30 2014
+++ src/sys/rump/dev/lib/libopencrypto/opencrypto_component.c	Mon Apr 13 16:46:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: opencrypto_component.c,v 1.1 2014/03/13 01:51:30 pooka Exp $ */
+/*	$NetBSD: opencrypto_component.c,v 1.2 2015/04/13 16:46:33 riastradh Exp $ */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,12 +26,11 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: opencrypto_component.c,v 1.1 2014/03/13 01:51:30 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: opencrypto_component.c,v 1.2 2015/04/13 16:46:33 riastradh Exp $);
 
 #include sys/param.h
 #include sys/conf.h
 #include sys/device.h
-#include sys/rnd.h
 #include sys/stat.h
 #include sys/module.h
 

Index: src/sys/rump/librump/rumpkern/hyperentropy.c
diff -u src/sys/rump/librump/rumpkern/hyperentropy.c:1.7 src/sys/rump/librump/rumpkern/hyperentropy.c:1.8
--- src/sys/rump/librump/rumpkern/hyperentropy.c:1.7	Fri Aug 15 19:47:59 2014
+++ src/sys/rump/librump/rumpkern/hyperentropy.c	Mon Apr 13 16:46:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: hyperentropy.c,v 1.7 2014/08/15 19:47:59 riastradh Exp $	*/
+/*	$NetBSD: hyperentropy.c,v 1.8 2015/04/13 16:46:33 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2014 Antti Kantee.  All Rights Reserved.
@@ -26,12 +26,13 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hyperentropy.c,v 1.7 2014/08/15 19:47:59 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: hyperentropy.c,v 1.8 2015/04/13 16:46:33 riastradh Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
 #include sys/kmem.h
-#include sys/rnd.h
+#include sys/rndpool.h
+#include sys/rndsource.h
 
 #include rump/rumpuser.h
 

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.316 src/sys/rump/librump/rumpkern/rump.c:1.317
--- src/sys/rump/librump/rumpkern/rump.c:1.316	Fri Feb  6 18:19:22 2015
+++ src/sys/rump/librump/rumpkern/rump.c	Mon Apr 13 16:46:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.316 2015/02/06 18:19:22 maxv Exp $	*/
+/*	$NetBSD: rump.c,v 1.317 2015/04/13 

CVS commit: src/sys/arch/i386/pnpbios

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 16:51:40 UTC 2015

Modified Files:
src/sys/arch/i386/pnpbios: fdc_pnpbios.c

Log Message:
Omit needless sys/rnd.h.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/i386/pnpbios/fdc_pnpbios.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/i386/pnpbios/fdc_pnpbios.c
diff -u src/sys/arch/i386/pnpbios/fdc_pnpbios.c:1.17 src/sys/arch/i386/pnpbios/fdc_pnpbios.c:1.18
--- src/sys/arch/i386/pnpbios/fdc_pnpbios.c:1.17	Thu Feb  2 19:42:59 2012
+++ src/sys/arch/i386/pnpbios/fdc_pnpbios.c	Mon Apr 13 16:51:40 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fdc_pnpbios.c,v 1.17 2012/02/02 19:42:59 tls Exp $	*/
+/*	$NetBSD: fdc_pnpbios.c,v 1.18 2015/04/13 16:51:40 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fdc_pnpbios.c,v 1.17 2012/02/02 19:42:59 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: fdc_pnpbios.c,v 1.18 2015/04/13 16:51:40 riastradh Exp $);
 
 
 
@@ -44,7 +44,6 @@ __KERNEL_RCSID(0, $NetBSD: fdc_pnpbios.
 #include sys/device.h
 #include sys/buf.h
 #include sys/queue.h
-#include sys/rnd.h
 
 #include sys/bus.h
 #include machine/intr.h



CVS commit: src/sys/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 15:39:20 UTC 2015

Modified Files:
src/sys/sys: rnd.h
Added Files:
src/sys/sys: rndio.h rndpool.h rndsource.h

Log Message:
Split sys/rnd.h into several header files.

It is silly that changing it causes ~the whole kernel to rebuild.
New header files:

- sys/rndio.h (user/kernel) for the ioctl interface.
- sys/rndsource.h (kernel-only) for the entropy source API.
- sys/rndpool.h (kernel-only) for the entropy pool algorithm.

(We already had sys/rndsink.h for the asynchronous reseed API.)

For now, sys/rnd.h includes all of these, until all users are
converted to include what they actually need.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/sys/rnd.h
cvs rdiff -u -r0 -r1.1 src/sys/sys/rndio.h src/sys/sys/rndpool.h \
src/sys/sys/rndsource.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/sys/rnd.h
diff -u src/sys/sys/rnd.h:1.46 src/sys/sys/rnd.h:1.47
--- src/sys/sys/rnd.h:1.46	Mon Apr 13 15:23:00 2015
+++ src/sys/sys/rnd.h	Mon Apr 13 15:39:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rnd.h,v 1.46 2015/04/13 15:23:00 riastradh Exp $	*/
+/*	$NetBSD: rnd.h,v 1.47 2015/04/13 15:39:19 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -38,259 +38,24 @@
 #endif /* !_KERNEL */
 
 #include sys/types.h
-#include sys/sha1.h
+#include sys/rndio.h		/* XXX provisional until users converted */
 
 #ifdef _KERNEL
 #include sys/queue.h
+#include sys/rndpool.h	/* XXX provisional until users converted */
+#include sys/rndsource.h	/* XXX provisional until users converted */
 #include sys/rngtest.h
 #include sys/systm.h
-#endif
 
 #define	RND_DEV_RANDOM	0	/* minor for blocking until unpredictable */
 #define	RND_DEV_URANDOM	1	/* minor for randomly generating data */
 
-/*
- * Exposed size of entropy pool, for convenience in load/save
- * from userspace.  Do not assume this is the same as the actual in-kernel
- * pool size!
- */
-#define RND_SAVEWORDS	128
-typedef struct {
-	uint32_t entropy;
-	uint8_t data[RND_SAVEWORDS * sizeof(uint32_t)];
-	uint8_t digest[SHA1_DIGEST_LENGTH];
-} rndsave_t;
-
-/* Statistics exposed by RNDGETPOOLSTAT */
-typedef struct
-{
-	uint32_t	poolsize;
-	uint32_t 	threshold;
-	uint32_t	maxentropy;
-
-	uint32_t	added;
-	uint32_t	curentropy;
-	uint32_t	removed;
-	uint32_t	discarded;
-	uint32_t	generated;
-} rndpoolstat_t;
-
-/* Sanitized random source view for userspace */
-typedef struct {
-	char		name[16];	/* device name */
-	uint32_t	total;		/* entropy from this source */
-	uint32_t	type;		/* type */
-	uint32_t	flags;		/* flags */
-} rndsource_t;
-
-typedef struct {
-	rndsource_t	rt;
-	uint32_t	dt_samples;	/* time-delta samples input */
-	uint32_t	dt_total;	/* time-delta entropy estimate */
-	uint32_t	dv_samples;	/* value-delta samples input */
-	uint32_t	dv_total;	/* value-delta entropy estimate */
-} rndsource_est_t;
-
-/*
- * Flags to control the source.  Low byte is type, upper bits are flags.
- */
-#define RND_FLAG_NO_ESTIMATE	0x0100
-#define RND_FLAG_NO_COLLECT	0x0200
-#define RND_FLAG_FAST		0x0400	/* process samples in bulk */
-#define RND_FLAG_HASCB		0x0800	/* has get callback */
-#define RND_FLAG_COLLECT_TIME	0x1000	/* use timestamp as input */
-#define RND_FLAG_COLLECT_VALUE	0x2000	/* use value as input */
-#define RND_FLAG_ESTIMATE_TIME	0x4000	/* estimate entropy on time */
-#define RND_FLAG_ESTIMATE_VALUE	0x8000	/* estimate entropy on value */
-#define	RND_FLAG_HASENABLE	0x0001	/* has enable/disable fns */
-#define RND_FLAG_DEFAULT	(RND_FLAG_COLLECT_VALUE|RND_FLAG_COLLECT_TIME|\
- RND_FLAG_ESTIMATE_TIME)
-
-#define	RND_TYPE_UNKNOWN	0	/* unknown source */
-#define	RND_TYPE_DISK		1	/* source is physical disk */
-#define	RND_TYPE_NET		2	/* source is a network device */
-#define	RND_TYPE_TAPE		3	/* source is a tape drive */
-#define	RND_TYPE_TTY		4	/* source is a tty device */
-#define	RND_TYPE_RNG		5	/* source is a hardware RNG */
-#define RND_TYPE_SKEW		6	/* source is skew between clocks */
-#define RND_TYPE_ENV		7	/* source is temp or fan sensor */
-#define RND_TYPE_VM		8	/* source is VM system events */
-#define RND_TYPE_POWER		9	/* source is power events */
-#define	RND_TYPE_MAX		9	/* last type id used */
-
-#ifdef _KERNEL
-/*
- * Size of entropy pool in 32-bit words.  This _MUST_ be a power of 2.  Don't
- * change this unless you really know what you are doing...
- */
-#ifndef RND_POOLWORDS
-#define RND_POOLWORDS	128
-#endif
-#define RND_POOLBITS	(RND_POOLWORDS * 32)
-
-typedef struct rnd_delta_estimator {
-	uint64_t	x;
-	uint64_t	dx;
-	uint64_t	d2x;
-	uint64_t	insamples;
-	uint64_t	outbits;
-} rnd_delta_t;
-
-typedef struct krndsource {
-	LIST_ENTRY(krndsource) list;	/* the linked list */
-charname[16];   /* device name */
-	rnd_delta_t	time_delta;	/* time delta estimator */
-	rnd_delta_t	

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

2015-04-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Mon Apr 13 16:19:42 UTC 2015

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

Log Message:
Add pmap locking to pmap_kenter_pa/kremove


To generate a diff of this commit:
cvs rdiff -u -r1.319 -r1.320 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.319 src/sys/arch/arm/arm32/pmap.c:1.320
--- src/sys/arch/arm/arm32/pmap.c:1.319	Sat Apr 11 15:21:33 2015
+++ src/sys/arch/arm/arm32/pmap.c	Mon Apr 13 16:19:42 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.319 2015/04/11 15:21:33 skrll Exp $	*/
+/*	$NetBSD: pmap.c,v 1.320 2015/04/13 16:19:42 matt Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -216,7 +216,7 @@
 
 #include arm/locore.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.319 2015/04/11 15:21:33 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.320 2015/04/13 16:19:42 matt Exp $);
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -3671,6 +3671,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v
 	}
 
 	pmap_t kpm = pmap_kernel();
+	pmap_acquire_pmap_lock(kpm);
 	struct l2_bucket * const l2b = pmap_get_l2_bucket(kpm, va);
 	const size_t l1slot __diagused = l1pte_index(va);
 	KASSERTMSG(l2b != NULL,
@@ -3718,6 +3719,7 @@ pmap_kenter_pa(vaddr_t va, paddr_t pa, v
 			cpu_cpwait();
 		}
 	}
+	pmap_release_pmap_lock(kpm);
 
 	pt_entry_t npte = L2_S_PROTO | pa | L2_S_PROT(PTE_KERNEL, prot)
 	| ((flags  PMAP_NOCACHE)
@@ -3814,6 +3816,8 @@ pmap_kremove(vaddr_t va, vsize_t len)
 
 	const vaddr_t eva = va + len;
 
+	pmap_acquire_pmap_lock(pmap_kernel());
+
 	while (va  eva) {
 		vaddr_t next_bucket = L2_NEXT_BUCKET_VA(va);
 		if (next_bucket  eva)
@@ -3875,6 +3879,7 @@ pmap_kremove(vaddr_t va, vsize_t len)
 		total_mappings += mappings;
 #endif
 	}
+	pmap_release_pmap_lock(pmap_kernel());
 	cpu_cpwait();
 	UVMHIST_LOG(maphist,   --- done (%u mappings removed),
 	total_mappings, 0, 0, 0);



CVS commit: src/sys/arch/i386/pci

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 16:21:54 UTC 2015

Modified Files:
src/sys/arch/i386/pci: glxsb.c

Log Message:
Need sys/rndsource.h, not sys/cprng.h, for rnd source stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/pci/glxsb.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/i386/pci/glxsb.c
diff -u src/sys/arch/i386/pci/glxsb.c:1.12 src/sys/arch/i386/pci/glxsb.c:1.13
--- src/sys/arch/i386/pci/glxsb.c:1.12	Sun Aug 10 16:44:34 2014
+++ src/sys/arch/i386/pci/glxsb.c	Mon Apr 13 16:21:54 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: glxsb.c,v 1.12 2014/08/10 16:44:34 tls Exp $	*/
+/*	$NetBSD: glxsb.c,v 1.13 2015/04/13 16:21:54 riastradh Exp $	*/
 /* $OpenBSD: glxsb.c,v 1.7 2007/02/12 14:31:45 tom Exp $ */
 
 /*
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: glxsb.c,v 1.12 2014/08/10 16:44:34 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: glxsb.c,v 1.13 2015/04/13 16:21:54 riastradh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -36,6 +36,7 @@ __KERNEL_RCSID(0, $NetBSD: glxsb.c,v 1.
 #include sys/callout.h
 #include sys/bus.h
 #include sys/cprng.h
+#include sys/rndsource.h
 
 #include machine/cpufunc.h
 



CVS commit: src/sys/dev

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 16:33:25 UTC 2015

Modified Files:
src/sys/dev: ld.c ldvar.h
src/sys/dev/acpi: fdc_acpi.c
src/sys/dev/ata: ld_ataraid.c wd.c wdvar.h
src/sys/dev/cardbus: if_fxp_cardbus.c if_rtk_cardbus.c rbus_ppb.c
src/sys/dev/gpib: rd.c
src/sys/dev/i2o: ld_iop.c
src/sys/dev/ic: am7990.c am79900.c com.c comvar.h cs89x0.c cs89x0var.h
dp8390.c dp8390var.h elink3.c elink3var.h elinkxl.c elinkxlvar.h
gemvar.h hme.c hmevar.h i82557.c i82557var.h lan9118.c lan9118var.h
lance.c lancevar.h ld_aac.c ld_cac.c ld_icp.c ld_mlx.c lemac.c
lemacvar.h mb86950.c mb86960.c mb86960var.h mtd803var.h pckbc.c
pckbcvar.h rtl8169.c rtl81x9.c rtl81x9var.h seeq8005.c
seeq8005var.h smc91cxx.c smc91cxxvar.h tulipvar.h
src/sys/dev/isa: cs89x0isa.c fd.c fdc_isa.c fdvar.h if_cs_isa.c if_eg.c
if_el.c if_iy.c if_tscs_isa.c
src/sys/dev/isapnp: if_cs_isapnp.c
src/sys/dev/iscsi: iscsi_globals.h iscsi_test.c
src/sys/dev/marvell: if_gfe.c if_mvgbe.c
src/sys/dev/mca: ed_mca.c edc_mca.c if_tra_mca.c
src/sys/dev/ofisa: if_cs_ofisa.c
src/sys/dev/pci: amdpm.c amdpm_smbus.c amdpmvar.h auich.c hifn7751.c
if_age.c if_alc.c if_ale.c if_bce.c if_bge.c if_cas.c if_de.c
if_devar.h if_dge.c if_fxp_pci.c if_jme.c if_msk.c if_mskvar.h
if_pcn.c if_sip.c if_sk.c if_skvar.h if_tl.c if_tlvar.h if_vr.c
if_vte.c if_wm.c if_xge.c ld_amr.c ld_twa.c ld_twe.c ld_virtio.c
viornd.c
src/sys/dev/pci/n8: nsp.c
src/sys/dev/pci/n8/common: config.c
src/sys/dev/pcmcia: if_cs_pcmcia.c if_xivar.h
src/sys/dev/sbus: be.c qe.c
src/sys/dev/scsipi: cd.c sd.c sdvar.h stvar.h
src/sys/dev/sdmmc: ld_sdmmc.c
src/sys/dev/sysmon: sysmon_envsys.c sysmon_power.c sysmonvar.h
src/sys/dev/usb: if_aue.c if_axe.c if_axen.c if_cdce.c if_cue.c
if_kue.c if_smsc.c if_udav.c if_upl.c if_url.c ucom.c uhidev.c
uhidev.h

Log Message:
Convert sys/dev to use sys/rndsource.h.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/ld.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/ldvar.h
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/acpi/fdc_acpi.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/ata/ld_ataraid.c
cvs rdiff -u -r1.418 -r1.419 src/sys/dev/ata/wd.c
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/ata/wdvar.h
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/cardbus/if_fxp_cardbus.c
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/cardbus/if_rtk_cardbus.c
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/cardbus/rbus_ppb.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/gpib/rd.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/i2o/ld_iop.c
cvs rdiff -u -r1.74 -r1.75 src/sys/dev/ic/am7990.c
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ic/am79900.c src/sys/dev/ic/hmevar.h
cvs rdiff -u -r1.332 -r1.333 src/sys/dev/ic/com.c
cvs rdiff -u -r1.79 -r1.80 src/sys/dev/ic/comvar.h
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/ic/cs89x0.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/ic/cs89x0var.h
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/ic/dp8390.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/ic/dp8390var.h
cvs rdiff -u -r1.135 -r1.136 src/sys/dev/ic/elink3.c
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/ic/elink3var.h
cvs rdiff -u -r1.116 -r1.117 src/sys/dev/ic/elinkxl.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/ic/elinkxlvar.h \
src/sys/dev/ic/gemvar.h
cvs rdiff -u -r1.90 -r1.91 src/sys/dev/ic/hme.c
cvs rdiff -u -r1.142 -r1.143 src/sys/dev/ic/i82557.c
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/ic/i82557var.h
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/ic/lan9118.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/ic/lan9118var.h
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/ic/lance.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/ic/lancevar.h
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/ic/ld_aac.c src/sys/dev/ic/ld_cac.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/ic/ld_icp.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/ic/ld_mlx.c src/sys/dev/ic/pckbcvar.h
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/ic/lemac.c
cvs rdiff -u -r1.12 -r1.13 src/sys/dev/ic/lemacvar.h
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/ic/mb86950.c
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/ic/mb86960.c
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/ic/mb86960var.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/mtd803var.h
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/ic/pckbc.c
cvs rdiff -u -r1.143 -r1.144 src/sys/dev/ic/rtl8169.c
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/ic/rtl81x9.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/ic/rtl81x9var.h
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/seeq8005.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/ic/seeq8005var.h
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/ic/smc91cxx.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/ic/smc91cxxvar.h
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/ic/tulipvar.h
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/isa/cs89x0isa.c
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/isa/fd.c
cvs rdiff -u 

CVS commit: src/sys/dev/usb

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 16:34:43 UTC 2015

Modified Files:
src/sys/dev/usb: if_cdcereg.h

Log Message:
Missed a spot: sys/rndsource.h for if_cdcereg.h.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/usb/if_cdcereg.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/usb/if_cdcereg.h
diff -u src/sys/dev/usb/if_cdcereg.h:1.7 src/sys/dev/usb/if_cdcereg.h:1.8
--- src/sys/dev/usb/if_cdcereg.h:1.7	Thu Feb  2 19:43:07 2012
+++ src/sys/dev/usb/if_cdcereg.h	Mon Apr 13 16:34:43 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cdcereg.h,v 1.7 2012/02/02 19:43:07 tls Exp $ */
+/*	$NetBSD: if_cdcereg.h,v 1.8 2015/04/13 16:34:43 riastradh Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul wp...@windriver.com
@@ -34,6 +34,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include sys/rndsource.h
+
 #define CDCE_RX_LIST_CNT	1
 #define CDCE_TX_LIST_CNT	1
 #define CDCE_BUFSZ		1542



CVS commit: src/sys/dist/pf/net

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 16:35:33 UTC 2015

Modified Files:
src/sys/dist/pf/net: pf_norm.c

Log Message:
sys/rnd.h not needed for pf_norm.c.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dist/pf/net/pf_norm.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/dist/pf/net/pf_norm.c
diff -u src/sys/dist/pf/net/pf_norm.c:1.27 src/sys/dist/pf/net/pf_norm.c:1.28
--- src/sys/dist/pf/net/pf_norm.c:1.27	Sun Oct 20 21:05:47 2013
+++ src/sys/dist/pf/net/pf_norm.c	Mon Apr 13 16:35:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pf_norm.c,v 1.27 2013/10/20 21:05:47 christos Exp $	*/
+/*	$NetBSD: pf_norm.c,v 1.28 2015/04/13 16:35:33 riastradh Exp $	*/
 /*	$OpenBSD: pf_norm.c,v 1.109 2007/05/28 17:16:39 henning Exp $ */
 
 /*
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pf_norm.c,v 1.27 2013/10/20 21:05:47 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: pf_norm.c,v 1.28 2015/04/13 16:35:33 riastradh Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_inet.h
@@ -46,7 +46,6 @@ __KERNEL_RCSID(0, $NetBSD: pf_norm.c,v 
 #include sys/pool.h
 
 #ifdef __NetBSD__
-#include sys/rnd.h
 #include sys/cprng.h
 #else
 #include dev/rndvar.h



CVS commit: src/sys/kern

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 16:36:12 UTC 2015

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

Log Message:
sys/rnd.h not needed for kern_pax.c.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/kern/kern_pax.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_pax.c
diff -u src/sys/kern/kern_pax.c:1.27 src/sys/kern/kern_pax.c:1.28
--- src/sys/kern/kern_pax.c:1.27	Tue Feb 25 18:30:11 2014
+++ src/sys/kern/kern_pax.c	Mon Apr 13 16:36:12 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_pax.c,v 1.27 2014/02/25 18:30:11 pooka Exp $	*/
+/*	$NetBSD: kern_pax.c,v 1.28 2015/04/13 16:36:12 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2006 Elad Efrat e...@netbsd.org
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_pax.c,v 1.27 2014/02/25 18:30:11 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_pax.c,v 1.28 2015/04/13 16:36:12 riastradh Exp $);
 
 #include opt_pax.h
 
@@ -47,7 +47,6 @@ __KERNEL_RCSID(0, $NetBSD: kern_pax.c,v
 
 #ifdef PAX_ASLR
 #include sys/mman.h
-#include sys/rnd.h
 #include sys/exec.h
 
 int pax_aslr_enabled = 1;



CVS commit: src/sys/kern

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 16:36:54 UTC 2015

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

Log Message:
sys/rnd.h - sys/rndsource.h in kern_todr.c.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/kern/kern_todr.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_todr.c
diff -u src/sys/kern/kern_todr.c:1.38 src/sys/kern/kern_todr.c:1.39
--- src/sys/kern/kern_todr.c:1.38	Sun Jan 11 14:22:53 2015
+++ src/sys/kern/kern_todr.c	Mon Apr 13 16:36:54 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_todr.c,v 1.38 2015/01/11 14:22:53 jmcneill Exp $	*/
+/*	$NetBSD: kern_todr.c,v 1.39 2015/04/13 16:36:54 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -41,7 +41,7 @@
 #include opt_todr.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_todr.c,v 1.38 2015/01/11 14:22:53 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_todr.c,v 1.39 2015/04/13 16:36:54 riastradh Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -49,7 +49,7 @@ __KERNEL_RCSID(0, $NetBSD: kern_todr.c,
 #include sys/device.h
 #include sys/timetc.h
 #include sys/intr.h
-#include sys/rnd.h
+#include sys/rndsource.h
 
 #include dev/clock_subr.h	/* hmm.. this should probably move to sys */
 



CVS commit: src/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 15:51:00 UTC 2015

Modified Files:
src/sys/crypto/cprng_fast: cprng_fast.c
src/sys/netinet: tcp_subr.c

Log Message:
cprng_strong(kern_cprng, ...) never blocks, pass 0 for flags.

FASYNC was wrong anyway!  It's FNONBLOCK.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/crypto/cprng_fast/cprng_fast.c
cvs rdiff -u -r1.258 -r1.259 src/sys/netinet/tcp_subr.c

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

Modified files:

Index: src/sys/crypto/cprng_fast/cprng_fast.c
diff -u src/sys/crypto/cprng_fast/cprng_fast.c:1.11 src/sys/crypto/cprng_fast/cprng_fast.c:1.12
--- src/sys/crypto/cprng_fast/cprng_fast.c:1.11	Mon Aug 11 22:36:49 2014
+++ src/sys/crypto/cprng_fast/cprng_fast.c	Mon Apr 13 15:51:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cprng_fast.c,v 1.11 2014/08/11 22:36:49 justin Exp $	*/
+/*	$NetBSD: cprng_fast.c,v 1.12 2015/04/13 15:51:00 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cprng_fast.c,v 1.11 2014/08/11 22:36:49 justin Exp $);
+__KERNEL_RCSID(0, $NetBSD: cprng_fast.c,v 1.12 2015/04/13 15:51:00 riastradh Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -233,7 +233,7 @@ cprng_fast_init_cpu(void *p, void *arg _
 	struct cprng_fast *const cprng = p;
 	uint8_t seed[CPRNG_FAST_SEED_BYTES];
 
-	cprng_strong(kern_cprng, seed, sizeof seed, FASYNC);
+	cprng_strong(kern_cprng, seed, sizeof seed, 0);
 	cprng_fast_seed(cprng, seed);
 	cprng-have_initial = rnd_initial_entropy;
 	(void)explicit_memset(seed, 0, sizeof seed);
@@ -278,7 +278,7 @@ cprng_fast_intr(void *cookie __unused)
 	uint8_t seed[CPRNG_FAST_SEED_BYTES];
 	int s;
 
-	cprng_strong(kern_cprng, seed, sizeof(seed), FASYNC);
+	cprng_strong(kern_cprng, seed, sizeof(seed), 0);
 
 	cprng = percpu_getref(cprng_fast_percpu);
 	s = splvm();

Index: src/sys/netinet/tcp_subr.c
diff -u src/sys/netinet/tcp_subr.c:1.258 src/sys/netinet/tcp_subr.c:1.259
--- src/sys/netinet/tcp_subr.c:1.258	Sat Feb 14 12:57:53 2015
+++ src/sys/netinet/tcp_subr.c	Mon Apr 13 15:51:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_subr.c,v 1.258 2015/02/14 12:57:53 he Exp $	*/
+/*	$NetBSD: tcp_subr.c,v 1.259 2015/04/13 15:51:00 riastradh Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tcp_subr.c,v 1.258 2015/02/14 12:57:53 he Exp $);
+__KERNEL_RCSID(0, $NetBSD: tcp_subr.c,v 1.259 2015/04/13 15:51:00 riastradh Exp $);
 
 #include opt_inet.h
 #include opt_ipsec.h
@@ -2248,7 +2248,7 @@ tcp_new_iss1(void *laddr, void *faddr, u
 	 */
 	if (tcp_iss_gotten_secret == false) {
 		cprng_strong(kern_cprng,
-			 tcp_iss_secret, sizeof(tcp_iss_secret), FASYNC);
+			 tcp_iss_secret, sizeof(tcp_iss_secret), 0);
 		tcp_iss_gotten_secret = true;
 	}
 



CVS commit: src/sys/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 15:51:30 UTC 2015

Modified Files:
src/sys/sys: cprng.h

Log Message:
Omit needless include of sys/fcntl.h from sys/cprng.h.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/sys/cprng.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/sys/cprng.h
diff -u src/sys/sys/cprng.h:1.11 src/sys/sys/cprng.h:1.12
--- src/sys/sys/cprng.h:1.11	Mon Apr 13 15:44:03 2015
+++ src/sys/sys/cprng.h	Mon Apr 13 15:51:30 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cprng.h,v 1.11 2015/04/13 15:44:03 riastradh Exp $ */
+/*	$NetBSD: cprng.h,v 1.12 2015/04/13 15:51:30 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2011-2013 The NetBSD Foundation, Inc.
@@ -37,7 +37,6 @@
 #define _CPRNG_H
 
 #include sys/types.h
-#include sys/fcntl.h		/* XXX users bogusly transitively need this */
 
 #include crypto/nist_ctr_drbg/nist_ctr_drbg.h
 #include crypto/cprng_fast/cprng_fast.h



CVS commit: src/sys/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 16:02:48 UTC 2015

Modified Files:
src/sys/sys: rndsource.h

Log Message:
sys/rndsource.h needs sys/rndio.h for RND_TYPE_*, RND_FLAG_*.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/sys/rndsource.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/sys/rndsource.h
diff -u src/sys/sys/rndsource.h:1.1 src/sys/sys/rndsource.h:1.2
--- src/sys/sys/rndsource.h:1.1	Mon Apr 13 15:39:19 2015
+++ src/sys/sys/rndsource.h	Mon Apr 13 16:02:48 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rndsource.h,v 1.1 2015/04/13 15:39:19 riastradh Exp $	*/
+/*	$NetBSD: rndsource.h,v 1.2 2015/04/13 16:02:48 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -38,6 +38,7 @@
 #endif
 
 #include sys/types.h
+#include sys/rndio.h		/* RND_TYPE_*, RND_FLAG_* */
 #include sys/rngtest.h
 
 typedef struct rnd_delta_estimator {



CVS commit: src/sys/arch/x86

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 16:03:51 UTC 2015

Modified Files:
src/sys/arch/x86/include: via_padlock.h
src/sys/arch/x86/pci: fwhrng.c
src/sys/arch/x86/x86: ipmi.c via_padlock.c

Log Message:
Convert arch/x86 to use sys/rnd*.h.  Omit needless includes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x86/include/via_padlock.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x86/pci/fwhrng.c
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/x86/x86/ipmi.c
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/x86/x86/via_padlock.c

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

Modified files:

Index: src/sys/arch/x86/include/via_padlock.h
diff -u src/sys/arch/x86/include/via_padlock.h:1.7 src/sys/arch/x86/include/via_padlock.h:1.8
--- src/sys/arch/x86/include/via_padlock.h:1.7	Sat Nov 19 22:51:21 2011
+++ src/sys/arch/x86/include/via_padlock.h	Mon Apr 13 16:03:51 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: via_padlock.h,v 1.7 2011/11/19 22:51:21 tls Exp $	*/
+/*	$NetBSD: via_padlock.h,v 1.8 2015/04/13 16:03:51 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2003 Jason Wright
@@ -23,7 +23,7 @@
 
 #if defined(_KERNEL)
 
-#include sys/rnd.h
+#include sys/rndsource.h
 #include sys/callout.h
 #include crypto/rijndael/rijndael.h
 

Index: src/sys/arch/x86/pci/fwhrng.c
diff -u src/sys/arch/x86/pci/fwhrng.c:1.8 src/sys/arch/x86/pci/fwhrng.c:1.9
--- src/sys/arch/x86/pci/fwhrng.c:1.8	Sun Nov 16 16:20:00 2014
+++ src/sys/arch/x86/pci/fwhrng.c	Mon Apr 13 16:03:51 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwhrng.c,v 1.8 2014/11/16 16:20:00 ozaki-r Exp $	*/
+/*	$NetBSD: fwhrng.c,v 1.9 2015/04/13 16:03:51 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2000 Michael Shalayeff
@@ -29,13 +29,13 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fwhrng.c,v 1.8 2014/11/16 16:20:00 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: fwhrng.c,v 1.9 2015/04/13 16:03:51 riastradh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
 #include sys/device.h
 #include sys/time.h
-#include sys/rnd.h
+#include sys/rndsource.h
 
 #include sys/bus.h
 

Index: src/sys/arch/x86/x86/ipmi.c
diff -u src/sys/arch/x86/x86/ipmi.c:1.60 src/sys/arch/x86/x86/ipmi.c:1.61
--- src/sys/arch/x86/x86/ipmi.c:1.60	Mon Dec 29 14:00:26 2014
+++ src/sys/arch/x86/x86/ipmi.c	Mon Apr 13 16:03:51 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipmi.c,v 1.60 2014/12/29 14:00:26 mlelstv Exp $ */
+/*	$NetBSD: ipmi.c,v 1.61 2015/04/13 16:03:51 riastradh Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -52,7 +52,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.60 2014/12/29 14:00:26 mlelstv Exp $);
+__KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.61 2015/04/13 16:03:51 riastradh Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -66,7 +66,6 @@ __KERNEL_RCSID(0, $NetBSD: ipmi.c,v 1.6
 #include sys/kthread.h
 #include sys/bus.h
 #include sys/intr.h
-#include sys/rnd.h
 
 #include x86/smbiosvar.h
 
@@ -89,7 +88,6 @@ struct ipmi_sensor {
 	uint32_t	i_props, i_defprops;
 	SLIST_ENTRY(ipmi_sensor) i_list;
 	int32_t		i_prevval;	/* feed rnd source on change */
-	krndsource_t	i_rnd;
 };
 
 int	ipmi_nintr;

Index: src/sys/arch/x86/x86/via_padlock.c
diff -u src/sys/arch/x86/x86/via_padlock.c:1.23 src/sys/arch/x86/x86/via_padlock.c:1.24
--- src/sys/arch/x86/x86/via_padlock.c:1.23	Sun Nov 16 16:20:00 2014
+++ src/sys/arch/x86/x86/via_padlock.c	Mon Apr 13 16:03:51 2015
@@ -1,5 +1,5 @@
 /*	$OpenBSD: via.c,v 1.8 2006/11/17 07:47:56 tom Exp $	*/
-/*	$NetBSD: via_padlock.c,v 1.23 2014/11/16 16:20:00 ozaki-r Exp $ */
+/*	$NetBSD: via_padlock.c,v 1.24 2015/04/13 16:03:51 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2003 Jason Wright
@@ -20,7 +20,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: via_padlock.c,v 1.23 2014/11/16 16:20:00 ozaki-r Exp $);
+__KERNEL_RCSID(0, $NetBSD: via_padlock.c,v 1.24 2015/04/13 16:03:51 riastradh Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -28,12 +28,10 @@ __KERNEL_RCSID(0, $NetBSD: via_padlock.
 #include sys/kernel.h
 #include sys/device.h
 #include sys/module.h
-#include sys/rnd.h
+#include sys/rndsource.h
 #include sys/malloc.h
 #include sys/mbuf.h
 #include sys/cpu.h
-#include sys/rnd.h
-#include sys/cprng.h
 
 #include x86/specialreg.h
 



CVS commit: src/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 15:23:01 UTC 2015

Modified Files:
src/sys/kern: kern_rndq.c
src/sys/sys: rnd.h

Log Message:
Little rnd.h cleanup.

- Make rnd_printing static in kern_rndq.c.
- Merge some #ifdef _KERNEL blocks.
- Fix comments about RND_DEV_(U)RANDOM.
- Move rnd_ready to rnd_private.h.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/kern/kern_rndq.c
cvs rdiff -u -r1.45 -r1.46 src/sys/sys/rnd.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_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.45 src/sys/kern/kern_rndq.c:1.46
--- src/sys/kern/kern_rndq.c:1.45	Mon Apr 13 15:13:50 2015
+++ src/sys/kern/kern_rndq.c	Mon Apr 13 15:23:01 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.45 2015/04/13 15:13:50 riastradh Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.46 2015/04/13 15:23:01 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.45 2015/04/13 15:13:50 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.46 2015/04/13 15:23:01 riastradh Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -176,7 +176,8 @@ static inline void	rnd_schedule_process(
 
 int			rnd_ready = 0;
 int			rnd_initial_entropy = 0;
-int			rnd_printing = 0;
+
+static int		rnd_printing = 0;
 
 #ifdef DIAGNOSTIC
 static int		rnd_tested = 0;

Index: src/sys/sys/rnd.h
diff -u src/sys/sys/rnd.h:1.45 src/sys/sys/rnd.h:1.46
--- src/sys/sys/rnd.h:1.45	Mon Apr 13 15:13:50 2015
+++ src/sys/sys/rnd.h	Mon Apr 13 15:23:00 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rnd.h,v 1.45 2015/04/13 15:13:50 riastradh Exp $	*/
+/*	$NetBSD: rnd.h,v 1.46 2015/04/13 15:23:00 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -42,15 +42,12 @@
 
 #ifdef _KERNEL
 #include sys/queue.h
-#include sys/systm.h
-#endif
-
-#ifdef _KERNEL
 #include sys/rngtest.h
+#include sys/systm.h
 #endif
 
-#define	RND_DEV_RANDOM	0	/* minor devices for random and kinda random */
-#define	RND_DEV_URANDOM	1
+#define	RND_DEV_RANDOM	0	/* minor for blocking until unpredictable */
+#define	RND_DEV_URANDOM	1	/* minor for randomly generating data */
 
 /*
  * Exposed size of entropy pool, for convenience in load/save
@@ -228,9 +225,6 @@ rnd_add_uint64(krndsource_t *kr, uint64_
 
 extern int	rnd_initial_entropy;
 
-extern int	rnd_ready;
-extern int	rnd_printing;		/* XXX recursion through printf */
-
 #endif /* _KERNEL */
 
 #define	RND_MAXSTATCOUNT	10	/* 10 sources at once max */



CVS commit: src/sys/dev/pci

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 15:43:43 UTC 2015

Modified Files:
src/sys/dev/pci: ubsec.c ubsecreg.h ubsecvar.h

Log Message:
Add header guards and necessary includes.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pci/ubsec.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/ubsecreg.h
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/ubsecvar.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/ubsec.c
diff -u src/sys/dev/pci/ubsec.c:1.41 src/sys/dev/pci/ubsec.c:1.42
--- src/sys/dev/pci/ubsec.c:1.41	Sun Aug 10 16:44:36 2014
+++ src/sys/dev/pci/ubsec.c	Mon Apr 13 15:43:43 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubsec.c,v 1.41 2014/08/10 16:44:36 tls Exp $	*/
+/*	$NetBSD: ubsec.c,v 1.42 2015/04/13 15:43:43 riastradh Exp $	*/
 /* $FreeBSD: src/sys/dev/ubsec/ubsec.c,v 1.6.2.6 2003/01/23 21:06:43 sam Exp $ */
 /*	$OpenBSD: ubsec.c,v 1.143 2009/03/27 13:31:30 reyk Exp$	*/
 
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ubsec.c,v 1.41 2014/08/10 16:44:36 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: ubsec.c,v 1.42 2015/04/13 15:43:43 riastradh Exp $);
 
 #undef UBSEC_DEBUG
 
@@ -69,6 +69,8 @@ __KERNEL_RCSID(0, $NetBSD: ubsec.c,v 1.
 #else
  #include sys/cprng.h
  #include sys/md5.h
+ #include sys/rndpool.h
+ #include sys/rndsource.h
 #endif
 #include sys/sha1.h
 

Index: src/sys/dev/pci/ubsecreg.h
diff -u src/sys/dev/pci/ubsecreg.h:1.4 src/sys/dev/pci/ubsecreg.h:1.5
--- src/sys/dev/pci/ubsecreg.h:1.4	Sat Apr 19 12:29:24 2014
+++ src/sys/dev/pci/ubsecreg.h	Mon Apr 13 15:43:43 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubsecreg.h,v 1.4 2014/04/19 12:29:24 bad Exp $	*/
+/*	$NetBSD: ubsecreg.h,v 1.5 2015/04/13 15:43:43 riastradh Exp $	*/
 /*	$OpenBSD: ubsecreg.h,v 1.29 2009/03/25 12:17:30 reyk Exp $	*/
 
 /*
@@ -32,6 +32,9 @@
  *
  */
 
+#ifndef	_DEV_PCI_UBSECREG_H
+#define	_DEV_PCI_UBSECREG_H
+
 /*
  * Register definitions for 5601 BlueSteel Networks Ubiquitous Broadband
  * Security uBSec chip.  Definitions from revision 2.8 of the product
@@ -251,3 +254,5 @@ struct ubsec_ctx_rsapriv {
 	u_int8_t		rpr_buf[5 * 1024 / 8];	/* parameters: */
 		/* p, q, dp, dq, pinv */
 };
+
+#endif	/* _DEV_PCI_UBSECREG_H */

Index: src/sys/dev/pci/ubsecvar.h
diff -u src/sys/dev/pci/ubsecvar.h:1.9 src/sys/dev/pci/ubsecvar.h:1.10
--- src/sys/dev/pci/ubsecvar.h:1.9	Sat Apr 19 12:29:24 2014
+++ src/sys/dev/pci/ubsecvar.h	Mon Apr 13 15:43:43 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubsecvar.h,v 1.9 2014/04/19 12:29:24 bad Exp $	*/
+/*	$NetBSD: ubsecvar.h,v 1.10 2015/04/13 15:43:43 riastradh Exp $	*/
 /*	$OpenBSD: ubsecvar.h,v 1.38 2009/03/27 13:31:30 reyk Exp $	*/
 
 /*
@@ -32,6 +32,12 @@
  *
  */
 
+#ifndef	_DEV_PCI_UBSECVAR_H
+#define	_DEV_PCI_UBSECVAR_H
+
+#include sys/types.h
+#include sys/rndsource.h
+
 /* Maximum queue length */
 #ifndef UBS_MAX_NQUEUE
 #define UBS_MAX_NQUEUE		60
@@ -240,3 +246,5 @@ struct ubsec_stats {
 	u_int32_t hst_modexp;		/* MOD EXP requests */
 	u_int32_t hst_modexpcrt;	/* MOD EXP CRT requests */
 };
+
+#endif	/* _DEV_PCI_UBSECVAR_H */



CVS commit: src/sys/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 15:44:03 UTC 2015

Modified Files:
src/sys/sys: cprng.h

Log Message:
Remove bogus #include sys/rnd.h from sys/cprng.h.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/sys/cprng.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/sys/cprng.h
diff -u src/sys/sys/cprng.h:1.10 src/sys/sys/cprng.h:1.11
--- src/sys/sys/cprng.h:1.10	Sun Aug 10 16:44:36 2014
+++ src/sys/sys/cprng.h	Mon Apr 13 15:44:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cprng.h,v 1.10 2014/08/10 16:44:36 tls Exp $ */
+/*	$NetBSD: cprng.h,v 1.11 2015/04/13 15:44:03 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2011-2013 The NetBSD Foundation, Inc.
@@ -38,7 +38,6 @@
 
 #include sys/types.h
 #include sys/fcntl.h		/* XXX users bogusly transitively need this */
-#include sys/rnd.h		/* XXX users bogusly transitively need this */
 
 #include crypto/nist_ctr_drbg/nist_ctr_drbg.h
 #include crypto/cprng_fast/cprng_fast.h



CVS commit: src/sys/dev

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 14:56:22 UTC 2015

Modified Files:
src/sys/dev: rndpseudo.c

Log Message:
If we're going to use the queue macros, use them as intended.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/rndpseudo.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/rndpseudo.c
diff -u src/sys/dev/rndpseudo.c:1.24 src/sys/dev/rndpseudo.c:1.25
--- src/sys/dev/rndpseudo.c:1.24	Sun Nov  9 20:29:58 2014
+++ src/sys/dev/rndpseudo.c	Mon Apr 13 14:56:22 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rndpseudo.c,v 1.24 2014/11/09 20:29:58 christos Exp $	*/
+/*	$NetBSD: rndpseudo.c,v 1.25 2015/04/13 14:56:22 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rndpseudo.c,v 1.24 2014/11/09 20:29:58 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: rndpseudo.c,v 1.25 2015/04/13 14:56:22 riastradh Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -641,10 +641,10 @@ rnd_ioctl(struct file *fp, u_long cmd, v
 		 * Find the starting source by running through the
 		 * list of sources.
 		 */
-		kr = rnd_sources.lh_first;
+		kr = LIST_FIRST(rnd_sources);
 		start = rst-start;
 		while (kr != NULL  start = 1) {
-			kr = kr-list.le_next;
+			kr = LIST_NEXT(kr, list);
 			start--;
 		}
 
@@ -655,7 +655,7 @@ rnd_ioctl(struct file *fp, u_long cmd, v
 		 */
 		for (count = 0; count  rst-count  kr != NULL; count++) {
 			krndsource_to_rndsource(kr, rst-source[count]);
-			kr = kr-list.le_next;
+			kr = LIST_NEXT(kr, list);
 		}
 
 		rst-count = count;
@@ -677,10 +677,10 @@ rnd_ioctl(struct file *fp, u_long cmd, v
 		 * Find the starting source by running through the
 		 * list of sources.
 		 */
-		kr = rnd_sources.lh_first;
+		kr = LIST_FIRST(rnd_sources);
 		start = rset-start;
 		while (kr != NULL  start  1) {
-			kr = kr-list.le_next;
+			kr = LIST_NEXT(kr, list);
 			start--;
 		}
 
@@ -690,7 +690,7 @@ rnd_ioctl(struct file *fp, u_long cmd, v
 		 */
 		for (count = 0; count  rset-count  kr != NULL; count++) {
 			krndsource_to_rndsource_est(kr, rset-source[count]);
-			kr = kr-list.le_next;
+			kr = LIST_NEXT(kr, list);
 		}
 
 		rset-count = count;
@@ -704,7 +704,7 @@ rnd_ioctl(struct file *fp, u_long cmd, v
 		 */
 		mutex_spin_enter(rndpool_mtx);
 		rstnm = (rndstat_name_t *)addr;
-		kr = rnd_sources.lh_first;
+		kr = LIST_FIRST(rnd_sources);
 		while (kr != NULL) {
 			if (strncmp(kr-name, rstnm-name,
 MIN(sizeof(kr-name),
@@ -713,7 +713,7 @@ rnd_ioctl(struct file *fp, u_long cmd, v
 mutex_spin_exit(rndpool_mtx);
 return (0);
 			}
-			kr = kr-list.le_next;
+			kr = LIST_NEXT(kr, list);
 		}
 		mutex_spin_exit(rndpool_mtx);
 
@@ -727,7 +727,7 @@ rnd_ioctl(struct file *fp, u_long cmd, v
 		 */
 		mutex_spin_enter(rndpool_mtx);
 		rsetnm = (rndstat_est_name_t *)addr;
-		kr = rnd_sources.lh_first;
+		kr = LIST_FIRST(rnd_sources);
 		while (kr != NULL) {
 			if (strncmp(kr-name, rsetnm-name,
 MIN(sizeof(kr-name),
@@ -737,7 +737,7 @@ rnd_ioctl(struct file *fp, u_long cmd, v
 mutex_spin_exit(rndpool_mtx);
 return (0);
 			}
-			kr = kr-list.le_next;
+			kr = LIST_NEXT(kr, list);
 		}
 		mutex_spin_exit(rndpool_mtx);
 
@@ -752,7 +752,7 @@ rnd_ioctl(struct file *fp, u_long cmd, v
 		 */
 		mutex_spin_enter(rndpool_mtx);
 		rctl = (rndctl_t *)addr;
-		kr = rnd_sources.lh_first;
+		kr = LIST_FIRST(rnd_sources);
 
 		/*
 		 * Flags set apply to all sources of this type.
@@ -763,7 +763,7 @@ rnd_ioctl(struct file *fp, u_long cmd, v
 	krs_setflags(kr,
 		 rctl-flags, rctl-mask);
 }
-kr = kr-list.le_next;
+kr = LIST_NEXT(kr, list);
 			}
 			mutex_spin_exit(rndpool_mtx);
 			return (0);
@@ -780,7 +780,7 @@ rnd_ioctl(struct file *fp, u_long cmd, v
 mutex_spin_exit(rndpool_mtx);
 return (0);
 			}
-			kr = kr-list.le_next;
+			kr = LIST_NEXT(kr, list);
 		}
 
 		mutex_spin_exit(rndpool_mtx);



CVS commit: src/sys

2015-04-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Apr 13 15:13:50 UTC 2015

Modified Files:
src/sys/dev: rnd_private.h rndpseudo.c
src/sys/kern: kern_rndq.c kern_rndsink.c
src/sys/sys: rnd.h

Log Message:
Gather rnd-private declarations into dev/rnd_private.h.

Let's try to avoid putting externs in .c files where the compiler
can't check them.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/rnd_private.h
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/rndpseudo.c
cvs rdiff -u -r1.44 -r1.45 src/sys/kern/kern_rndq.c
cvs rdiff -u -r1.11 -r1.12 src/sys/kern/kern_rndsink.c
cvs rdiff -u -r1.44 -r1.45 src/sys/sys/rnd.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/rnd_private.h
diff -u src/sys/dev/rnd_private.h:1.6 src/sys/dev/rnd_private.h:1.7
--- src/sys/dev/rnd_private.h:1.6	Mon Apr 13 14:41:06 2015
+++ src/sys/dev/rnd_private.h	Mon Apr 13 15:13:50 2015
@@ -1,4 +1,4 @@
-/*  $NetBSD: rnd_private.h,v 1.6 2015/04/13 14:41:06 riastradh Exp $ */
+/*  $NetBSD: rnd_private.h,v 1.7 2015/04/13 15:13:50 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -32,6 +32,12 @@
 
 #ifndef _DEV_RNDPRIVATE_H
 #define _DEV_RNDPRIVATE_H
+
+#include sys/types.h
+#include sys/mutex.h
+#include sys/queue.h
+#include sys/rnd.h
+
 /*
  * Number of bytes returned per hash.  This value is used in both
  * rnd.c and rndpool.c to decide when enough entropy exists to do a
@@ -49,4 +55,42 @@
 
 bool	rnd_extract(void *, size_t);
 bool	rnd_tryextract(void *, size_t);
+void	rnd_getmore(size_t);
+void	rnd_wakeup_readers(void);
+
+/*
+ * Flag indicating rnd_init has run.
+ */
+extern int		rnd_ready;
+
+/*
+ * Bootloader-supplied entropy.  Use only in tests against NULL to
+ * determine whether the bootloader supplied entropy.
+ */
+extern rndsave_t	*boot_rsp;
+
+/*
+ * List of rndsources.
+ */
+LIST_HEAD(rndsource_head, krndsource);
+
+/*
+ * Global entropy pool state.  Access to everything here is serialized
+ * by rndpool_mtx.
+ */
+extern kmutex_t			rndpool_mtx;
+extern rndpool_t		rnd_pool;
+extern struct rndsource_head	rnd_sources;
+
+/*
+ * Debugging flags.
+ */
+#ifdef RND_DEBUG
+extern int rnd_debug;
+#define	RND_DEBUG_WRITE		0x0001
+#define	RND_DEBUG_READ		0x0002
+#define	RND_DEBUG_IOCTL		0x0004
+#define	RND_DEBUG_SNOOZE	0x0008
 #endif
+
+#endif	/* _DEV_RNDPRIVATE_H */

Index: src/sys/dev/rndpseudo.c
diff -u src/sys/dev/rndpseudo.c:1.25 src/sys/dev/rndpseudo.c:1.26
--- src/sys/dev/rndpseudo.c:1.25	Mon Apr 13 14:56:22 2015
+++ src/sys/dev/rndpseudo.c	Mon Apr 13 15:13:50 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: rndpseudo.c,v 1.25 2015/04/13 14:56:22 riastradh Exp $	*/
+/*	$NetBSD: rndpseudo.c,v 1.26 2015/04/13 15:13:50 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1997-2013 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rndpseudo.c,v 1.25 2015/04/13 14:56:22 riastradh Exp $);
+__KERNEL_RCSID(0, $NetBSD: rndpseudo.c,v 1.26 2015/04/13 15:13:50 riastradh Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h
@@ -73,16 +73,10 @@ __KERNEL_RCSID(0, $NetBSD: rndpseudo.c,
 
 #ifdef RND_DEBUG
 #define	DPRINTF(l,x)  if (rnd_debug  (l)) printf x
-extern int rnd_debug;
 #else
 #define	DPRINTF(l,x)
 #endif
 
-#define	RND_DEBUG_WRITE		0x0001
-#define	RND_DEBUG_READ		0x0002
-#define	RND_DEBUG_IOCTL		0x0004
-#define	RND_DEBUG_SNOOZE	0x0008
-
 /*
  * list devices attached
  */
@@ -112,17 +106,7 @@ static pool_cache_t rnd_ctx_cache;
  */
 static percpu_t *percpu_urandom_cprng;
 
-/*
- * Our random pool.  This is defined here rather than using the general
- * purpose one defined in rndpool.c.
- *
- * Samples are collected and queued into a separate mutex-protected queue
- * (rnd_samples, see above), and processed in a timeout routine; therefore,
- * the mutex protecting the random pool is at IPL_SOFTCLOCK() as well.
- */
-extern rndpool_t rnd_pool;
-extern kmutex_t  rndpool_mtx;
-
+/* Used by ioconf.c to attach the rnd pseudo-device.  */
 void	rndattach(int);
 
 dev_type_open(rndopen);
@@ -162,11 +146,6 @@ const struct fileops rnd_fileops = {
 	.fo_restart = fnullop_restart
 };
 
-void			rnd_wakeup_readers(void);	/* XXX */
-extern int		rnd_ready;		/* XXX */
-extern rndsave_t	*boot_rsp;		/* XXX */
-extern LIST_HEAD(, krndsource) rnd_sources;	/* XXX */
-
 static struct evcnt rndpseudo_soft = EVCNT_INITIALIZER(EVCNT_TYPE_MISC,
 NULL, rndpseudo, open soft);
 static struct evcnt rndpseudo_hard = EVCNT_INITIALIZER(EVCNT_TYPE_MISC,

Index: src/sys/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.44 src/sys/kern/kern_rndq.c:1.45
--- src/sys/kern/kern_rndq.c:1.44	Mon Apr 13 14:41:06 2015
+++ src/sys/kern/kern_rndq.c	Mon Apr 13 15:13:50 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.44 2015/04/13 14:41:06 riastradh Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.45 2015/04/13 15:13:50 riastradh Exp $	*/