CVS commit: src/share/mk

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  4 03:35:01 UTC 2020

Modified Files:
src/share/mk: bsd.prog.mk

Log Message:
Fix kerberos libraries order


To generate a diff of this commit:
cvs rdiff -u -r1.326 -r1.327 src/share/mk/bsd.prog.mk

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

Modified files:

Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.326 src/share/mk/bsd.prog.mk:1.327
--- src/share/mk/bsd.prog.mk:1.326	Fri Apr  3 21:35:22 2020
+++ src/share/mk/bsd.prog.mk	Fri Apr  3 23:35:01 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.prog.mk,v 1.326 2020/04/04 01:35:22 christos Exp $
+#	$NetBSD: bsd.prog.mk,v 1.327 2020/04/04 03:35:01 christos Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -221,15 +221,17 @@ LIB${_lib:tu}=	${DESTDIR}/usr/lib/lib${_
 .endfor
 
 .if (${MKKERBEROS} != "no")
-LIBKRB5_LDADD+= -lkrb5
-LIBKRB5_DPADD+= ${LIBKRB5}
+LIBKRB5_LDADD+= -lkrb5 -lcom_err
+LIBKRB5_DPADD+= ${LIBKRB5} ${LIBCOM_ERR}
 # Kerberos5 applications, if linked statically, need more libraries
 LIBKRB5_STATIC_LDADD+= \
-	-lhx509 -lcrypto -lasn1 -lcom_err -lroken \
-	-lwind -lheimbase -lsqlite3 -lcrypt -lutil
+	-lhx509 -lcrypto -lasn1 \
+	-lwind -lheimbase -lcom_err -lroken \
+	-lsqlite3 -lcrypt -lutil
 LIBKRB5_STATIC_DPADD+= \
-	${LIBHX509} ${LIBCRYPTO} ${LIBASN1} ${LIBCOM_ERR} ${LIBROKEN} \
-	${LIBWIND} ${LIBHEIMBASE} ${LIBSQLITE3} ${LIBCRYPT}  ${LIBUTIL}
+	${LIBHX509} ${LIBCRYPTO} ${LIBASN1} \
+	${LIBWIND} ${LIBHEIMBASE} ${LIBCOM_ERR} ${LIBROKEN} \
+	${LIBSQLITE3} ${LIBCRYPT}  ${LIBUTIL}
 . if (${MKPIC} == "no")
 LIBKRB5_LDADD+= ${LIBKRB5_STATIC_LDADD}
 LIBKRB5_DPADD+= ${LIBKRB5_STATIC_DPADD}



CVS commit: src/external/mit/xorg/lib/gallium

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  4 03:04:58 UTC 2020

Modified Files:
src/external/mit/xorg/lib/gallium: Makefile

Log Message:
Add all the dependent libraries and sort


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/external/mit/xorg/lib/gallium/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/mit/xorg/lib/gallium/Makefile
diff -u src/external/mit/xorg/lib/gallium/Makefile:1.43 src/external/mit/xorg/lib/gallium/Makefile:1.44
--- src/external/mit/xorg/lib/gallium/Makefile:1.43	Fri Jan 31 16:13:40 2020
+++ src/external/mit/xorg/lib/gallium/Makefile	Fri Apr  3 23:04:58 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.43 2020/01/31 21:13:40 jmcneill Exp $
+# $NetBSD: Makefile,v 1.44 2020/04/04 03:04:58 christos Exp $
 
 # Link the gallium mega driver.
 
@@ -25,7 +25,6 @@ CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/libd
 
 CFLAGS+=	-pthread
 LDFLAGS+=	-pthread
-LIBDPLIBS+=	pthread		${.CURDIR}/../../../../../lib/libpthread
 
 GALLIUM_SUBDIRS= \
 	auxiliary \
@@ -953,10 +952,11 @@ CPPFLAGS.${_s}+= -I${X11SRCDIR.Mesa}/src
 .if ${BUILD_RADEON} == 1
 CFLAGS+=	-pthread
 LDFLAGS+=	-pthread
-LIBDPLIBS+=	pthread		${.CURDIR}/../../../../../lib/libpthread
 .endif
 
-LIBDPLIBS+=	m		${.CURDIR}/../../../../../lib/libm
+LIBDPLIBS+=	X11-xcb ${.CURDIR}/../libX11/libX11-xcb
+LIBDPLIBS+=	xcb-dri2${.CURDIR}/../libxcb/dri2
+LIBDPLIBS+=	xcb		${.CURDIR}/../libxcb/libxcb
 .if ${BUILD_RADEON} == 1 || ${BUILD_NOUVEAU} == 1
 LIBDPLIBS+= 	drm		${.CURDIR}/../libdrm
 .if ${BUILD_I915} == 1
@@ -973,10 +973,11 @@ LIBDPLIBS+= 	drm_nouveau	${.CURDIR}/../l
 LIBDPLIBS+= 	glapi		${.CURDIR}/../libglapi
 LIBDPLIBS+=	expat		${.CURDIR}/../../../../../external/mit/expat/lib/libexpat
 LIBDPLIBS+=	terminfo	${.CURDIR}/../../../../../lib/libterminfo
-LIBDPLIBS+=	z		${.CURDIR}/../../../../../lib/libz
 LIBDPLIBS+=	execinfo	${.CURDIR}/../../../../../lib/libexecinfo
-LIBDPLIBS+=	X11-xcb ${.CURDIR}/../libX11/libX11-xcb
-LIBDPLIBS+=	xcb-dri2${.CURDIR}/../libxcb/dri2
+
+LIBDPLIBS+=	elf		${NETBSDSRCDIR}/external/bsd/elftoolchain/lib/libelf
+LIBDPLIBS+=	z		${.CURDIR}/../../../../../lib/libz
+LIBDPLIBS+=	m		${.CURDIR}/../../../../../lib/libm
 
 # gallium drivers requiring LLVM
 .if ${BUILD_LLVMPIPE} == 1 || ${BUILD_RADEON} == 1



CVS commit: src/external/gpl3/binutils/dist/binutils/doc

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  4 01:44:43 UTC 2020

Modified Files:
src/external/gpl3/binutils/dist/binutils/doc: cxxfilt.man

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \
src/external/gpl3/binutils/dist/binutils/doc/cxxfilt.man

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

Modified files:

Index: src/external/gpl3/binutils/dist/binutils/doc/cxxfilt.man
diff -u src/external/gpl3/binutils/dist/binutils/doc/cxxfilt.man:1.11 src/external/gpl3/binutils/dist/binutils/doc/cxxfilt.man:1.12
--- src/external/gpl3/binutils/dist/binutils/doc/cxxfilt.man:1.11	Fri Apr  3 19:49:38 2020
+++ src/external/gpl3/binutils/dist/binutils/doc/cxxfilt.man	Fri Apr  3 21:44:43 2020
@@ -1,4 +1,4 @@
-.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
+.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
 .\"
 .\" Standard preamble:
 .\" 
@@ -54,16 +54,20 @@
 .\" Avoid warning from groff about undefined register 'F'.
 .de IX
 ..
-.if !\nF .nr F 0
-.if \nF>0 \{\
-.de IX
-.tm Index:\\$1\t\\n%\t"\\$2"
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{\
+.if \nF \{\
+.de IX
+.tm Index:\\$1\t\\n%\t"\\$2"
 ..
-.if !\nF==2 \{\
-.nr % 0
-.nr F 2
+.if !\nF==2 \{\
+.nr % 0
+.nr F 2
+.\}
 .\}
 .\}
+.rr rF
 .\"
 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
@@ -129,13 +133,13 @@
 .\" 
 .\"
 .IX Title "C++FILT 1"
-.TH C++FILT 1 "2018-07-09" "binutils-2.30.90" "GNU Development Tools"
+.TH C++FILT 1 "2020-04-03" "binutils-2.34" "GNU Development Tools"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
 .nh
 .SH "NAME"
-cxxfilt \- Demangle C++ and Java symbols.
+cxxfilt \- demangle C++ and Java symbols
 .SH "SYNOPSIS"
 .IX Header "SYNOPSIS"
 c++filt [\fB\-_\fR|\fB\-\-strip\-underscore\fR]
@@ -143,6 +147,8 @@ c++filt [\fB\-_\fR|\fB\-\-strip\-undersc
 [\fB\-p\fR|\fB\-\-no\-params\fR]
 [\fB\-t\fR|\fB\-\-types\fR]
 [\fB\-i\fR|\fB\-\-no\-verbose\fR]
+[\fB\-r\fR|\fB\-\-no\-recurse\-limit\fR]
+[\fB\-R\fR|\fB\-\-recurse\-limit\fR]
 [\fB\-s\fR \fIformat\fR|\fB\-\-format=\fR\fIformat\fR]
 [\fB\-\-help\fR]  [\fB\-\-version\fR]  [\fIsymbol\fR...]
 .SH "DESCRIPTION"
@@ -177,7 +183,7 @@ If no \fIsymbol\fR arguments are given, 
 names from the standard input instead.  All the results are printed on
 the standard output.  The difference between reading names from the
 command line versus reading names from the standard input is that
-command line arguments are expected to be just mangled names and no
+command-line arguments are expected to be just mangled names and no
 checking is performed to separate them from surrounding text.  Thus
 for example:
 .PP
@@ -253,6 +259,35 @@ demangled to \*(L"signed char\*(R".
 .PD
 Do not include implementation details (if any) in the demangled
 output.
+.IP "\fB\-r\fR" 4
+.IX Item "-r"
+.PD 0
+.IP "\fB\-R\fR" 4
+.IX Item "-R"
+.IP "\fB\-\-recurse\-limit\fR" 4
+.IX Item "--recurse-limit"
+.IP "\fB\-\-no\-recurse\-limit\fR" 4
+.IX Item "--no-recurse-limit"
+.IP "\fB\-\-recursion\-limit\fR" 4
+.IX Item "--recursion-limit"
+.IP "\fB\-\-no\-recursion\-limit\fR" 4
+.IX Item "--no-recursion-limit"
+.PD
+Enables or disables a limit on the amount of recursion performed
+whilst demangling strings.  Since the name mangling formats allow for
+an inifinite level of recursion it is possible to create strings whose
+decoding will exhaust the amount of stack space available on the host
+machine, triggering a memory fault.  The limit tries to prevent this
+from happening by restricting recursion to 2048 levels of nesting.
+.Sp
+The default is for this limit to be enabled, but disabling it may be
+necessary in order to demangle truly complicated names.  Note however
+that if the recursion limit is disabled then stack exhaustion is
+possible and any bug reports about such an event will be rejected.
+.Sp
+The \fB\-r\fR option is a synonym for the
+\&\fB\-\-no\-recurse\-limit\fR option.  The \fB\-R\fR option is a
+synonym for the \fB\-\-recurse\-limit\fR option.
 .IP "\fB\-s\fR \fIformat\fR" 4
 .IX Item "-s format"
 .PD 0
@@ -331,7 +366,7 @@ MS-DOS this program is named \fB\s-1CXXF
 the Info entries for \fIbinutils\fR.
 .SH "COPYRIGHT"
 .IX Header "COPYRIGHT"
-Copyright (c) 1991\-2018 Free Software Foundation, Inc.
+Copyright (c) 1991\-2020 Free Software Foundation, Inc.
 .PP
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the \s-1GNU\s0 Free 

CVS commit: src/share/mk

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  4 01:35:22 UTC 2020

Modified Files:
src/share/mk: bsd.README bsd.hostprog.mk bsd.prog.mk

Log Message:
Add libgnuctf


To generate a diff of this commit:
cvs rdiff -u -r1.399 -r1.400 src/share/mk/bsd.README
cvs rdiff -u -r1.82 -r1.83 src/share/mk/bsd.hostprog.mk
cvs rdiff -u -r1.325 -r1.326 src/share/mk/bsd.prog.mk

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

Modified files:

Index: src/share/mk/bsd.README
diff -u src/share/mk/bsd.README:1.399 src/share/mk/bsd.README:1.400
--- src/share/mk/bsd.README:1.399	Tue Mar 24 03:56:26 2020
+++ src/share/mk/bsd.README	Fri Apr  3 21:35:22 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.399 2020/03/24 07:56:26 mrg Exp $
+#	$NetBSD: bsd.README,v 1.400 2020/04/04 01:35:22 christos Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -1678,6 +1678,7 @@ DPADD		Additional dependencies for the p
 		LIBFL?=			${DESTDIR}/usr/lib/libfl.a
 		LIBFORM?=		${DESTDIR}/usr/lib/libform.a
 		LIBGCC?=		${DESTDIR}/usr/lib/libgcc.a
+		LIBGNUCTF?=		${DESTDIR}/usr/lib/libgnuctf.a
 		LIBGNUMALLOC?=		${DESTDIR}/usr/lib/libgnumalloc.a
 		LIBGSSAPI?=		${DESTDIR}/usr/lib/libgssapi.a
 		LIBHDB?=		${DESTDIR}/usr/lib/libhdb.a

Index: src/share/mk/bsd.hostprog.mk
diff -u src/share/mk/bsd.hostprog.mk:1.82 src/share/mk/bsd.hostprog.mk:1.83
--- src/share/mk/bsd.hostprog.mk:1.82	Mon Oct 28 09:04:19 2019
+++ src/share/mk/bsd.hostprog.mk	Fri Apr  3 21:35:22 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.hostprog.mk,v 1.82 2019/10/28 13:04:19 maxv Exp $
+#	$NetBSD: bsd.hostprog.mk,v 1.83 2020/04/04 01:35:22 christos Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .include 
@@ -27,6 +27,7 @@ LIBEXPAT?=	/usr/lib/libexpat.a
 LIBFETCH?=	/usr/lib/libfetch.a
 LIBFORM?=	/usr/lib/libform.a
 LIBGCC?=	/usr/lib/libgcc.a
+LIBGNUCTF?=	/usr/lib/libgnuctf.a
 LIBGNUMALLOC?=	/usr/lib/libgnumalloc.a
 LIBINTL?=	/usr/lib/libintl.a
 LIBIPSEC?=	/usr/lib/libipsec.a

Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.325 src/share/mk/bsd.prog.mk:1.326
--- src/share/mk/bsd.prog.mk:1.325	Mon Mar  2 21:25:03 2020
+++ src/share/mk/bsd.prog.mk	Fri Apr  3 21:35:22 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.prog.mk,v 1.325 2020/03/03 02:25:03 christos Exp $
+#	$NetBSD: bsd.prog.mk,v 1.326 2020/04/04 01:35:22 christos Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -137,6 +137,7 @@ _LIBLIST=\
 	fido2 \
 	form \
 	gcc \
+	gnuctf \
 	gnumalloc \
 	gssapi \
 	hdb \



CVS commit: src/external/gpl3/binutils

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  4 01:34:30 UTC 2020

Modified Files:
src/external/gpl3/binutils/lib: Makefile
src/external/gpl3/binutils/lib/libbfd/arch/x86_64: bfd_stdint.h
src/external/gpl3/binutils/usr.bin/ld: Makefile
src/external/gpl3/binutils/usr.bin/objdump: Makefile
src/external/gpl3/binutils/usr.bin/readelf: Makefile
Added Files:
src/external/gpl3/binutils/lib/libgnuctf: Makefile
src/external/gpl3/binutils/lib/libgnuctf/arch/i386: config.h defs.mk
src/external/gpl3/binutils/lib/libgnuctf/arch/x86_64: config.h defs.mk
Removed Files:
src/external/gpl3/binutils/lib/libctf: Makefile
src/external/gpl3/binutils/lib/libctf/arch/i386: config.h defs.mk
src/external/gpl3/binutils/lib/libctf/arch/x86_64: config.h defs.mk

Log Message:
rename libctf to libgnuctf to avoid conflict with the sun version.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/binutils/lib/Makefile
cvs rdiff -u -r1.8 -r1.9 \
src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h
cvs rdiff -u -r1.1 -r0 src/external/gpl3/binutils/lib/libctf/Makefile
cvs rdiff -u -r1.1 -r0 \
src/external/gpl3/binutils/lib/libctf/arch/i386/config.h \
src/external/gpl3/binutils/lib/libctf/arch/i386/defs.mk
cvs rdiff -u -r1.1 -r0 \
src/external/gpl3/binutils/lib/libctf/arch/x86_64/config.h \
src/external/gpl3/binutils/lib/libctf/arch/x86_64/defs.mk
cvs rdiff -u -r0 -r1.1 src/external/gpl3/binutils/lib/libgnuctf/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/binutils/lib/libgnuctf/arch/i386/config.h \
src/external/gpl3/binutils/lib/libgnuctf/arch/i386/defs.mk
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/binutils/lib/libgnuctf/arch/x86_64/config.h \
src/external/gpl3/binutils/lib/libgnuctf/arch/x86_64/defs.mk
cvs rdiff -u -r1.32 -r1.33 src/external/gpl3/binutils/usr.bin/ld/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/binutils/usr.bin/objdump/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/gpl3/binutils/usr.bin/readelf/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/gpl3/binutils/lib/Makefile
diff -u src/external/gpl3/binutils/lib/Makefile:1.2 src/external/gpl3/binutils/lib/Makefile:1.3
--- src/external/gpl3/binutils/lib/Makefile:1.2	Fri Apr  3 20:46:53 2020
+++ src/external/gpl3/binutils/lib/Makefile	Fri Apr  3 21:34:28 2020
@@ -1,5 +1,5 @@
-#	$NetBSD: Makefile,v 1.2 2020/04/04 00:46:53 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2020/04/04 01:34:28 christos Exp $
 
-SUBDIR+= libctf libopcodes libbfd libiberty
+SUBDIR+= libgnuctf libopcodes libbfd libiberty
 
 .include 

Index: src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h
diff -u src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h:1.8 src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h:1.9
--- src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h:1.8	Fri Apr  3 20:46:53 2020
+++ src/external/gpl3/binutils/lib/libbfd/arch/x86_64/bfd_stdint.h	Fri Apr  3 21:34:29 2020
@@ -1,8 +1,8 @@
 /* This file is automatically generated.  DO NOT EDIT! */
-/* Generated from: NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp  */
+/* Generated from: NetBSD: mknative-binutils,v 1.12 2020/04/04 00:47:52 christos Exp  */
 /* Generated from: NetBSD: mknative.common,v 1.16 2018/04/15 15:13:37 christos Exp  */
 
-/* generated for  x86_64--netbsd-gcc (NetBSD nb1 20190930) 8.3.0 */
+/* generated for  x86_64--netbsd-gcc (NetBSD nb1 20200311) 8.4.0 */
 
 #ifndef GCC_GENERATED_STDINT_H
 #define GCC_GENERATED_STDINT_H 1

Index: src/external/gpl3/binutils/usr.bin/ld/Makefile
diff -u src/external/gpl3/binutils/usr.bin/ld/Makefile:1.32 src/external/gpl3/binutils/usr.bin/ld/Makefile:1.33
--- src/external/gpl3/binutils/usr.bin/ld/Makefile:1.32	Fri Apr  3 20:46:55 2020
+++ src/external/gpl3/binutils/usr.bin/ld/Makefile	Fri Apr  3 21:34:30 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.32 2020/04/04 00:46:55 christos Exp $
+#	$NetBSD: Makefile,v 1.33 2020/04/04 01:34:30 christos Exp $
 
 CPPFLAGS+=	-I${.CURDIR}/arch/${BINUTILS_MACHINE_ARCH} \
 		-I${DIST}/ld \
@@ -22,7 +22,7 @@ SRCS=		${G_OFILES:.o=.c}
 
 COPTS.ldgram.c = -Wno-stack-protector
 
-PROGDPLIBS+=	ctf 	${TOP}/${BFDSUBDIR}/libctf
+PROGDPLIBS+=	gnuctf 	${TOP}/${BFDSUBDIR}/libgnuctf
 PROGDPLIBS+=	bfd	${TOP}/${BFDSUBDIR}/libbfd
 PROGDPLIBS+=	iberty 	${TOP}/${BFDSUBDIR}/libiberty
 

Index: src/external/gpl3/binutils/usr.bin/objdump/Makefile
diff -u src/external/gpl3/binutils/usr.bin/objdump/Makefile:1.4 src/external/gpl3/binutils/usr.bin/objdump/Makefile:1.5
--- src/external/gpl3/binutils/usr.bin/objdump/Makefile:1.4	Fri Apr  3 20:46:55 2020
+++ src/external/gpl3/binutils/usr.bin/objdump/Makefile	Fri Apr  3 21:34:30 2020
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.4 2020/04/04 00:46:55 christos Exp $
+#	$NetBSD: 

CVS commit: src/tools/binutils

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  4 01:34:53 UTC 2020

Modified Files:
src/tools/binutils: mknative-binutils

Log Message:
rename libctf to libgnuctf


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/tools/binutils/mknative-binutils

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

Modified files:

Index: src/tools/binutils/mknative-binutils
diff -u src/tools/binutils/mknative-binutils:1.12 src/tools/binutils/mknative-binutils:1.13
--- src/tools/binutils/mknative-binutils:1.12	Fri Apr  3 20:47:52 2020
+++ src/tools/binutils/mknative-binutils	Fri Apr  3 21:34:53 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mknative-binutils,v 1.12 2020/04/04 00:47:52 christos Exp $
+#	$NetBSD: mknative-binutils,v 1.13 2020/04/04 01:34:53 christos Exp $
 #
 # Shell script for generating all the constants needed for a native
 # platform build of src/external/gpl3/binutils
@@ -49,16 +49,16 @@ get_libopcodes () {
 	} | write_c external/gpl3/binutils/lib/libopcodes/arch/$MACHINE_ARCH/config.h
 }
 
-get_libctf () {
-	mkdir -p $_TOP/external/gpl3/binutils/lib/libctf/arch/$MACHINE_ARCH
+get_libgnuctf () {
+	mkdir -p $_TOP/external/gpl3/binutils/lib/libgnuctf/arch/$MACHINE_ARCH
 
 	{
 		getvars libctf/Makefile libctf_la_SOURCES
-	} | write_mk external/gpl3/binutils/lib/libctf/arch/$MACHINE_ARCH/defs.mk
+	} | write_mk external/gpl3/binutils/lib/libgnuctf/arch/$MACHINE_ARCH/defs.mk
 
 	{
 		cat $_TMPDIR/libctf/config.h
-	} | write_c external/gpl3/binutils/lib/libctf/arch/$MACHINE_ARCH/config.h
+	} | write_c external/gpl3/binutils/lib/libgnuctf/arch/$MACHINE_ARCH/config.h
 }
 
 # external/gpl3/binutils/lib/libiberty #
@@ -150,7 +150,7 @@ case $1 in
 all|binutils)	# everything (uses "canadian cross" temp environment)
 	get_binutils
 	get_libbfd
-	get_libctf
+	get_libgnuctf
 	get_libopcodes
 	get_libiberty
 	exit 0



CVS commit: src/tools/binutils

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  4 00:47:52 UTC 2020

Modified Files:
src/tools/binutils: mknative-binutils

Log Message:
Handle libctf new in binutils 2.34


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tools/binutils/mknative-binutils

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

Modified files:

Index: src/tools/binutils/mknative-binutils
diff -u src/tools/binutils/mknative-binutils:1.11 src/tools/binutils/mknative-binutils:1.12
--- src/tools/binutils/mknative-binutils:1.11	Wed Nov  7 21:08:35 2018
+++ src/tools/binutils/mknative-binutils	Fri Apr  3 20:47:52 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: mknative-binutils,v 1.11 2018/11/08 02:08:35 christos Exp $
+#	$NetBSD: mknative-binutils,v 1.12 2020/04/04 00:47:52 christos Exp $
 #
 # Shell script for generating all the constants needed for a native
 # platform build of src/external/gpl3/binutils
@@ -49,6 +49,18 @@ get_libopcodes () {
 	} | write_c external/gpl3/binutils/lib/libopcodes/arch/$MACHINE_ARCH/config.h
 }
 
+get_libctf () {
+	mkdir -p $_TOP/external/gpl3/binutils/lib/libctf/arch/$MACHINE_ARCH
+
+	{
+		getvars libctf/Makefile libctf_la_SOURCES
+	} | write_mk external/gpl3/binutils/lib/libctf/arch/$MACHINE_ARCH/defs.mk
+
+	{
+		cat $_TMPDIR/libctf/config.h
+	} | write_c external/gpl3/binutils/lib/libctf/arch/$MACHINE_ARCH/config.h
+}
+
 # external/gpl3/binutils/lib/libiberty #
 
 get_libiberty () {
@@ -138,6 +150,7 @@ case $1 in
 all|binutils)	# everything (uses "canadian cross" temp environment)
 	get_binutils
 	get_libbfd
+	get_libctf
 	get_libopcodes
 	get_libiberty
 	exit 0



CVS commit: src/tools/binutils

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Apr  4 00:47:30 UTC 2020

Modified Files:
src/tools/binutils: Makefile

Log Message:
put the binutils include before /usr/include to get the right md5.h


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/tools/binutils/Makefile

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

Modified files:

Index: src/tools/binutils/Makefile
diff -u src/tools/binutils/Makefile:1.30 src/tools/binutils/Makefile:1.31
--- src/tools/binutils/Makefile:1.30	Thu Dec 27 11:26:52 2018
+++ src/tools/binutils/Makefile	Fri Apr  3 20:47:30 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.30 2018/12/27 16:26:52 christos Exp $
+#	$NetBSD: Makefile,v 1.31 2020/04/04 00:47:30 christos Exp $
 
 .include 
 
@@ -34,7 +34,8 @@ INSTALL_TARGET+=install-gprof
 
 .include "${.CURDIR}/../Makefile.gnuhost"
 
-CCADDFLAGS=	-I${DESTDIR}/usr/include -B${DESTDIR}/usr/lib/
+CCADDFLAGS=	-I${GNUHOSTDIST}/include  -I${DESTDIR}/usr/include
+CCADDFLAGS+=	-B${DESTDIR}/usr/lib/
 LDADDFLAGS=	-L${DESTDIR}/lib -L${DESTDIR}/usr/lib
 
 # Force avoiding possibly non-executable install-sh.



CVS commit: src/sys/dev/ic

2020-04-03 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Apr  4 00:01:28 UTC 2020

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

Log Message:
Mark res __diagused; #ifdef DIAGNOSTIC panic ---> KASSERT.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/dev/ic/vga_raster.c

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

Modified files:

Index: src/sys/dev/ic/vga_raster.c
diff -u src/sys/dev/ic/vga_raster.c:1.46 src/sys/dev/ic/vga_raster.c:1.47
--- src/sys/dev/ic/vga_raster.c:1.46	Sun Dec  1 14:18:51 2019
+++ src/sys/dev/ic/vga_raster.c	Sat Apr  4 00:01:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vga_raster.c,v 1.46 2019/12/01 14:18:51 ad Exp $	*/
+/*	$NetBSD: vga_raster.c,v 1.47 2020/04/04 00:01:28 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Bang Jun-Young
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vga_raster.c,v 1.46 2019/12/01 14:18:51 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vga_raster.c,v 1.47 2020/04/04 00:01:28 riastradh Exp $");
 
 #include "opt_vga.h"
 #include "opt_wsmsgattrs.h" /* for WSDISPLAY_CUSTOM_OUTPUT */
@@ -440,7 +440,7 @@ vga_raster_init_screen(struct vga_config
 const struct wsscreen_descr *type, int existing, long *attrp)
 {
 	int cpos;
-	int res;
+	int res __diagused;
 	struct vga_handle *vh;
 
 	scr->cfg = vc;
@@ -513,10 +513,7 @@ vga_raster_init_screen(struct vga_config
 	else
 #endif
 	res = vga_raster_allocattr(scr, 0, 0, 0, attrp);
-#ifdef DIAGNOSTIC
-	if (res)
-		panic("vga_raster_init_screen: attribute botch");
-#endif
+	KASSERTMSG(res == 0, "attribute botch");
 
 	vc->nscreens++;
 	LIST_INSERT_HEAD(>screens, scr, next);



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

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  3 23:48:50 UTC 2020

Modified Files:
src/external/gpl3/binutils/dist: config.guess config.sub configure
configure.ac
src/external/gpl3/binutils/dist/bfd: ChangeLog Makefile.am Makefile.in
aoutx.h archive.c archures.c bfd-in2.h bfd.c coff-alpha.c
coffcode.h config.bfd configure configure.ac configure.host
cpu-mips.c cpu-or1k.c cpu-riscv.c dwarf2.c elf-bfd.h elf-eh-frame.c
elf.c elf32-arm.c elf32-avr.c elf32-hppa.c elf32-i386.c
elf32-m68k.c elf32-or1k.c elf32-ppc.c elf32-sh.c elf32-vax.c
elf64-alpha.c elf64-mips.c elf64-ppc.c elf64-x86-64.c elflink.c
elfn32-mips.c elfnn-riscv.c elfxx-mips.c elfxx-riscv.c
elfxx-riscv.h elfxx-sparc.c libbfd.h linker.c reloc.c syms.c
targets.c version.h
src/external/gpl3/binutils/dist/bfd/doc: Makefile.in bfdt.texi
bfdver.texi reloc.texi
src/external/gpl3/binutils/dist/binutils: ChangeLog Makefile.in NEWS
ar.c arsup.c bucomm.c configure objcopy.c readelf.c strings.c
src/external/gpl3/binutils/dist/binutils/doc: Makefile.am Makefile.in
binutils.texi
src/external/gpl3/binutils/dist/cpu: or1k.cpu or1k.opc or1kcommon.cpu
or1korbis.cpu or1korfpx.cpu
src/external/gpl3/binutils/dist/gas: ChangeLog Makefile.am Makefile.in
atof-generic.c configure configure.ac configure.tgt remap.c write.c
src/external/gpl3/binutils/dist/gas/config: atof-vax.c obj-elf.c
tc-alpha.c tc-arm.c tc-m68k.c tc-mips.c tc-mips.h tc-or1k.c
tc-or1k.h tc-ppc.c tc-riscv.c tc-riscv.h tc-sparc.c tc-vax.c
tc-vax.h vax-inst.h
src/external/gpl3/binutils/dist/gas/doc: Makefile.am Makefile.in as.1
as.info c-mips.texi c-ppc.texi
src/external/gpl3/binutils/dist/gold: Makefile.am
src/external/gpl3/binutils/dist/gprof: corefile.c gprof.1 gprof.c
gprof.info
src/external/gpl3/binutils/dist/include: ChangeLog bfdlink.h dis-asm.h
objalloc.h
src/external/gpl3/binutils/dist/include/elf: arm.h common.h internal.h
mips.h or1k.h ppc.h riscv.h
src/external/gpl3/binutils/dist/include/opcode: hppa.h mips.h ppc.h
riscv-opc.h riscv.h
src/external/gpl3/binutils/dist/ld: ChangeLog Makefile.am Makefile.in
configure configure.ac configure.host configure.tgt genscripts.sh
ldctor.c ldemul.c ldemul.h ldexp.c ldgram.c ldgram.h ldlang.c
ldlang.h ldlex.c ldlex.h ldlex.l ldmain.c ldmain.h lexsup.c
src/external/gpl3/binutils/dist/ld/emulparams: armelf_nbsd.sh
elf32_sparc.sh elf32bmipn32-defs.sh elf32lriscv-defs.sh
elf32lriscv.sh elf32lriscv_ilp32.sh elf32lriscv_ilp32f.sh
elf32or1k.sh elf32or1k_linux.sh elf64alpha_nbsd.sh
elf64lriscv-defs.sh elf64lriscv.sh elf_i386.sh hppalinux.sh
hppanbsd.sh hppaobsd.sh m68kelf.sh m68kelfnbsd.sh shelf_nbsd.sh
src/external/gpl3/binutils/dist/ld/emultempl: aarch64elf.em armelf.em
beos.em genelf.em mmo.em pe.em pep.em riscvelf.em spuelf.em
xtensaelf.em
src/external/gpl3/binutils/dist/ld/scripttempl: elf.sc sh.sc
src/external/gpl3/binutils/dist/libiberty: Makefile.in configure
configure.ac floatformat.c make-temp-file.c objalloc.c strerror.c
src/external/gpl3/binutils/dist/opcodes: ChangeLog Makefile.am
Makefile.in cgen.sh configure disassemble.c mips-dis.c mips-opc.c
or1k-asm.c or1k-desc.c or1k-desc.h or1k-dis.c or1k-ibld.c
or1k-opc.c or1k-opc.h or1k-opinst.c ppc-dis.c ppc-opc.c riscv-dis.c
riscv-opc.c sparc-dis.c
Removed Files:
src/external/gpl3/binutils/dist/bfd: .gitignore coff-tic80.c
cpu-cr16c.c cpu-tic80.c elf32-cr16c.c elf32-xgate.h
src/external/gpl3/binutils/dist/binutils: .gitignore
src/external/gpl3/binutils/dist/binutils/doc: addr2line.1 ar.1
binutils.info cxxfilt.man dlltool.1 elfedit.1 nm.1 objcopy.1
objdump.1 ranlib.1 readelf.1 size.1 strings.1 strip.1 windmc.1
windres.1
src/external/gpl3/binutils/dist/gas: .gitignore struc-symbol.h
src/external/gpl3/binutils/dist/gprof: .gitignore
src/external/gpl3/binutils/dist/include/coff: tic80.h
src/external/gpl3/binutils/dist/include/elf: cr16c.h
src/external/gpl3/binutils/dist/include/opcode: tic80.h
src/external/gpl3/binutils/dist/ld: .gitignore
src/external/gpl3/binutils/dist/ld/emulparams: arcelf_prof.sh
arclinux_prof.sh elf32cr16c.sh elf_i386_chaos.sh tic80coff.sh
src/external/gpl3/binutils/dist/ld/emultempl: elf32.em
src/external/gpl3/binutils/dist/ld/scripttempl: elf32cr16c.sc
elf32msp430_3.sc tic80coff.sc

CVS commit: src/external/gpl3/binutils

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  3 23:46:43 UTC 2020

Modified Files:
src/external/gpl3/binutils: binutils2netbsd

Log Message:
remove .gitignore files


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/gpl3/binutils/binutils2netbsd

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

Modified files:

Index: src/external/gpl3/binutils/binutils2netbsd
diff -u src/external/gpl3/binutils/binutils2netbsd:1.1 src/external/gpl3/binutils/binutils2netbsd:1.2
--- src/external/gpl3/binutils/binutils2netbsd:1.1	Wed Oct 26 14:00:56 2016
+++ src/external/gpl3/binutils/binutils2netbsd	Fri Apr  3 19:46:43 2020
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: binutils2netbsd,v 1.1 2016/10/26 18:00:56 christos Exp $
+#	$NetBSD: binutils2netbsd,v 1.2 2020/04/03 23:46:43 christos Exp $
 #
 # Copyright (c) 2016 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -45,6 +45,7 @@ DIR="$1"
 cleantags "$DIR"
 
 find "$DIR" -name testsuite -exec rm -fr {} +
+find "$DIR" -name .gitignore -rm
 
 echo You can import now.  Use the following command:
 echo cvs import src/external/gpl3/binutils/dist FSF binutils-X-YY-Z



CVS commit: src/sys/arch

2020-04-03 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Apr  3 22:45:30 UTC 2020

Modified Files:
src/sys/arch/x86/x86: identcpu.c
src/sys/arch/xen/conf: files.xen

Log Message:
CPU topology makes almost no sense for Xen, and populates it with B/S values


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/x86/x86/identcpu.c
cvs rdiff -u -r1.179 -r1.180 src/sys/arch/xen/conf/files.xen

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/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.100 src/sys/arch/x86/x86/identcpu.c:1.101
--- src/sys/arch/x86/x86/identcpu.c:1.100	Sat Dec 21 12:53:54 2019
+++ src/sys/arch/x86/x86/identcpu.c	Fri Apr  3 22:45:30 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: identcpu.c,v 1.100 2019/12/21 12:53:54 ad Exp $	*/
+/*	$NetBSD: identcpu.c,v 1.101 2020/04/03 22:45:30 ad Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.100 2019/12/21 12:53:54 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.101 2020/04/03 22:45:30 ad Exp $");
 
 #include "opt_xen.h"
 
@@ -950,7 +950,9 @@ cpu_probe(struct cpu_info *ci)
 		cpu_probe_fpu(ci);
 	}
 
+#ifndef XEN
 	x86_cpu_topology(ci);
+#endif
 
 	if (cpu_vendor != CPUVENDOR_AMD && (ci->ci_feat_val[0] & CPUID_TM) &&
 	(rdmsr(MSR_MISC_ENABLE) & (1 << 3)) == 0) {

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.179 src/sys/arch/xen/conf/files.xen:1.180
--- src/sys/arch/xen/conf/files.xen:1.179	Sat Sep  7 18:56:01 2019
+++ src/sys/arch/xen/conf/files.xen	Fri Apr  3 22:45:30 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.xen,v 1.179 2019/09/07 18:56:01 maxv Exp $
+#	$NetBSD: files.xen,v 1.180 2020/04/03 22:45:30 ad Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
@@ -157,7 +157,6 @@ file	arch/x86/x86/tsc.c		machdep
 file	arch/x86/x86/vm_machdep.c	machdep
 file	arch/x86/x86/x86_autoconf.c	machdep & xenpvhvm
 file	arch/x86/x86/x86_machdep.c	machdep
-file	arch/x86/x86/cpu_topology.c	machdep
 file	arch/x86/x86/platform.c		machdep
 
 include	"arch/xen/conf/files.compat"



CVS commit: src/sys/arch/xen

2020-04-03 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Apr  3 22:20:37 UTC 2020

Modified Files:
src/sys/arch/xen/include: intrdefs.h
src/sys/arch/xen/x86: xen_intr.c

Log Message:
Attach xen IPI event counters.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/xen/include/intrdefs.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/xen/x86/xen_intr.c

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

Modified files:

Index: src/sys/arch/xen/include/intrdefs.h
diff -u src/sys/arch/xen/include/intrdefs.h:1.14 src/sys/arch/xen/include/intrdefs.h:1.15
--- src/sys/arch/xen/include/intrdefs.h:1.14	Sat Nov 23 19:40:38 2019
+++ src/sys/arch/xen/include/intrdefs.h	Fri Apr  3 22:20:36 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: intrdefs.h,v 1.14 2019/11/23 19:40:38 ad Exp $ */
+/* $NetBSD: intrdefs.h,v 1.15 2020/04/03 22:20:36 ad Exp $ */
 
 /* This file co-exists, and is included via machine/intrdefs.h */
 
@@ -21,4 +21,9 @@
 /* The number of 'irqs' that XEN understands */
 #define NUM_XEN_IRQS 		256
 
+#define XEN_IPI_NAMES {  "halt IPI", "FPU synch IPI", \
+			 "DDB IPI", "xcall IPI", \
+			 "HVCB IPI", "generic IPI", \
+			 "AST IPI" }
+
 #endif /* _XEN_INTRDEFS_H_ */

Index: src/sys/arch/xen/x86/xen_intr.c
diff -u src/sys/arch/xen/x86/xen_intr.c:1.18 src/sys/arch/xen/x86/xen_intr.c:1.19
--- src/sys/arch/xen/x86/xen_intr.c:1.18	Mon Dec 23 13:35:37 2019
+++ src/sys/arch/xen/x86/xen_intr.c	Fri Apr  3 22:20:36 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xen_intr.c,v 1.18 2019/12/23 13:35:37 thorpej Exp $	*/
+/*	$NetBSD: xen_intr.c,v 1.19 2020/04/03 22:20:36 ad Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -30,13 +30,15 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.18 2019/12/23 13:35:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.19 2020/04/03 22:20:36 ad Exp $");
+
+#include "opt_multiprocessor.h"
 
 #include 
 #include 
 #include 
-
 #include 
+#include 
 
 #include 
 #include 
@@ -67,6 +69,10 @@ __KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v
 #include 
 #endif
 
+#if defined(MULTIPROCESSOR)
+static const char *xen_ipi_names[XEN_NIPIS] = XEN_IPI_NAMES;
+#endif
+
 /*
  * Restore a value to cpl (unmasking interrupts).  If any unmasked
  * interrupts are pending, call Xspllower() to process them.
@@ -369,6 +375,12 @@ xen_cpu_intr_init(struct cpu_info *ci)
 	INTRSTACKSIZE - 33 * sizeof(register_t);
 #endif
 
+#ifdef MULTIPROCESSOR
+	for (i = 0; i < XEN_NIPIS; i++)
+		evcnt_attach_dynamic(>ci_ipi_events[i], EVCNT_TYPE_MISC,
+		NULL, device_xname(ci->ci_dev), xen_ipi_names[i]);
+#endif
+
 	ci->ci_idepth = -1;
 }
 



CVS commit: src/sys/dev/ofw

2020-04-03 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Apr  3 21:55:07 UTC 2020

Modified Files:
src/sys/dev/ofw: ofw_sysctl.c

Log Message:
various fixes:
- don't create hw.ofw if there is no /openprom node
- just copy 'model' and 'version' properties if present instead of reporting
  'model' as 'version'...


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ofw/ofw_sysctl.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/ofw/ofw_sysctl.c
diff -u src/sys/dev/ofw/ofw_sysctl.c:1.1 src/sys/dev/ofw/ofw_sysctl.c:1.2
--- src/sys/dev/ofw/ofw_sysctl.c:1.1	Fri Apr  3 06:02:51 2020
+++ src/sys/dev/ofw/ofw_sysctl.c	Fri Apr  3 21:55:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_sysctl.c,v 1.1 2020/04/03 06:02:51 macallan Exp $ */
+/*	$NetBSD: ofw_sysctl.c,v 1.2 2020/04/03 21:55:07 macallan Exp $ */
 
 /*-
  * Copyright (c) 2020 Michael Lorenz
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_sysctl.c,v 1.1 2020/04/03 06:02:51 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_sysctl.c,v 1.2 2020/04/03 21:55:07 macallan Exp $");
 
 #include 
 #include 
@@ -36,18 +36,15 @@ __KERNEL_RCSID(0, "$NetBSD: ofw_sysctl.c
 #include 
 
 char firmwarestring[64] = "unknown";
+char firmwareversion[64] = "unknown";
 
 SYSCTL_SETUP(sysctl_hw_misc_setup, "sysctl hw.ofw subtree misc setup")
 {
 	const struct sysctlnode *me;
 	int openprom;
 
-	if ((openprom = OF_finddevice("/openprom")) != 0) {
-		memset(firmwarestring, 0, 64);
-		if (OF_getprop(openprom, "model", firmwarestring, 63) != 0) {
-			printf("firmware: %s\n", firmwarestring);
-		}
-	}
+	openprom = OF_finddevice("/openprom");
+	if (openprom == 0 || openprom == -1) return;
 
 	sysctl_createv(clog, 0, NULL, ,
 		CTLFLAG_PERMANENT,
@@ -55,10 +52,28 @@ SYSCTL_SETUP(sysctl_hw_misc_setup, "sysc
 		SYSCTL_DESCR("OpenFirmware information"),
 		NULL, 0, NULL, 0,
 		CTL_HW, CTL_CREATE, CTL_EOL);
-	sysctl_createv(clog, 0, NULL, NULL,
-		CTLFLAG_PERMANENT,
-		CTLTYPE_STRING, "version",
-		SYSCTL_DESCR("firmware version string"),
-		NULL, 0, firmwarestring, 0,
-		CTL_HW, me->sysctl_num, CTL_CREATE, CTL_EOL);
+
+	memset(firmwarestring, 0, 64);
+	if (OF_getprop(openprom, "model", firmwarestring, 63) > 0) {
+
+		aprint_debug("firmware: %s\n", firmwarestring);
+		sysctl_createv(clog, 0, NULL, NULL,
+			CTLFLAG_PERMANENT,
+			CTLTYPE_STRING, "model",
+			SYSCTL_DESCR("firmware type"),
+			NULL, 0, firmwarestring, 0,
+			CTL_HW, me->sysctl_num, CTL_CREATE, CTL_EOL);
+	}
+
+	memset(firmwareversion, 0, 64);
+	if (OF_getprop(openprom, "version", firmwareversion, 63) > 0) {
+
+		aprint_debug("version: %s\n", firmwareversion);
+		sysctl_createv(clog, 0, NULL, NULL,
+			CTLFLAG_PERMANENT,
+			CTLTYPE_STRING, "version",
+			SYSCTL_DESCR("firmware version"),
+			NULL, 0, firmwareversion, 0,
+			CTL_HW, me->sysctl_num, CTL_CREATE, CTL_EOL);
+	}
 }



CVS commit: src/usr.bin/config

2020-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Apr  3 19:53:41 UTC 2020

Modified Files:
src/usr.bin/config: defs.h main.c scan.l

Log Message:
Avoid depending on common symbols.


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/usr.bin/config/defs.h
cvs rdiff -u -r1.99 -r1.100 src/usr.bin/config/main.c
cvs rdiff -u -r1.31 -r1.32 src/usr.bin/config/scan.l

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/config/defs.h
diff -u src/usr.bin/config/defs.h:1.105 src/usr.bin/config/defs.h:1.106
--- src/usr.bin/config/defs.h:1.105	Sat Mar  7 19:26:13 2020
+++ src/usr.bin/config/defs.h	Fri Apr  3 19:53:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.105 2020/03/07 19:26:13 christos Exp $	*/
+/*	$NetBSD: defs.h,v 1.106 2020/04/03 19:53:41 joerg Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -437,80 +437,88 @@ struct devm {
  */
 struct hashtab;
 
-int lkmmode;
-const char *conffile;		/* source file, e.g., "GENERIC.sparc" */
-const char *machine;		/* machine type, e.g., "sparc" or "sun3" */
-const char *machinearch;	/* machine arch, e.g., "sparc" or "m68k" */
-struct	nvlist *machinesubarches;
+extern int lkmmode;
+extern const char *conffile;		/* source file, e.g., "GENERIC.sparc" */
+extern const char *machine;		/* machine type, e.g., "sparc" or "sun3" */
+extern const char *machinearch;	/* machine arch, e.g., "sparc" or "m68k" */
+extern struct	nvlist *machinesubarches;
 /* machine subarches, e.g., "sun68k" or "hpc" */
-const char *ioconfname;		/* ioconf name, mutually exclusive to machine */
-const char *srcdir;		/* path to source directory (rel. to build) */
-const char *builddir;		/* path to build directory */
-const char *defbuilddir;	/* default build directory */
-const char *ident;		/* kernel "ident"ification string */
-int	errors;			/* counts calls to error() */
-int	minmaxusers;		/* minimum "maxusers" parameter */
-int	defmaxusers;		/* default "maxusers" parameter */
-int	maxmaxusers;		/* default "maxusers" parameter */
-int	maxusers;		/* configuration's "maxusers" parameter */
-int	maxpartitions;		/* configuration's "maxpartitions" parameter */
-int	version;		/* version of the configuration file */
-struct	nvlist *options;	/* options */
-struct	nvlist *fsoptions;	/* filesystems */
-struct	nvlist *mkoptions;	/* makeoptions */
-struct	nvlist *appmkoptions;	/* appending mkoptions */
-struct	nvlist *condmkoptions;	/* conditional makeoption table */
-struct	hashtab *devbasetab;	/* devbase lookup */
-struct	hashtab *devroottab;	/* attach at root lookup */
-struct	hashtab *devatab;	/* devbase attachment lookup */
-struct	hashtab *devitab;	/* device instance lookup */
-struct	hashtab *deaddevitab;	/* removed instances lookup */
-struct	hashtab *selecttab;	/* selects things that are "optional foo" */
-struct	hashtab *needcnttab;	/* retains names marked "needs-count" */
-struct	hashtab *opttab;	/* table of configured options */
-struct	hashtab *fsopttab;	/* table of configured file systems */
-struct	dlhash *defopttab;	/* options that have been "defopt"'d */
-struct	dlhash *defflagtab;	/* options that have been "defflag"'d */
-struct	dlhash *defparamtab;	/* options that have been "defparam"'d */
-struct	dlhash *defoptlint;	/* lint values for options */
-struct	nvhash *deffstab;	/* defined file systems */
-struct	dlhash *optfiletab;	/* "defopt"'d option .h files */
-struct	hashtab *attrtab;	/* attributes (locators, etc.) */
-struct	hashtab *attrdeptab;	/* attribute dependencies */
-struct	hashtab *bdevmtab;	/* block devm lookup */
-struct	hashtab *cdevmtab;	/* character devm lookup */
-
-TAILQ_HEAD(, devbase)	allbases;	/* list of all devbase structures */
-TAILQ_HEAD(, deva)	alldevas;	/* list of all devbase attachments */
-TAILQ_HEAD(conftq, config) allcf;	/* list of configured kernels */
-TAILQ_HEAD(, devi)	alldevi,	/* list of all instances */
-			allpseudo;	/* list of all pseudo-devices */
-TAILQ_HEAD(, devm)	alldevms;	/* list of all device-majors */
-TAILQ_HEAD(, pspec)	allpspecs;	/* list of all parent specs */
-int	ndevi;/* number of devi's (before packing) */
-int	npspecs;			/* number of parent specs */
-devmajor_t maxbdevm;			/* max number of block major */
-devmajor_t maxcdevm;			/* max number of character major */
-int	do_devsw;			/* 0 if pre-devsw config */
-int	oktopackage;			/* 0 before setmachine() */
-int	devilevel;			/* used for devi->i_level */
-
-struct filelist		allfiles;	/* list of all kernel source files */
-struct filelist		allcfiles;	/* list of all .c files */
-struct filelist		allsfiles;	/* list of all .S files */
-struct filelist		allofiles;	/* list of all .o files */
-
-struct prefixlist	prefixes,	/* prefix stack */
-			allprefixes;	/* all prefixes used (after popped) */
-struct prefixlist	buildprefixes,	/* build prefix stack */
-			allbuildprefixes;/* all build prefixes used (after popped) */
-SLIST_HEAD(, prefix)	curdirs;	/* curdir stack */

CVS commit: src/sbin

2020-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Apr  3 19:36:33 UTC 2020

Modified Files:
src/sbin/fsck: fsutil.c fsutil.h
src/sbin/fsck_lfs: bufcache.c dir.c extern.h fsck.h fsck_vars.h inode.c
lfs.c main.c pass0.c pass1.c pass2.c pass4.c pass5.c pass6.c
segwrite.c setup.c utilities.c vars.c vnode.c

Log Message:
Avoid common symbols for fsck_lfs.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sbin/fsck/fsutil.c
cvs rdiff -u -r1.20 -r1.21 src/sbin/fsck/fsutil.h
cvs rdiff -u -r1.20 -r1.21 src/sbin/fsck_lfs/bufcache.c
cvs rdiff -u -r1.46 -r1.47 src/sbin/fsck_lfs/dir.c src/sbin/fsck_lfs/pass1.c \
src/sbin/fsck_lfs/segwrite.c
cvs rdiff -u -r1.15 -r1.16 src/sbin/fsck_lfs/extern.h \
src/sbin/fsck_lfs/fsck_vars.h src/sbin/fsck_lfs/vnode.c
cvs rdiff -u -r1.26 -r1.27 src/sbin/fsck_lfs/fsck.h
cvs rdiff -u -r1.69 -r1.70 src/sbin/fsck_lfs/inode.c
cvs rdiff -u -r1.74 -r1.75 src/sbin/fsck_lfs/lfs.c
cvs rdiff -u -r1.54 -r1.55 src/sbin/fsck_lfs/main.c
cvs rdiff -u -r1.42 -r1.43 src/sbin/fsck_lfs/pass0.c
cvs rdiff -u -r1.34 -r1.35 src/sbin/fsck_lfs/pass2.c
cvs rdiff -u -r1.27 -r1.28 src/sbin/fsck_lfs/pass4.c
cvs rdiff -u -r1.36 -r1.37 src/sbin/fsck_lfs/pass5.c
cvs rdiff -u -r1.50 -r1.51 src/sbin/fsck_lfs/pass6.c
cvs rdiff -u -r1.61 -r1.62 src/sbin/fsck_lfs/setup.c
cvs rdiff -u -r1.41 -r1.42 src/sbin/fsck_lfs/utilities.c
cvs rdiff -u -r1.18 -r1.19 src/sbin/fsck_lfs/vars.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/fsutil.c
diff -u src/sbin/fsck/fsutil.c:1.26 src/sbin/fsck/fsutil.c:1.27
--- src/sbin/fsck/fsutil.c:1.26	Sun Jun 21 04:01:40 2015
+++ src/sbin/fsck/fsutil.c	Fri Apr  3 19:36:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsutil.c,v 1.26 2015/06/21 04:01:40 dholland Exp $	*/
+/*	$NetBSD: fsutil.c,v 1.27 2020/04/03 19:36:32 joerg Exp $	*/
 
 /*
  * Copyright (c) 1990, 1993
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fsutil.c,v 1.26 2015/06/21 04:01:40 dholland Exp $");
+__RCSID("$NetBSD: fsutil.c,v 1.27 2020/04/03 19:36:32 joerg Exp $");
 #endif /* not lint */
 
 /*
@@ -66,10 +66,12 @@ __RCSID("$NetBSD: fsutil.c,v 1.26 2015/0
 
 volatile sig_atomic_t returntosingle;
 
+void (*ckfinish)(int);
+
 static const char *dev = NULL;
 static int hot = 0;
 static int preen = 0;
-int quiet;
+int quiet;			/* don't report clean filesystems */
 #define F_ERROR	0x8000
 
 void

Index: src/sbin/fsck/fsutil.h
diff -u src/sbin/fsck/fsutil.h:1.20 src/sbin/fsck/fsutil.h:1.21
--- src/sbin/fsck/fsutil.h:1.20	Sun Jun 21 03:58:36 2015
+++ src/sbin/fsck/fsutil.h	Fri Apr  3 19:36:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsutil.h,v 1.20 2015/06/21 03:58:36 dholland Exp $	*/
+/*	$NetBSD: fsutil.h,v 1.21 2020/04/03 19:36:32 joerg Exp $	*/
 
 /*
  * Copyright (c) 1996 Christos Zoulas.  All rights reserved.
@@ -50,8 +50,10 @@ struct fstab;
 int checkfstab(int, int, void *(*)(struct fstab *), 
 int (*) (const char *, const char *, const char *, void *, pid_t *));
 
-void (*ckfinish)(int);
+extern void (*ckfinish)(int);
 extern volatile sig_atomic_t returntosingle;
 void catch(int) __dead;
 void catchquit(int);
 void voidquit(int);
+
+extern int quiet;

Index: src/sbin/fsck_lfs/bufcache.c
diff -u src/sbin/fsck_lfs/bufcache.c:1.20 src/sbin/fsck_lfs/bufcache.c:1.21
--- src/sbin/fsck_lfs/bufcache.c:1.20	Fri Mar 30 12:56:46 2018
+++ src/sbin/fsck_lfs/bufcache.c	Fri Apr  3 19:36:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: bufcache.c,v 1.20 2018/03/30 12:56:46 christos Exp $ */
+/* $NetBSD: bufcache.c,v 1.21 2020/04/03 19:36:33 joerg Exp $ */
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -44,7 +44,7 @@
 #include 
 
 #include "bufcache.h"
-#include "vnode.h"
+#include "extern.h"
 
 /*
  * Definitions for the buffer free lists.

Index: src/sbin/fsck_lfs/dir.c
diff -u src/sbin/fsck_lfs/dir.c:1.46 src/sbin/fsck_lfs/dir.c:1.47
--- src/sbin/fsck_lfs/dir.c:1.46	Mon Sep 21 01:24:23 2015
+++ src/sbin/fsck_lfs/dir.c	Fri Apr  3 19:36:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.46 2015/09/21 01:24:23 dholland Exp $	 */
+/* $NetBSD: dir.c,v 1.47 2020/04/03 19:36:33 joerg Exp $	 */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -45,7 +45,6 @@
 #include 
 
 #include "bufcache.h"
-#include "vnode.h"
 #include "lfs_user.h"
 
 #include "fsck.h"
@@ -53,7 +52,6 @@
 #include "extern.h"
 
 const char *lfname = "lost+found";
-int lfmode = 01700;
 #if 0
 struct lfs_dirtemplate emptydir = {
 	.dot_ino = 0,
Index: src/sbin/fsck_lfs/pass1.c
diff -u src/sbin/fsck_lfs/pass1.c:1.46 src/sbin/fsck_lfs/pass1.c:1.47
--- src/sbin/fsck_lfs/pass1.c:1.46	Sun Feb 23 15:11:33 2020
+++ src/sbin/fsck_lfs/pass1.c	Fri Apr  3 19:36:33 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: pass1.c,v 1.46 2020/02/23 15:11:33 riastradh Exp $	 */
+/* $NetBSD: pass1.c,v 1.47 2020/04/03 19:36:33 joerg Exp $	 */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -48,7 +48,6 @@
 #include 
 
 #include 

CVS commit: src/sbin/savecore

2020-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr  3 19:09:43 UTC 2020

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

Log Message:
Avoid overflows when reading strings.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sbin/savecore/savecore.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/savecore/savecore.c
diff -u src/sbin/savecore/savecore.c:1.89 src/sbin/savecore/savecore.c:1.90
--- src/sbin/savecore/savecore.c:1.89	Wed Nov  6 07:29:08 2019
+++ src/sbin/savecore/savecore.c	Fri Apr  3 19:09:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: savecore.c,v 1.89 2019/11/06 07:29:08 mrg Exp $	*/
+/*	$NetBSD: savecore.c,v 1.90 2020/04/03 19:09:43 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1992, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 19
 #if 0
 static char sccsid[] = "@(#)savecore.c	8.5 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: savecore.c,v 1.89 2019/11/06 07:29:08 mrg Exp $");
+__RCSID("$NetBSD: savecore.c,v 1.90 2020/04/03 19:09:43 maxv Exp $");
 #endif
 #endif /* not lint */
 
@@ -275,6 +275,20 @@ main(int argc, char *argv[])
 }
 
 static void
+read_string(kvm_t *kd, u_long kva, char *buf, size_t size)
+{
+	size_t i;
+
+	for (i = 0; i < size - 1; i++) {
+		(void)kvm_read(kd, kva + i, buf + i, 1);
+		if (buf[i] == '\0')
+			return;
+	}
+
+	buf[size - 1] = '\0';
+}
+
+static void
 kmem_setup(int verbose)
 {
 	long l_dumplo;
@@ -331,9 +345,8 @@ kmem_setup(int verbose)
 		(long long)dumplo, (long)(dumplo / DEV_BSIZE), (long)DEV_BSIZE);
 	KREAD_LOGWARN(kd_kern, current_nl[X_DUMPMAG].n_value, dumpmag, exit(1));
 
-	(void)kvm_read(kd_kern, current_nl[X_VERSION].n_value, vers,
+	read_string(kd_kern, current_nl[X_VERSION].n_value, vers,
 	sizeof(vers));
-	vers[sizeof(vers) - 1] = '\0';
 
 	if (current_nl[X_DUMPCDEV].n_value != 0) {
 		KREAD_LOGWARN(kd_kern, current_nl[X_DUMPCDEV].n_value, dumpcdev,
@@ -395,9 +408,8 @@ check_kmem(void)
 	long panicloc, panicstart, panicend;
 	char core_vers[1024];
 
-	(void)kvm_read(kd_dump, dump_nl[X_VERSION].n_value, core_vers,
+	read_string(kd_dump, dump_nl[X_VERSION].n_value, core_vers,
 	sizeof(core_vers));
-	core_vers[sizeof(core_vers) - 1] = '\0';
 
 	if (strcmp(vers, core_vers) != 0)
 		syslog(LOG_WARNING,



CVS commit: src/sys

2020-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr  3 18:44:50 UTC 2020

Modified Files:
src/sys/kern: subr_asan.c
src/sys/lib/libkern: libkern.h

Log Message:
Add KASAN instrumentation on strcat/strchr/strrchr.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/kern/subr_asan.c
cvs rdiff -u -r1.137 -r1.138 src/sys/lib/libkern/libkern.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_asan.c
diff -u src/sys/kern/subr_asan.c:1.19 src/sys/kern/subr_asan.c:1.20
--- src/sys/kern/subr_asan.c:1.19	Fri Apr  3 18:12:39 2020
+++ src/sys/kern/subr_asan.c	Fri Apr  3 18:44:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_asan.c,v 1.19 2020/04/03 18:12:39 maxv Exp $	*/
+/*	$NetBSD: subr_asan.c,v 1.20 2020/04/03 18:44:50 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.19 2020/04/03 18:12:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.20 2020/04/03 18:44:50 maxv Exp $");
 
 #include 
 #include 
@@ -507,6 +507,37 @@ kasan_strlen(const char *str)
 	return (s - str);
 }
 
+char *
+kasan_strcat(char *dst, const char *src)
+{
+	size_t ldst, lsrc;
+
+	ldst = __builtin_strlen(dst);
+	lsrc = __builtin_strlen(src);
+	kasan_shadow_check((unsigned long)dst, ldst + lsrc + 1, true,
+	__RET_ADDR);
+	kasan_shadow_check((unsigned long)src, lsrc + 1, false,
+	__RET_ADDR);
+
+	return __builtin_strcat(dst, src);
+}
+
+char *
+kasan_strchr(const char *s, int c)
+{
+	kasan_shadow_check((unsigned long)s, __builtin_strlen(s) + 1, false,
+	__RET_ADDR);
+	return __builtin_strchr(s, c);
+}
+
+char *
+kasan_strrchr(const char *s, int c)
+{
+	kasan_shadow_check((unsigned long)s, __builtin_strlen(s) + 1, false,
+	__RET_ADDR);
+	return __builtin_strrchr(s, c);
+}
+
 #undef kcopy
 #undef copystr
 #undef copyinstr

Index: src/sys/lib/libkern/libkern.h
diff -u src/sys/lib/libkern/libkern.h:1.137 src/sys/lib/libkern/libkern.h:1.138
--- src/sys/lib/libkern/libkern.h:1.137	Sat Dec 14 17:23:47 2019
+++ src/sys/lib/libkern/libkern.h	Fri Apr  3 18:44:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: libkern.h,v 1.137 2019/12/14 17:23:47 riastradh Exp $	*/
+/*	$NetBSD: libkern.h,v 1.138 2020/04/03 18:44:50 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -430,7 +430,14 @@ size_t	 kmsan_strlen(const char *);
 #endif
 
 /* These exist in GCC 3.x, but we don't bother. */
-#if defined(_KERNEL) && defined(KMSAN)
+#if defined(_KERNEL) && defined(KASAN)
+char	*kasan_strcat(char *, const char *);
+char	*kasan_strchr(const char *, int);
+char	*kasan_strrchr(const char *, int);
+#define	strcat(d, s)		kasan_strcat(d, s)
+#define	strchr(s, c)		kasan_strchr(s, c)
+#define	strrchr(s, c)		kasan_strrchr(s, c)
+#elif defined(_KERNEL) && defined(KMSAN)
 char	*kmsan_strcat(char *, const char *);
 char	*kmsan_strchr(const char *, int);
 char	*kmsan_strrchr(const char *, int);



CVS commit: src/sbin/iscsictl

2020-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Apr  3 18:39:15 UTC 2020

Modified Files:
src/sbin/iscsictl: iscsic_globals.h

Log Message:
Just declare driver and buf


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sbin/iscsictl/iscsic_globals.h

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

Modified files:

Index: src/sbin/iscsictl/iscsic_globals.h
diff -u src/sbin/iscsictl/iscsic_globals.h:1.5 src/sbin/iscsictl/iscsic_globals.h:1.6
--- src/sbin/iscsictl/iscsic_globals.h:1.5	Sat May 30 15:57:32 2015
+++ src/sbin/iscsictl/iscsic_globals.h	Fri Apr  3 18:39:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_globals.h,v 1.5 2015/05/30 15:57:32 joerg Exp $	*/
+/*	$NetBSD: iscsic_globals.h,v 1.6 2020/04/03 18:39:15 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -72,8 +72,8 @@ typedef struct {
 
 /* -  Global Variables  - */
 
-int driver;		/* handle to driver (for ioctls) */
-uint8_t buf[BUF_SIZE];			/* buffer for daemon comm and driver I/O */
+extern int driver;			/* handle to driver (for ioctls) */
+extern uint8_t buf[BUF_SIZE];		/* buffer for daemon comm and driver I/O */
 
 /* -  Global Functions  - */
 



CVS commit: src/sys/kern

2020-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr  3 18:26:14 UTC 2020

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

Log Message:
Verify that the terminating '\0', too, is initialized.


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

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

Modified files:

Index: src/sys/kern/subr_msan.c
diff -u src/sys/kern/subr_msan.c:1.8 src/sys/kern/subr_msan.c:1.9
--- src/sys/kern/subr_msan.c:1.8	Sat Feb 22 20:08:39 2020
+++ src/sys/kern/subr_msan.c	Fri Apr  3 18:26:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_msan.c,v 1.8 2020/02/22 20:08:39 maxv Exp $	*/
+/*	$NetBSD: subr_msan.c,v 1.9 2020/04/03 18:26:14 maxv Exp $	*/
 
 /*
  * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_msan.c,v 1.8 2020/02/22 20:08:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_msan.c,v 1.9 2020/04/03 18:26:14 maxv Exp $");
 
 #include 
 #include 
@@ -778,7 +778,7 @@ kmsan_strchr(const char *s, int c)
 	char *ret;
 
 	kmsan_check_arg(sizeof(s) + sizeof(c), "strchr():args");
-	kmsan_shadow_check(s, __builtin_strlen(s), "strchr():arg1");
+	kmsan_shadow_check(s, __builtin_strlen(s) + 1, "strchr():arg1");
 	ret = __builtin_strchr(s, c);
 
 	kmsan_init_ret(sizeof(char *));
@@ -791,7 +791,7 @@ kmsan_strrchr(const char *s, int c)
 	char *ret;
 
 	kmsan_check_arg(sizeof(s) + sizeof(c), "strrchr():args");
-	kmsan_shadow_check(s, __builtin_strlen(s), "strrchr():arg1");
+	kmsan_shadow_check(s, __builtin_strlen(s) + 1, "strrchr():arg1");
 	ret = __builtin_strrchr(s, c);
 
 	kmsan_init_ret(sizeof(char *));



CVS commit: src/sys

2020-04-03 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr  3 18:12:39 UTC 2020

Modified Files:
src/sys/arch/amd64/conf: Makefile.amd64
src/sys/kern: subr_asan.c

Log Message:
Add KASAN instrumentation on on-stack VLAs.


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/amd64/conf/Makefile.amd64
cvs rdiff -u -r1.18 -r1.19 src/sys/kern/subr_asan.c

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

Modified files:

Index: src/sys/arch/amd64/conf/Makefile.amd64
diff -u src/sys/arch/amd64/conf/Makefile.amd64:1.80 src/sys/arch/amd64/conf/Makefile.amd64:1.81
--- src/sys/arch/amd64/conf/Makefile.amd64:1.80	Thu Nov 14 16:23:52 2019
+++ src/sys/arch/amd64/conf/Makefile.amd64	Fri Apr  3 18:12:39 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.amd64,v 1.80 2019/11/14 16:23:52 maxv Exp $
+#	$NetBSD: Makefile.amd64,v 1.81 2020/04/03 18:12:39 maxv Exp $
 
 # Makefile for NetBSD
 #
@@ -52,6 +52,7 @@ CFLAGS+=  -mindirect-branch-register
 .if ${KASAN:U0} > 0 && ${HAVE_GCC:U0} > 0
 KASANFLAGS=	-fsanitize=kernel-address \
 		--param asan-globals=1 --param asan-stack=1 \
+		--param asan-instrument-allocas=1 \
 		-fsanitize-address-use-after-scope \
 		-fasan-shadow-offset=0xDFFF9000
 .for f in subr_asan.c subr_kcov.c subr_lwp_specificdata.c subr_specificdata.c

Index: src/sys/kern/subr_asan.c
diff -u src/sys/kern/subr_asan.c:1.18 src/sys/kern/subr_asan.c:1.19
--- src/sys/kern/subr_asan.c:1.18	Sat Feb  8 09:05:08 2020
+++ src/sys/kern/subr_asan.c	Fri Apr  3 18:12:39 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_asan.c,v 1.18 2020/02/08 09:05:08 maxv Exp $	*/
+/*	$NetBSD: subr_asan.c,v 1.19 2020/04/03 18:12:39 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.18 2020/02/08 09:05:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.19 2020/04/03 18:12:39 maxv Exp $");
 
 #include 
 #include 
@@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: subr_asan.c,
 #define KASAN_SHADOW_SCALE_SHIFT	3
 #define KASAN_SHADOW_SCALE_SIZE		(1UL << KASAN_SHADOW_SCALE_SHIFT)
 #define KASAN_SHADOW_MASK		(KASAN_SHADOW_SCALE_SIZE - 1)
+#define KASAN_ALLOCA_SCALE_SIZE		32
 
 /* The MD code. */
 #include 
@@ -1247,3 +1248,34 @@ __asan_unpoison_stack_memory(const void 
 {
 	kasan_shadow_Nbyte_markvalid(addr, size);
 }
+
+void __asan_alloca_poison(const void *, size_t);
+void __asan_allocas_unpoison(const void *, const void *);
+
+void __asan_alloca_poison(const void *addr, size_t size)
+{
+	const void *l, *r;
+
+	KASSERT((vaddr_t)addr % KASAN_ALLOCA_SCALE_SIZE == 0);
+
+	l = (const uint8_t *)addr - KASAN_ALLOCA_SCALE_SIZE;
+	r = (const uint8_t *)addr + roundup(size, KASAN_ALLOCA_SCALE_SIZE);
+
+	kasan_shadow_Nbyte_fill(l, KASAN_ALLOCA_SCALE_SIZE, KASAN_STACK_LEFT);
+	kasan_mark(addr, size, roundup(size, KASAN_ALLOCA_SCALE_SIZE),
+	KASAN_STACK_MID);
+	kasan_shadow_Nbyte_fill(r, KASAN_ALLOCA_SCALE_SIZE, KASAN_STACK_RIGHT);
+}
+
+void __asan_allocas_unpoison(const void *stkbegin, const void *stkend)
+{
+	size_t size;
+
+	if (__predict_false(!stkbegin))
+		return;
+	if (__predict_false((uintptr_t)stkbegin > (uintptr_t)stkend))
+		return;
+	size = (uintptr_t)stkend - (uintptr_t)stkbegin;
+
+	kasan_shadow_Nbyte_fill(stkbegin, size, 0);
+}



CVS commit: src/bin/csh

2020-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Apr  3 18:11:29 UTC 2020

Modified Files:
src/bin/csh: csh.c csh.h dir.c dir.h proc.c proc.h

Log Message:
Don't depend on common declarations.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/bin/csh/csh.c
cvs rdiff -u -r1.28 -r1.29 src/bin/csh/csh.h
cvs rdiff -u -r1.32 -r1.33 src/bin/csh/dir.c
cvs rdiff -u -r1.8 -r1.9 src/bin/csh/dir.h
cvs rdiff -u -r1.38 -r1.39 src/bin/csh/proc.c
cvs rdiff -u -r1.14 -r1.15 src/bin/csh/proc.h

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

Modified files:

Index: src/bin/csh/csh.c
diff -u src/bin/csh/csh.c:1.49 src/bin/csh/csh.c:1.50
--- src/bin/csh/csh.c:1.49	Sun Jan 12 18:36:55 2020
+++ src/bin/csh/csh.c	Fri Apr  3 18:11:29 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: csh.c,v 1.49 2020/01/12 18:36:55 christos Exp $ */
+/* $NetBSD: csh.c,v 1.50 2020/04/03 18:11:29 joerg Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)csh.c	8.2 (Berkeley) 10/12/93";
 #else
-__RCSID("$NetBSD: csh.c,v 1.49 2020/01/12 18:36:55 christos Exp $");
+__RCSID("$NetBSD: csh.c,v 1.50 2020/04/03 18:11:29 joerg Exp $");
 #endif
 #endif /* not lint */
 
@@ -77,6 +77,97 @@ __RCSID("$NetBSD: csh.c,v 1.49 2020/01/1
  * June, 1991
  */
 
+FILE *cshin, *cshout, *csherr;
+struct timespec time0;
+struct rusage ru0;
+struct varent shvhed, aliases;
+Char HISTSUB;
+int editing;
+
+int child;
+int chkstop;
+int didfds;
+int doneinp;
+int exiterr;
+int haderr;
+int havhash;
+int intact;
+int intty;
+int justpr;
+int loginsh;
+int neednote;
+int noexec;
+int pjobs;
+int setintr;
+int timflg;
+
+Char *arginp;
+Char *ffile;
+int onelflg;
+Char *shtemp;
+
+time_t chktim;
+Char *doldol;
+pid_t backpid;
+gid_t egid, gid;
+uid_t euid, uid;
+int shpgrp;
+int tpgrp;
+
+int opgrp;
+
+int SHIN;
+int SHOUT;
+int SHERR;
+int OLDSTD;
+
+jmp_buf reslab;
+
+Char *gointr;
+
+sig_t parintr;
+sig_t parterm;
+
+struct Bin B;
+
+struct Ain lineloc;
+int cantell;
+Char *lap;
+struct whyle *whyles;
+
+struct wordent *alhistp,*alhistt;
+
+int AsciiOnly;
+int gflag;
+long pnleft;
+Char *pargs;
+Char *pargcp;
+struct Hist Histlist;
+struct wordent paraml;
+int eventno;
+int lastev;
+Char HIST;
+Char HISTSUB;
+const char *bname;
+Char *Vsav;
+Char *Vdp;
+Char *Vexpath;
+char **Vt;
+Char **evalvec;
+Char *evalp;
+Char *word_chars;
+Char *STR_SHELLPATH;
+#ifdef _PATH_BSHELL
+Char *STR_BSHELL;
+#endif
+Char *STR_WORD_CHARS;
+Char **STR_environ;
+#ifdef EDIT
+EditLine *el;
+History *hi;
+#endif
+int editing;
+
 Char *dumphist[] = {STRhistory, STRmh, 0, 0};
 Char *tildehist[] = {STRsource, STRmh, STRtildothist, 0};
 

Index: src/bin/csh/csh.h
diff -u src/bin/csh/csh.h:1.28 src/bin/csh/csh.h:1.29
--- src/bin/csh/csh.h:1.28	Sat Jan  5 16:54:00 2019
+++ src/bin/csh/csh.h	Fri Apr  3 18:11:29 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: csh.h,v 1.28 2019/01/05 16:54:00 christos Exp $ */
+/* $NetBSD: csh.h,v 1.29 2020/04/03 18:11:29 joerg Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -89,7 +89,7 @@ typedef void *ioctl_t;		/* Third arg of 
 #define xcalloc(n, s) Calloc(n, s)
 
 #include 
-FILE *cshin, *cshout, *csherr;
+extern FILE *cshin, *cshout, *csherr;
 
 #define	isdir(d) (S_ISDIR(d.st_mode))
 
@@ -103,22 +103,22 @@ FILE *cshin, *cshout, *csherr;
 /*
  * Global flags
  */
-int child;			/* Child shell ... errors cause exit */
-int chkstop;			/* Warned of stopped jobs... allow exit */
-int didfds;			/* Have setup i/o fd's for child */
-int doneinp;			/* EOF indicator after reset from readc */
-int exiterr;			/* Exit if error or non-zero exit status */
-int haderr;			/* Reset was because of an error */
-int havhash;			/* path hashing is available */
-int intact;			/* We are interactive... therefore prompt */
-int intty;			/* Input is a tty */
-int justpr;			/* Just print because of :p hist mod */
-int loginsh;			/* We are a loginsh -> .login/.logout */
-int neednote;			/* Need to pnotify() */
-int noexec;			/* Don't execute, just syntax check */
-int pjobs;			/* want to print jobs if interrupted */
-int setintr;			/* Set interrupts on/off -> Wait intr... */
-int timflg;			/* Time the next waited for command */
+extern int child;		/* Child shell ... errors cause exit */
+extern int chkstop;		/* Warned of stopped jobs... allow exit */
+extern int didfds;		/* Have setup i/o fd's for child */
+extern int doneinp;		/* EOF indicator after reset from readc */
+extern int exiterr;		/* Exit if error or non-zero exit status */
+extern int haderr;		/* Reset was because of an error */
+extern int havhash;		/* path hashing is available */
+extern int intact;		/* We are interactive... therefore prompt */
+extern int intty;		/* Input is a tty */
+extern int justpr;		/* Just print because of :p hist mod */
+extern int loginsh;		/* We are a loginsh -> .login/.logout */
+extern int neednote;		/* Need to pnotify() */
+extern int 

CVS commit: src/share/mk

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  3 17:57:30 UTC 2020

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Switch to binutils.old


To generate a diff of this commit:
cvs rdiff -u -r1.1177 -r1.1178 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1177 src/share/mk/bsd.own.mk:1.1178
--- src/share/mk/bsd.own.mk:1.1177	Thu Feb 27 07:52:20 2020
+++ src/share/mk/bsd.own.mk	Fri Apr  3 13:57:30 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1177 2020/02/27 12:52:20 macallan Exp $
+#	$NetBSD: bsd.own.mk,v 1.1178 2020/04/03 17:57:30 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -171,9 +171,9 @@ EXTERNAL_GDB_SUBDIR=		/does/not/exist
 #
 HAVE_BINUTILS?=	231
 
-.if ${HAVE_BINUTILS} == 231
+.if ${HAVE_BINUTILS} == 234
 EXTERNAL_BINUTILS_SUBDIR=	binutils
-.elif ${HAVE_BINUTILS} == 227
+.elif ${HAVE_BINUTILS} == 231
 EXTERNAL_BINUTILS_SUBDIR=	binutils.old
 .else
 EXTERNAL_BINUTILS_SUBDIR=	/does/not/exist



CVS commit: src/usr.bin/netstat

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  3 16:42:00 UTC 2020

Modified Files:
src/usr.bin/netstat: Makefile netstat_hostops.c netstat_rumpops.c
Removed Files:
src/usr.bin/netstat: prog_ops.h

Log Message:
remove unused


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/usr.bin/netstat/Makefile
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/netstat/netstat_hostops.c \
src/usr.bin/netstat/netstat_rumpops.c
cvs rdiff -u -r1.4 -r0 src/usr.bin/netstat/prog_ops.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/netstat/Makefile
diff -u src/usr.bin/netstat/Makefile:1.47 src/usr.bin/netstat/Makefile:1.48
--- src/usr.bin/netstat/Makefile:1.47	Sun Oct 13 03:28:16 2019
+++ src/usr.bin/netstat/Makefile	Fri Apr  3 12:41:59 2020
@@ -1,10 +1,15 @@
-#	$NetBSD: Makefile,v 1.47 2019/10/13 07:28:16 mrg Exp $
+#	$NetBSD: Makefile,v 1.48 2020/04/03 16:41:59 christos Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 6/12/93
 
 .include 
 
 USE_FORT?= yes	# setgid
 
+ROUTE=${NETBSDSRCDIR}/sbin/route
+PF=${NETBSDSRCDIR}/sys/dist/pf
+
+.PATH: ${ROUTE} 
+
 RUMPPRG=netstat
 SRCS=	atalk.c bpf.c fast_ipsec.c if.c inet.c inet6.c \
 	main.c mbuf.c mroute.c mroute6.c pfkey.c pfsync.c route.c \
@@ -14,10 +19,8 @@ BINMODE=2555
 LDADD=	-lutil -lkvm
 DPADD=	${LIBUTIL} ${LIBKVM}
 CPPFLAGS+= -DIPSEC -I${.CURDIR}
-CPPFLAGS+= -I${NETBSDSRCDIR}/sys/dist/pf
-CPPFLAGS+= -I${NETBSDSRCDIR}/sbin/route
-
-.PATH:  ${.CURDIR}/../../sbin/route
+CPPFLAGS+= -I${PF}
+CPPFLAGS+= -I${ROUTE}
 
 .if (${MKRUMP} != "no")
 .PATH:  ${.CURDIR}/../../lib/libc/gen

Index: src/usr.bin/netstat/netstat_hostops.c
diff -u src/usr.bin/netstat/netstat_hostops.c:1.3 src/usr.bin/netstat/netstat_hostops.c:1.4
--- src/usr.bin/netstat/netstat_hostops.c:1.3	Fri Apr  3 12:20:51 2020
+++ src/usr.bin/netstat/netstat_hostops.c	Fri Apr  3 12:41:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netstat_hostops.c,v 1.3 2020/04/03 16:20:51 martin Exp $	*/
+/*	$NetBSD: netstat_hostops.c,v 1.4 2020/04/03 16:41:59 christos Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -26,9 +26,4 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include 
-#ifndef lint
-__RCSID("$NetBSD: netstat_hostops.c,v 1.3 2020/04/03 16:20:51 martin Exp $");
-#endif /* !lint */
-
-#include "../../sbin/route/route_hostops.c"
+#include "route_hostops.c"
Index: src/usr.bin/netstat/netstat_rumpops.c
diff -u src/usr.bin/netstat/netstat_rumpops.c:1.3 src/usr.bin/netstat/netstat_rumpops.c:1.4
--- src/usr.bin/netstat/netstat_rumpops.c:1.3	Fri Apr  3 12:20:51 2020
+++ src/usr.bin/netstat/netstat_rumpops.c	Fri Apr  3 12:41:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netstat_rumpops.c,v 1.3 2020/04/03 16:20:51 martin Exp $	*/
+/*	$NetBSD: netstat_rumpops.c,v 1.4 2020/04/03 16:41:59 christos Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -26,4 +26,4 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "../../sbin/route/route_rumpops.c"
+#include "route_rumpops.c"



CVS commit: src/bin/sh

2020-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Apr  3 16:22:23 UTC 2020

Modified Files:
src/bin/sh: redir.h

Log Message:
Don't define max_user_fd in the header.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/bin/sh/redir.h

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

Modified files:

Index: src/bin/sh/redir.h
diff -u src/bin/sh/redir.h:1.24 src/bin/sh/redir.h:1.25
--- src/bin/sh/redir.h:1.24	Fri Jun 30 23:01:21 2017
+++ src/bin/sh/redir.h	Fri Apr  3 16:22:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: redir.h,v 1.24 2017/06/30 23:01:21 kre Exp $	*/
+/*	$NetBSD: redir.h,v 1.25 2020/04/03 16:22:23 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -52,4 +52,4 @@ void sh_close(int);
 struct output;
 int outredir(struct output *, union node *, int);
 
-int max_user_fd;		/* highest fd used by user */
+extern int max_user_fd;		/* highest fd used by user */



CVS commit: src

2020-04-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Apr  3 16:20:52 UTC 2020

Modified Files:
src/sbin/route: prog_ops.h route_hostops.c route_rumpops.c
src/usr.bin/netstat: netstat_hostops.c netstat_rumpops.c prog_ops.h

Log Message:
Make route and netstat share the same struct progops (and initialization
code)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sbin/route/prog_ops.h
cvs rdiff -u -r1.2 -r1.3 src/sbin/route/route_hostops.c \
src/sbin/route/route_rumpops.c
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/netstat/netstat_hostops.c \
src/usr.bin/netstat/netstat_rumpops.c
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/netstat/prog_ops.h

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

Modified files:

Index: src/sbin/route/prog_ops.h
diff -u src/sbin/route/prog_ops.h:1.4 src/sbin/route/prog_ops.h:1.5
--- src/sbin/route/prog_ops.h:1.4	Thu Apr  2 18:32:31 2020
+++ src/sbin/route/prog_ops.h	Fri Apr  3 16:20:52 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: prog_ops.h,v 1.4 2020/04/02 18:32:31 christos Exp $	*/
+/*  $NetBSD: prog_ops.h,v 1.5 2020/04/03 16:20:52 martin Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -30,9 +30,13 @@
 #define _PROG_OPS_H_
 
 #include 
+#include 
 
 #ifndef CRUNCHOPS
-/* XXX: Keep same order with netstat! */
+/*
+ * This is shared between netstat and route (as they share some code)
+ */
+struct sysctlnode;
 struct prog_ops {
 	int (*op_init)(void);
 
@@ -46,10 +50,18 @@ struct prog_ops {
 	ssize_t (*op_read)(int, void *, size_t);
 	ssize_t (*op_write)(int, const void *, size_t);
 
+	int (*op_shutdown)(int, int);
+
 	int (*op_sysctl)(const int *, u_int, void *, size_t *,
 			 const void *, size_t);
 
-	int (*op_shutdown)(int, int);
+	int (*op_sysctlbyname)(const char *, void *, size_t *,
+			 const void *, size_t);
+
+	int (*op_sysctlgetmibinfo)(const char *, int *, u_int *,
+			 char *, size_t *, struct sysctlnode **, int);
+
+	int (*op_sysctlnametomib)(const char *, int *, size_t *);
 };
 extern const struct prog_ops prog_ops;
 
@@ -64,9 +76,13 @@ extern const struct prog_ops prog_ops;
 #define prog_read prog_ops.op_read
 #define prog_write prog_ops.op_write
 
+#define prog_shutdown prog_ops.op_shutdown
+
 #define prog_sysctl prog_ops.op_sysctl
 
-#define prog_shutdown prog_ops.op_shutdown
+#define prog_sysctlbyname prog_ops.op_sysctlbyname
+#define prog_sysctlgetmibinfo prog_ops.op_sysctlgetmibinfo
+#define prog_sysctlnametomib prog_ops.op_sysctlnametomib
 
 #else
 #define prog_init ((int (*)(void))NULL)
@@ -80,8 +96,13 @@ extern const struct prog_ops prog_ops;
 #define prog_read read
 #define prog_write write
 
-#define prog_sysctl sysctl
 #define prog_shutdown shutdown
+
+#define prog_sysctl sysctl
+#define prog_sysctlbyname sysctlbyname
+#define prog_sysctlgetmibinfo sysctlgetmibinfo
+#define prog_sysctlnametomib sysctlnametomib
+
 #endif
 
 #endif /* _PROG_OPS_H_ */

Index: src/sbin/route/route_hostops.c
diff -u src/sbin/route/route_hostops.c:1.2 src/sbin/route/route_hostops.c:1.3
--- src/sbin/route/route_hostops.c:1.2	Thu Apr  2 18:32:31 2020
+++ src/sbin/route/route_hostops.c	Fri Apr  3 16:20:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: route_hostops.c,v 1.2 2020/04/02 18:32:31 christos Exp $	*/
+/*	$NetBSD: route_hostops.c,v 1.3 2020/04/03 16:20:52 martin Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: route_hostops.c,v 1.2 2020/04/02 18:32:31 christos Exp $");
+__RCSID("$NetBSD: route_hostops.c,v 1.3 2020/04/03 16:20:52 martin Exp $");
 #endif /* !lint */
 
 #include 
@@ -51,7 +51,13 @@ const struct prog_ops prog_ops = {
 	.op_read =		read,
 	.op_write =		write,
 
+	.op_shutdown =		shutdown,
+
 	.op_sysctl =		sysctl,
 
-	.op_shutdown =		shutdown,
+	.op_sysctlbyname =	sysctlbyname,
+
+	.op_sysctlgetmibinfo =	sysctlgetmibinfo,
+
+	.op_sysctlnametomib =	sysctlnametomib,
 };
Index: src/sbin/route/route_rumpops.c
diff -u src/sbin/route/route_rumpops.c:1.2 src/sbin/route/route_rumpops.c:1.3
--- src/sbin/route/route_rumpops.c:1.2	Thu Apr  2 18:32:31 2020
+++ src/sbin/route/route_rumpops.c	Fri Apr  3 16:20:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: route_rumpops.c,v 1.2 2020/04/02 18:32:31 christos Exp $	*/
+/*	$NetBSD: route_rumpops.c,v 1.3 2020/04/03 16:20:52 martin Exp $	*/
 
 /*
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: route_rumpops.c,v 1.2 2020/04/02 18:32:31 christos Exp $");
+__RCSID("$NetBSD: route_rumpops.c,v 1.3 2020/04/03 16:20:52 martin Exp $");
 #endif /* !lint */
 
 #include 
@@ -54,7 +54,17 @@ const struct prog_ops prog_ops = {
 	.op_read =		rump_sys_read,
 	.op_write =		rump_sys_write,
 
+	.op_shutdown =		rump_sys_shutdown,
+
 	.op_sysctl =		rump_sys___sysctl,
 
-	.op_shutdown =		rump_sys_shutdown,
+	/*
+	 * The following are only indirected through ops because
+	 * santizers get confused otherwise.
+	 

CVS commit: src/bin/pax

2020-04-03 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Apr  3 16:13:32 UTC 2020

Modified Files:
src/bin/pax: extern.h options.c

Log Message:
Move definition of chdname and do_chroot to options.c


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/bin/pax/extern.h
cvs rdiff -u -r1.118 -r1.119 src/bin/pax/options.c

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

Modified files:

Index: src/bin/pax/extern.h
diff -u src/bin/pax/extern.h:1.59 src/bin/pax/extern.h:1.60
--- src/bin/pax/extern.h:1.59	Thu Aug  9 08:09:21 2012
+++ src/bin/pax/extern.h	Fri Apr  3 16:13:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.59 2012/08/09 08:09:21 christos Exp $	*/
+/*	$NetBSD: extern.h,v 1.60 2020/04/03 16:13:32 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -204,9 +204,8 @@ void options(int, char **);
 OPLIST * opt_next(void);
 int bad_opt(void);
 int mkpath(char *);
-char *chdname;
 #if !HAVE_NBTOOL_CONFIG_H
-int do_chroot;
+extern int do_chroot;
 #endif
 
 /*

Index: src/bin/pax/options.c
diff -u src/bin/pax/options.c:1.118 src/bin/pax/options.c:1.119
--- src/bin/pax/options.c:1.118	Sat Dec 19 18:45:52 2015
+++ src/bin/pax/options.c	Fri Apr  3 16:13:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: options.c,v 1.118 2015/12/19 18:45:52 christos Exp $	*/
+/*	$NetBSD: options.c,v 1.119 2020/04/03 16:13:32 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)options.c	8.2 (Berkeley) 4/18/94";
 #else
-__RCSID("$NetBSD: options.c,v 1.118 2015/12/19 18:45:52 christos Exp $");
+__RCSID("$NetBSD: options.c,v 1.119 2020/04/03 16:13:32 joerg Exp $");
 #endif
 #endif /* not lint */
 
@@ -74,6 +74,11 @@ __RCSID("$NetBSD: options.c,v 1.118 2015
 #include "mtree.h"
 #endif	/* SMALL */
 
+char *chdname;
+#if !HAVE_NBTOOL_CONFIG_H
+int do_chroot;
+#endif
+
 /*
  * Routines which handle command line options
  */



CVS commit: src/external/bsd/dhcpcd/libexec/dhcpcd-hooks

2020-04-03 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Fri Apr  3 15:02:11 UTC 2020

Modified Files:
src/external/bsd/dhcpcd/libexec/dhcpcd-hooks: Makefile

Log Message:
Try a better syntax for building 30-hostname


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/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/dhcpcd/libexec/dhcpcd-hooks/Makefile
diff -u src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile:1.4 src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile:1.5
--- src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile:1.4	Thu Apr  2 14:05:28 2020
+++ src/external/bsd/dhcpcd/libexec/dhcpcd-hooks/Makefile	Fri Apr  3 15:02:11 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2020/04/02 14:05:28 roy Exp $
+# $NetBSD: Makefile,v 1.5 2020/04/03 15:02:11 roy Exp $
 #
 
 .include 
@@ -10,15 +10,14 @@ HOOKSRC=	${DIST}/hooks
 FILES=		01-test 02-dump 20-resolv.conf 30-hostname
 FILES+=		50-ntp.conf
 
-FILESBUILD_30-hostname=   YES
-
 FILESDIR=	/libexec/dhcpcd-hooks
 
+FILESBUILD_30-hostname=   YES
 CLEANFILES=	30-hostname
 
-.for f in ${FILES}
-${f}:	../../Makefile.inc ${f}.in
-	${TOOL_SED} ${SED_SYS} ${HOOKSRC}/${f}.in > $@
-.endfor
+.SUFFIXES:	.in
+
+.in:	../../Makefile.inc
+	${TOOL_SED} ${SED_SYS} $< > $@
 
 .include 



CVS commit: src/sys/netinet6

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  3 14:04:27 UTC 2020

Modified Files:
src/sys/netinet6: nd6.c

Log Message:
PR/55030: Avoid locking against myself panic by moving the icmp error outside
the lock. Thanks ozaki-r!


To generate a diff of this commit:
cvs rdiff -u -r1.267 -r1.268 src/sys/netinet6/nd6.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/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.267 src/sys/netinet6/nd6.c:1.268
--- src/sys/netinet6/nd6.c:1.267	Mon Mar  9 17:20:56 2020
+++ src/sys/netinet6/nd6.c	Fri Apr  3 10:04:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.267 2020/03/09 21:20:56 roy Exp $	*/
+/*	$NetBSD: nd6.c,v 1.268 2020/04/03 14:04:27 christos Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.267 2020/03/09 21:20:56 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.268 2020/04/03 14:04:27 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -463,6 +463,7 @@ nd6_llinfo_timer(void *arg)
 	const struct in6_addr *taddr6 = >r_l3addr.addr6;
 	struct sockaddr_in6 dsin6, tsin6;
 	struct sockaddr *sa;
+	struct mbuf *m = NULL;
 
 	SOFTNET_KERNEL_LOCK_UNLESS_NET_MPSAFE();
 
@@ -493,7 +494,9 @@ nd6_llinfo_timer(void *arg)
 		}
 
 		if (ln->ln_hold) {
-			struct mbuf *m = ln->ln_hold, *m0;
+			struct mbuf *m0;
+
+			m = ln->ln_hold;
 
 			/*
 			 * assuming every packet in ln_hold has
@@ -503,9 +506,6 @@ nd6_llinfo_timer(void *arg)
 			m->m_nextpkt = NULL;
 			ln->ln_hold = m0;
 			clear_llinfo_pqueue(ln);
-
-			icmp6_error2(m, ICMP6_DST_UNREACH,
-			ICMP6_DST_UNREACH_ADDR, 0, ifp, );
 		}
 
 		sockaddr_in6_init(, taddr6, 0, 0, 0);
@@ -586,6 +586,10 @@ out:
 	if (ln != NULL)
 		LLE_FREE_LOCKED(ln);
 	SOFTNET_KERNEL_UNLOCK_UNLESS_NET_MPSAFE();
+	if (m) {
+		icmp6_error2(m, ICMP6_DST_UNREACH,
+		ICMP6_DST_UNREACH_ADDR, 0, ifp, );
+	}
 }
 
 /*



CVS commit: src/sys/rump/net/lib/libshmif

2020-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr  3 13:57:48 UTC 2020

Modified Files:
src/sys/rump/net/lib/libshmif: shmifvar.h

Log Message:
make constant unsigned


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/rump/net/lib/libshmif/shmifvar.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/rump/net/lib/libshmif/shmifvar.h
diff -u src/sys/rump/net/lib/libshmif/shmifvar.h:1.10 src/sys/rump/net/lib/libshmif/shmifvar.h:1.11
--- src/sys/rump/net/lib/libshmif/shmifvar.h:1.10	Wed Sep 17 00:20:58 2014
+++ src/sys/rump/net/lib/libshmif/shmifvar.h	Fri Apr  3 09:57:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: shmifvar.h,v 1.10 2014/09/17 04:20:58 ozaki-r Exp $	*/
+/*	$NetBSD: shmifvar.h,v 1.11 2020/04/03 13:57:48 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009, 2010 Antti Kantee.  All Rights Reserved.
@@ -60,7 +60,7 @@ struct shmif_pkthdr {
 	uint64_t sp_sender;
 };
 
-#define BUSMEM_SIZE (1024*1024)
+#define BUSMEM_SIZE (1024*1024U)
 #define BUSMEM_DATASIZE (BUSMEM_SIZE - sizeof(struct shmif_mem))
 
 #if 0



CVS commit: [netbsd-9] src/doc

2020-04-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Apr  3 12:28:24 UTC 2020

Modified Files:
src/doc [netbsd-9]: CHANGES-9.1

Log Message:
Ticket #819


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.29 -r1.1.2.30 src/doc/CHANGES-9.1

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

Modified files:

Index: src/doc/CHANGES-9.1
diff -u src/doc/CHANGES-9.1:1.1.2.29 src/doc/CHANGES-9.1:1.1.2.30
--- src/doc/CHANGES-9.1:1.1.2.29	Thu Apr  2 19:24:39 2020
+++ src/doc/CHANGES-9.1	Fri Apr  3 12:28:24 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.29 2020/04/02 19:24:39 martin Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.30 2020/04/03 12:28:24 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -789,3 +789,8 @@ sys/dev/pckbport/synaptics.c			1.64
 	up/down are remapped.
 	[nia, ticket #818]
 
+sys/dev/usb/usbdi.c1.199
+
+	Avoid crashes if we fail to allocate a transfer buffer.
+	[skrll, ticket #819]
+



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

2020-04-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Apr  3 12:27:56 UTC 2020

Modified Files:
src/sys/dev/usb [netbsd-9]: usbdi.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #819):

sys/dev/usb/usbdi.c: revision 1.199

Avoid crashes if we fail to allocate a transfer buffer and avoid an
unnecessary usbd_free_buffer before usbd_free_xfer

Worked out by Riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.182.4.3 -r1.182.4.4 src/sys/dev/usb/usbdi.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/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.182.4.3 src/sys/dev/usb/usbdi.c:1.182.4.4
--- src/sys/dev/usb/usbdi.c:1.182.4.3	Sun Mar  1 12:35:16 2020
+++ src/sys/dev/usb/usbdi.c	Fri Apr  3 12:27:55 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.182.4.3 2020/03/01 12:35:16 martin Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.182.4.4 2020/04/03 12:27:55 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.182.4.3 2020/03/01 12:35:16 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.182.4.4 2020/04/03 12:27:55 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -523,6 +523,11 @@ usbd_create_xfer(struct usbd_pipe *pipe,
 	if (xfer == NULL)
 		return ENOMEM;
 
+	xfer->ux_pipe = pipe;
+	xfer->ux_flags = flags;
+	xfer->ux_nframes = nframes;
+	xfer->ux_methods = pipe->up_methods;
+
 	if (len) {
 		buf = usbd_alloc_buffer(xfer, len);
 		if (!buf) {
@@ -530,16 +535,10 @@ usbd_create_xfer(struct usbd_pipe *pipe,
 			return ENOMEM;
 		}
 	}
-	xfer->ux_pipe = pipe;
-	xfer->ux_flags = flags;
-	xfer->ux_nframes = nframes;
-	xfer->ux_methods = pipe->up_methods;
 
 	if (xfer->ux_methods->upm_init) {
 		int err = xfer->ux_methods->upm_init(xfer);
 		if (err) {
-			if (buf)
-usbd_free_buffer(xfer);
 			usbd_free_xfer(xfer);
 			return err;
 		}



CVS commit: src/usr.bin/kdump

2020-04-03 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Apr  3 06:13:07 UTC 2020

Modified Files:
src/usr.bin/kdump: kdump.c

Log Message:
Update usage for ioctlprint.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/usr.bin/kdump/kdump.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.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.135 src/usr.bin/kdump/kdump.c:1.136
--- src/usr.bin/kdump/kdump.c:1.135	Thu Apr  2 17:41:34 2020
+++ src/usr.bin/kdump/kdump.c	Fri Apr  3 06:13:07 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.135 2020/04/02 17:41:34 christos Exp $	*/
+/*	$NetBSD: kdump.c,v 1.136 2020/04/03 06:13:07 wiz Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.135 2020/04/02 17:41:34 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.136 2020/04/03 06:13:07 wiz Exp $");
 #endif
 #endif /* not lint */
 
@@ -1319,7 +1319,7 @@ static void
 usage(void)
 {
 	if (strcmp(getprogname(), "ioctlprint") == 0) {
-		(void)fprintf(stderr, "Usage: %s [-f format] [-e emulation]  ...\n",
+		(void)fprintf(stderr, "Usage: %s [-l] [-e emulation] [-f format]  ...\n",
 		getprogname());
 	} else {
 		(void)fprintf(stderr, "Usage: %s [-dElNnRT] [-e emulation] "



CVS commit: src/usr.bin/kdump

2020-04-03 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Apr  3 06:12:48 UTC 2020

Modified Files:
src/usr.bin/kdump: ioctlprint.1

Log Message:
Increase column widths. Improve -l description wording to match ioctl(2).
Fix Xr.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/kdump/ioctlprint.1

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/kdump/ioctlprint.1
diff -u src/usr.bin/kdump/ioctlprint.1:1.4 src/usr.bin/kdump/ioctlprint.1:1.5
--- src/usr.bin/kdump/ioctlprint.1:1.4	Thu Apr  2 17:41:34 2020
+++ src/usr.bin/kdump/ioctlprint.1	Fri Apr  3 06:12:48 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: ioctlprint.1,v 1.4 2020/04/02 17:41:34 christos Exp $
+.\" $NetBSD: ioctlprint.1,v 1.5 2020/04/03 06:12:48 wiz Exp $
 .\"
 .\" Copyright (c) 2020 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -47,12 +47,11 @@ to by one or more
 .Ar arg
 arguments.
 The argument can either be an
-.Xr ioctl
-symbolic name or the
-ioctl value.
+.Xr ioctl 2
+symbolic name or the ioctl value.
 .Pp
 The options are as follows:
-.Bl -tag -width Fl
+.Bl -tag -width 12n
 .It Fl e Ar emulation
 If an emulation of a process is unknown,
 interpret system call maps assuming the named emulation instead of
@@ -65,7 +64,7 @@ style format string that allows customiz
 output.
 .Pp
 The following conversion characters can be used:
-.Bl -tag -width 
+.Bl -tag -width 9n
 .It \&%E
 Symbolic decoded ioctl string.
 .It \&%e
@@ -85,9 +84,9 @@ The default format is:
 "%n %e %x\\n"
 .Ed
 .It Fl l
-List all 
+List all known
 .Xr ioctl 2
-known.
+requests.
 .El
 .Sh SEE ALSO
 .Xr kdump 1 ,



CVS commit: src/sys/dev/usb

2020-04-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Apr  3 06:05:00 UTC 2020

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

Log Message:
Avoid crashes if we fail to allocate a transfer buffer and avoid an
unnecessary usbd_free_buffer before usbd_free_xfer

Worked out by Riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/dev/usb/usbdi.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/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.198 src/sys/dev/usb/usbdi.c:1.199
--- src/sys/dev/usb/usbdi.c:1.198	Sat Mar 14 02:35:33 2020
+++ src/sys/dev/usb/usbdi.c	Fri Apr  3 06:05:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.198 2020/03/14 02:35:33 christos Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.199 2020/04/03 06:05:00 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.198 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.199 2020/04/03 06:05:00 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -593,6 +593,11 @@ usbd_create_xfer(struct usbd_pipe *pipe,
 	if (xfer == NULL)
 		return ENOMEM;
 
+	xfer->ux_pipe = pipe;
+	xfer->ux_flags = flags;
+	xfer->ux_nframes = nframes;
+	xfer->ux_methods = pipe->up_methods;
+
 	if (len) {
 		buf = usbd_alloc_buffer(xfer, len);
 		if (!buf) {
@@ -600,16 +605,10 @@ usbd_create_xfer(struct usbd_pipe *pipe,
 			return ENOMEM;
 		}
 	}
-	xfer->ux_pipe = pipe;
-	xfer->ux_flags = flags;
-	xfer->ux_nframes = nframes;
-	xfer->ux_methods = pipe->up_methods;
 
 	if (xfer->ux_methods->upm_init) {
 		int err = xfer->ux_methods->upm_init(xfer);
 		if (err) {
-			if (buf)
-usbd_free_buffer(xfer);
 			usbd_free_xfer(xfer);
 			return err;
 		}



CVS commit: src/sys/dev/ofw

2020-04-03 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Apr  3 06:02:51 UTC 2020

Modified Files:
src/sys/dev/ofw: files.ofw
Added Files:
src/sys/dev/ofw: ofw_sysctl.c

Log Message:
make OpenFirmware info available via sysctl.ofw
tested on macppc, shark and sparc64


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/ofw/files.ofw
cvs rdiff -u -r0 -r1.1 src/sys/dev/ofw/ofw_sysctl.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/ofw/files.ofw
diff -u src/sys/dev/ofw/files.ofw:1.14 src/sys/dev/ofw/files.ofw:1.15
--- src/sys/dev/ofw/files.ofw:1.14	Wed Dec 16 12:22:48 2015
+++ src/sys/dev/ofw/files.ofw	Fri Apr  3 06:02:51 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.ofw,v 1.14 2015/12/16 12:22:48 jmcneill Exp $
+#	$NetBSD: files.ofw,v 1.15 2020/04/03 06:02:51 macallan Exp $
 #
 # First cut on Openfirmware interface
 #
@@ -9,6 +9,7 @@ define	ofw_subr
 
 defpseudo openfirm
 file	dev/ofw/openfirmio.c		openfirm needs-flag
+file 	dev/ofw/ofw_sysctl.c		openfirm | ofw_subr
 
 file	dev/ofw/ofw_subr.c		ofbus | openfirm | ofw_subr
 

Added files:

Index: src/sys/dev/ofw/ofw_sysctl.c
diff -u /dev/null src/sys/dev/ofw/ofw_sysctl.c:1.1
--- /dev/null	Fri Apr  3 06:02:51 2020
+++ src/sys/dev/ofw/ofw_sysctl.c	Fri Apr  3 06:02:51 2020
@@ -0,0 +1,64 @@
+/*	$NetBSD: ofw_sysctl.c,v 1.1 2020/04/03 06:02:51 macallan Exp $ */
+
+/*-
+ * Copyright (c) 2020 Michael Lorenz
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY 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 THE FOUNDATION OR CONTRIBUTORS
+ * 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 THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#include 
+__KERNEL_RCSID(0, "$NetBSD: ofw_sysctl.c,v 1.1 2020/04/03 06:02:51 macallan Exp $");
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+char firmwarestring[64] = "unknown";
+
+SYSCTL_SETUP(sysctl_hw_misc_setup, "sysctl hw.ofw subtree misc setup")
+{
+	const struct sysctlnode *me;
+	int openprom;
+
+	if ((openprom = OF_finddevice("/openprom")) != 0) {
+		memset(firmwarestring, 0, 64);
+		if (OF_getprop(openprom, "model", firmwarestring, 63) != 0) {
+			printf("firmware: %s\n", firmwarestring);
+		}
+	}
+
+	sysctl_createv(clog, 0, NULL, ,
+		CTLFLAG_PERMANENT,
+		CTLTYPE_NODE, "ofw",
+		SYSCTL_DESCR("OpenFirmware information"),
+		NULL, 0, NULL, 0,
+		CTL_HW, CTL_CREATE, CTL_EOL);
+	sysctl_createv(clog, 0, NULL, NULL,
+		CTLFLAG_PERMANENT,
+		CTLTYPE_STRING, "version",
+		SYSCTL_DESCR("firmware version string"),
+		NULL, 0, firmwarestring, 0,
+		CTL_HW, me->sysctl_num, CTL_CREATE, CTL_EOL);
+}