CVS commit: src

2012-04-21 Thread Bernd Ernesti
Module Name:src
Committed By:   veego
Date:   Sat Apr 21 08:28:00 UTC 2012

Modified Files:
src: Makefile

Log Message:
Add usr.bin to the exclude list for make includes.
This is no longer needed after flex was moved to the external framework.


To generate a diff of this commit:
cvs rdiff -u -r1.291 -r1.292 src/Makefile

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

Modified files:

Index: src/Makefile
diff -u src/Makefile:1.291 src/Makefile:1.292
--- src/Makefile:1.291	Tue Jan 24 17:37:34 2012
+++ src/Makefile	Sat Apr 21 08:28:00 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.291 2012/01/24 17:37:34 abs Exp $
+#	$NetBSD: Makefile,v 1.292 2012/04/21 08:28:00 veego Exp $
 
 #
 # This is the top-level makefile for building NetBSD. For an outline of
@@ -563,7 +563,7 @@ do-obsolete: .PHONY .MAKE
 # (Tells bsd.subdir.mk not to recurse for them.)
 #
 
-.for dir in bin etc distrib games libexec regress sbin usr.sbin tools
+.for dir in bin etc distrib games libexec regress sbin usr.bin usr.sbin tools
 includes-${dir}: .PHONY
 	@true
 .endfor



CVS commit: src/lib/libcurses

2012-04-21 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sat Apr 21 11:32:00 UTC 2012

Modified Files:
src/lib/libcurses: inchstr.c

Log Message:
Remove trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libcurses/inchstr.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/libcurses/inchstr.c
diff -u src/lib/libcurses/inchstr.c:1.4 src/lib/libcurses/inchstr.c:1.5
--- src/lib/libcurses/inchstr.c:1.4	Sun Aug  7 10:57:10 2011
+++ src/lib/libcurses/inchstr.c	Sat Apr 21 11:31:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: inchstr.c,v 1.4 2011/08/07 10:57:10 blymn Exp $	*/
+/*	$NetBSD: inchstr.c,v 1.5 2012/04/21 11:31:59 blymn Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -23,21 +23,21 @@
  *written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC. BE 
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+ * ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC. BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: inchstr.c,v 1.4 2011/08/07 10:57:10 blymn Exp $);
+__RCSID($NetBSD: inchstr.c,v 1.5 2012/04/21 11:31:59 blymn Exp $);
 #endif/* not lint */
 
 #include curses.h



CVS commit: src/lib/libcurses

2012-04-21 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Sat Apr 21 11:33:16 UTC 2012

Modified Files:
src/lib/libcurses: inchstr.c refresh.c

Log Message:
Fix build break if curses is built without wide char support


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libcurses/inchstr.c
cvs rdiff -u -r1.75 -r1.76 src/lib/libcurses/refresh.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/libcurses/inchstr.c
diff -u src/lib/libcurses/inchstr.c:1.5 src/lib/libcurses/inchstr.c:1.6
--- src/lib/libcurses/inchstr.c:1.5	Sat Apr 21 11:31:59 2012
+++ src/lib/libcurses/inchstr.c	Sat Apr 21 11:33:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: inchstr.c,v 1.5 2012/04/21 11:31:59 blymn Exp $	*/
+/*	$NetBSD: inchstr.c,v 1.6 2012/04/21 11:33:16 blymn Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: inchstr.c,v 1.5 2012/04/21 11:31:59 blymn Exp $);
+__RCSID($NetBSD: inchstr.c,v 1.6 2012/04/21 11:33:16 blymn Exp $);
 #endif/* not lint */
 
 #include curses.h
@@ -145,7 +145,11 @@ winchnstr(WINDOW *win, chtype *chstr, in
 
 	while (start = end) {
 		/* or in the attributes but strip out internal flags */
+#ifdef HAVE_WCHAR
 		*chstr = start-ch | (start-attr  ~__ACS_IS_WACS);
+#else
+		*chstr = start-ch | start-attr;
+#endif
 		chstr++;
 		start++;
 	}

Index: src/lib/libcurses/refresh.c
diff -u src/lib/libcurses/refresh.c:1.75 src/lib/libcurses/refresh.c:1.76
--- src/lib/libcurses/refresh.c:1.75	Mon Oct  3 12:32:15 2011
+++ src/lib/libcurses/refresh.c	Sat Apr 21 11:33:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.75 2011/10/03 12:32:15 roy Exp $	*/
+/*	$NetBSD: refresh.c,v 1.76 2012/04/21 11:33:16 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = @(#)refresh.c	8.7 (Berkeley) 8/13/94;
 #else
-__RCSID($NetBSD: refresh.c,v 1.75 2011/10/03 12:32:15 roy Exp $);
+__RCSID($NetBSD: refresh.c,v 1.76 2012/04/21 11:33:16 blymn Exp $);
 #endif
 #endif/* not lint */
 
@@ -849,8 +849,19 @@ makech(int wy)
 #ifdef DEBUG
 __CTRACE(__CTRACE_REFRESH,
 makech: have attr %08x, need attr %08x\n,
-curscr-wattr  WA_ATTRIBUTES,
-nsp-attr  WA_ATTRIBUTES);
+curscr-wattr
+#ifndef HAVE_WCHAR
+  __ATTRIBUTES
+#else
+  WA_ATTRIBUTES
+#endif
+	 ,  nsp-attr
+#ifndef HAVE_WCHAR
+  __ATTRIBUTES
+#else
+  WA_ATTRIBUTES
+#endif
+	);
 #endif
 
 			off = (~nsp-attr  curscr-wattr)



CVS commit: src/lib/libcurses

2012-04-21 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sat Apr 21 14:39:35 UTC 2012

Modified Files:
src/lib/libcurses: Makefile

Log Message:
Fix build


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/lib/libcurses/Makefile

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

Modified files:

Index: src/lib/libcurses/Makefile
diff -u src/lib/libcurses/Makefile:1.67 src/lib/libcurses/Makefile:1.68
--- src/lib/libcurses/Makefile:1.67	Sat Apr 21 12:27:27 2012
+++ src/lib/libcurses/Makefile	Sat Apr 21 14:39:35 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.67 2012/04/21 12:27:27 roy Exp $
+#	$NetBSD: Makefile,v 1.68 2012/04/21 14:39:35 roy Exp $
 #	@(#)Makefile	8.2 (Berkeley) 1/2/94
 
 .include bsd.own.mk
@@ -79,7 +79,7 @@ MLINKS+= curses_addch.3 addch.3 curses_a
 	 curses_tty.3 flash.3 curses_tty.3 flushinp.3 \
 	 curses_refresh.3 flushok.3 \
 	 curses_termcap.3 fullname.3 curses_attributes.3 getattrs.3  \
-	 curses_background.3 getbkgd.3 curses_termcap.3 \
+	 curses_background.3 getbkgd.3 \
 	 curses_input.3 getch.3 curses_cursor.3 getcury.3 \
 	 curses_cursor.3 getcurx.3 curses_cursor.3 getbegy.3 \
 	 curses_cursor.3 getbegx.3 curses_cursor.3 getmaxx.3 \



CVS commit: [netbsd-5] src

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 15:52:55 UTC 2012

Modified Files:
src/crypto/dist/openssl/crypto [netbsd-5]: mem.c
src/crypto/dist/openssl/crypto/asn1 [netbsd-5]: a_d2i_fp.c
src/crypto/dist/openssl/crypto/buffer [netbsd-5]: buffer.c
src/sys/miscfs/genfs [netbsd-5]: genfs_io.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #1750):
crypto/dist/openssl/crypto/mem.cpatch
crypto/dist/openssl/crypto/asn1/a_d2i_fp.c  patch
crypto/dist/openssl/crypto/buffer/buffer.c  patch
sys/miscfs/genfs/genfs_io.c patch

Address CVE-2012-2110.
[spz, ticket #1750]


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.8 -r1.1.1.8.4.1 src/crypto/dist/openssl/crypto/mem.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.26.1 \
src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.4.1 \
src/crypto/dist/openssl/crypto/buffer/buffer.c
cvs rdiff -u -r1.13.4.3 -r1.13.4.4 src/sys/miscfs/genfs/genfs_io.c

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

Modified files:

Index: src/crypto/dist/openssl/crypto/mem.c
diff -u src/crypto/dist/openssl/crypto/mem.c:1.1.1.8 src/crypto/dist/openssl/crypto/mem.c:1.1.1.8.4.1
--- src/crypto/dist/openssl/crypto/mem.c:1.1.1.8	Fri May  9 21:34:14 2008
+++ src/crypto/dist/openssl/crypto/mem.c	Sat Apr 21 15:52:54 2012
@@ -354,6 +354,10 @@ void *CRYPTO_realloc_clean(void *str, in
 
 	if (num = 0) return NULL;
 
+	/* We don't support shrinking the buffer. Note the memcpy that copies
+	 * |old_len| bytes to the new buffer, below. */
+	if (num  old_len) return NULL;
+
 	if (realloc_debug_func != NULL)
 		realloc_debug_func(str, NULL, num, file, line, 0);
 	ret=malloc_ex_func(num,file,line);

Index: src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c
diff -u src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c:1.1.1.3 src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c:1.1.1.3.26.1
--- src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c:1.1.1.3	Fri Nov 25 03:04:06 2005
+++ src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c	Sat Apr 21 15:52:54 2012
@@ -57,6 +57,7 @@
  */
 
 #include stdio.h
+#include limits.h
 #include cryptlib.h
 #include openssl/buffer.h
 #include openssl/asn1_mac.h
@@ -143,17 +144,11 @@ static int asn1_d2i_read_bio(BIO *in, BU
 	BUF_MEM *b;
 	unsigned char *p;
 	int i;
-	int ret=-1;
 	ASN1_const_CTX c;
-	int want=HEADER_SIZE;
+	size_t want=HEADER_SIZE;
 	int eos=0;
-#if defined(__GNUC__)  defined(__ia64)
-	/* pathetic compiler bug in all known versions as of Nov. 2002 */
-	long off=0;
-#else
-	int off=0;
-#endif
-	int len=0;
+	size_t off=0;
+	size_t len=0;
 
 	b=BUF_MEM_new();
 	if (b == NULL)
@@ -169,7 +164,7 @@ static int asn1_d2i_read_bio(BIO *in, BU
 			{
 			want-=(len-off);
 
-			if (!BUF_MEM_grow_clean(b,len+want))
+			if (len + want  len || !BUF_MEM_grow_clean(b,len+want))
 {
 ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
 goto err;
@@ -181,7 +176,14 @@ static int asn1_d2i_read_bio(BIO *in, BU
 goto err;
 }
 			if (i  0)
+{
+if (len+i  len)
+	{
+	ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
+	goto err;
+	}
 len+=i;
+}
 			}
 		/* else data already loaded */
 
@@ -206,6 +208,11 @@ static int asn1_d2i_read_bio(BIO *in, BU
 			{
 			/* no data body so go round again */
 			eos++;
+			if (eos  0)
+{
+ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_HEADER_TOO_LONG);
+goto err;
+}
 			want=HEADER_SIZE;
 			}
 		else if (eos  (c.slen == 0)  (c.tag == V_ASN1_EOC))
@@ -220,10 +227,16 @@ static int asn1_d2i_read_bio(BIO *in, BU
 		else 
 			{
 			/* suck in c.slen bytes of data */
-			want=(int)c.slen;
+			want=c.slen;
 			if (want  (len-off))
 {
 want-=(len-off);
+if (want  INT_MAX /* BIO_read takes an int length */ ||
+	len+want  len)
+		{
+		ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
+		goto err;
+		}
 if (!BUF_MEM_grow_clean(b,len+want))
 	{
 	ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
@@ -238,11 +251,18 @@ static int asn1_d2i_read_bio(BIO *in, BU
 		ASN1_R_NOT_ENOUGH_DATA);
 		goto err;
 		}
+	/* This can't overflow because
+	 * |len+want| didn't overflow. */
 	len+=i;
-	want -= i;
+	want-=i;
 	}
 }
-			off+=(int)c.slen;
+			if (off + c.slen  off)
+{
+ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
+goto err;
+}
+			off+=c.slen;
 			if (eos = 0)
 {
 break;
@@ -252,9 +272,15 @@ static int asn1_d2i_read_bio(BIO *in, BU
 			}
 		}
 
+	if (off  INT_MAX)
+		{
+		ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
+		goto err;
+		}
+
 	*pb = b;
 	return off;
 err:
 	if (b != NULL) BUF_MEM_free(b);
-	return(ret);
+	return -1;
 	}

Index: src/crypto/dist/openssl/crypto/buffer/buffer.c
diff -u src/crypto/dist/openssl/crypto/buffer/buffer.c:1.1.1.5 

CVS commit: [netbsd-5] src/doc

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 15:53:38 UTC 2012

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket 1750.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.155 -r1.1.2.156 src/doc/CHANGES-5.2

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

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.155 src/doc/CHANGES-5.2:1.1.2.156
--- src/doc/CHANGES-5.2:1.1.2.155	Fri Mar 30 19:29:49 2012
+++ src/doc/CHANGES-5.2	Sat Apr 21 15:53:38 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.155 2012/03/30 19:29:49 bouyer Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.156 2012/04/21 15:53:38 riz Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -6307,3 +6307,11 @@ sys/arch/hp700/hp700/intr.c			1.38
 	mutex_enter critical section.
 	[skrll, ticket #1745]
 
+crypto/dist/openssl/crypto/mem.c		patch
+crypto/dist/openssl/crypto/asn1/a_d2i_fp.c	patch
+crypto/dist/openssl/crypto/buffer/buffer.c	patch
+sys/miscfs/genfs/genfs_io.c			patch
+
+	Address CVE-2012-2110.
+	[spz, ticket #1750]
+



CVS commit: [netbsd-5-0] src

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 15:54:03 UTC 2012

Modified Files:
src/crypto/dist/openssl/crypto [netbsd-5-0]: mem.c
src/crypto/dist/openssl/crypto/asn1 [netbsd-5-0]: a_d2i_fp.c
src/crypto/dist/openssl/crypto/buffer [netbsd-5-0]: buffer.c
src/sys/miscfs/genfs [netbsd-5-0]: genfs_io.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #1750):
crypto/dist/openssl/crypto/mem.cpatch
crypto/dist/openssl/crypto/asn1/a_d2i_fp.c  patch
crypto/dist/openssl/crypto/buffer/buffer.c  patch
sys/miscfs/genfs/genfs_io.c patch

Address CVE-2012-2110.
[spz, ticket #1750]


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.8 -r1.1.1.8.8.1 src/crypto/dist/openssl/crypto/mem.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.30.1 \
src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.8.1 \
src/crypto/dist/openssl/crypto/buffer/buffer.c
cvs rdiff -u -r1.13.4.2.2.1 -r1.13.4.2.2.2 src/sys/miscfs/genfs/genfs_io.c

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

Modified files:

Index: src/crypto/dist/openssl/crypto/mem.c
diff -u src/crypto/dist/openssl/crypto/mem.c:1.1.1.8 src/crypto/dist/openssl/crypto/mem.c:1.1.1.8.8.1
--- src/crypto/dist/openssl/crypto/mem.c:1.1.1.8	Fri May  9 21:34:14 2008
+++ src/crypto/dist/openssl/crypto/mem.c	Sat Apr 21 15:54:02 2012
@@ -354,6 +354,10 @@ void *CRYPTO_realloc_clean(void *str, in
 
 	if (num = 0) return NULL;
 
+	/* We don't support shrinking the buffer. Note the memcpy that copies
+	 * |old_len| bytes to the new buffer, below. */
+	if (num  old_len) return NULL;
+
 	if (realloc_debug_func != NULL)
 		realloc_debug_func(str, NULL, num, file, line, 0);
 	ret=malloc_ex_func(num,file,line);

Index: src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c
diff -u src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c:1.1.1.3 src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c:1.1.1.3.30.1
--- src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c:1.1.1.3	Fri Nov 25 03:04:06 2005
+++ src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c	Sat Apr 21 15:54:03 2012
@@ -57,6 +57,7 @@
  */
 
 #include stdio.h
+#include limits.h
 #include cryptlib.h
 #include openssl/buffer.h
 #include openssl/asn1_mac.h
@@ -143,17 +144,11 @@ static int asn1_d2i_read_bio(BIO *in, BU
 	BUF_MEM *b;
 	unsigned char *p;
 	int i;
-	int ret=-1;
 	ASN1_const_CTX c;
-	int want=HEADER_SIZE;
+	size_t want=HEADER_SIZE;
 	int eos=0;
-#if defined(__GNUC__)  defined(__ia64)
-	/* pathetic compiler bug in all known versions as of Nov. 2002 */
-	long off=0;
-#else
-	int off=0;
-#endif
-	int len=0;
+	size_t off=0;
+	size_t len=0;
 
 	b=BUF_MEM_new();
 	if (b == NULL)
@@ -169,7 +164,7 @@ static int asn1_d2i_read_bio(BIO *in, BU
 			{
 			want-=(len-off);
 
-			if (!BUF_MEM_grow_clean(b,len+want))
+			if (len + want  len || !BUF_MEM_grow_clean(b,len+want))
 {
 ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
 goto err;
@@ -181,7 +176,14 @@ static int asn1_d2i_read_bio(BIO *in, BU
 goto err;
 }
 			if (i  0)
+{
+if (len+i  len)
+	{
+	ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
+	goto err;
+	}
 len+=i;
+}
 			}
 		/* else data already loaded */
 
@@ -206,6 +208,11 @@ static int asn1_d2i_read_bio(BIO *in, BU
 			{
 			/* no data body so go round again */
 			eos++;
+			if (eos  0)
+{
+ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_HEADER_TOO_LONG);
+goto err;
+}
 			want=HEADER_SIZE;
 			}
 		else if (eos  (c.slen == 0)  (c.tag == V_ASN1_EOC))
@@ -220,10 +227,16 @@ static int asn1_d2i_read_bio(BIO *in, BU
 		else 
 			{
 			/* suck in c.slen bytes of data */
-			want=(int)c.slen;
+			want=c.slen;
 			if (want  (len-off))
 {
 want-=(len-off);
+if (want  INT_MAX /* BIO_read takes an int length */ ||
+	len+want  len)
+		{
+		ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
+		goto err;
+		}
 if (!BUF_MEM_grow_clean(b,len+want))
 	{
 	ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
@@ -238,11 +251,18 @@ static int asn1_d2i_read_bio(BIO *in, BU
 		ASN1_R_NOT_ENOUGH_DATA);
 		goto err;
 		}
+	/* This can't overflow because
+	 * |len+want| didn't overflow. */
 	len+=i;
-	want -= i;
+	want-=i;
 	}
 }
-			off+=(int)c.slen;
+			if (off + c.slen  off)
+{
+ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
+goto err;
+}
+			off+=c.slen;
 			if (eos = 0)
 {
 break;
@@ -252,9 +272,15 @@ static int asn1_d2i_read_bio(BIO *in, BU
 			}
 		}
 
+	if (off  INT_MAX)
+		{
+		ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
+		goto err;
+		}
+
 	*pb = b;
 	return off;
 err:
 	if (b != NULL) BUF_MEM_free(b);
-	return(ret);
+	return -1;
 	}

Index: src/crypto/dist/openssl/crypto/buffer/buffer.c
diff -u src/crypto/dist/openssl/crypto/buffer/buffer.c:1.1.1.5 

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

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 15:54:27 UTC 2012

Modified Files:
src/doc [netbsd-5-0]: CHANGES-5.0.3

Log Message:
Ticket 1750.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.69 -r1.1.2.70 src/doc/CHANGES-5.0.3

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

Modified files:

Index: src/doc/CHANGES-5.0.3
diff -u src/doc/CHANGES-5.0.3:1.1.2.69 src/doc/CHANGES-5.0.3:1.1.2.70
--- src/doc/CHANGES-5.0.3:1.1.2.69	Wed Mar 21 21:31:03 2012
+++ src/doc/CHANGES-5.0.3	Sat Apr 21 15:54:27 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.3,v 1.1.2.69 2012/03/21 21:31:03 jdc Exp $
+# $NetBSD: CHANGES-5.0.3,v 1.1.2.70 2012/04/21 15:54:27 riz Exp $
 
 A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3
 release:
@@ -3004,3 +3004,11 @@ sys/dev/wscons/wsksymdef.h			1.62
 
 	s/portugese/portuguese/, spotted by Ari Constancio in PR misc/40202.
 	[bouyer, ticket #1727]
+crypto/dist/openssl/crypto/mem.c		patch
+crypto/dist/openssl/crypto/asn1/a_d2i_fp.c	patch
+crypto/dist/openssl/crypto/buffer/buffer.c	patch
+sys/miscfs/genfs/genfs_io.c			patch
+
+	Address CVE-2012-2110.
+	[spz, ticket #1750]
+



CVS commit: [netbsd-5-1] src

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 15:54:46 UTC 2012

Modified Files:
src/crypto/dist/openssl/crypto [netbsd-5-1]: mem.c
src/crypto/dist/openssl/crypto/asn1 [netbsd-5-1]: a_d2i_fp.c
src/crypto/dist/openssl/crypto/buffer [netbsd-5-1]: buffer.c
src/sys/miscfs/genfs [netbsd-5-1]: genfs_io.c

Log Message:
Pull up following revision(s) (requested by spz in ticket #1750):
crypto/dist/openssl/crypto/mem.cpatch
crypto/dist/openssl/crypto/asn1/a_d2i_fp.c  patch
crypto/dist/openssl/crypto/buffer/buffer.c  patch
sys/miscfs/genfs/genfs_io.c patch

Address CVE-2012-2110.
[spz, ticket #1750]


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.8 -r1.1.1.8.12.1 src/crypto/dist/openssl/crypto/mem.c
cvs rdiff -u -r1.1.1.3 -r1.1.1.3.34.1 \
src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.12.1 \
src/crypto/dist/openssl/crypto/buffer/buffer.c
cvs rdiff -u -r1.13.4.3 -r1.13.4.3.2.1 src/sys/miscfs/genfs/genfs_io.c

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

Modified files:

Index: src/crypto/dist/openssl/crypto/mem.c
diff -u src/crypto/dist/openssl/crypto/mem.c:1.1.1.8 src/crypto/dist/openssl/crypto/mem.c:1.1.1.8.12.1
--- src/crypto/dist/openssl/crypto/mem.c:1.1.1.8	Fri May  9 21:34:14 2008
+++ src/crypto/dist/openssl/crypto/mem.c	Sat Apr 21 15:54:46 2012
@@ -354,6 +354,10 @@ void *CRYPTO_realloc_clean(void *str, in
 
 	if (num = 0) return NULL;
 
+	/* We don't support shrinking the buffer. Note the memcpy that copies
+	 * |old_len| bytes to the new buffer, below. */
+	if (num  old_len) return NULL;
+
 	if (realloc_debug_func != NULL)
 		realloc_debug_func(str, NULL, num, file, line, 0);
 	ret=malloc_ex_func(num,file,line);

Index: src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c
diff -u src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c:1.1.1.3 src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c:1.1.1.3.34.1
--- src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c:1.1.1.3	Fri Nov 25 03:04:06 2005
+++ src/crypto/dist/openssl/crypto/asn1/a_d2i_fp.c	Sat Apr 21 15:54:46 2012
@@ -57,6 +57,7 @@
  */
 
 #include stdio.h
+#include limits.h
 #include cryptlib.h
 #include openssl/buffer.h
 #include openssl/asn1_mac.h
@@ -143,17 +144,11 @@ static int asn1_d2i_read_bio(BIO *in, BU
 	BUF_MEM *b;
 	unsigned char *p;
 	int i;
-	int ret=-1;
 	ASN1_const_CTX c;
-	int want=HEADER_SIZE;
+	size_t want=HEADER_SIZE;
 	int eos=0;
-#if defined(__GNUC__)  defined(__ia64)
-	/* pathetic compiler bug in all known versions as of Nov. 2002 */
-	long off=0;
-#else
-	int off=0;
-#endif
-	int len=0;
+	size_t off=0;
+	size_t len=0;
 
 	b=BUF_MEM_new();
 	if (b == NULL)
@@ -169,7 +164,7 @@ static int asn1_d2i_read_bio(BIO *in, BU
 			{
 			want-=(len-off);
 
-			if (!BUF_MEM_grow_clean(b,len+want))
+			if (len + want  len || !BUF_MEM_grow_clean(b,len+want))
 {
 ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
 goto err;
@@ -181,7 +176,14 @@ static int asn1_d2i_read_bio(BIO *in, BU
 goto err;
 }
 			if (i  0)
+{
+if (len+i  len)
+	{
+	ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
+	goto err;
+	}
 len+=i;
+}
 			}
 		/* else data already loaded */
 
@@ -206,6 +208,11 @@ static int asn1_d2i_read_bio(BIO *in, BU
 			{
 			/* no data body so go round again */
 			eos++;
+			if (eos  0)
+{
+ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_HEADER_TOO_LONG);
+goto err;
+}
 			want=HEADER_SIZE;
 			}
 		else if (eos  (c.slen == 0)  (c.tag == V_ASN1_EOC))
@@ -220,10 +227,16 @@ static int asn1_d2i_read_bio(BIO *in, BU
 		else 
 			{
 			/* suck in c.slen bytes of data */
-			want=(int)c.slen;
+			want=c.slen;
 			if (want  (len-off))
 {
 want-=(len-off);
+if (want  INT_MAX /* BIO_read takes an int length */ ||
+	len+want  len)
+		{
+		ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
+		goto err;
+		}
 if (!BUF_MEM_grow_clean(b,len+want))
 	{
 	ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ERR_R_MALLOC_FAILURE);
@@ -238,11 +251,18 @@ static int asn1_d2i_read_bio(BIO *in, BU
 		ASN1_R_NOT_ENOUGH_DATA);
 		goto err;
 		}
+	/* This can't overflow because
+	 * |len+want| didn't overflow. */
 	len+=i;
-	want -= i;
+	want-=i;
 	}
 }
-			off+=(int)c.slen;
+			if (off + c.slen  off)
+{
+ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
+goto err;
+}
+			off+=c.slen;
 			if (eos = 0)
 {
 break;
@@ -252,9 +272,15 @@ static int asn1_d2i_read_bio(BIO *in, BU
 			}
 		}
 
+	if (off  INT_MAX)
+		{
+		ASN1err(ASN1_F_ASN1_D2I_READ_BIO,ASN1_R_TOO_LONG);
+		goto err;
+		}
+
 	*pb = b;
 	return off;
 err:
 	if (b != NULL) BUF_MEM_free(b);
-	return(ret);
+	return -1;
 	}

Index: src/crypto/dist/openssl/crypto/buffer/buffer.c
diff -u src/crypto/dist/openssl/crypto/buffer/buffer.c:1.1.1.5 

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

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 15:55:16 UTC 2012

Modified Files:
src/doc [netbsd-5-1]: CHANGES-5.1.3

Log Message:
Ticket 1750.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/doc/CHANGES-5.1.3

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

Modified files:

Index: src/doc/CHANGES-5.1.3
diff -u src/doc/CHANGES-5.1.3:1.1.2.10 src/doc/CHANGES-5.1.3:1.1.2.11
--- src/doc/CHANGES-5.1.3:1.1.2.10	Wed Mar 21 21:31:06 2012
+++ src/doc/CHANGES-5.1.3	Sat Apr 21 15:55:15 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.3,v 1.1.2.10 2012/03/21 21:31:06 jdc Exp $
+# $NetBSD: CHANGES-5.1.3,v 1.1.2.11 2012/04/21 15:55:15 riz Exp $
 
 A complete list of changes from the NetBSD 5.1.2 release to the NetBSD 5.1.3
 release:
@@ -90,3 +90,11 @@ sys/dev/wscons/wsksymdef.h			1.62
 
 	s/portugese/portuguese/, spotted by Ari Constancio in PR misc/40202.
 	[bouyer, ticket #1727]
+crypto/dist/openssl/crypto/mem.c		patch
+crypto/dist/openssl/crypto/asn1/a_d2i_fp.c	patch
+crypto/dist/openssl/crypto/buffer/buffer.c	patch
+sys/miscfs/genfs/genfs_io.c			patch
+
+	Address CVE-2012-2110.
+	[spz, ticket #1750]
+



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

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 15:57:28 UTC 2012

Modified Files:
src/sys/dev/usb [netbsd-5]: uaudio.c

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #1746):
sys/dev/usb/uaudio.c: revision 1.120
Address PR#44279.
- Be more lenient to device descriptor inconsistencies.
- Apply Roland SD-90 quirk only to the SD-90.


To generate a diff of this commit:
cvs rdiff -u -r1.114 -r1.114.6.1 src/sys/dev/usb/uaudio.c

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

Modified files:

Index: src/sys/dev/usb/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.114 src/sys/dev/usb/uaudio.c:1.114.6.1
--- src/sys/dev/usb/uaudio.c:1.114	Sat Jun 28 09:14:56 2008
+++ src/sys/dev/usb/uaudio.c	Sat Apr 21 15:57:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaudio.c,v 1.114 2008/06/28 09:14:56 kent Exp $	*/
+/*	$NetBSD: uaudio.c,v 1.114.6.1 2012/04/21 15:57:27 riz Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1.114 2008/06/28 09:14:56 kent Exp $);
+__KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1.114.6.1 2012/04/21 15:57:27 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -65,6 +65,8 @@ __KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1
 #include dev/usb/usbdi_util.h
 #include dev/usb/usb_quirks.h
 
+#include dev/usb/usbdevs.h
+
 #include dev/usb/uaudioreg.h
 
 /* #define UAUDIO_DEBUG */
@@ -1847,7 +1849,7 @@ uaudio_identify_ac(struct uaudio_softc *
 	const struct usb_audio_output_terminal *pot;
 	struct terminal_list *tml;
 	const char *tbuf, *ibuf, *ibufend;
-	int size, offs, aclen, ndps, i, j;
+	int size, offs, ndps, i, j;
 
 	size = UGETW(cdesc-wTotalLength);
 	tbuf = (const char *)cdesc;
@@ -1864,26 +1866,23 @@ uaudio_identify_ac(struct uaudio_softc *
 
 	/* A class-specific AC interface header should follow. */
 	ibuf = tbuf + offs;
+	ibufend = tbuf + size;
 	acdp = (const struct usb_audio_control_descriptor *)ibuf;
 	if (acdp-bDescriptorType != UDESC_CS_INTERFACE ||
 	acdp-bDescriptorSubtype != UDESCSUB_AC_HEADER)
 		return USBD_INVAL;
-	aclen = UGETW(acdp-wTotalLength);
-	if (offs + aclen  size)
-		return USBD_INVAL;
 
 	if (!(usbd_get_quirks(sc-sc_udev)-uq_flags  UQ_BAD_ADC) 
 	 UGETW(acdp-bcdADC) != UAUDIO_VERSION)
 		return USBD_INVAL;
 
 	sc-sc_audio_rev = UGETW(acdp-bcdADC);
-	DPRINTFN(2,(uaudio_identify_ac: found AC header, vers=%03x, len=%d\n,
-		 sc-sc_audio_rev, aclen));
+	DPRINTFN(2,(uaudio_identify_ac: found AC header, vers=%03x\n,
+		 sc-sc_audio_rev));
 
 	sc-sc_nullalt = -1;
 
 	/* Scan through all the AC specific descriptors */
-	ibufend = ibuf + aclen;
 	dp = (const uaudio_cs_descriptor_t *)ibuf;
 	ndps = 0;
 	iot = malloc(sizeof(struct io_terminal) * 256, M_TEMP, M_NOWAIT | M_ZERO);
@@ -1900,12 +1899,8 @@ uaudio_identify_ac(struct uaudio_softc *
 			free(iot, M_TEMP);
 			return USBD_INVAL;
 		}
-		if (dp-bDescriptorType != UDESC_CS_INTERFACE) {
-			aprint_error(
-			uaudio_identify_ac: skip desc type=0x%02x\n,
-			dp-bDescriptorType);
-			continue;
-		}
+		if (dp-bDescriptorType != UDESC_CS_INTERFACE)
+			break;
 		i = ((const struct usb_audio_input_terminal *)dp)-bTerminalId;
 		iot[i].d.desc = dp;
 		if (i  ndps)
@@ -2625,11 +2620,10 @@ uaudio_chan_open(struct uaudio_softc *sc
 		return err;
 
 	/*
-	 * If just one sampling rate is supported,
-	 * no need to call uaudio_set_speed().
 	 * Roland SD-90 freezes by a SAMPLING_FREQ_CONTROL request.
 	 */
-	if (as-asf1desc-bSamFreqType != 1) {
+	if ((UGETW(sc-sc_udev-ddesc.idVendor) != USB_VENDOR_ROLAND) 
+	(UGETW(sc-sc_udev-ddesc.idProduct) != USB_PRODUCT_ROLAND_SD90)) {
 		err = uaudio_set_speed(sc, endpt, ch-sample_rate);
 		if (err) {
 			DPRINTF((uaudio_chan_open: set_speed failed err=%s\n,



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

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 16:00:47 UTC 2012

Modified Files:
src/sys/arch/x86/x86 [netbsd-5]: ioapic.c

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #1747):
sys/arch/x86/x86/ioapic.c: revision 1.46
sys/arch/x86/x86/ioapic.c: revision 1.47
Mask all i8259 interrupts in ioapic_enable().
Should fix PR kern/45160.
Need i8259.h for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.38.6.1 -r1.38.6.2 src/sys/arch/x86/x86/ioapic.c

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

Modified files:

Index: src/sys/arch/x86/x86/ioapic.c
diff -u src/sys/arch/x86/x86/ioapic.c:1.38.6.1 src/sys/arch/x86/x86/ioapic.c:1.38.6.2
--- src/sys/arch/x86/x86/ioapic.c:1.38.6.1	Tue Sep 29 23:55:49 2009
+++ src/sys/arch/x86/x86/ioapic.c	Sat Apr 21 16:00:47 2012
@@ -1,4 +1,4 @@
-/* 	$NetBSD: ioapic.c,v 1.38.6.1 2009/09/29 23:55:49 snj Exp $	*/
+/* 	$NetBSD: ioapic.c,v 1.38.6.2 2012/04/21 16:00:47 riz Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ioapic.c,v 1.38.6.1 2009/09/29 23:55:49 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: ioapic.c,v 1.38.6.2 2012/04/21 16:00:47 riz Exp $);
 
 #include opt_ddb.h
 
@@ -83,6 +83,7 @@ __KERNEL_RCSID(0, $NetBSD: ioapic.c,v 1
 #include machine/i82093var.h
 #include machine/i82489reg.h
 #include machine/i82489var.h
+#include machine/i8259.h
 #include machine/mpbiosvar.h
 #include machine/pio.h
 #include machine/pmap.h
@@ -461,6 +462,8 @@ ioapic_enable(void)
 	if (ioapics == NULL)
 		return;
 
+	i8259_setmask(0x);
+
 	if (ioapics-sc_flags  IOAPIC_PICMODE) {
 		aprint_debug_dev(ioapics-sc_dev,
  writing to IMCR to disable pics\n);



CVS commit: [netbsd-5] src/sys/netatalk

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 16:03:27 UTC 2012

Modified Files:
src/sys/netatalk [netbsd-5]: aarp.c ddp_output.c

Log Message:
Pull up following revision(s) (requested by hauke in ticket #1749):
sys/netatalk/aarp.c: revision 1.36
sys/netatalk/ddp_output.c: revision 1.16
Fix AppleTalk name registration, as discussed on the port-macppc list
http://mail-index.netbsd.org/port-macppc/2010/07/09/msg001119.html
and in PR kern/44412, by looping back ddp broadcasts.
Patch submitted by David Riley against netbsd-5, adaptation for
-current and minor KNF touchup by me.
Needs to be pulled up to netbsd-5.


To generate a diff of this commit:
cvs rdiff -u -r1.27.12.1 -r1.27.12.2 src/sys/netatalk/aarp.c
cvs rdiff -u -r1.14 -r1.14.14.1 src/sys/netatalk/ddp_output.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/netatalk/aarp.c
diff -u src/sys/netatalk/aarp.c:1.27.12.1 src/sys/netatalk/aarp.c:1.27.12.2
--- src/sys/netatalk/aarp.c:1.27.12.1	Thu Jun 30 09:31:15 2011
+++ src/sys/netatalk/aarp.c	Sat Apr 21 16:03:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: aarp.c,v 1.27.12.1 2011/06/30 09:31:15 sborrill Exp $	*/
+/*	$NetBSD: aarp.c,v 1.27.12.2 2012/04/21 16:03:27 riz Exp $	*/
 
 /*
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aarp.c,v 1.27.12.1 2011/06/30 09:31:15 sborrill Exp $);
+__KERNEL_RCSID(0, $NetBSD: aarp.c,v 1.27.12.2 2012/04/21 16:03:27 riz Exp $);
 
 #include opt_mbuftrace.h
 
@@ -226,11 +226,19 @@ aarpwhohas(ifp, sat)
 		ea-aarp_tpa = sat-sat_addr.s_node;
 	}
 
+	/* If we are talking to ourselves, use the loopback interface. */
+	if (AA_SAT(aa)-sat_addr.s_net == sat-sat_addr.s_net 
+	AA_SAT(aa)-sat_addr.s_node == sat-sat_addr.s_node)
+		ifp = lo0ifp;
+
 #ifdef NETATALKDEBUG
-	printf(aarp: sending request via %u.%u seaking %u.%u\n,
-	ntohs(AA_SAT(aa)-sat_addr.s_net), AA_SAT(aa)-sat_addr.s_node,
-	ntohs(sat-sat_addr.s_net), sat-sat_addr.s_node);
-#endif	/* NETATALKDEBUG */
+	printf(aarp: sending request via %u.%u through %s seeking %u.%u\n,
+	ntohs(AA_SAT(aa)-sat_addr.s_net),
+	AA_SAT(aa)-sat_addr.s_node,
+	ifp-if_xname,
+	ntohs(sat-sat_addr.s_net),
+	sat-sat_addr.s_node);
+#endif /* NETATALKDEBUG */
 
 	sa.sa_len = sizeof(struct sockaddr);
 	sa.sa_family = AF_UNSPEC;

Index: src/sys/netatalk/ddp_output.c
diff -u src/sys/netatalk/ddp_output.c:1.14 src/sys/netatalk/ddp_output.c:1.14.14.1
--- src/sys/netatalk/ddp_output.c:1.14	Sun Apr  6 18:46:56 2008
+++ src/sys/netatalk/ddp_output.c	Sat Apr 21 16:03:27 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ddp_output.c,v 1.14 2008/04/06 18:46:56 dyoung Exp $	 */
+/*	$NetBSD: ddp_output.c,v 1.14.14.1 2012/04/21 16:03:27 riz Exp $	 */
 
 /*
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ddp_output.c,v 1.14 2008/04/06 18:46:56 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: ddp_output.c,v 1.14.14.1 2012/04/21 16:03:27 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -128,20 +128,40 @@ ddp_route(struct mbuf *m, struct route *
 	struct elaphdr *elh;
 	struct at_ifaddr *aa = NULL;
 	struct ifnet   *ifp = NULL;
-	u_short net;
+	uint16_tnet;
+	uint8_t node;
+	uint8_t loopback = 0;
 
 	if ((rt = rtcache_validate(ro)) != NULL  (ifp = rt-rt_ifp) != NULL) {
+		const struct sockaddr_at *dst = satocsat(rtcache_getdst(ro));
+		uint16_t dnet = dst-sat_addr.s_net;
+		uint8_t dnode = dst-sat_addr.s_node;
 		net = satosat(rt-rt_gateway)-sat_addr.s_net;
+		node = satosat(rt-rt_gateway)-sat_addr.s_node;
+
 		TAILQ_FOREACH(aa, at_ifaddr, aa_list) {
-			if (aa-aa_ifp == ifp 
-			ntohs(net) = ntohs(aa-aa_firstnet) 
+			if (ntohs(net) = ntohs(aa-aa_firstnet) 
 			ntohs(net) = ntohs(aa-aa_lastnet)) {
+/* Are we talking to ourselves? */
+if (dnet == aa-aa_addr.sat_addr.s_net 
+dnode == aa-aa_addr.sat_addr.s_node) {
+	/* If to us, redirect to lo0. */
+	ifp = lo0ifp;
+}
+/* Or is it a broadcast? */
+else if (dnet == aa-aa_addr.sat_addr.s_net 
+	dnode == 255) {
+	/* If broadcast, loop back a copy. */
+	loopback = 1;
+}
 break;
 			}
 		}
 	}
 	if (aa == NULL) {
+#ifdef NETATALKDEBUG
 		printf(%s: no address found\n, __func__);
+#endif
 		m_freem(m);
 		return EINVAL;
 	}
@@ -163,7 +183,8 @@ ddp_route(struct mbuf *m, struct route *
 		ntohs(aa-aa_firstnet) 
 		ntohs(satocsat(rtcache_getdst(ro))-sat_addr.s_net) =
 		ntohs(aa-aa_lastnet)) {
-			elh-el_dnode = satocsat(rtcache_getdst(ro))-sat_addr.s_node;
+			elh-el_dnode =
+			satocsat(rtcache_getdst(ro))-sat_addr.s_node;
 		} else {
 			elh-el_dnode =
 			satosat(rt-rt_gateway)-sat_addr.s_node;
@@ -184,5 +205,13 @@ ddp_route(struct mbuf *m, struct route *
 #endif
 
 	/* XXX */
+	

CVS commit: [netbsd-5] src/doc

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 16:06:07 UTC 2012

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Tickets 1746, 1747, 1749.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.156 -r1.1.2.157 src/doc/CHANGES-5.2

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

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.156 src/doc/CHANGES-5.2:1.1.2.157
--- src/doc/CHANGES-5.2:1.1.2.156	Sat Apr 21 15:53:38 2012
+++ src/doc/CHANGES-5.2	Sat Apr 21 16:06:07 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.156 2012/04/21 15:53:38 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.157 2012/04/21 16:06:07 riz Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -6315,3 +6315,19 @@ sys/miscfs/genfs/genfs_io.c			patch
 	Address CVE-2012-2110.
 	[spz, ticket #1750]
 
+sys/dev/usb/uaudio.c1.120
+
+	Allow Logitech C260 uaudio(4) portion to work. PR#44279.
+	[jakllsch, ticket #1746]
+
+sys/arch/x86/x86/ioapic.c			1.46-1.47
+
+	Mask all i8259 interrupts in ioapic_enable().  PR#45160.
+	[jakllsch, ticket #1747]
+
+sys/netatalk/aarp.c1.36
+sys/netatalk/ddp_output.c			1.16
+
+	Fix AppleTalk name registration. PR#44412.
+	[hauke, ticket #1749]
+



CVS commit: src/sys/arch/amd64/amd64

2012-04-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr 21 18:52:37 UTC 2012

Modified Files:
src/sys/arch/amd64/amd64: vector.S

Log Message:
Alignment fault traps push the error code automatically, so don't use ZTRAP!


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/amd64/amd64/vector.S

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

Modified files:

Index: src/sys/arch/amd64/amd64/vector.S
diff -u src/sys/arch/amd64/amd64/vector.S:1.38 src/sys/arch/amd64/amd64/vector.S:1.39
--- src/sys/arch/amd64/amd64/vector.S:1.38	Sat Jun 11 23:35:38 2011
+++ src/sys/arch/amd64/amd64/vector.S	Sat Apr 21 14:52:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vector.S,v 1.38 2011/06/12 03:35:38 rmind Exp $	*/
+/*	$NetBSD: vector.S,v 1.39 2012/04/21 18:52:36 christos Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@@ -228,7 +228,7 @@ IDTVEC(trap10)
   	STI(si)
 	jmp	calltrap
 IDTVEC(trap11)
-	ZTRAP(T_ALIGNFLT)
+	TRAP(T_ALIGNFLT)
 IDTVEC(trap12)
 	ZTRAP(T_MCA)
 IDTVEC(trap13)



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

2012-04-21 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sat Apr 21 22:22:48 UTC 2012

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

Log Message:
- pmap_tlb_shootdown: do not overwrite tp_cpumask with pm_cpus, but merge
  like pm_kernel_cpus.  Remove unecessary intersection with kcpuset_running.
  Do not reset tp_userpmap if pmap_kernel().
- Remove pmap_tlb_mailbox_t wrapping, which is pointless after recent changes.
- pmap_tlb_invalidate, pmap_tlb_intr: constify for packet structure.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/x86/pmap_tlb.c

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

Modified files:

Index: src/sys/arch/x86/x86/pmap_tlb.c
diff -u src/sys/arch/x86/x86/pmap_tlb.c:1.5 src/sys/arch/x86/x86/pmap_tlb.c:1.6
--- src/sys/arch/x86/x86/pmap_tlb.c:1.5	Fri Apr 20 22:23:24 2012
+++ src/sys/arch/x86/x86/pmap_tlb.c	Sat Apr 21 22:22:48 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_tlb.c,v 1.5 2012/04/20 22:23:24 rmind Exp $	*/
+/*	$NetBSD: pmap_tlb.c,v 1.6 2012/04/21 22:22:48 rmind Exp $	*/
 
 /*-
  * Copyright (c) 2008-2012 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_tlb.c,v 1.5 2012/04/20 22:23:24 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_tlb.c,v 1.6 2012/04/21 22:22:48 rmind Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -77,17 +77,13 @@ typedef struct {
 /* No more than N seperate invlpg. */
 #define	TP_MAXVA		6
 
-typedef struct {
-	volatile u_int		tm_pendcount;
-	volatile u_int		tm_gen;
-} pmap_tlb_mailbox_t;
-
 /*
  * TLB shootdown state.
  */
-static struct evcnt		pmap_tlb_evcnt		__cacheline_aligned;
 static pmap_tlb_packet_t	pmap_tlb_packet		__cacheline_aligned;
-static pmap_tlb_mailbox_t	pmap_tlb_mailbox	__cacheline_aligned;
+static volatile u_int		pmap_tlb_pendcount	__cacheline_aligned;
+static volatile u_int		pmap_tlb_gen		__cacheline_aligned;
+static struct evcnt		pmap_tlb_evcnt		__cacheline_aligned;
 
 /*
  * TLB shootdown statistics.
@@ -121,7 +117,8 @@ pmap_tlb_init(void)
 {
 
 	memset(pmap_tlb_packet, 0, sizeof(pmap_tlb_packet_t));
-	memset(pmap_tlb_mailbox, 0, sizeof(pmap_tlb_mailbox_t));
+	pmap_tlb_pendcount = 0;
+	pmap_tlb_gen = 0;
 
 	evcnt_attach_dynamic(pmap_tlb_evcnt, EVCNT_TYPE_INTR,
 	NULL, TLB, shootdown);
@@ -189,7 +186,7 @@ pmap_tlbstat_count(struct pmap *pm, vadd
 }
 
 static inline void
-pmap_tlb_invalidate(pmap_tlb_packet_t *tp)
+pmap_tlb_invalidate(const pmap_tlb_packet_t *tp)
 {
 	int i;
 
@@ -261,15 +258,13 @@ pmap_tlb_shootdown(struct pmap *pm, vadd
 	}
 
 	if (pm != pmap_kernel()) {
-		kcpuset_copy(tp-tp_cpumask, pm-pm_cpus);
+		kcpuset_merge(tp-tp_cpumask, pm-pm_cpus);
 		if (va = VM_MAXUSER_ADDRESS) {
 			kcpuset_merge(tp-tp_cpumask, pm-pm_kernel_cpus);
 		}
-		kcpuset_intersect(tp-tp_cpumask, kcpuset_running);
 		tp-tp_userpmap = 1;
 	} else {
 		kcpuset_copy(tp-tp_cpumask, kcpuset_running);
-		tp-tp_userpmap = 0;
 	}
 	pmap_tlbstat_count(pm, va, why);
 	splx(s);
@@ -281,7 +276,6 @@ pmap_tlb_shootdown(struct pmap *pm, vadd
 static inline void
 pmap_tlb_processpacket(pmap_tlb_packet_t *tp, kcpuset_t *target)
 {
-	pmap_tlb_mailbox_t *tm = pmap_tlb_mailbox;
 
 	if (tp-tp_count != (uint16_t)-1) {
 		/* Invalidating a single page or a range of pages. */
@@ -293,7 +287,7 @@ pmap_tlb_processpacket(pmap_tlb_packet_t
 	}
 
 	/* Remote CPUs have been synchronously flushed. */
-	tm-tm_pendcount = 0;
+	pmap_tlb_pendcount = 0;
 }
 
 #else
@@ -337,7 +331,6 @@ void
 pmap_tlb_shootnow(void)
 {
 	pmap_tlb_packet_t *tp;
-	pmap_tlb_mailbox_t *tm;
 	struct cpu_info *ci;
 	kcpuset_t *target;
 	u_int local, gen, rcpucount;
@@ -359,7 +352,6 @@ pmap_tlb_shootnow(void)
 		splx(s);
 		return;
 	}
-	tm = pmap_tlb_mailbox;
 	cid = cpu_index(ci);
 
 	target = tp-tp_cpumask;
@@ -378,11 +370,11 @@ pmap_tlb_shootnow(void)
 		 */
 		KASSERT(rcpucount  ncpu);
 
-		while (atomic_cas_uint(tm-tm_pendcount, 0, rcpucount) != 0) {
+		while (atomic_cas_uint(pmap_tlb_pendcount, 0, rcpucount)) {
 			splx(s);
 			count = SPINLOCK_BACKOFF_MIN;
-			while (tm-tm_pendcount != 0) {
-KASSERT(tm-tm_pendcount  ncpu);
+			while (pmap_tlb_pendcount) {
+KASSERT(pmap_tlb_pendcount  ncpu);
 SPINLOCK_BACKOFF(count);
 			}
 			s = splvm();
@@ -395,9 +387,10 @@ pmap_tlb_shootnow(void)
 
 		/*
 		 * Start a new generation of updates.  Copy our shootdown
-		 * requests into the global buffer.
+		 * requests into the global buffer.  Note that tp_cpumask
+		 * will not be used by remote CPUs (it would be unsafe).
 		 */
-		gen = ++tm-tm_gen;
+		gen = ++pmap_tlb_gen;
 		memcpy(pmap_tlb_packet, tp, sizeof(*tp));
 		pmap_tlb_evcnt.ev_count++;
 
@@ -434,11 +427,11 @@ pmap_tlb_shootnow(void)
 	 * Now wait for the current generation of updates to be
 	 * processed by remote CPUs.
 	 */
-	if (rcpucount  tm-tm_pendcount) {
+	if (rcpucount  pmap_tlb_pendcount) {
 		int count = SPINLOCK_BACKOFF_MIN;
 
-		while (tm-tm_pendcount  

CVS commit: src/sys/kern

2012-04-21 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sat Apr 21 22:38:25 UTC 2012

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

Log Message:
Improve the assert message.


To generate a diff of this commit:
cvs rdiff -u -r1.300 -r1.301 src/sys/kern/kern_synch.c

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

Modified files:

Index: src/sys/kern/kern_synch.c
diff -u src/sys/kern/kern_synch.c:1.300 src/sys/kern/kern_synch.c:1.301
--- src/sys/kern/kern_synch.c:1.300	Wed Apr 18 13:44:19 2012
+++ src/sys/kern/kern_synch.c	Sat Apr 21 22:38:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.300 2012/04/18 13:44:19 yamt Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.301 2012/04/21 22:38:25 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009
@@ -69,7 +69,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_synch.c,v 1.300 2012/04/18 13:44:19 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_synch.c,v 1.301 2012/04/21 22:38:25 rmind Exp $);
 
 #include opt_kstack.h
 #include opt_perfctrs.h
@@ -684,7 +684,8 @@ mi_switch(lwp_t *l)
 		 * the context switch.
 		 */
 		KASSERTMSG(ci-ci_mtx_count == -1,
-		%s: cpu%u: ci_mtx_count (%d) != -1,
+		%s: cpu%u: ci_mtx_count (%d) != -1 
+		(block with spin-mutex held),
 		 __func__, cpu_index(ci), ci-ci_mtx_count);
 		oldspl = MUTEX_SPIN_OLDSPL(ci);
 		ci-ci_mtx_count--;



CVS commit: [netbsd-5] src

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 23:10:42 UTC 2012

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2
src/sys/miscfs/genfs [netbsd-5]: genfs_io.c

Log Message:
Back out a commit included in the ticket 1750 patch which obviously
doesn't belong there.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.157 -r1.1.2.158 src/doc/CHANGES-5.2
cvs rdiff -u -r1.13.4.4 -r1.13.4.5 src/sys/miscfs/genfs/genfs_io.c

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-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.157 src/doc/CHANGES-5.2:1.1.2.158
--- src/doc/CHANGES-5.2:1.1.2.157	Sat Apr 21 16:06:07 2012
+++ src/doc/CHANGES-5.2	Sat Apr 21 23:10:41 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.157 2012/04/21 16:06:07 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.158 2012/04/21 23:10:41 riz Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -6310,7 +6310,6 @@ sys/arch/hp700/hp700/intr.c			1.38
 crypto/dist/openssl/crypto/mem.c		patch
 crypto/dist/openssl/crypto/asn1/a_d2i_fp.c	patch
 crypto/dist/openssl/crypto/buffer/buffer.c	patch
-sys/miscfs/genfs/genfs_io.c			patch
 
 	Address CVE-2012-2110.
 	[spz, ticket #1750]

Index: src/sys/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.13.4.4 src/sys/miscfs/genfs/genfs_io.c:1.13.4.5
--- src/sys/miscfs/genfs/genfs_io.c:1.13.4.4	Sat Apr 21 15:52:54 2012
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Apr 21 23:10:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.13.4.4 2012/04/21 15:52:54 riz Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.13.4.5 2012/04/21 23:10:42 riz Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.13.4.4 2012/04/21 15:52:54 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.13.4.5 2012/04/21 23:10:42 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -802,19 +802,7 @@ genfs_do_putpages(struct vnode *vp, off_
 
 	KASSERT(origflags  (PGO_CLEANIT|PGO_FREE|PGO_DEACTIVATE));
 	KASSERT((startoff  PAGE_MASK) == 0  (endoff  PAGE_MASK) == 0);
-//	KASSERT(startoff  endoff || endoff == 0);
-
-// replacement for the previous KASSERT to get debug output, by rmind
-	if (!(startoff  endoff || endoff == 0)) {
-		proc_t *p = curproc;
-		mutex_exit(slock);
-		printf(genfs_do_putpages: startoff 0x%lx, endoff 0x%lx vm_map %p\n, (uint64_t) startoff, (uint64_t) endoff, p-p_vmspace-vm_map);
-		void uvm_map_printit(struct vm_map *, bool, void (*)(const char *, ...));
-		uvm_map_printit(p-p_vmspace-vm_map, true, printf);
-		KASSERT(p == l-l_proc);
-		Debugger();	/* Bang ! */
-		return EIO;
-	}
+	KASSERT(startoff  endoff || endoff == 0);
 
 	UVMHIST_LOG(ubchist, vp %p pages %d off 0x%x len 0x%x,
 	vp, uobj-uo_npages, startoff, endoff - startoff);



CVS commit: [netbsd-5-1] src

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 23:11:42 UTC 2012

Modified Files:
src/doc [netbsd-5-1]: CHANGES-5.1.3
src/sys/miscfs/genfs [netbsd-5-1]: genfs_io.c

Log Message:
Back out a commit included in the ticket 1750 patch which obviously
doesn't belong there.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/doc/CHANGES-5.1.3
cvs rdiff -u -r1.13.4.3.2.1 -r1.13.4.3.2.2 src/sys/miscfs/genfs/genfs_io.c

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-5.1.3
diff -u src/doc/CHANGES-5.1.3:1.1.2.11 src/doc/CHANGES-5.1.3:1.1.2.12
--- src/doc/CHANGES-5.1.3:1.1.2.11	Sat Apr 21 15:55:15 2012
+++ src/doc/CHANGES-5.1.3	Sat Apr 21 23:11:42 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.3,v 1.1.2.11 2012/04/21 15:55:15 riz Exp $
+# $NetBSD: CHANGES-5.1.3,v 1.1.2.12 2012/04/21 23:11:42 riz Exp $
 
 A complete list of changes from the NetBSD 5.1.2 release to the NetBSD 5.1.3
 release:
@@ -90,10 +90,10 @@ sys/dev/wscons/wsksymdef.h			1.62
 
 	s/portugese/portuguese/, spotted by Ari Constancio in PR misc/40202.
 	[bouyer, ticket #1727]
+
 crypto/dist/openssl/crypto/mem.c		patch
 crypto/dist/openssl/crypto/asn1/a_d2i_fp.c	patch
 crypto/dist/openssl/crypto/buffer/buffer.c	patch
-sys/miscfs/genfs/genfs_io.c			patch
 
 	Address CVE-2012-2110.
 	[spz, ticket #1750]

Index: src/sys/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.13.4.3.2.1 src/sys/miscfs/genfs/genfs_io.c:1.13.4.3.2.2
--- src/sys/miscfs/genfs/genfs_io.c:1.13.4.3.2.1	Sat Apr 21 15:54:46 2012
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Apr 21 23:11:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.13.4.3.2.1 2012/04/21 15:54:46 riz Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.13.4.3.2.2 2012/04/21 23:11:42 riz Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.13.4.3.2.1 2012/04/21 15:54:46 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.13.4.3.2.2 2012/04/21 23:11:42 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -802,19 +802,7 @@ genfs_do_putpages(struct vnode *vp, off_
 
 	KASSERT(origflags  (PGO_CLEANIT|PGO_FREE|PGO_DEACTIVATE));
 	KASSERT((startoff  PAGE_MASK) == 0  (endoff  PAGE_MASK) == 0);
-//	KASSERT(startoff  endoff || endoff == 0);
-
-// replacement for the previous KASSERT to get debug output, by rmind
-	if (!(startoff  endoff || endoff == 0)) {
-		proc_t *p = curproc;
-		mutex_exit(slock);
-		printf(genfs_do_putpages: startoff 0x%lx, endoff 0x%lx vm_map %p\n, (uint64_t) startoff, (uint64_t) endoff, p-p_vmspace-vm_map);
-		void uvm_map_printit(struct vm_map *, bool, void (*)(const char *, ...));
-		uvm_map_printit(p-p_vmspace-vm_map, true, printf);
-		KASSERT(p == l-l_proc);
-		Debugger();	/* Bang ! */
-		return EIO;
-	}
+	KASSERT(startoff  endoff || endoff == 0);
 
 	UVMHIST_LOG(ubchist, vp %p pages %d off 0x%x len 0x%x,
 	vp, uobj-uo_npages, startoff, endoff - startoff);



CVS commit: [netbsd-5-0] src

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Apr 21 23:12:17 UTC 2012

Modified Files:
src/doc [netbsd-5-0]: CHANGES-5.0.3
src/sys/miscfs/genfs [netbsd-5-0]: genfs_io.c

Log Message:
Back out a commit included in the ticket 1750 patch which obviously
doesn't belong there.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.70 -r1.1.2.71 src/doc/CHANGES-5.0.3
cvs rdiff -u -r1.13.4.2.2.2 -r1.13.4.2.2.3 src/sys/miscfs/genfs/genfs_io.c

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-5.0.3
diff -u src/doc/CHANGES-5.0.3:1.1.2.70 src/doc/CHANGES-5.0.3:1.1.2.71
--- src/doc/CHANGES-5.0.3:1.1.2.70	Sat Apr 21 15:54:27 2012
+++ src/doc/CHANGES-5.0.3	Sat Apr 21 23:12:17 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.3,v 1.1.2.70 2012/04/21 15:54:27 riz Exp $
+# $NetBSD: CHANGES-5.0.3,v 1.1.2.71 2012/04/21 23:12:17 riz Exp $
 
 A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3
 release:
@@ -3004,10 +3004,10 @@ sys/dev/wscons/wsksymdef.h			1.62
 
 	s/portugese/portuguese/, spotted by Ari Constancio in PR misc/40202.
 	[bouyer, ticket #1727]
+
 crypto/dist/openssl/crypto/mem.c		patch
 crypto/dist/openssl/crypto/asn1/a_d2i_fp.c	patch
 crypto/dist/openssl/crypto/buffer/buffer.c	patch
-sys/miscfs/genfs/genfs_io.c			patch
 
 	Address CVE-2012-2110.
 	[spz, ticket #1750]

Index: src/sys/miscfs/genfs/genfs_io.c
diff -u src/sys/miscfs/genfs/genfs_io.c:1.13.4.2.2.2 src/sys/miscfs/genfs/genfs_io.c:1.13.4.2.2.3
--- src/sys/miscfs/genfs/genfs_io.c:1.13.4.2.2.2	Sat Apr 21 15:54:03 2012
+++ src/sys/miscfs/genfs/genfs_io.c	Sat Apr 21 23:12:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfs_io.c,v 1.13.4.2.2.2 2012/04/21 15:54:03 riz Exp $	*/
+/*	$NetBSD: genfs_io.c,v 1.13.4.2.2.3 2012/04/21 23:12:17 riz Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.13.4.2.2.2 2012/04/21 15:54:03 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: genfs_io.c,v 1.13.4.2.2.3 2012/04/21 23:12:17 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -802,19 +802,7 @@ genfs_do_putpages(struct vnode *vp, off_
 
 	KASSERT(origflags  (PGO_CLEANIT|PGO_FREE|PGO_DEACTIVATE));
 	KASSERT((startoff  PAGE_MASK) == 0  (endoff  PAGE_MASK) == 0);
-//	KASSERT(startoff  endoff || endoff == 0);
-
-// replacement for the previous KASSERT to get debug output, by rmind
-	if (!(startoff  endoff || endoff == 0)) {
-		proc_t *p = curproc;
-		mutex_exit(slock);
-		printf(genfs_do_putpages: startoff 0x%lx, endoff 0x%lx vm_map %p\n, (uint64_t) startoff, (uint64_t) endoff, p-p_vmspace-vm_map);
-		void uvm_map_printit(struct vm_map *, bool, void (*)(const char *, ...));
-		uvm_map_printit(p-p_vmspace-vm_map, true, printf);
-		KASSERT(p == l-l_proc);
-		Debugger();	/* Bang ! */
-		return EIO;
-	}
+	KASSERT(startoff  endoff || endoff == 0);
 
 	UVMHIST_LOG(ubchist, vp %p pages %d off 0x%x len 0x%x,
 	vp, uobj-uo_npages, startoff, endoff - startoff);



CVS commit: src/sys/dev/usb

2012-04-21 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Sun Apr 22 01:31:48 UTC 2012

Modified Files:
src/sys/dev/usb: uaudio.c

Log Message:
Use usbd_get_device_descriptor() instead of groping for it directly
in the usbd_device struct.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/dev/usb/uaudio.c

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

Modified files:

Index: src/sys/dev/usb/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.130 src/sys/dev/usb/uaudio.c:1.131
--- src/sys/dev/usb/uaudio.c:1.130	Thu Mar 15 18:40:32 2012
+++ src/sys/dev/usb/uaudio.c	Sun Apr 22 01:31:48 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaudio.c,v 1.130 2012/03/15 18:40:32 bouyer Exp $	*/
+/*	$NetBSD: uaudio.c,v 1.131 2012/04/22 01:31:48 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1.130 2012/03/15 18:40:32 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1.131 2012/04/22 01:31:48 jakllsch Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -2685,6 +2685,7 @@ Static usbd_status
 uaudio_chan_open(struct uaudio_softc *sc, struct chan *ch)
 {
 	struct as_info *as;
+	usb_device_descriptor_t *ddesc;
 	int endpt;
 	usbd_status err;
 
@@ -2701,8 +2702,9 @@ uaudio_chan_open(struct uaudio_softc *sc
 	/*
 	 * Roland SD-90 freezes by a SAMPLING_FREQ_CONTROL request.
 	 */
-	if ((UGETW(sc-sc_udev-ddesc.idVendor) != USB_VENDOR_ROLAND) 
-	(UGETW(sc-sc_udev-ddesc.idProduct) != USB_PRODUCT_ROLAND_SD90)) {
+	ddesc = usbd_get_device_descriptor(sc-sc_udev);
+	if ((UGETW(ddesc-idVendor) != USB_VENDOR_ROLAND) 
+	(UGETW(ddesc-idProduct) != USB_PRODUCT_ROLAND_SD90)) {
 		err = uaudio_set_speed(sc, endpt, ch-sample_rate);
 		if (err) {
 			DPRINTF(set_speed failed err=%s\n, usbd_errstr(err));



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

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 22 03:13:21 UTC 2012

Modified Files:
src/sys/dev/usb [netbsd-5]: uaudio.c

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #1751):
sys/dev/usb/uaudio.c: revision 1.131
Use usbd_get_device_descriptor() instead of groping for it directly
in the usbd_device struct.


To generate a diff of this commit:
cvs rdiff -u -r1.114.6.1 -r1.114.6.2 src/sys/dev/usb/uaudio.c

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

Modified files:

Index: src/sys/dev/usb/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.114.6.1 src/sys/dev/usb/uaudio.c:1.114.6.2
--- src/sys/dev/usb/uaudio.c:1.114.6.1	Sat Apr 21 15:57:27 2012
+++ src/sys/dev/usb/uaudio.c	Sun Apr 22 03:13:21 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uaudio.c,v 1.114.6.1 2012/04/21 15:57:27 riz Exp $	*/
+/*	$NetBSD: uaudio.c,v 1.114.6.2 2012/04/22 03:13:21 riz Exp $	*/
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1.114.6.1 2012/04/21 15:57:27 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: uaudio.c,v 1.114.6.2 2012/04/22 03:13:21 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -2606,6 +2606,7 @@ Static usbd_status
 uaudio_chan_open(struct uaudio_softc *sc, struct chan *ch)
 {
 	struct as_info *as;
+	usb_device_descriptor_t *ddesc;
 	int endpt;
 	usbd_status err;
 
@@ -2622,8 +2623,9 @@ uaudio_chan_open(struct uaudio_softc *sc
 	/*
 	 * Roland SD-90 freezes by a SAMPLING_FREQ_CONTROL request.
 	 */
-	if ((UGETW(sc-sc_udev-ddesc.idVendor) != USB_VENDOR_ROLAND) 
-	(UGETW(sc-sc_udev-ddesc.idProduct) != USB_PRODUCT_ROLAND_SD90)) {
+	ddesc = usbd_get_device_descriptor(sc-sc_udev);
+	if ((UGETW(ddesc-idVendor) != USB_VENDOR_ROLAND) 
+	(UGETW(ddesc-idProduct) != USB_PRODUCT_ROLAND_SD90)) {
 		err = uaudio_set_speed(sc, endpt, ch-sample_rate);
 		if (err) {
 			DPRINTF((uaudio_chan_open: set_speed failed err=%s\n,



CVS commit: [netbsd-5] src/doc

2012-04-21 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Apr 22 03:16:44 UTC 2012

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
Ticket 1751.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.158 -r1.1.2.159 src/doc/CHANGES-5.2

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

Modified files:

Index: src/doc/CHANGES-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.158 src/doc/CHANGES-5.2:1.1.2.159
--- src/doc/CHANGES-5.2:1.1.2.158	Sat Apr 21 23:10:41 2012
+++ src/doc/CHANGES-5.2	Sun Apr 22 03:16:43 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.158 2012/04/21 23:10:41 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.159 2012/04/22 03:16:43 riz Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -6330,3 +6330,10 @@ sys/netatalk/ddp_output.c			1.16
 	Fix AppleTalk name registration. PR#44412.
 	[hauke, ticket #1749]
 
+sys/dev/usb/uaudio.c1.131
+
+	Use usbd_get_device_descriptor() instead of groping for it directly
+	in the usbd_device struct.  Fixes build breakage introduced in
+	ticket #1746.
+	[jakllsch, ticket #1751]
+



CVS commit: src/sys/dev/wscons

2012-04-21 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Apr 22 03:47:53 UTC 2012

Modified Files:
src/sys/dev/wscons: wsdisplay_glyphcachevar.h

Log Message:
Add newline at end of file; fix ALL build for me.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/wscons/wsdisplay_glyphcachevar.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/wscons/wsdisplay_glyphcachevar.h
diff -u src/sys/dev/wscons/wsdisplay_glyphcachevar.h:1.2 src/sys/dev/wscons/wsdisplay_glyphcachevar.h:1.3
--- src/sys/dev/wscons/wsdisplay_glyphcachevar.h:1.2	Thu Apr 19 08:46:17 2012
+++ src/sys/dev/wscons/wsdisplay_glyphcachevar.h	Sun Apr 22 03:47:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: wsdisplay_glyphcachevar.h,v 1.2 2012/04/19 08:46:17 macallan Exp $	*/
+/*	$NetBSD: wsdisplay_glyphcachevar.h,v 1.3 2012/04/22 03:47:53 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 2012 Michael Lorenz
@@ -62,4 +62,4 @@ int glyphcache_try(glyphcache *, int, in
 #define GC_ADD	1 /* glyph is not in cache but can be added */
 #define GC_NOPE 2 /* glyph is not in cache and can't be added */
 
-#endif /* WSDISPLAY_GLYPHCACHEVAR_H */
\ No newline at end of file
+#endif /* WSDISPLAY_GLYPHCACHEVAR_H */



CVS commit: src/sys/dev/pci

2012-04-21 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Sun Apr 22 03:57:00 UTC 2012

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

Log Message:
Consistent declaration.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/pci/radeonfb.c

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

Modified files:

Index: src/sys/dev/pci/radeonfb.c
diff -u src/sys/dev/pci/radeonfb.c:1.61 src/sys/dev/pci/radeonfb.c:1.62
--- src/sys/dev/pci/radeonfb.c:1.61	Thu Apr 12 18:55:26 2012
+++ src/sys/dev/pci/radeonfb.c	Sun Apr 22 03:57:00 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.61 2012/04/12 18:55:26 macallan Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.62 2012/04/22 03:57:00 uebayasi Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: radeonfb.c,v 1.61 2012/04/12 18:55:26 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: radeonfb.c,v 1.62 2012/04/22 03:57:00 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -154,7 +154,7 @@ static void radeonfb_cursor_position(str
 static void radeonfb_cursor_visible(struct radeonfb_display *);
 static void radeonfb_cursor_update(struct radeonfb_display *, unsigned);
 
-static void radeonfb_wait_fifo(struct radeonfb_softc *, int);
+static inline void radeonfb_wait_fifo(struct radeonfb_softc *, int);
 static void radeonfb_engine_idle(struct radeonfb_softc *);
 static void radeonfb_engine_flush(struct radeonfb_softc *);
 static void radeonfb_engine_reset(struct radeonfb_softc *);



CVS commit: src/distrib/common/bootimage

2012-04-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr 22 05:24:39 UTC 2012

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
Add two optional variables for liveimage/installimage builds:
---
MBR_BOOTCODE
optional MBR bootcode which should be installed by fdisk(8)
(default: empty)
- specified MBR_BOOTCODE must exist in ${DESTDIR}/usr/mdec
- if MBR_BOOTCODE is not specified,
  MBR_DEFAULT_BOOTCODE (default: mbr) will be used
  if the target ${MACHINE} has the one in /usr/mdec

INSTALLBOOTOPTIONS
options passed to installboot(8), e.g., -o console=com0
(default: empty)
---
Proposed by Brook Milligan on current-users@:
http://mail-index.NetBSD.org/current-users/2012/04/16/msg019892.html

Also make USE_MBR work on ${MACHINE}s which don't have the default
/usr/mdec/mbr bootcode. (no such port has the liveimage target yet though)

XXX: tools fdisk(8) implicitly uses host's /usr/mdec/mbr for the default
XXX: bootcode even for non-x86 targets if host is x86


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/common/bootimage/Makefile.bootimage

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.4 src/distrib/common/bootimage/Makefile.bootimage:1.5
--- src/distrib/common/bootimage/Makefile.bootimage:1.4	Mon Apr  9 19:22:49 2012
+++ src/distrib/common/bootimage/Makefile.bootimage	Sun Apr 22 05:24:39 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.4 2012/04/09 19:22:49 riz Exp $
+#	$NetBSD: Makefile.bootimage,v 1.5 2012/04/22 05:24:39 tsutsui Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -40,6 +40,13 @@
 #	USE_MBR
 #		set yes if target disk image requires MBR partition
 #		(defautl: no)
+#	MBR_BOOTCODE
+#		optional MBR bootcode which should be installed by fdisk(8)
+#		(default: empty)
+#		- specified MBR_BOOTCODE must exist in ${DESTDIR}/usr/mdec
+#		- if MBR_BOOTCODE is not specified,
+#		  MBR_DEFAULT_BOOTCODE (default: mbr) will be used
+#		  if the target ${MACHINE} has the one in /usr/mdec
 #	USE_SUNLABEL
 #		set yes if target disk image requires Sun's label
 #		(default: no)
@@ -92,6 +99,9 @@
 #	IMGMAKEFSOPTIONS
 #		options passed to makefs(8) to create root file system
 #		(default: -o bsize=16384,fsize=2048,density=8192)
+#	INSTALLBOOTOPTIONS
+#		options passed to installboot(8), e.g., -o console=com0
+#		(default: empty)
 #	PRIMARY_BOOT
 #		primary boot loader that should be installed into
 #		the target image via installboot(8)
@@ -286,7 +296,7 @@ ${TARGETFS}: prepare_md_post
 	${IMGMAKEFSOPTIONS}		\
 	${WORKFS} ${WORKDIR}
 .if !empty(PRIMARY_BOOT)  ${INSTALLBOOT_AFTER_DISKLABEL} == no
-	${TOOL_INSTALLBOOT} -vm ${MACHINE} ${WORKFS} \
+	${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${INSTALLBOOTOPTIONS} ${WORKFS} \
 	${WORKDIR}/usr/mdec/${PRIMARY_BOOT} ${SECONDARY_BOOT_ARG}
 .endif
 	@echo done.
@@ -301,6 +311,8 @@ DISKPROTO_IN?=	${DISTRIBDIR}/common/boot
 DISKPROTO_IN?=	${DISTRIBDIR}/common/bootimage/diskproto.in
 .endif
 
+MBR_DEFAULT_BOOTCODE?=	mbr
+
 OMIT_SWAPIMG?=	no
 
 WORKMBR?=	work.mbr
@@ -328,14 +340,30 @@ ${WORKLABEL}:
 	mv ${WORKLABEL}.tmp ${WORKLABEL}
 
 ${IMGBASE}.img:	${TARGETFS} ${WORKLABEL}
-.if ${LABELSECTORS} != 0
+.if ${USE_MBR} != no
 	@echo creating MBR labels...
 	${DD} if=/dev/zero of=${WORKMBR} seek=$$((${IMAGESECTORS} - 1)) count=1
-	${TOOL_FDISK} -f -u \
+	${TOOL_FDISK} -f -i -u \
 	-b ${MBRCYLINDERS}/${MBRHEADS}/${MBRSECTORS}		\
 	-0 -a -s ${MBRNETBSD}/${FSOFFSET}/${BSDPARTSECTORS}		\
-	-i -c ${WORKDIR}/usr/mdec/mbr\
 	-F ${WORKMBR}
+.if empty(MBR_BOOTCODE)
+	@if [ -f ${WORKDIR}/usr/mdec/${MBR_DEFAULT_BOOTCODE} ]; then 	\
+		echo ${TOOL_FDISK} -f	\
+		-i -c ${WORKDIR}/usr/mdec/${MBR_DEFAULT_BOOTCODE}	\
+		-F ${WORKMBR};	\
+		${TOOL_FDISK} -f	\
+		-i -c ${WORKDIR}/usr/mdec/${MBR_DEFAULT_BOOTCODE}	\
+		-F ${WORKMBR};	\
+	fi
+.else
+	@if [ ! -f ${WORKDIR}/usr/mdec/${MBR_BOOTCODE} ]; then 		\
+		echo ${MBR_BOOTCODE} is not found in DESTDIR/usr/mdec, aborting; \
+		false; 			\
+	fi
+	${TOOL_FDISK} -f -i -c ${WORKDIR}/usr/mdec/${MBR_BOOTCODE}	\
+	-F ${WORKMBR}
+.endif
 	${DD} if=${WORKMBR} count=${LABELSECTORS} |			\
 	${CAT} - ${TARGETFS}  ${WORKIMG}
 .else
@@ -354,7 +382,7 @@ ${IMGBASE}.img:	${TARGETFS} ${WORKLABEL}
 .endif
 	${TOOL_DISKLABEL} -R -F ${WORKIMG} ${WORKLABEL}
 .if !empty(PRIMARY_BOOT)  ${INSTALLBOOT_AFTER_DISKLABEL} != no
-	${TOOL_INSTALLBOOT}  -vm ${MACHINE} ${WORKIMG}			\
+	${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${INSTALLBOOTOPTOINS} ${WORKIMG} \
 	${WORKDIR}/usr/mdec/${PRIMARY_BOOT}
 .endif
 	mv ${WORKIMG} ${.TARGET}