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

2019-01-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 30 02:44:20 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_drm.c sunxi_fb.c

Log Message:
Detach previous console device before attaching drmfb instead of relying on 
fdt_remove_bycompat hack


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sunxi_drm.c \
src/sys/arch/arm/sunxi/sunxi_fb.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sunxi_drm.c
diff -u src/sys/arch/arm/sunxi/sunxi_drm.c:1.1 src/sys/arch/arm/sunxi/sunxi_drm.c:1.2
--- src/sys/arch/arm/sunxi/sunxi_drm.c:1.1	Wed Jan 30 01:24:00 2019
+++ src/sys/arch/arm/sunxi/sunxi_drm.c	Wed Jan 30 02:44:19 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_drm.c,v 1.1 2019/01/30 01:24:00 jmcneill Exp $ */
+/* $NetBSD: sunxi_drm.c,v 1.2 2019/01/30 02:44:19 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.1 2019/01/30 01:24:00 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.2 2019/01/30 02:44:19 jmcneill Exp $");
 
 #include 
 #include 
@@ -58,11 +58,6 @@ static const char * const compatible[] =
 	NULL
 };
 
-static const char * fb_compatible[] = {
-	"allwinner,simple-framebuffer",
-	NULL
-};
-
 static int	sunxi_drm_match(device_t, cfdata_t, void *);
 static void	sunxi_drm_attach(device_t, device_t, void *);
 
@@ -140,8 +135,6 @@ sunxi_drm_attach(device_t parent, device
 	sc->sc_ddev->dmat = sc->sc_ddev->bus_dmat;
 	sc->sc_ddev->dmat_subregion_p = false;
 
-	fdt_remove_bycompat(fb_compatible);
-
 	config_defer(self, sunxi_drm_init);
 }
 
Index: src/sys/arch/arm/sunxi/sunxi_fb.c
diff -u src/sys/arch/arm/sunxi/sunxi_fb.c:1.1 src/sys/arch/arm/sunxi/sunxi_fb.c:1.2
--- src/sys/arch/arm/sunxi/sunxi_fb.c:1.1	Wed Jan 30 01:24:00 2019
+++ src/sys/arch/arm/sunxi/sunxi_fb.c	Wed Jan 30 02:44:19 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_fb.c,v 1.1 2019/01/30 01:24:00 jmcneill Exp $ */
+/* $NetBSD: sunxi_fb.c,v 1.2 2019/01/30 02:44:19 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2019 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_wsdisplay_compat.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_fb.c,v 1.1 2019/01/30 01:24:00 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_fb.c,v 1.2 2019/01/30 02:44:19 jmcneill Exp $");
 
 #include 
 #include 
@@ -37,6 +37,8 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_fb.c,v
 
 #include 
 
+#include 
+
 #include 
 #include 
 
@@ -94,6 +96,7 @@ sunxi_fb_attach(device_t parent, device_
 	prop_dictionary_t dict = device_properties(self);
 	const bool is_console = true;
 	prop_dictionary_set_bool(dict, "is_console", is_console);
+	wsdisplay_cndetach();
 #endif
 
 	const struct drmfb_attach_args da = {



CVS commit: src/sys/dev/wscons

2019-01-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 30 02:43:47 UTC 2019

Modified Files:
src/sys/dev/wscons: wsdisplay.c

Log Message:
Remove KASSERT in wsdisplay_cndetach. The caller likely doesn't know the
state of the console, so simply do cleanup if a previous console has been
attached.


To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/sys/dev/wscons/wsdisplay.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/wscons/wsdisplay.c
diff -u src/sys/dev/wscons/wsdisplay.c:1.149 src/sys/dev/wscons/wsdisplay.c:1.150
--- src/sys/dev/wscons/wsdisplay.c:1.149	Thu Nov 29 23:18:40 2018
+++ src/sys/dev/wscons/wsdisplay.c	Wed Jan 30 02:43:47 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.149 2018/11/29 23:18:40 jmcneill Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.150 2019/01/30 02:43:47 jmcneill Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.149 2018/11/29 23:18:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.150 2019/01/30 02:43:47 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_wsdisplay_compat.h"
@@ -966,10 +966,12 @@ wsdisplay_preattach(const struct wsscree
 void
 wsdisplay_cndetach(void)
 {
-	KASSERT(wsdisplay_console_initted == 2);
-
-	cn_tab = wsdisplay_ocn;
-	wsdisplay_console_initted = 0;
+	if (wsdisplay_console_initted > 0) {
+		cn_tab = wsdisplay_ocn;
+		wsdisplay_console_initted = 0;
+		wsdisplay_console_attached = 0;
+		wsdisplay_console_device = NULL;
+	}
 }
 
 /*



CVS commit: src/sys/arch

2019-01-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 30 02:02:23 UTC 2019

Modified Files:
src/sys/arch/aarch64/include: armreg.h
src/sys/arch/arm/include: armreg.h

Log Message:
add gtmr_cntv_cval_write


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/aarch64/include/armreg.h
cvs rdiff -u -r1.124 -r1.125 src/sys/arch/arm/include/armreg.h

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

Modified files:

Index: src/sys/arch/aarch64/include/armreg.h
diff -u src/sys/arch/aarch64/include/armreg.h:1.22 src/sys/arch/aarch64/include/armreg.h:1.23
--- src/sys/arch/aarch64/include/armreg.h:1.22	Thu Dec 13 10:44:25 2018
+++ src/sys/arch/aarch64/include/armreg.h	Wed Jan 30 02:02:23 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: armreg.h,v 1.22 2018/12/13 10:44:25 ryo Exp $ */
+/* $NetBSD: armreg.h,v 1.23 2019/01/30 02:02:23 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -1156,6 +1156,13 @@ gtmr_cntv_cval_read(void)
 
 	return reg_cntv_cval_el0_read();
 }
+
+static __inline void
+gtmr_cntv_cval_write(uint64_t val)
+{
+
+	reg_cntv_cval_el0_write(val);
+}
 #endif /* _KERNEL */
 
 /*

Index: src/sys/arch/arm/include/armreg.h
diff -u src/sys/arch/arm/include/armreg.h:1.124 src/sys/arch/arm/include/armreg.h:1.125
--- src/sys/arch/arm/include/armreg.h:1.124	Wed Aug 15 06:13:56 2018
+++ src/sys/arch/arm/include/armreg.h	Wed Jan 30 02:02:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: armreg.h,v 1.124 2018/08/15 06:13:56 skrll Exp $	*/
+/*	$NetBSD: armreg.h,v 1.125 2019/01/30 02:02:23 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Ben Harris
@@ -1026,6 +1026,13 @@ gtmr_cntv_cval_read(void)
 	return armreg_cntv_cval_read();
 }
 
+static inline void
+gtmr_cntv_cval_write(uint64_t val)
+{
+
+	armreg_cntv_cval_write(val);
+}
+
 #endif /* _KERNEL */
 #endif /* !__ASSEMBLER && !_RUMPKERNEL */
 



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

2019-01-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 30 02:01:59 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gtmr.c

Log Message:
Fix bitmask in A64 errata workaround and write cval instead of tval on A64


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/cortex/gtmr.c

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

Modified files:

Index: src/sys/arch/arm/cortex/gtmr.c
diff -u src/sys/arch/arm/cortex/gtmr.c:1.38 src/sys/arch/arm/cortex/gtmr.c:1.39
--- src/sys/arch/arm/cortex/gtmr.c:1.38	Thu Nov 15 17:15:52 2018
+++ src/sys/arch/arm/cortex/gtmr.c	Wed Jan 30 02:01:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gtmr.c,v 1.38 2018/11/15 17:15:52 jmcneill Exp $	*/
+/*	$NetBSD: gtmr.c,v 1.39 2019/01/30 02:01:58 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.38 2018/11/15 17:15:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtmr.c,v 1.39 2019/01/30 02:01:58 jmcneill Exp $");
 
 #include 
 #include 
@@ -171,8 +171,8 @@ gtmr_read_cntvct(struct gtmr_softc *sc)
 		u_int bits;
 		do {
 			val = gtmr_cntvct_read();
-			bits = val & __BITS(10,0);
-		} while (bits == 0 || bits == __BITS(10,0));
+			bits = val & __BITS(9,0);
+		} while (bits == 0 || bits == __BITS(9,0));
 		return val;
 	}
 
@@ -298,7 +298,12 @@ gtmr_intr(void *arg)
 	} else {
 		delta = 0;
 	}
-	gtmr_cntv_tval_write(sc->sc_autoinc - delta);
+
+	if (ISSET(sc->sc_flags, GTMR_FLAG_SUN50I_A64_UNSTABLE_TIMER)) {
+		gtmr_cntv_cval_write(now + sc->sc_autoinc - delta);
+	} else {
+		gtmr_cntv_tval_write(sc->sc_autoinc - delta);
+	}
 
 	ci->ci_lastintr = now;
 



CVS commit: src/sys/compat/netbsd32

2019-01-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Jan 30 02:00:02 UTC 2019

Modified Files:
src/sys/compat/netbsd32: netbsd32_compat_80.c

Log Message:
Remove #ifdef COMPAT_80

The file will only be selected if "options COMPAT_80" is defined in
the config file.  The COMPAT_80 macro is defined only if the option
is explicitly defined, and not if it is implicitly defined due to
inclusion of lesser-version COMPATs.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/netbsd32/netbsd32_compat_80.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/compat/netbsd32/netbsd32_compat_80.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_80.c:1.3 src/sys/compat/netbsd32/netbsd32_compat_80.c:1.4
--- src/sys/compat/netbsd32/netbsd32_compat_80.c:1.3	Mon Jan 28 01:09:52 2019
+++ src/sys/compat/netbsd32/netbsd32_compat_80.c	Wed Jan 30 02:00:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_80.c,v 1.3 2019/01/28 01:09:52 pgoyette Exp $	*/
+/*	$NetBSD: netbsd32_compat_80.c,v 1.4 2019/01/30 02:00:02 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_80.c,v 1.3 2019/01/28 01:09:52 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_80.c,v 1.4 2019/01/30 02:00:02 pgoyette Exp $");
 
 #include 
 #include 
@@ -46,8 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_com
 #include 
 #include 
 
-#ifdef COMPAT_80
-
 int netbsd32_80_modctl(struct lwp *, const struct netbsd32_modctl_args *,
 	register_t *);
 
@@ -197,4 +195,3 @@ compat_netbsd32_80_modcmd(modcmd_t cmd, 
 		return ENOTTY;
 	}
 }
-#endif	/* COMPAT_80 */



CVS commit: src/bin/dd

2019-01-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jan 30 01:40:02 UTC 2019

Modified Files:
src/bin/dd: args.c dd.1

Log Message:
adjust the open flags available for dd to match actual reality
of what matters.  remove "search" for now, since O_SEARCH has
no backend.  document them all.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/bin/dd/args.c
cvs rdiff -u -r1.34 -r1.35 src/bin/dd/dd.1

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

Modified files:

Index: src/bin/dd/args.c
diff -u src/bin/dd/args.c:1.39 src/bin/dd/args.c:1.40
--- src/bin/dd/args.c:1.39	Wed Mar 18 13:23:49 2015
+++ src/bin/dd/args.c	Wed Jan 30 01:40:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: args.c,v 1.39 2015/03/18 13:23:49 manu Exp $	*/
+/*	$NetBSD: args.c,v 1.40 2019/01/30 01:40:02 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)args.c	8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: args.c,v 1.39 2015/03/18 13:23:49 manu Exp $");
+__RCSID("$NetBSD: args.c,v 1.40 2019/01/30 01:40:02 mrg Exp $");
 #endif
 #endif /* not lint */
 
@@ -447,7 +447,7 @@ static const struct ioflag {
 	{ "direct",	O_DIRECT,	C_IFLAG|C_OFLAG	},
 	{ "directory",	O_DIRECTORY,	C_NONE		},
 	{ "dsync",	O_DSYNC,	C_OFLAG		},
-	{ "excl",	O_EXCL,		C_IFLAG|C_OFLAG	},
+	{ "excl",	O_EXCL,		C_OFLAG		},
 	{ "exlock",	O_EXLOCK,	C_IFLAG|C_OFLAG	},
 	{ "noctty",	O_NOCTTY,	C_IFLAG|C_OFLAG	},
 	{ "nofollow",	O_NOFOLLOW,	C_IFLAG|C_OFLAG	},
@@ -456,11 +456,10 @@ static const struct ioflag {
 	{ "rdonly",	O_RDONLY,	C_IFLAG		},
 	{ "rdwr",	O_RDWR,		C_IFLAG		},
 	{ "rsync",	O_RSYNC,	C_IFLAG		},
-	{ "search",	O_SEARCH,	C_IFLAG|C_OFLAG	},
 	{ "shlock",	O_SHLOCK,	C_IFLAG|C_OFLAG	},
 	{ "sync",	O_SYNC,		C_IFLAG|C_OFLAG	},
-	{ "trunc",	O_TRUNC,	C_IFLAG|C_OFLAG	},
-	{ "wronly",	O_WRONLY,	C_NONE		},
+	{ "trunc",	O_TRUNC,	C_OFLAG		},
+	{ "wronly",	O_WRONLY,	C_OFLAG		},
 };
 
 static u_int

Index: src/bin/dd/dd.1
diff -u src/bin/dd/dd.1:1.34 src/bin/dd/dd.1:1.35
--- src/bin/dd/dd.1:1.34	Tue Jul  4 06:48:15 2017
+++ src/bin/dd/dd.1	Wed Jan 30 01:40:02 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dd.1,v 1.34 2017/07/04 06:48:15 wiz Exp $
+.\"	$NetBSD: dd.1,v 1.35 2019/01/30 01:40:02 mrg Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\"	@(#)dd.1	8.2 (Berkeley) 1/13/94
 .\"
-.Dd August 18, 2016
+.Dd January 29, 2019
 .Dt DD 1
 .Os
 .Sh NAME
@@ -97,13 +97,9 @@ Use comma-separated
 when calling
 .Xr open 2
 for the input file.
-The possible values are
-.Va O_
-flags documented in
-.Xr open 2 ,
-specified as lowercase and with the leading
-.Va O_
-removed.
+See the
+.Sx INPUT AND OUTPUT FLAGS
+section for details.
 Default value is
 .Va rdonly .
 .It Cm iseek= Ns Ar n
@@ -203,9 +199,9 @@ but for the call to
 on the output file.
 The default value is
 .Va creat ,
-which should be explicitly added in
+which must be explicitly added in
 .Cm oflag
-in order to output to a nonexistent file.
+if this option is used in order to output to a nonexistent file.
 The default or specified value is or'ed with
 .Va rdwr
 for a first
@@ -220,7 +216,10 @@ is automatically added if none of
 .Cm seek ,
 or
 .Cm conv=notrunc
-operands are used,
+operands are used.
+See the
+.Sx INPUT AND OUTPUT FLAGS
+section for details.
 .It Cm oseek= Ns Ar n
 Seek on the output file
 .Ar n
@@ -475,6 +474,76 @@ be written to the standard error output
 in the same format as the standard completion message and
 .Nm
 will exit.
+.Sh INPUT AND OUTPUT FLAGS
+There are flags valid for input only, for output only, or for either.
+.Pp
+The flags that apply to both input and output are:
+.Bl -tag -width directory
+.It Cm alt_io
+Use Alternative I/O.
+.It Cm async
+Use
+.Dv SIGIO
+signalling for I/O.
+.It Cm cloexec
+Set the close-on-exec flag.
+.It Cm direct
+Directly access the data, skipping any caches.
+.It Cm directory
+Not avaiable for
+.Nm .
+.It Cm exlock
+Atomically obtain an exclusive lock.
+.It Cm noctty
+Do not consider the file as a potential controlling tty.
+.It Cm nofollow
+Do not follow symbolic links.
+.It Cm nonblock
+Do not block on open or I/O requests.
+.It Cm nosigpipe
+Return
+.Er EPIPE
+instead of raising
+.Dv SIGPIPE .
+.It Cm shlock
+Atomically obtain a shared lock.
+.It Cm sync
+All I/O will be performed with full synchronisation.
+.El
+.Pp
+The flags that apply to only input are:
+.Bl -tag -width directory
+.It Cm rdonly
+Set the read-only flag.
+.It Cm rdwr
+Set the read and write flags.
+.It Cm rsync
+Enable read synchronisation, if the
+.Cm sync
+option is also set.
+.El
+.Pp
+The flags that apply to only output are:
+.Bl -tag -width directory
+.It Cm append
+Append to the output by default.
+.It Cm creat
+Create the output file.
+.It Cm dsync
+Wait for all data to be syncronously written.
+.It Cm excl
+Ensure that output is to a new file.
+.It Cm trunc
+Truncate the output 

CVS commit: src/sys/arch/evbarm/conf

2019-01-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 30 01:26:18 UTC 2019

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64

Log Message:
Add Allwinner A64 display pipeline drivers (commented out for now)


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/evbarm/conf/GENERIC64

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/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.75 src/sys/arch/evbarm/conf/GENERIC64:1.76
--- src/sys/arch/evbarm/conf/GENERIC64:1.75	Tue Jan 22 20:17:36 2019
+++ src/sys/arch/evbarm/conf/GENERIC64	Wed Jan 30 01:26:18 2019
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.75 2019/01/22 20:17:36 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.76 2019/01/30 01:26:18 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -359,6 +359,14 @@ tegracec0	at fdt?			# NVIDIA Tegra HDMI 
 hdmicec*	at hdmicecbus?
 
 # Display
+#dispcon*	at fdt?			# Display connector devices
+#dwhdmi* 	at fdt?			# Designware HDMI TX
+#sunxide2bus*	at fdt? pass 4		# Allwinner DE2 bus
+#sunxidrm*	at fdt?	pass 5		# Allwinner Display Pipeline
+#sunxifb*	at sunxidrm?		# Allwinner DRM framebuffer
+#sunxihdmiphy*	at fdt? pass 9		# Allwinner HDMI TX PHY
+#sunxilcdc*	at fdt?			# Allwinner DE2 timing controller
+#sunximixer*	at fdt?			# Allwinner DE2 mixer
 #tegradrm*	at fdt?			# NVIDIA Tegra Display
 #tegrafb*	at tegrafbbus?
 genfb*		at fdt?			# Simple Framebuffer
@@ -380,7 +388,6 @@ pseudo-device	wsfont
 
 # GPU
 #nouveau*	at fdt?			# NVIDIA GPU
-sunxide2bus*	at fdt?			# Allwinner DE2 bus
 
 # Backlight
 pwmbacklight*	at fdt?			# PWM Backlight controls



CVS commit: src/sys

2019-01-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 30 01:24:00 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi sun50i_a64_ccu.c sunxi_ccu.h
sunxi_ccu_fractional.c
src/sys/dev/fdt: fdt_i2c.c fdt_phy.c fdt_port.c fdt_port.h fdtvar.h
files.fdt
Added Files:
src/sys/arch/arm/sunxi: sunxi_drm.c sunxi_drm.h sunxi_dwhdmi.c
sunxi_fb.c sunxi_hdmiphy.c sunxi_hdmiphy.h sunxi_lcdc.c
sunxi_mixer.c
src/sys/dev/fdt: hdmi_connector.c

Log Message:
Add support for Allwinner A64's display pipeline.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/sunxi/sun50i_a64_ccu.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/sunxi/sunxi_ccu.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sunxi_ccu_fractional.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sunxi_drm.c \
src/sys/arch/arm/sunxi/sunxi_drm.h src/sys/arch/arm/sunxi/sunxi_dwhdmi.c \
src/sys/arch/arm/sunxi/sunxi_fb.c src/sys/arch/arm/sunxi/sunxi_hdmiphy.c \
src/sys/arch/arm/sunxi/sunxi_hdmiphy.h \
src/sys/arch/arm/sunxi/sunxi_lcdc.c src/sys/arch/arm/sunxi/sunxi_mixer.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/fdt/fdt_i2c.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/fdt_phy.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/fdt_port.c \
src/sys/dev/fdt/fdt_port.h
cvs rdiff -u -r1.47 -r1.48 src/sys/dev/fdt/fdtvar.h
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/fdt/files.fdt
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/hdmi_connector.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/files.sunxi
diff -u src/sys/arch/arm/sunxi/files.sunxi:1.60 src/sys/arch/arm/sunxi/files.sunxi:1.61
--- src/sys/arch/arm/sunxi/files.sunxi:1.60	Tue Jan 22 20:17:36 2019
+++ src/sys/arch/arm/sunxi/files.sunxi	Wed Jan 30 01:24:00 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sunxi,v 1.60 2019/01/22 20:17:36 jmcneill Exp $
+#	$NetBSD: files.sunxi,v 1.61 2019/01/30 01:24:00 jmcneill Exp $
 #
 # Configuration info for Allwinner sunxi family SoCs
 #
@@ -307,6 +307,36 @@ device	sunxide2ccu: sunxi_ccu
 attach	sunxide2ccu at fdt with sunxi_de2ccu
 file	arch/arm/sunxi/sunxi_de2_ccu.c		sunxi_de2ccu
 
+# DE2 mixer
+device	sunximixer: drmkms
+attach	sunximixer at fdt with sunxi_mixer
+file	arch/arm/sunxi/sunxi_mixer.c		sunxi_mixer
+
+# DE2 timing controller
+device	sunxilcdc: drmkms
+attach	sunxilcdc at fdt with sunxi_lcdc
+file	arch/arm/sunxi/sunxi_lcdc.c		sunxi_lcdc
+
+# Display Pipeline
+define	sunxifbbus { }
+device	sunxidrm: drmkms, ddc_read_edid, sunxifbbus
+attach	sunxidrm at fdt with sunxi_drm
+file	arch/arm/sunxi/sunxi_drm.c		sunxi_drm
+
+# DRM framebuffer console
+device	sunxifb: sunxifbbus, drmfb, wsemuldisplaydev
+attach	sunxifb at sunxifbbus with sunxi_fb
+file	arch/arm/sunxi/sunxi_fb.c		sunxi_fb
+
+# Allwinner HDMI (Designware based)
+attach	dwhdmi at fdt with sunxi_dwhdmi
+file	arch/arm/sunxi/sunxi_dwhdmi.c		sunxi_dwhdmi
+
+# Allwinner HDMI TX PHY
+device	sunxihdmiphy: drmkms
+attach	sunxihdmiphy at fdt with sunxi_hdmiphy
+file	arch/arm/sunxi/sunxi_hdmiphy.c		sunxi_hdmiphy | sunxi_dwhdmi
+
 # SOC parameters
 defflag	opt_soc.h			SOC_SUNXI
 defflag	opt_soc.h			SOC_SUNXI_MC

Index: src/sys/arch/arm/sunxi/sun50i_a64_ccu.c
diff -u src/sys/arch/arm/sunxi/sun50i_a64_ccu.c:1.10 src/sys/arch/arm/sunxi/sun50i_a64_ccu.c:1.11
--- src/sys/arch/arm/sunxi/sun50i_a64_ccu.c:1.10	Tue Jan 22 23:06:49 2019
+++ src/sys/arch/arm/sunxi/sun50i_a64_ccu.c	Wed Jan 30 01:24:00 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sun50i_a64_ccu.c,v 1.10 2019/01/22 23:06:49 jmcneill Exp $ */
+/* $NetBSD: sun50i_a64_ccu.c,v 1.11 2019/01/30 01:24:00 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.10 2019/01/22 23:06:49 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.11 2019/01/30 01:24:00 jmcneill Exp $");
 
 #include 
 #include 
@@ -42,8 +42,10 @@ __KERNEL_RCSID(1, "$NetBSD: sun50i_a64_c
 
 #define	PLL_CPUX_CTRL_REG	0x000
 #define	PLL_AUDIO_CTRL_REG	0x008
+#define	PLL_VIDEO0_CTRL_REG	0x010
 #define	PLL_PERIPH0_CTRL_REG	0x028
 #define	PLL_PERIPH1_CTRL_REG	0x02c
+#define	PLL_VIDEO1_CTRL_REG	0x030
 #define	PLL_DE_CTRL_REG		0x048
 #define	AHB1_APB1_CFG_REG	0x054
 #define	APB2_CFG_REG		0x058
@@ -61,7 +63,10 @@ __KERNEL_RCSID(1, "$NetBSD: sun50i_a64_c
 #define	DRAM_CFG_REG		0x0f4
 #define	MBUS_RST_REG		0x0fc
 #define	DE_CLK_REG		0x104
+#define	TCON1_CLK_REG		0x11c
 #define	AC_DIG_CLK_REG		0x140
+#define	HDMI_CLK_REG		0x150
+#define	HDMI_SLOW_CLK_REG	0x154
 #define	BUS_SOFT_RST_REG0	0x2c0
 #define	BUS_SOFT_RST_REG1	0x2c4
 #define	BUS_SOFT_RST_REG2	0x2c8
@@ -146,6 +151,8 @@ static const char *apb2_parents[] = { "l
 static const char *mmc_parents[] = { "hosc", "pll_periph0_2x", "pll_periph1_2x" };
 static const char *ths_parents[] = { "hosc", 

CVS commit: src/sys/dev/clk

2019-01-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 30 01:20:47 UTC 2019

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

Log Message:
Make "put" clk func optional


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/clk/clk.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/clk/clk.c
diff -u src/sys/dev/clk/clk.c:1.5 src/sys/dev/clk/clk.c:1.6
--- src/sys/dev/clk/clk.c:1.5	Tue Jun 12 23:08:37 2018
+++ src/sys/dev/clk/clk.c	Wed Jan 30 01:20:47 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: clk.c,v 1.5 2018/06/12 23:08:37 jmcneill Exp $ */
+/* $NetBSD: clk.c,v 1.6 2019/01/30 01:20:47 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clk.c,v 1.5 2018/06/12 23:08:37 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clk.c,v 1.6 2019/01/30 01:20:47 jmcneill Exp $");
 
 #include 
 #include 
@@ -196,7 +196,8 @@ clk_get(struct clk_domain *domain, const
 void
 clk_put(struct clk *clk)
 {
-	return clk->domain->funcs->put(clk->domain->priv, clk);
+	if (clk->domain->funcs->put)
+		clk->domain->funcs->put(clk->domain->priv, clk);
 }
 
 u_int



CVS commit: src/sys

2019-01-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 30 01:19:49 UTC 2019

Modified Files:
src/sys/conf: files
Added Files:
src/sys/dev/ic: dw_hdmi.c dw_hdmi.h

Log Message:
Add driver for Designware HDMI TX controller.


To generate a diff of this commit:
cvs rdiff -u -r1.1227 -r1.1228 src/sys/conf/files
cvs rdiff -u -r0 -r1.1 src/sys/dev/ic/dw_hdmi.c src/sys/dev/ic/dw_hdmi.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/conf/files
diff -u src/sys/conf/files:1.1227 src/sys/conf/files:1.1228
--- src/sys/conf/files:1.1227	Mon Jan 28 01:00:23 2019
+++ src/sys/conf/files	Wed Jan 30 01:19:49 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1227 2019/01/28 01:00:23 pgoyette Exp $
+#	$NetBSD: files,v 1.1228 2019/01/30 01:19:49 jmcneill Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20171118
@@ -1480,6 +1480,10 @@ file	dev/led.c			leds
 device	ipmi: sysmon_envsys, sysmon_wdog
 attach	ipmi at ipmibus
 
+# Designware HDMI TX
+device	dwhdmi: edid, videomode, drmkms, drmkms_i2c
+file	dev/ic/dw_hdmi.c		dwhdmi
+
 #
 # File systems
 #

Added files:

Index: src/sys/dev/ic/dw_hdmi.c
diff -u /dev/null src/sys/dev/ic/dw_hdmi.c:1.1
--- /dev/null	Wed Jan 30 01:19:49 2019
+++ src/sys/dev/ic/dw_hdmi.c	Wed Jan 30 01:19:49 2019
@@ -0,0 +1,660 @@
+/* $NetBSD: dw_hdmi.c,v 1.1 2019/01/30 01:19:49 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2019 Jared D. McNeill 
+ * 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 AUTHOR ``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 AUTHOR 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: dw_hdmi.c,v 1.1 2019/01/30 01:19:49 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#define	HDMI_IH_I2CM_STAT0	0x0105
+#define	 HDMI_IH_I2CM_STAT0_DONE		__BIT(1)
+#define	 HDMI_IH_I2CM_STAT0_ERROR		__BIT(0)
+#define	HDMI_IH_MUTE		0x01ff
+#define	 HDMI_IH_MUTE_WAKEUP_INTERRUPT		__BIT(1)
+#define	 HDMI_IH_MUTE_ALL_INTERRUPT		__BIT(0)
+
+#define	HDMI_TX_INVID0		0x0200
+#define	 HDMI_TX_INVID0_VIDEO_MAPPING		__BITS(4,0)
+#define	  HDMI_TX_INVID0_VIDEO_MAPPING_DEFAULT	1
+#define	HDMI_TX_INSTUFFING	0x0201
+#define	 HDMI_TX_INSTUFFING_BCBDATA_STUFFING	__BIT(2)
+#define	 HDMI_TX_INSTUFFING_RCRDATA_STUFFING	__BIT(1)
+#define	 HDMI_TX_INSTUFFING_GYDATA_STUFFING	__BIT(0)
+#define	HDMI_TX_GYDATA0		0x0202
+#define	HDMI_TX_GYDATA1		0x0203
+#define	HDMI_TX_RCRDATA0	0x0204
+#define	HDMI_TX_RCRDATA1	0x0205
+#define	HDMI_TX_BCBDATA0	0x0206
+#define	HDMI_TX_BCBDATA1	0x0207
+
+#define	HDMI_VP_STATUS		0x0800
+#define	HDMI_VP_PR_CD		0x0801
+#define	 HDMI_VP_PR_CD_COLOR_DEPTH		__BITS(7,4)
+#define	  HDMI_VP_PR_CD_COLOR_DEPTH_24		0
+#define	 HDMI_VP_PR_CD_DESIRED_PR_FACTOR	__BITS(3,0)
+#define	  HDMI_VP_PR_CD_DESIRED_PR_FACTOR_NONE	0
+#define	HDMI_VP_STUFF		0x0802
+#define	 HDMI_VP_STUFF_IDEFAULT_PHASE		__BIT(5)
+#define	 HDMI_VP_STUFF_YCC422_STUFFING		__BIT(2)
+#define	 HDMI_VP_STUFF_PP_STUFFING		__BIT(1)
+#define	 HDMI_VP_STUFF_PR_STUFFING		__BIT(0)
+#define	HDMI_VP_REMAP		0x0803
+#define	 HDMI_VP_REMAP_YCC422_SIZE		__BITS(1,0)
+#define	  HDMI_VP_REMAP_YCC422_SIZE_16		0
+#define	HDMI_VP_CONF		0x0804
+#define	 HDMI_VP_CONF_BYPASS_EN			__BIT(6)
+#define	 HDMI_VP_CONF_BYPASS_SELECT		__BIT(2)
+#define	 HDMI_VP_CONF_OUTPUT_SELECT		__BITS(1,0)
+#define	  HDMI_VP_CONF_OUTPUT_SELECT_BYPASS	2
+#define	HDMI_VP_STAT		0x0805
+#define	HDMI_VP_INT		0x0806
+#define	HDMI_VP_MASK		0x0807
+#define	HDMI_VP_POL		0x0808
+
+#define	HDMI_FC_INVIDCONF	0x1000
+#define	 HDMI_FC_INVIDCONF_VSYNC_IN_POLARITY	__BIT(6)
+#define	 HDMI_FC_INVIDCONF_HSYNC_IN_POLARITY	__BIT(5)
+#define	 

CVS commit: src/sys/external/bsd/drm2/dist/drm/radeon

2019-01-29 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Jan 30 01:11:08 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: radeon_display.c

Log Message:
revert rev 1.3 + 1.4 (2015):  blank console / CLUT attempts.
we disabled the driver for almost all r100/r200 chipsets so
this code has been obsolete for ages and doesn't need to
remain a diff against upstream.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c

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

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c:1.9 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c:1.10
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c:1.9	Mon Aug 27 15:22:54 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_display.c	Wed Jan 30 01:11:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_display.c,v 1.9 2018/08/27 15:22:54 riastradh Exp $	*/
+/*	$NetBSD: radeon_display.c,v 1.10 2019/01/30 01:11:08 mrg Exp $	*/
 
 /*
  * Copyright 2007-8 Advanced Micro Devices, Inc.
@@ -26,7 +26,7 @@
  *  Alex Deucher
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_display.c,v 1.9 2018/08/27 15:22:54 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_display.c,v 1.10 2019/01/30 01:11:08 mrg Exp $");
 
 #include 
 #include 
@@ -188,36 +188,12 @@ static void legacy_crtc_load_lut(struct 
 		dac2_cntl |= RADEON_DAC2_PALETTE_ACC_CTL;
 	WREG32(RADEON_DAC_CNTL2, dac2_cntl);
 
-	/*
-	 * At least the RV100 [vendor 1002 product 515e (rev. 0x02)]
-	 * has an old style palette
-	 */
-	if (rdev->family < CHIP_RV280) {
-#ifdef notyet
-		/*
-		 * Leave CLUT alone for now. The code below gives us a
-		 * nice 444 grayscale, but we are not in true color mode
-		 * anymore and I don't have any docs how to do this right.
-		 */
-		WREG8(RADEON_PALETTE_INDEX, 0);
-		for (i = 0; i < 256; i++) {
-#define R(x) (radeon_crtc->lut_r[i] >> 2)
-#define G(x) (radeon_crtc->lut_g[i] >> 2)
-#define B(x) (radeon_crtc->lut_b[i] >> 2)
-			WREG32(RADEON_PALETTE_DATA, ((R(i) << 16)
-| (G(i) << 8) | B(i)) << 4);
-		}
-#else
-		printf("%s: unknown DAC, can't set lookup table\n", __func__);
-#endif
-	} else {
-		WREG8(RADEON_PALETTE_INDEX, 0);
-		for (i = 0; i < 256; i++) {
-			WREG32(RADEON_PALETTE_30_DATA,
- (radeon_crtc->lut_r[i] << 20) |
- (radeon_crtc->lut_g[i] << 10) |
- (radeon_crtc->lut_b[i] << 0));
-		}
+	WREG8(RADEON_PALETTE_INDEX, 0);
+	for (i = 0; i < 256; i++) {
+		WREG32(RADEON_PALETTE_30_DATA,
+			 (radeon_crtc->lut_r[i] << 20) |
+			 (radeon_crtc->lut_g[i] << 10) |
+			 (radeon_crtc->lut_b[i] << 0));
 	}
 }
 



CVS commit: src/sys/dev/fdt

2019-01-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 30 00:56:47 UTC 2019

Modified Files:
src/sys/dev/fdt: fdt_subr.c

Log Message:
Hide address decoding debug messages under FDTBUS_DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/fdt/fdt_subr.c

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

Modified files:

Index: src/sys/dev/fdt/fdt_subr.c
diff -u src/sys/dev/fdt/fdt_subr.c:1.26 src/sys/dev/fdt/fdt_subr.c:1.27
--- src/sys/dev/fdt/fdt_subr.c:1.26	Sun Jan 27 09:19:36 2019
+++ src/sys/dev/fdt/fdt_subr.c	Wed Jan 30 00:56:47 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_subr.c,v 1.26 2019/01/27 09:19:36 rin Exp $ */
+/* $NetBSD: fdt_subr.c,v 1.27 2019/01/30 00:56:47 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.26 2019/01/27 09:19:36 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.27 2019/01/30 00:56:47 jmcneill Exp $");
 
 #include "opt_fdt.h"
 
@@ -289,10 +289,12 @@ fdtbus_get_reg64(int phandle, u_int inde
 
 	if (paddr) {
 		*paddr = fdtbus_decode_range(OF_parent(phandle), addr);
+#ifdef FDTBUS_DEBUG
 		const char *name = fdt_get_name(fdtbus_get_data(),
 		fdtbus_phandle2offset(phandle), NULL);
-		aprint_debug("fdt: [%s] decoded addr #%u: %" PRIx64
+		printf("fdt: [%s] decoded addr #%u: %" PRIx64
 		" -> %" PRIx64 "\n", name, index, addr, *paddr);
+#endif
 	}
 	if (psize)
 		*psize = size;



CVS commit: src/sys/dev/fdt

2019-01-29 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 30 00:55:04 UTC 2019

Modified Files:
src/sys/dev/fdt: simplefb.c

Log Message:
Call genfb_cnattach when WSDISPLAY_MULTICONS is defined


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/fdt/simplefb.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/fdt/simplefb.c
diff -u src/sys/dev/fdt/simplefb.c:1.6 src/sys/dev/fdt/simplefb.c:1.7
--- src/sys/dev/fdt/simplefb.c:1.6	Mon Jul 23 00:51:40 2018
+++ src/sys/dev/fdt/simplefb.c	Wed Jan 30 00:55:04 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: simplefb.c,v 1.6 2018/07/23 00:51:40 macallan Exp $ */
+/* $NetBSD: simplefb.c,v 1.7 2019/01/30 00:55:04 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_wsdisplay_compat.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.6 2018/07/23 00:51:40 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: simplefb.c,v 1.7 2019/01/30 00:55:04 jmcneill Exp $");
 
 #include 
 #include 
@@ -199,6 +199,7 @@ simplefb_attach_genfb(struct simplefb_so
 
 #ifdef WSDISPLAY_MULTICONS
 	const bool is_console = true;
+	genfb_cnattach();
 #else
 	const bool is_console = phandle == simplefb_console_phandle;
 	if (is_console)



CVS commit: src/sys/dev/raidframe

2019-01-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Jan 29 23:57:01 UTC 2019

Modified Files:
src/sys/dev/raidframe: rf_compat80.c

Log Message:
KNF - insert tab (thanks to mrg@)

NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/raidframe/rf_compat80.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/raidframe/rf_compat80.c
diff -u src/sys/dev/raidframe/rf_compat80.c:1.5 src/sys/dev/raidframe/rf_compat80.c:1.6
--- src/sys/dev/raidframe/rf_compat80.c:1.5	Tue Jan 29 23:42:06 2019
+++ src/sys/dev/raidframe/rf_compat80.c	Tue Jan 29 23:57:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_compat80.c,v 1.5 2019/01/29 23:42:06 oster Exp $	*/
+/*	$NetBSD: rf_compat80.c,v 1.6 2019/01/29 23:57:01 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2017 Matthew R. Green
@@ -226,7 +226,7 @@ int
 raidframe_ioctl_80(int cmd, int initted, RF_Raid_t *raidPtr, int unit,
 void *data, RF_Config_t **k_cfg)  
 {
-int error;
+	int error;
  
 	switch (cmd) {
 	case RAIDFRAME_CHECK_RECON_STATUS_EXT80:



CVS commit: src/sys/dev/raidframe

2019-01-29 Thread Greg Oster
Module Name:src
Committed By:   oster
Date:   Tue Jan 29 23:42:06 UTC 2019

Modified Files:
src/sys/dev/raidframe: rf_compat80.c

Log Message:
Need to return EPASSTHROUGH for ioctls that arn't handled in compat.
Thanks to mlelstv for finding this!


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/raidframe/rf_compat80.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/raidframe/rf_compat80.c
diff -u src/sys/dev/raidframe/rf_compat80.c:1.4 src/sys/dev/raidframe/rf_compat80.c:1.5
--- src/sys/dev/raidframe/rf_compat80.c:1.4	Tue Jan 29 09:28:50 2019
+++ src/sys/dev/raidframe/rf_compat80.c	Tue Jan 29 23:42:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_compat80.c,v 1.4 2019/01/29 09:28:50 pgoyette Exp $	*/
+/*	$NetBSD: rf_compat80.c,v 1.5 2019/01/29 23:42:06 oster Exp $	*/
 
 /*
  * Copyright (c) 2017 Matthew R. Green
@@ -242,7 +242,7 @@ int error;
 	case RAIDFRAME_FAIL_DISK80:
 		return EPASSTHROUGH;
 	default:
-		return EINVAL;
+		return EPASSTHROUGH;
 	}
 
 	switch (cmd) {



CVS commit: src/libexec/ftpd

2019-01-29 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue Jan 29 23:19:31 UTC 2019

Modified Files:
src/libexec/ftpd: pfilter.c

Log Message:
clarify the fd used for blacklisting.

Use STDIN_FILENO instead of 0 as the fd to blacklist_r(),
since we use the former in ftpd.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/libexec/ftpd/pfilter.c

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

Modified files:

Index: src/libexec/ftpd/pfilter.c
diff -u src/libexec/ftpd/pfilter.c:1.1 src/libexec/ftpd/pfilter.c:1.2
--- src/libexec/ftpd/pfilter.c:1.1	Sun Jan 25 15:53:49 2015
+++ src/libexec/ftpd/pfilter.c	Tue Jan 29 23:19:30 2019
@@ -1,4 +1,5 @@
 #include 
+#include 
 #include 
 
 #include "pfilter.h"
@@ -20,5 +21,5 @@ pfilter_notify(int what, const char *msg
 	if (blstate == NULL)
 		return;
 
-	blacklist_r(blstate, what, 0, msg);
+	blacklist_r(blstate, what, STDIN_FILENO, msg);
 }



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 23:14:48 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: ChangeLog

Log Message:
changes so far this year


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 othersrc/libexec/tnftpd/ChangeLog

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

Modified files:

Index: othersrc/libexec/tnftpd/ChangeLog
diff -u othersrc/libexec/tnftpd/ChangeLog:1.60 othersrc/libexec/tnftpd/ChangeLog:1.61
--- othersrc/libexec/tnftpd/ChangeLog:1.60	Mon Mar 25 04:29:01 2013
+++ othersrc/libexec/tnftpd/ChangeLog	Tue Jan 29 23:14:48 2019
@@ -1,4 +1,46 @@
-$NetBSD: ChangeLog,v 1.60 2013/03/25 04:29:01 lukem Exp $
+$NetBSD: ChangeLog,v 1.61 2019/01/29 23:14:48 lukem Exp $
+
+
+Tue Jan 29 23:12:52 UTC 2019	lukem
+
+	* Limit fnmatch(), fts(),  strsuftollx() recursion to avoid
+	  DoS attacks. From Maksymilian Arciemowicz.
+
+	* Improve glob():
+		* Switch from a recursive pattern matching algorithm to handle
+		  '*' to a backtracking one. Avoids DoS attacks with patterns
+		  "a*a*a*a*a*...b" matching against "...".
+		  See https://research.swtch.com/glob
+		* Bump the glob limits to 512KB for total string size and 64KB
+		  path entries. The old limits were too small for some
+		  important FTP use cases like a pkgsrc repository.
+
+	* Add --with-blacklist to enable support for NetBSD blacklist daemon.
+
+	* Save struct passwd.pw_class if it exists. Inspired by FreeBSD.
+
+	* Sync libnetbsd replacements with NetBSD:
+		* ANSI C, coding, style, copyright improvements.
+		* Fix fparseln() parsing issues.
+		* Fix fts() error handling issues.
+		* Improve strmode() to support S_IFDOOR.
+		* Fix strsuftollx() error message and base 10 handling.
+		* Provide explicit_memset() replacement.
+
+	* Update to NetBSD-ftpd as at 20190129:
+		* Fix violations of the sequence point rule.
+		* Add volatile for gcc 5.
+		* Check that stat and fstat succeed.
+		* Support blacklistd(8) hooks.
+		* Clear utmpx struct before writing it to wtmpx files.
+		* Fix directory stream leaks.
+		* Use explicit_memset(3) instead of memset(3) to clear password.
+		* Fix scope of variable. PR/50665.
+		* Ensure that closing socket exists. CID 603440.
+		* Add -f option to ftpd to stay in foreground with -D. PR/53221.
+		* Update version to "NetBSD-ftpd 20180428".
+
+	* Remove endorsment clause from some of my licenses.
 
 Mon Mar 25 03:51:20 UTC 2013	lukem
 



CVS commit: src/sys/arch/evbppc/obs405

2019-01-29 Thread David H. Gutteridge
Module Name:src
Committed By:   gutteridge
Date:   Tue Jan 29 22:59:03 UTC 2019

Modified Files:
src/sys/arch/evbppc/obs405: rbus_machdep.c

Log Message:
Fix typo in error message.


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

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

Modified files:

Index: src/sys/arch/evbppc/obs405/rbus_machdep.c
diff -u src/sys/arch/evbppc/obs405/rbus_machdep.c:1.9 src/sys/arch/evbppc/obs405/rbus_machdep.c:1.10
--- src/sys/arch/evbppc/obs405/rbus_machdep.c:1.9	Mon Apr  9 14:44:01 2012
+++ src/sys/arch/evbppc/obs405/rbus_machdep.c	Tue Jan 29 22:59:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbus_machdep.c,v 1.9 2012/04/09 14:44:01 kiyohara Exp $	*/
+/*	$NetBSD: rbus_machdep.c,v 1.10 2019/01/29 22:59:03 gutteridge Exp $	*/
 
 /*
  * Copyright (c) 2003
@@ -45,7 +45,7 @@
 #include "opt_pci.h"
 
 #ifndef PCI_NETBSD_CONFIGURE
-#error requird macro PCI_NETBSD_CONFIGURE
+#error requires macro PCI_NETBSD_CONFIGURE
 #endif
 
 #ifdef RBUS_DEBUG



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 22:39:11 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure: AM_PROG_AR is needed by newer automake


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 othersrc/libexec/tnftpd/configure.ac

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

Modified files:

Index: othersrc/libexec/tnftpd/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.42 othersrc/libexec/tnftpd/configure.ac:1.43
--- othersrc/libexec/tnftpd/configure.ac:1.42	Tue Jan 29 13:30:32 2019
+++ othersrc/libexec/tnftpd/configure.ac	Tue Jan 29 22:39:11 2019
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.42 2019/01/29 13:30:32 lukem Exp $
+# $NetBSD: configure.ac,v 1.43 2019/01/29 22:39:11 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
 Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.42 $])
+AC_REVISION([$Revision: 1.43 $])
 
 AS_SHELL_SANITIZE()
 
@@ -21,6 +21,7 @@ AC_CONFIG_LIBOBJ_DIR([libnetbsd])
 
 AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc silent-rules])
 AM_MAINTAINER_MODE()
+AM_PROG_AR()
 
 LT_PREREQ([2.4])
 LT_INIT()



CVS commit: src/tests/usr.bin/c++

2019-01-29 Thread Michał Górny
Module Name:src
Committed By:   mgorny
Date:   Tue Jan 29 20:07:03 UTC 2019

Modified Files:
src/tests/usr.bin/c++: Makefile asan_common.subr
t_ubsan_int_add_overflow.sh t_ubsan_int_divzero.sh
t_ubsan_int_neg_overflow.sh t_ubsan_int_sub_overflow.sh
t_ubsan_vla_out_of_bounds.sh
Added Files:
src/tests/usr.bin/c++: ubsan_common.subr

Log Message:
Move common UBSAN test case code into ubsan_common.subr

Reviewed by 


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/c++/Makefile
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/c++/asan_common.subr
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/c++/t_ubsan_int_add_overflow.sh \
src/tests/usr.bin/c++/t_ubsan_int_divzero.sh \
src/tests/usr.bin/c++/t_ubsan_int_neg_overflow.sh \
src/tests/usr.bin/c++/t_ubsan_int_sub_overflow.sh
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/c++/t_ubsan_vla_out_of_bounds.sh
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/c++/ubsan_common.subr

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

Modified files:

Index: src/tests/usr.bin/c++/Makefile
diff -u src/tests/usr.bin/c++/Makefile:1.10 src/tests/usr.bin/c++/Makefile:1.11
--- src/tests/usr.bin/c++/Makefile:1.10	Tue Jan 29 20:02:34 2019
+++ src/tests/usr.bin/c++/Makefile	Tue Jan 29 20:07:03 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2019/01/29 20:02:34 mgorny Exp $
+# $NetBSD: Makefile,v 1.11 2019/01/29 20:07:03 mgorny Exp $
 
 .include 
 
@@ -12,13 +12,16 @@ ASAN_TESTS+=	t_asan_off_by_one
 ASAN_TESTS+=	t_asan_poison
 ASAN_TESTS+=	t_asan_uaf
 
+UBSAN_TESTS=	#
+UBSAN_TESTS+=	t_ubsan_int_add_overflow
+UBSAN_TESTS+=	t_ubsan_int_neg_overflow
+UBSAN_TESTS+=	t_ubsan_vla_out_of_bounds
+UBSAN_TESTS+=	t_ubsan_int_sub_overflow
+UBSAN_TESTS+=	t_ubsan_int_divzero
+
 TESTS_SH=	#
 TESTS_SH+=	$(ASAN_TESTS)
-TESTS_SH+=	t_ubsan_int_add_overflow
-TESTS_SH+=	t_ubsan_int_sub_overflow
-TESTS_SH+=	t_ubsan_int_neg_overflow
-TESTS_SH+=	t_ubsan_int_divzero
-TESTS_SH+=	t_ubsan_vla_out_of_bounds
+TESTS_SH+=	$(UBSAN_TESTS)
 TESTS_SH+=	t_call_once
 TESTS_SH+=	t_call_once2
 TESTS_SH+=	t_cxxruntime
@@ -29,5 +32,8 @@ TESTS_SH+=	t_static_destructor
 .for test in ${ASAN_TESTS}
 TESTS_SH_SRC_${test}=	asan_common.subr ${test}.sh
 .endfor
+.for test in ${UBSAN_TESTS}
+TESTS_SH_SRC_${test}=	ubsan_common.subr ${test}.sh
+.endfor
 
 .include 

Index: src/tests/usr.bin/c++/asan_common.subr
diff -u src/tests/usr.bin/c++/asan_common.subr:1.1 src/tests/usr.bin/c++/asan_common.subr:1.2
--- src/tests/usr.bin/c++/asan_common.subr:1.1	Tue Jan 29 20:02:34 2019
+++ src/tests/usr.bin/c++/asan_common.subr	Tue Jan 29 20:07:03 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: asan_common.subr,v 1.1 2019/01/29 20:02:34 mgorny Exp $
+#	$NetBSD: asan_common.subr,v 1.2 2019/01/29 20:07:03 mgorny Exp $
 #
 # Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
 # All rights reserved.

Index: src/tests/usr.bin/c++/t_ubsan_int_add_overflow.sh
diff -u src/tests/usr.bin/c++/t_ubsan_int_add_overflow.sh:1.3 src/tests/usr.bin/c++/t_ubsan_int_add_overflow.sh:1.4
--- src/tests/usr.bin/c++/t_ubsan_int_add_overflow.sh:1.3	Mon Jul 16 07:27:26 2018
+++ src/tests/usr.bin/c++/t_ubsan_int_add_overflow.sh	Tue Jan 29 20:07:03 2019
@@ -1,4 +1,4 @@
-# Copyright (c) 2018 The NetBSD Foundation, Inc.
+# Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -26,172 +26,23 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-test_target()
-{
-	SUPPORT='n'
-	if ! echo __GNUC__ | c++ -E - | grep -q __GNUC__; then
-		SUPPORT='y'
-	fi
-
-	if ! echo __clang__ | c++ -E - | grep -q __clang__; then
-		SUPPORT='y'
-	fi
-}
-
-atf_test_case int_add_overflow
-int_add_overflow_head() {
-	atf_set "descr" "Test Undefined Behavior for int addition overflows"
-	atf_set "require.progs" "c++"
-}
-
-atf_test_case int_add_overflow_profile
-int_add_overflow_profile_head() {
-	atf_set "descr" "Test Undefined Behavior for int addition overflows with profiling option"
-	atf_set "require.progs" "c++"
-}
-atf_test_case int_add_overflow_pic
-int_add_overflow_pic_head() {
-	atf_set "descr" "Test Undefined Behavior for int addition overflows with position independent code (PIC) flag"
-	atf_set "require.progs" "c++"
-}
-atf_test_case int_add_overflow_pie
-int_add_overflow_pie_head() {
-	atf_set "descr" "Test Undefined Behavior for int addition overflows with position independent execution (PIE) flag"
-	atf_set "require.progs" "c++"
-}
-atf_test_case int_add_overflow32
-int_add_overflow32_head() {
-	atf_set "descr" "Test Undefined Behavior for int addition overflows in NetBSD_32 emulation"
-	atf_set "require.progs" "c++ file diff cat"
-}
-
-
-int_add_overflow_body(){
-	cat > test.c << EOF
-#include 
-#include 
-#include 
-int main(int argc, char **argv) {volatile int l = INT_MAX; l+=argc; return l;}
-EOF
-
-	c++ -fsanitize=undefined -o test test.c
-	atf_check -e 

CVS commit: src/tests/usr.bin/c++

2019-01-29 Thread Michał Górny
Module Name:src
Committed By:   mgorny
Date:   Tue Jan 29 20:02:34 UTC 2019

Modified Files:
src/tests/usr.bin/c++: Makefile t_asan_double_free.sh
t_asan_global_buffer_overflow.sh t_asan_heap_overflow.sh
t_asan_off_by_one.sh t_asan_poison.sh t_asan_uaf.sh
Added Files:
src/tests/usr.bin/c++: asan_common.subr

Log Message:
Move common ASAN test case code into asan_common.subr

Reviewed by 


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/usr.bin/c++/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/c++/asan_common.subr
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/c++/t_asan_double_free.sh \
src/tests/usr.bin/c++/t_asan_global_buffer_overflow.sh \
src/tests/usr.bin/c++/t_asan_heap_overflow.sh \
src/tests/usr.bin/c++/t_asan_off_by_one.sh \
src/tests/usr.bin/c++/t_asan_poison.sh \
src/tests/usr.bin/c++/t_asan_uaf.sh

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

Modified files:

Index: src/tests/usr.bin/c++/Makefile
diff -u src/tests/usr.bin/c++/Makefile:1.9 src/tests/usr.bin/c++/Makefile:1.10
--- src/tests/usr.bin/c++/Makefile:1.9	Wed May  2 18:46:05 2018
+++ src/tests/usr.bin/c++/Makefile	Tue Jan 29 20:02:34 2019
@@ -1,16 +1,19 @@
-# $NetBSD: Makefile,v 1.9 2018/05/02 18:46:05 kamil Exp $
+# $NetBSD: Makefile,v 1.10 2019/01/29 20:02:34 mgorny Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/usr.bin/c++
 
+ASAN_TESTS=	#
+ASAN_TESTS+=	t_asan_double_free
+ASAN_TESTS+=	t_asan_global_buffer_overflow
+ASAN_TESTS+=	t_asan_heap_overflow
+ASAN_TESTS+=	t_asan_off_by_one
+ASAN_TESTS+=	t_asan_poison
+ASAN_TESTS+=	t_asan_uaf
+
 TESTS_SH=	#
-TESTS_SH+=	t_asan_double_free
-TESTS_SH+=	t_asan_global_buffer_overflow
-TESTS_SH+=	t_asan_heap_overflow
-TESTS_SH+=	t_asan_off_by_one
-TESTS_SH+=	t_asan_poison
-TESTS_SH+=	t_asan_uaf
+TESTS_SH+=	$(ASAN_TESTS)
 TESTS_SH+=	t_ubsan_int_add_overflow
 TESTS_SH+=	t_ubsan_int_sub_overflow
 TESTS_SH+=	t_ubsan_int_neg_overflow
@@ -23,4 +26,8 @@ TESTS_SH+=	t_hello
 TESTS_SH+=	t_pthread_once
 TESTS_SH+=	t_static_destructor
 
+.for test in ${ASAN_TESTS}
+TESTS_SH_SRC_${test}=	asan_common.subr ${test}.sh
+.endfor
+
 .include 

Index: src/tests/usr.bin/c++/t_asan_double_free.sh
diff -u src/tests/usr.bin/c++/t_asan_double_free.sh:1.2 src/tests/usr.bin/c++/t_asan_double_free.sh:1.3
--- src/tests/usr.bin/c++/t_asan_double_free.sh:1.2	Mon Jul 16 07:27:26 2018
+++ src/tests/usr.bin/c++/t_asan_double_free.sh	Tue Jan 29 20:02:34 2019
@@ -1,6 +1,6 @@
-#	$NetBSD: t_asan_double_free.sh,v 1.2 2018/07/16 07:27:26 kamil Exp $
+#	$NetBSD: t_asan_double_free.sh,v 1.3 2019/01/29 20:02:34 mgorny Exp $
 #
-# Copyright (c) 2018 The NetBSD Foundation, Inc.
+# Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -28,185 +28,22 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-SUPPORT='n'
-test_target() {
-	if uname -m | grep -q "amd64"; then
-		SUPPORT='y'
-	fi
-
-	if uname -m | grep -q "i386"; then
-		SUPPORT='y'
-	fi
-}
-
-atf_test_case double_free
-double_free_head() {
-	atf_set "descr" "compile and run \"Double Free example\""
-	atf_set "require.progs" "c++ paxctl"
-}
-
-atf_test_case double_free_profile
-double_free_profile_head() {
-	atf_set "descr" "compile and run \"Double Free example\" with profiling option"
-	atf_set "require.progs" "c++ paxctl"
-}
-
-atf_test_case double_free_pic
-double_free_pic_head() {
-	atf_set "descr" "compile and run PIC \"Double Free example\""
-	atf_set "require.progs" "c++ paxctl"
-}
-
-atf_test_case double_free_pie
-double_free_pie_head() {
-	atf_set "descr" "compile and run position independent (PIE) \"Double Free example\""
-	atf_set "require.progs" "c++ paxctl"
-}
-
-atf_test_case double_free32
-double_free32_head() {
-	atf_set "descr" "compile and run \"Double Free example\" for/in netbsd32 emulation"
-	atf_set "require.progs" "c++ paxctl file diff cat"
-}
-
-atf_test_case target_not_supported
-target_not_supported_head()
-{
-	atf_set "descr" "Test forced skip"
-}
-
-double_free_body() {
-	cat > test.cpp << EOF
+ASAN_CODE='
 #include 
 #include 
 #include 
+void foo(int);
+#ifndef PIC_MAIN
 void foo(int index) { char *x = (char*)malloc(10 * sizeof(char)); memset(x, 0, 10); free(x); free(x - index); }
+#endif
+#ifndef PIC_FOO
 int main(int argc, char **argv) { foo(argc - 1); printf("CHECK\n"); exit(0); }
-EOF
-	c++ -fsanitize=address -o test test.cpp
-	paxctl +a test
-	atf_check -s not-exit:0 -o not-match:"CHECK\n" -e match:"double-free" ./test
-}
+#endif
+'
 
-double_free_profile_body() {
-	cat > test.cpp << EOF
-#include 
-#include 
-#include 
-void foo(int index) { char *x = (char*)malloc(10 * sizeof(char)); memset(x, 0, 10); free(x); free(x - index); }
-int main(int argc, char **argv) { foo(argc - 1); printf("CHECK\n"); exit(0); }
-EOF
-	c++ -fsanitize=address -o test -pg test.cpp
-	paxctl +a test
-	atf_check -s not-exit:0 -o 

CVS commit: src/tests/usr.bin/cc

2019-01-29 Thread Michał Górny
Module Name:src
Committed By:   mgorny
Date:   Tue Jan 29 19:59:10 UTC 2019

Modified Files:
src/tests/usr.bin/cc: Makefile t_ubsan_int_add_overflow.sh
t_ubsan_int_divzero.sh t_ubsan_int_neg_overflow.sh
t_ubsan_int_sub_overflow.sh t_ubsan_vla_out_of_bounds.sh
Added Files:
src/tests/usr.bin/cc: ubsan_common.subr

Log Message:
Move common UBSAN test case code into ubsan_common.subr

Reviewed by 


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/cc/Makefile
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/cc/t_ubsan_int_add_overflow.sh \
src/tests/usr.bin/cc/t_ubsan_int_divzero.sh \
src/tests/usr.bin/cc/t_ubsan_int_neg_overflow.sh \
src/tests/usr.bin/cc/t_ubsan_int_sub_overflow.sh
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/cc/t_ubsan_vla_out_of_bounds.sh
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/cc/ubsan_common.subr

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

Modified files:

Index: src/tests/usr.bin/cc/Makefile
diff -u src/tests/usr.bin/cc/Makefile:1.5 src/tests/usr.bin/cc/Makefile:1.6
--- src/tests/usr.bin/cc/Makefile:1.5	Tue Jan 29 19:56:37 2019
+++ src/tests/usr.bin/cc/Makefile	Tue Jan 29 19:59:10 2019
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2019/01/29 19:56:37 mgorny Exp $
+# $NetBSD: Makefile,v 1.6 2019/01/29 19:59:10 mgorny Exp $
 
 .include 
 
@@ -12,17 +12,23 @@ ASAN_TESTS+=	t_asan_off_by_one
 ASAN_TESTS+=	t_asan_poison
 ASAN_TESTS+=	t_asan_uaf
 
+UBSAN_TESTS=	#
+UBSAN_TESTS+=	t_ubsan_int_add_overflow
+UBSAN_TESTS+=	t_ubsan_int_neg_overflow
+UBSAN_TESTS+=	t_ubsan_vla_out_of_bounds
+UBSAN_TESTS+=	t_ubsan_int_sub_overflow
+UBSAN_TESTS+=	t_ubsan_int_divzero
+
 TESTS_SH=	#
 TESTS_SH+=	$(ASAN_TESTS)
-TESTS_SH+=	t_ubsan_int_add_overflow
-TESTS_SH+=	t_ubsan_int_sub_overflow
-TESTS_SH+=	t_ubsan_int_neg_overflow
-TESTS_SH+=	t_ubsan_int_divzero
-TESTS_SH+=	t_ubsan_vla_out_of_bounds
+TESTS_SH+=	$(UBSAN_TESTS)
 TESTS_SH+=	t_hello
 
 .for test in ${ASAN_TESTS}
 TESTS_SH_SRC_${test}=	asan_common.subr ${test}.sh
 .endfor
+.for test in ${UBSAN_TESTS}
+TESTS_SH_SRC_${test}=	ubsan_common.subr ${test}.sh
+.endfor
 
 .include 

Index: src/tests/usr.bin/cc/t_ubsan_int_add_overflow.sh
diff -u src/tests/usr.bin/cc/t_ubsan_int_add_overflow.sh:1.3 src/tests/usr.bin/cc/t_ubsan_int_add_overflow.sh:1.4
--- src/tests/usr.bin/cc/t_ubsan_int_add_overflow.sh:1.3	Mon Jul 16 07:25:58 2018
+++ src/tests/usr.bin/cc/t_ubsan_int_add_overflow.sh	Tue Jan 29 19:59:10 2019
@@ -1,4 +1,4 @@
-# Copyright (c) 2018 The NetBSD Foundation, Inc.
+# Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -26,172 +26,23 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-test_target()
-{
-	SUPPORT='n'
-	if ! echo __GNUC__ | cc -E - | grep -q __GNUC__; then
-		SUPPORT='y'
-	fi
-
-	if ! echo __clang__ | cc -E - | grep -q __clang__; then
-		SUPPORT='y'
-	fi
-}
-
-atf_test_case int_add_overflow
-int_add_overflow_head() {
-	atf_set "descr" "Test Undefined Behavior for int addition overflows"
-	atf_set "require.progs" "cc"
-}
-
-atf_test_case int_add_overflow_profile
-int_add_overflow_profile_head() {
-	atf_set "descr" "Test Undefined Behavior for int addition overflows with profiling option"
-	atf_set "require.progs" "cc"
-}
-atf_test_case int_add_overflow_pic
-int_add_overflow_pic_head() {
-	atf_set "descr" "Test Undefined Behavior for int addition overflows with position independent code (PIC) flag"
-	atf_set "require.progs" "cc"
-}
-atf_test_case int_add_overflow_pie
-int_add_overflow_pie_head() {
-	atf_set "descr" "Test Undefined Behavior for int addition overflows with position independent execution (PIE) flag"
-	atf_set "require.progs" "cc"
-}
-atf_test_case int_add_overflow32
-int_add_overflow32_head() {
-	atf_set "descr" "Test Undefined Behavior for int addition overflows in NetBSD_32 emulation"
-	atf_set "require.progs" "cc file diff cat"
-}
-
-
-int_add_overflow_body(){
-	cat > test.c << EOF
-#include 
-#include 
-#include 
-int main(int argc, char **argv) {volatile int l = INT_MAX; l+=argc; return l;}
-EOF
-
-	cc -fsanitize=undefined -o test test.c
-	atf_check -e match:"signed integer overflow" ./test
-}
-
-int_add_overflow_profile_body(){
-	cat > test.c << EOF
+UBSAN_CODE='
 #include 
 #include 
 #include 
-int main(int argc, char **argv) {volatile int l = INT_MAX; l+=argc; return l;}
-EOF
-
-	cc -fsanitize=undefined -o test -pg test.c
-	atf_check -e match:"signed integer overflow" ./test
-}
-
-int_add_overflow_pic_body(){
-	cat > test.c << EOF
-#include 
-#include 
 int help(int);
-int main(int argc, char **argv) {volatile int k = help(argc); return k;}
-EOF
-
-	cat > pic.c << EOF
-#include 
-#include 
-#include 
+#ifndef PIC_MAIN
 int help(int count) {volatile int l = INT_MAX; l+= count; return l;}
-EOF
-
-	cc -fsanitize=undefined -fPIC -shared -o libtest.so pic.c
-	cc -o test test.c 

CVS commit: src/tests/usr.bin/cc

2019-01-29 Thread Michał Górny
Module Name:src
Committed By:   mgorny
Date:   Tue Jan 29 19:56:38 UTC 2019

Modified Files:
src/tests/usr.bin/cc: Makefile t_asan_double_free.sh
t_asan_global_buffer_overflow.sh t_asan_heap_overflow.sh
t_asan_off_by_one.sh t_asan_poison.sh t_asan_uaf.sh
Added Files:
src/tests/usr.bin/cc: asan_common.subr

Log Message:
Move common ASAN test case code into asan_common.subr

Reviewed by 


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/cc/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/cc/asan_common.subr
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/cc/t_asan_double_free.sh \
src/tests/usr.bin/cc/t_asan_global_buffer_overflow.sh \
src/tests/usr.bin/cc/t_asan_heap_overflow.sh \
src/tests/usr.bin/cc/t_asan_off_by_one.sh \
src/tests/usr.bin/cc/t_asan_poison.sh src/tests/usr.bin/cc/t_asan_uaf.sh

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

Modified files:

Index: src/tests/usr.bin/cc/Makefile
diff -u src/tests/usr.bin/cc/Makefile:1.4 src/tests/usr.bin/cc/Makefile:1.5
--- src/tests/usr.bin/cc/Makefile:1.4	Wed May  2 18:46:05 2018
+++ src/tests/usr.bin/cc/Makefile	Tue Jan 29 19:56:37 2019
@@ -1,16 +1,19 @@
-# $NetBSD: Makefile,v 1.4 2018/05/02 18:46:05 kamil Exp $
+# $NetBSD: Makefile,v 1.5 2019/01/29 19:56:37 mgorny Exp $
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/usr.bin/cc
 
+ASAN_TESTS=	#
+ASAN_TESTS+=	t_asan_double_free
+ASAN_TESTS+=	t_asan_global_buffer_overflow
+ASAN_TESTS+=	t_asan_heap_overflow
+ASAN_TESTS+=	t_asan_off_by_one
+ASAN_TESTS+=	t_asan_poison
+ASAN_TESTS+=	t_asan_uaf
+
 TESTS_SH=	#
-TESTS_SH+=	t_asan_double_free
-TESTS_SH+=	t_asan_global_buffer_overflow
-TESTS_SH+=	t_asan_heap_overflow
-TESTS_SH+=	t_asan_off_by_one
-TESTS_SH+=	t_asan_poison
-TESTS_SH+=	t_asan_uaf
+TESTS_SH+=	$(ASAN_TESTS)
 TESTS_SH+=	t_ubsan_int_add_overflow
 TESTS_SH+=	t_ubsan_int_sub_overflow
 TESTS_SH+=	t_ubsan_int_neg_overflow
@@ -18,4 +21,8 @@ TESTS_SH+=	t_ubsan_int_divzero
 TESTS_SH+=	t_ubsan_vla_out_of_bounds
 TESTS_SH+=	t_hello
 
+.for test in ${ASAN_TESTS}
+TESTS_SH_SRC_${test}=	asan_common.subr ${test}.sh
+.endfor
+
 .include 

Index: src/tests/usr.bin/cc/t_asan_double_free.sh
diff -u src/tests/usr.bin/cc/t_asan_double_free.sh:1.2 src/tests/usr.bin/cc/t_asan_double_free.sh:1.3
--- src/tests/usr.bin/cc/t_asan_double_free.sh:1.2	Mon Jul 16 07:25:58 2018
+++ src/tests/usr.bin/cc/t_asan_double_free.sh	Tue Jan 29 19:56:37 2019
@@ -1,6 +1,6 @@
-#	$NetBSD: t_asan_double_free.sh,v 1.2 2018/07/16 07:25:58 kamil Exp $
+#	$NetBSD: t_asan_double_free.sh,v 1.3 2019/01/29 19:56:37 mgorny Exp $
 #
-# Copyright (c) 2018 The NetBSD Foundation, Inc.
+# Copyright (c) 2018, 2019 The NetBSD Foundation, Inc.
 # All rights reserved.
 #
 # This code is derived from software contributed to The NetBSD Foundation
@@ -28,184 +28,22 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-SUPPORT='n'
-test_target() {
-	if uname -m | grep -q "amd64"; then
-		SUPPORT='y'
-	fi
-
-	if uname -m | grep -q "i386"; then
-		SUPPORT='y'
-	fi
-}
-
-atf_test_case double_free
-double_free_head() {
-	atf_set "descr" "compile and run \"Double Free example\""
-	atf_set "require.progs" "cc paxctl"
-}
-
-atf_test_case double_free_profile
-double_free_profile_head() {
-	atf_set "descr" "compile and run \"Double Free example\" with profiling option"
-	atf_set "require.progs" "cc paxctl"
-}
-
-atf_test_case double_free_pic
-double_free_pic_head() {
-	atf_set "descr" "compile and run PIC \"Double Free example\""
-	atf_set "require.progs" "cc paxctl"
-}
-
-atf_test_case double_free_pie
-double_free_pie_head() {
-	atf_set "descr" "compile and run position independent (PIE) \"Double Free example\""
-	atf_set "require.progs" "cc paxctl"
-}
-
-atf_test_case double_free32
-double_free32_head() {
-	atf_set "descr" "compile and run \"Double Free example\" for/in netbsd32 emulation"
-	atf_set "require.progs" "cc paxctl file diff cat"
-}
-
-atf_test_case target_not_supported
-target_not_supported_head()
-{
-	atf_set "descr" "Test forced skip"
-}
-
-double_free_body() {
-	cat > test.c << EOF
-#include 
-#include 
-#include 
-void foo(int index) { char *x = (char*)malloc(10 * sizeof(char)); memset(x, 0, 10); free(x); free(x - index); }
-int main(int argc, char **argv) { foo(argc - 1); printf("CHECK\n"); exit(0); }
-EOF
-	cc -fsanitize=address -o test test.c
-	paxctl +a test
-	atf_check -s not-exit:0 -o not-match:"CHECK\n" -e match:"double-free" ./test
-}
-
-double_free_profile_body() {
-	cat > test.c << EOF
-#include 
-#include 
-#include 
-void foo(int index) { char *x = (char*)malloc(10 * sizeof(char)); memset(x, 0, 10); free(x); free(x - index); }
-int main(int argc, char **argv) { foo(argc - 1); printf("CHECK\n"); exit(0); }
-EOF
-	cc -fsanitize=address -o test -pg test.c
-	paxctl +a test
-	atf_check -s not-exit:0 -o not-match:"CHECK\n" -e match:"double-free" ./test
-}
-
-double_free_pic_body() {
-	cat > test.c << EOF
-#include 

CVS commit: src/sys/arch/ia64

2019-01-29 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Jan 29 19:44:03 UTC 2019

Modified Files:
src/sys/arch/ia64: TODO

Log Message:
add more items


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/ia64/TODO

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/ia64/TODO
diff -u src/sys/arch/ia64/TODO:1.2 src/sys/arch/ia64/TODO:1.3
--- src/sys/arch/ia64/TODO:1.2	Wed Nov 14 20:13:14 2018
+++ src/sys/arch/ia64/TODO	Tue Jan 29 19:44:03 2019
@@ -32,14 +32,14 @@ Tasks remaining, first couple seem most 
 - implement ld.elf_so, MK_DYNAMICROOT
 - fix memory detection, on real hardware doesn't find all memory
 - implement interrupts (sacpi & pci), can be mostly from freebsd?
-- MKLINT and MKGDB for ia64?
+- MKGDB for ia64
 - implement fp[gs]etsticky, [make|get|set|swap]context
 - floating point, fenv functions were imported from freebsd, but haven't been tested
 - implement core_machdep.c
 - implement __cloneS ptrace.S sbrk.S shmat.S
 - implement kvm_ia64.c
 - implement pmc (performance monitoring counters) for ia64 pmc registers
-- cpuctl
+- implement ia64 md code for cpuctl, intrctl as needed
 - optional(?) mutex.h/lock_stubs.S, mutex_enter()/mutex_exit() __HAVE_MUTEX_STUBS
mutex_spin_enter()/mutex_spin_exit() __HAVE_SPIN_MUTEX_STUBS
 - rwlock.h rw_enter(),rw_exit(),rw_tryenter() __HAVE_RW_STUBS, implemented already?
@@ -63,6 +63,7 @@ Tasks remaining, first couple seem most 
 - add ia32 emulation, port from freebsd
 - add rump stuff/MKRUMP
 - create install EFI/cdrom/netbsd
+- fix ski to run on other archs beside i386, or at least amd64
 
 Pie in the sky
 - Xen and itanium!



CVS commit: src/share/mk

2019-01-29 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Tue Jan 29 19:40:42 UTC 2019

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

Log Message:
remove "MKLINT.ia64=no" as default is no anyway, and should compile on 64 bit 
host now


To generate a diff of this commit:
cvs rdiff -u -r1.1095 -r1.1096 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.1095 src/share/mk/bsd.own.mk:1.1096
--- src/share/mk/bsd.own.mk:1.1095	Sat Jan 19 12:58:37 2019
+++ src/share/mk/bsd.own.mk	Tue Jan 29 19:40:42 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1095 2019/01/19 12:58:37 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1096 2019/01/29 19:40:42 scole Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -811,7 +811,6 @@ NOPROFILE=	# defined
 #
 # The ia64 port is incomplete.
 #
-MKLINT.ia64=	no
 MKGDB.ia64=	no
 
 #



CVS commit: othersrc/libexec/tnftpd/src

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 13:35:58 UTC 2019

Modified Files:
othersrc/libexec/tnftpd/src: tnftpd.manin

Log Message:
merge changes from ftpd.8 1.85 - 1.87


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/src/tnftpd.manin

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

Modified files:

Index: othersrc/libexec/tnftpd/src/tnftpd.manin
diff -u othersrc/libexec/tnftpd/src/tnftpd.manin:1.2 othersrc/libexec/tnftpd/src/tnftpd.manin:1.3
--- othersrc/libexec/tnftpd/src/tnftpd.manin:1.2	Mon Jan  4 01:10:43 2010
+++ othersrc/libexec/tnftpd/src/tnftpd.manin	Tue Jan 29 13:35:58 2019
@@ -1,5 +1,5 @@
-.\"	$NetBSD: tnftpd.manin,v 1.2 2010/01/04 01:10:43 lukem Exp $
-.\"	from	NetBSD: ftpd.8,v 1.85 2009/05/01 10:53:27 wiz Exp
+.\"	$NetBSD: tnftpd.manin,v 1.3 2019/01/29 13:35:58 lukem Exp $
++.\"	from	NetBSD: ftpd.8,v 1.87 2018/04/28 13:38:00 riastradh Exp 
 .\"
 .\" Copyright (c) 1997-2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -66,7 +66,7 @@
 Internet File Transfer Protocol server
 .Sh SYNOPSIS
 .Nm
-.Op Fl 46DdHlnQqrsUuWwX
+.Op Fl 46DdfHlnQqrsUuWwX
 .Op Fl a Ar anondir
 .Op Fl C Ar user Ns Op @ Ns Ar host
 .Op Fl c Ar confdir
@@ -155,6 +155,10 @@ for the
 .Dq "\&%E"
 escape sequence (see
 .Sx Display file escape sequences )
+.It Fl f
+Stops the
+.Fl D
+flag from detaching from the tty and going into the background.
 .It Fl H
 Equivalent to
 .Do
@@ -279,7 +283,7 @@ style
 .Pa xferlog
 file suitable for input into a third-party log analysis tool with a command
 similar to:
-.Dl "sed -ne 's/^.*xferlog: //p' /var/log/xferlog \*[Gt] wuxferlog"
+.Dl "sed -ne 's/^.*xferlog: //p' /var/log/xferlog > wuxferlog"
 .El
 .Pp
 The file



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 13:30:32 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: configure.ac
othersrc/libexec/tnftpd/src: ftpd.c

Log Message:
save passwd.pw_class if it exists

Add autoconf check for struct passwd.pw_class.
If pw_class is present, save it in sgetpwnam().
Inspired by FreeBSD head/libexec/ftpd/ftpd.c revision 261885.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.35 -r1.36 othersrc/libexec/tnftpd/src/ftpd.c

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

Modified files:

Index: othersrc/libexec/tnftpd/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.41 othersrc/libexec/tnftpd/configure.ac:1.42
--- othersrc/libexec/tnftpd/configure.ac:1.41	Tue Jan 29 13:06:14 2019
+++ othersrc/libexec/tnftpd/configure.ac	Tue Jan 29 13:30:32 2019
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.41 2019/01/29 13:06:14 lukem Exp $
+# $NetBSD: configure.ac,v 1.42 2019/01/29 13:30:32 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
 Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.41 $])
+AC_REVISION([$Revision: 1.42 $])
 
 AS_SHELL_SANITIZE()
 
@@ -243,7 +243,9 @@ AC_TYPE_SIZE_T()
 AC_STRUCT_TM()
 AC_CHECK_MEMBERS([struct sockaddr.sa_len, struct sockaddr_in.sin_len,
   DIR.dd_fd, DIR.__dd_fd, struct dirent.d_namlen,
-  struct passwd.pw_change, struct passwd.pw_expire],
+  struct passwd.pw_change,
+  struct passwd.pw_class,
+  struct passwd.pw_expire],
  [], [], [$accheck_includes])
 AC_CHECK_TYPES([in_port_t, sa_family_t, socklen_t, struct addrinfo],
[], [], [$accheck_includes])

Index: othersrc/libexec/tnftpd/src/ftpd.c
diff -u othersrc/libexec/tnftpd/src/ftpd.c:1.35 othersrc/libexec/tnftpd/src/ftpd.c:1.36
--- othersrc/libexec/tnftpd/src/ftpd.c:1.35	Tue Jan 29 12:14:46 2019
+++ othersrc/libexec/tnftpd/src/ftpd.c	Tue Jan 29 13:30:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftpd.c,v 1.35 2019/01/29 12:14:46 lukem Exp $	*/
+/*	$NetBSD: ftpd.c,v 1.36 2019/01/29 13:30:32 lukem Exp $	*/
 /*	from	NetBSD: ftpd.c,v 1.204 2018/04/28 13:38:00 riastradh Exp	*/
 
 /*
@@ -946,6 +946,9 @@ sgetpwnam(const char *name)
 		free((char *)save.pw_gecos);
 		free((char *)save.pw_dir);
 		free((char *)save.pw_shell);
+#if defined(HAVE_STRUCT_PASSWD_PW_CLASS)
+		free((char *)save.pw_class);
+#endif
 	}
 	save = *p;
 	save.pw_name = ftpd_strdup(p->pw_name);
@@ -953,6 +956,9 @@ sgetpwnam(const char *name)
 	save.pw_gecos = ftpd_strdup(p->pw_gecos);
 	save.pw_dir = ftpd_strdup(p->pw_dir);
 	save.pw_shell = ftpd_strdup(p->pw_shell);
+#if defined(HAVE_STRUCT_PASSWD_PW_CLASS)
+	save.pw_class = ftpd_strdup(p->pw_class);
+#endif
 	return ();
 }
 



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 13:06:14 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: configure.ac tnftpd.h
Added Files:
othersrc/libexec/tnftpd/libnetbsd: explicit_memset.c

Log Message:
provide explicit_memset() from NetBSD

Import NetBSD src/common/lib/libc/string/explicit_memset.c rev 1.4
for explicit_memset(3), because ftpcmd.y now uses that.

Add autoconf AC_REPLACE_FUNCS check for explicit_memset.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.36 -r1.37 othersrc/libexec/tnftpd/tnftpd.h
cvs rdiff -u -r0 -r1.1 othersrc/libexec/tnftpd/libnetbsd/explicit_memset.c

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

Modified files:

Index: othersrc/libexec/tnftpd/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.40 othersrc/libexec/tnftpd/configure.ac:1.41
--- othersrc/libexec/tnftpd/configure.ac:1.40	Tue Jan 29 12:51:38 2019
+++ othersrc/libexec/tnftpd/configure.ac	Tue Jan 29 13:06:14 2019
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.40 2019/01/29 12:51:38 lukem Exp $
+# $NetBSD: configure.ac,v 1.41 2019/01/29 13:06:14 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
 Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.40 $])
+AC_REVISION([$Revision: 1.41 $])
 
 AS_SHELL_SANITIZE()
 
@@ -274,7 +274,7 @@ AC_FUNC_CLOSEDIR_VOID()
 AC_FUNC_FORK()
 AC_FUNC_FSEEKO()
 AC_FUNC_STRCOLL()
-AC_REPLACE_FUNCS([daemon err fgetln fparseln \
+AC_REPLACE_FUNCS([daemon err explicit_memset fgetln fparseln \
   getaddrinfo getgrouplist getnameinfo getusershell \
   inet_net_pton inet_ntop inet_pton mkstemp \
   sl_init snprintf strdup strerror strsuftollx \

Index: othersrc/libexec/tnftpd/tnftpd.h
diff -u othersrc/libexec/tnftpd/tnftpd.h:1.36 othersrc/libexec/tnftpd/tnftpd.h:1.37
--- othersrc/libexec/tnftpd/tnftpd.h:1.36	Wed Jan 23 07:00:21 2019
+++ othersrc/libexec/tnftpd/tnftpd.h	Tue Jan 29 13:06:14 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: tnftpd.h,v 1.36 2019/01/23 07:00:21 lukem Exp $ */
+/* $NetBSD: tnftpd.h,v 1.37 2019/01/29 13:06:14 lukem Exp $ */
 
 #define	FTPD_VERSION	PACKAGE_STRING
 
@@ -420,6 +420,10 @@ void	warn(const char *, ...);
 void	warnx(const char *, ...);
 #endif
 
+#if !defined(HAVE_EXPLICIT_MEMSET)
+void	*explicit_memset(void *, int, size_t);
+#endif
+
 #if !defined(HAVE_FGETLN)
 char	*fgetln(FILE *, size_t *);
 #endif

Added files:

Index: othersrc/libexec/tnftpd/libnetbsd/explicit_memset.c
diff -u /dev/null othersrc/libexec/tnftpd/libnetbsd/explicit_memset.c:1.1
--- /dev/null	Tue Jan 29 13:06:14 2019
+++ othersrc/libexec/tnftpd/libnetbsd/explicit_memset.c	Tue Jan 29 13:06:14 2019
@@ -0,0 +1,37 @@
+/* $NetBSD: explicit_memset.c,v 1.1 2019/01/29 13:06:14 lukem Exp $ */
+/* from	NetBSD: explicit_memset.c,v 1.4 2014/06/24 16:39:39 drochner Exp */
+
+/*
+ * Written by Matthias Drochner .
+ * Public domain.
+ */
+
+#include "tnftpd.h"
+
+#if 0
+
+#if !defined(_KERNEL) && !defined(_STANDALONE)
+#include "namespace.h"
+#include 
+#ifdef __weak_alias
+__weak_alias(explicit_memset,_explicit_memset)
+#endif
+#define explicit_memset_impl __explicit_memset_impl
+#else
+#include 
+#endif
+
+#endif
+
+/*
+ * The use of a volatile pointer guarantees that the compiler
+ * will not optimise the call away.
+ */
+void *(* volatile explicit_memset_impl)(void *, int, size_t) = memset;
+
+void *
+explicit_memset(void *b, int c, size_t len)
+{
+
+	return (*explicit_memset_impl)(b, c, len);
+}



CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 12:51:38 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: Makefile.am configure.ac
othersrc/libexec/tnftpd/libnetbsd: Makefile.am
othersrc/libexec/tnftpd/ls: Makefile.am
othersrc/libexec/tnftpd/src: Makefile.am pfilter.c

Log Message:
implement --with-blacklist

Add --with-blacklist to enable NetBSD's blacklistd(8) support.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/Makefile.am
cvs rdiff -u -r1.39 -r1.40 othersrc/libexec/tnftpd/configure.ac
cvs rdiff -u -r1.3 -r1.4 othersrc/libexec/tnftpd/libnetbsd/Makefile.am
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/ls/Makefile.am
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/src/Makefile.am
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/libexec/tnftpd/src/pfilter.c

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

Modified files:

Index: othersrc/libexec/tnftpd/Makefile.am
diff -u othersrc/libexec/tnftpd/Makefile.am:1.3 othersrc/libexec/tnftpd/Makefile.am:1.4
--- othersrc/libexec/tnftpd/Makefile.am:1.3	Thu Mar 21 02:56:56 2013
+++ othersrc/libexec/tnftpd/Makefile.am	Tue Jan 29 12:51:38 2019
@@ -1,9 +1,11 @@
-## $NetBSD: Makefile.am,v 1.3 2013/03/21 02:56:56 lukem Exp $
+## $NetBSD: Makefile.am,v 1.4 2019/01/29 12:51:38 lukem Exp $
 
 ACLOCAL_AMFLAGS = -I buildaux
 
 SUBDIRS = examples libnetbsd ls src
 
-EXTRA_DIST = \
-	todo \
+noinst_HEADERS = \
 	tnftpd.h
+
+EXTRA_DIST = \
+	todo

Index: othersrc/libexec/tnftpd/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.39 othersrc/libexec/tnftpd/configure.ac:1.40
--- othersrc/libexec/tnftpd/configure.ac:1.39	Tue Jan 29 12:28:44 2019
+++ othersrc/libexec/tnftpd/configure.ac	Tue Jan 29 12:51:38 2019
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.39 2019/01/29 12:28:44 lukem Exp $
+# $NetBSD: configure.ac,v 1.40 2019/01/29 12:51:38 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
 Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.39 $])
+AC_REVISION([$Revision: 1.40 $])
 
 AS_SHELL_SANITIZE()
 
@@ -28,18 +28,28 @@ LT_INIT()
 #
 # Arguments for which features are included.
 #
+
 AC_ARG_ENABLE([ipv6],
   [AS_HELP_STRING([--enable-ipv6],
   [enable IPv6 support (if your OS supports it)
[default=enabled]])],
   [opt_ipv6=$enableval],
   [opt_ipv6=yes])
+
 AC_ARG_ENABLE([builtinls],
   [AS_HELP_STRING([--enable-builtinls],
   [enable built-in /bin/ls
[default=enabled]])],
   [opt_builtinls=$enableval],
   [opt_builtinls=yes])
+
+AC_ARG_WITH([blacklist],
+[AS_HELP_STRING([--with-blacklist],
+[enable support for NetBSD blacklist daemon
+ [default=auto]])],
+[],
+[with_blacklist=auto])
+
 AC_ARG_WITH([pam],
 [AS_HELP_STRING([--with-pam],
 [enable support for Pluggable Authentication
@@ -47,6 +57,7 @@ AC_ARG_WITH([pam],
  [default=auto]])],
 [],
 [with_pam=auto])
+
 AC_ARG_WITH([sia],
 [AS_HELP_STRING([--with-sia],
 [enable support for Tru64 Security Integration
@@ -54,6 +65,7 @@ AC_ARG_WITH([sia],
  [default=auto]])],
 [],
 [with_sia=auto])
+
 AC_ARG_WITH([skey],
 [AS_HELP_STRING([--with-skey],
 [enable support for S/Key authentication
@@ -77,6 +89,8 @@ AH_TEMPLATE([HAVE_PRINTF_LONG_LONG],
  *printf() supports %lld or %qd to print them.])
 AH_TEMPLATE([NO_INTERNAL_LS],
 [Define if not using in-built /bin/ls code.])
+AH_TEMPLATE([USE_BLACKLIST],
+[Define if using blacklist.])
 AH_TEMPLATE([USE_INET6],
 [Define if using IPv6 support.])
 AH_TEMPLATE([USE_PAM],
@@ -368,6 +382,22 @@ AS_IF([test "$ac_cv_have_decl_AI_NUMERIC
   AC_MSG_RESULT([no - using local version])],
  [AC_MSG_RESULT([using local version])])])
 
+# Check for blacklist.
+#
+AS_IF([test "$with_blacklist" != no],
+  [AC_MSG_NOTICE([--with-blacklist=$with_blacklist; checking for required blacklist features])
+   AC_CHECK_LIB([blacklist],
+[blacklist_open],
+[LIBS="-lblacklist $LIBS"
+ AC_DEFINE([USE_BLACKLIST], [1])
+ AC_MSG_NOTICE([enabling blacklist support])
+ with_blacklist=yes],
+[AS_IF([test "$with_blacklist" != auto],
+   [AC_MSG_FAILURE(
+[--with-blacklist was given, but blacklist_open() was not 

CVS commit: othersrc/libexec/tnftpd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 12:28:44 UTC 2019

Modified Files:
othersrc/libexec/tnftpd: configure.ac

Log Message:
configure.ac style tweaks

do not use contractions to avoid syntax highlight confusion


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 othersrc/libexec/tnftpd/configure.ac

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

Modified files:

Index: othersrc/libexec/tnftpd/configure.ac
diff -u othersrc/libexec/tnftpd/configure.ac:1.38 othersrc/libexec/tnftpd/configure.ac:1.39
--- othersrc/libexec/tnftpd/configure.ac:1.38	Mon Mar 25 03:52:48 2013
+++ othersrc/libexec/tnftpd/configure.ac	Tue Jan 29 12:28:44 2019
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.38 2013/03/25 03:52:48 lukem Exp $
+# $NetBSD: configure.ac,v 1.39 2019/01/29 12:28:44 lukem Exp $
 #
 # Process this file with autoconf to produce a configure script.
 
@@ -6,10 +6,10 @@ AC_INIT([tnftpd], [20130325], [lukem@Net
 AC_PREREQ([2.69])
 
 AC_COPYRIGHT([
-Copyright (c) 2001-2013 The NetBSD Foundation, Inc.
+Copyright (c) 2001-2019 The NetBSD Foundation, Inc.
 All rights reserved.
 ])
-AC_REVISION([$Revision: 1.38 $])
+AC_REVISION([$Revision: 1.39 $])
 
 AS_SHELL_SANITIZE()
 
@@ -285,7 +285,7 @@ have_dirfd_as_macro
 #
 AC_LIBOBJ([glob])
 
-# Replace fnmatch() if FNM_CASEFOLD isn't supported.
+# Replace fnmatch() if FNM_CASEFOLD is not supported.
 #
 AS_IF([test "$ac_cv_have_decl_FNM_CASEFOLD" != yes], [AC_LIBOBJ([fnmatch])])
 
@@ -295,7 +295,7 @@ AS_IF([test "$ac_cv_func_getusershell" =
 
 # We assume that if sprintf() supports %lld or %qd,
 # then all of *printf() does. If not, disable long long
-# support because we don't know how to display it.
+# support because we do not know how to display it.
 #
 AS_IF([test "$ac_cv_type_long_long_int" = yes],
   [AC_MSG_CHECKING([*printf() support for %lld])
@@ -335,9 +335,9 @@ int main() {
   [AC_MSG_RESULT([no])])])
 
 # Handle Darwin 7 having a poll() compatibility function,
-# and don't use it if it's emulated.
-# Be conservative, if we don't find one of poll.h or sys/poll.h,
-# don't attempt to use poll().
+# and do not use it if it is emulated.
+# Be conservative, if we do not find one of poll.h or sys/poll.h,
+# do not attempt to use poll().
 #
 AC_CHECK_TYPES([struct pollfd], [], [], [$accheck_includes])
 AC_CHECK_FUNC([poll],
@@ -358,7 +358,7 @@ AS_IF([test "$ac_cv_func_sl_init" = yes]
   AC_LIBOBJ([sl_init])],
  [AC_MSG_RESULT([unknown - cross-compiling])])])
 
-# Replace getaddrinfo() if missing or AI_NUMERICHOST isn't declared.
+# Replace getaddrinfo() if missing or AI_NUMERICHOST is not declared.
 #
 AC_MSG_CHECKING([whether getaddrinfo() is usuable])
 AS_IF([test "$ac_cv_have_decl_AI_NUMERICHOST" = yes],
@@ -380,13 +380,13 @@ AS_IF([test "$with_pam" != no],
   [AC_CHECK_HEADERS([pam/pam_appl.h],
 [],
 [AC_MSG_FAILURE(
-[--with-pam was given, but pam_appl.h wasn't found])])])
+[--with-pam was given, but pam_appl.h was not found])])])
  AC_DEFINE([USE_PAM], [1])
  AC_MSG_NOTICE([enabling PAM authentication])
  with_pam=yes],
 [AS_IF([test "$with_pam" != "auto"],
[AC_MSG_FAILURE(
-[--with-pam was given, but pam_start() wasn't found])])
+[--with-pam was given, but pam_start() was not found])])
  AC_MSG_NOTICE([disabling --with-pam])
  with_pam=no])])
 
@@ -400,7 +400,7 @@ AS_IF([test "$with_sia" != no],
   with_sia=yes],
  [AS_IF([test "$with_sia" != "auto"],
 [AC_MSG_FAILURE(
-[--with-sia was given, but sia_ses_init() wasn't found])])
+[--with-sia was given, but sia_ses_init() was not found])])
   AC_MSG_NOTICE([disabling --with-sia])
   with_sia=no])])
 
@@ -419,7 +419,7 @@ AS_IF([test "$with_skey" != no],
  with_skey=yes],
 [AS_IF([test "$with_skey" != auto],
[AC_MSG_FAILURE(
-[--with-skey was given, but skey_haskey() wasn't found])])
+[--with-skey was given, but skey_haskey() was not found])])
  AC_MSG_NOTICE([disabling --with-skey])
  with_skey=no])])
 



CVS commit: othersrc/libexec/tnftpd/src

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 12:26:47 UTC 2019

Modified Files:
othersrc/libexec/tnftpd/src: extern.h

Log Message:
minimize differences with NetBSD upstream


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 othersrc/libexec/tnftpd/src/extern.h

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

Modified files:

Index: othersrc/libexec/tnftpd/src/extern.h
diff -u othersrc/libexec/tnftpd/src/extern.h:1.17 othersrc/libexec/tnftpd/src/extern.h:1.18
--- othersrc/libexec/tnftpd/src/extern.h:1.17	Tue Jan 29 12:14:46 2019
+++ othersrc/libexec/tnftpd/src/extern.h	Tue Jan 29 12:26:47 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: extern.h,v 1.17 2019/01/29 12:14:46 lukem Exp $	*/
+/*	$NetBSD: extern.h,v 1.18 2019/01/29 12:26:47 lukem Exp $	*/
 /*	from	NetBSD: extern.h,v 1.64 2018/06/23 07:21:00 gson Exp	*/
 
 /*-
@@ -304,7 +304,7 @@ struct ftpclass {
 	LLT		 sendlowat;	/* SO_SNDLOWAT size */
 };
 
-extern void		ftp_loop(void);
+__dead extern void		ftp_loop(void);
 extern void		ftp_handle_line(char *);
 
 #ifndef	GLOBAL



CVS commit: othersrc/libexec/tnftpd/src

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 12:14:46 UTC 2019

Modified Files:
othersrc/libexec/tnftpd/src: cmds.c extern.h ftpcmd.y ftpd.c logwtmp.c
popen.c version.h

Log Message:
merge from NetBSD-20130321 to NetBSD-20190129


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 othersrc/libexec/tnftpd/src/cmds.c \
othersrc/libexec/tnftpd/src/extern.h othersrc/libexec/tnftpd/src/popen.c
cvs rdiff -u -r1.18 -r1.19 othersrc/libexec/tnftpd/src/ftpcmd.y
cvs rdiff -u -r1.34 -r1.35 othersrc/libexec/tnftpd/src/ftpd.c
cvs rdiff -u -r1.2 -r1.3 othersrc/libexec/tnftpd/src/logwtmp.c
cvs rdiff -u -r1.8 -r1.9 othersrc/libexec/tnftpd/src/version.h

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

Modified files:

Index: othersrc/libexec/tnftpd/src/cmds.c
diff -u othersrc/libexec/tnftpd/src/cmds.c:1.16 othersrc/libexec/tnftpd/src/cmds.c:1.17
--- othersrc/libexec/tnftpd/src/cmds.c:1.16	Thu Mar 21 01:01:56 2013
+++ othersrc/libexec/tnftpd/src/cmds.c	Tue Jan 29 12:14:46 2019
@@ -1,5 +1,5 @@
-/*	$NetBSD: cmds.c,v 1.16 2013/03/21 01:01:56 lukem Exp $	*/
-/*	from	NetBSD: cmds.c,v 1.31 2012/06/19 06:06:34 dholland Exp	*/
+/*	$NetBSD: cmds.c,v 1.17 2019/01/29 12:14:46 lukem Exp $	*/
+/*	from	NetBSD: cmds.c,v 1.35 2016/01/17 14:46:07 christos Exp	*/
 
 /*
  * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@
 
 #include 
 #ifndef lint
-__RCSID(" NetBSD: cmds.c,v 1.31 2012/06/19 06:06:34 dholland Exp  ");
+__RCSID(" NetBSD: cmds.c,v 1.35 2016/01/17 14:46:07 christos Exp  ");
 #endif /* not lint */
 
 #include 
@@ -256,8 +256,10 @@ mlsd(const char *path)
 		goto mlsdperror;
 
 	dout = dataconn("MLSD", (off_t)-1, "w");
-	if (dout == NULL)
+	if (dout == NULL) {
+		(void) closedir(dirp);
 		return;
+	}
 
 	memset(, 0, sizeof(f));
 	f.stat = 
@@ -605,7 +607,7 @@ static void
 fact_perm(const char *fact, FILE *fd, factelem *fe)
 {
 	int		rok, wok, xok, pdirwok;
-	struct stat	*pdir;
+	struct stat	*pdir, dir;
 
 	if (fe->stat->st_uid == geteuid()) {
 		rok = ((fe->stat->st_mode & S_IRUSR) != 0);
@@ -632,7 +634,6 @@ fact_perm(const char *fact, FILE *fd, fa
 	if (pdir == NULL && CURCLASS_FLAGS_ISSET(modify)) {
 		size_t		len;
 		char		realdir[MAXPATHLEN], *p;
-		struct stat	dir;
 
 		len = strlcpy(realdir, fe->path, sizeof(realdir));
 		if (len < sizeof(realdir) - 4) {
@@ -885,7 +886,7 @@ discover_path(char *last_path, const cha
 		cp = tp;
 		nomorelink = 1;
 		
-		while ((cp = strstr(++cp, "/")) != NULL) {
+		while ((cp = strstr(cp + 1, "/")) != NULL) {
 			sz1 = (unsigned long)cp - (unsigned long)tp;
 			if (sz1 > MAXPATHLEN)
 goto bad;
@@ -958,8 +959,8 @@ discover_path(char *last_path, const cha
 		tp[strlen(tp) - 1] = '\0';
 
 	/* check that the path is correct */
-	stat(tp, );
-	stat(".", );
+	if (stat(tp, ) == -1 || stat(".", ) == -1)
+		goto bad;
 	if ((st1.st_dev != st2.st_dev) || (st1.st_ino != st2.st_ino))
 		goto bad;
 
Index: othersrc/libexec/tnftpd/src/extern.h
diff -u othersrc/libexec/tnftpd/src/extern.h:1.16 othersrc/libexec/tnftpd/src/extern.h:1.17
--- othersrc/libexec/tnftpd/src/extern.h:1.16	Thu Mar 21 01:01:56 2013
+++ othersrc/libexec/tnftpd/src/extern.h	Tue Jan 29 12:14:46 2019
@@ -1,5 +1,5 @@
-/*	$NetBSD: extern.h,v 1.16 2013/03/21 01:01:56 lukem Exp $	*/
-/*	from	NetBSD: extern.h,v 1.62 2011/08/29 20:41:06 joerg Exp	*/
+/*	$NetBSD: extern.h,v 1.17 2019/01/29 12:14:46 lukem Exp $	*/
+/*	from	NetBSD: extern.h,v 1.64 2018/06/23 07:21:00 gson Exp	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -367,7 +367,7 @@ extern	struct tab	cmdtab[];
 
 #define	CPUTC(c, f)	do { \
 putc(c, f); total_bytes++; total_bytes_out++; \
-			} while (0);
+			} while (0)
 
 #define CURCLASSTYPE	curclass.type == CLASS_GUEST  ? "GUEST"  : \
 			curclass.type == CLASS_CHROOT ? "CHROOT" : \
Index: othersrc/libexec/tnftpd/src/popen.c
diff -u othersrc/libexec/tnftpd/src/popen.c:1.16 othersrc/libexec/tnftpd/src/popen.c:1.17
--- othersrc/libexec/tnftpd/src/popen.c:1.16	Sun Mar 21 11:07:37 2010
+++ othersrc/libexec/tnftpd/src/popen.c	Tue Jan 29 12:14:46 2019
@@ -1,5 +1,5 @@
-/*	$NetBSD: popen.c,v 1.16 2010/03/21 11:07:37 lukem Exp $	*/
-/*	from	NetBSD: popen.c,v 1.37 2010/03/20 18:23:30 christos Exp	*/
+/*	$NetBSD: popen.c,v 1.17 2019/01/29 12:14:46 lukem Exp $	*/
+/*	from	NetBSD: popen.c,v 1.38 2016/03/17 00:17:58 christos Exp	*/
 
 /*-
  * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
 #if 0
 static char sccsid[] = "@(#)popen.c	8.3 (Berkeley) 4/6/94";
 #else
-__RCSID(" NetBSD: popen.c,v 1.37 2010/03/20 18:23:30 christos Exp  ");
+__RCSID(" NetBSD: popen.c,v 1.38 2016/03/17 00:17:58 christos Exp  ");
 #endif
 #endif /* not lint */
 
@@ -114,7 +114,7 @@ extern int ls_main(int, char *[]);
 FILE *
 ftpd_popen(const char *ar

CVS import: othersrc/libexec/tnftpd/src

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 12:06:33 UTC 2019

Update of /cvsroot/othersrc/libexec/tnftpd/src
In directory ivanova.netbsd.org:/tmp/cvs-serv4616

Log Message:
Import NetBSD ftpd as at 20190129

Notable changes:
- Fix violations of the sequence point rule.
- Add volatile for gcc 5.
- Check that stat and fstat succeed.
- Support blacklistd(8) hooks.
- Clear utmpx struct before writing it to wtmpx files.
- Fix directory stream leaks.
- Use explicit_memset(3) instead of memset(3) to clear password.
- Fix scope of variable. PR misc/50665.
- Ensure that closing socket exists. CID 603440.
- Add -f option to ftpd to stay in foreground with -D. PR bin/53221.
- Update version to "NetBSD-ftpd 20180428".

Status:

Vendor Tag: NetBSD
Release Tags:   NetBSD-20190129

U othersrc/libexec/tnftpd/src/ftpd.conf.5
C othersrc/libexec/tnftpd/src/popen.c
C othersrc/libexec/tnftpd/src/ftpcmd.y
C othersrc/libexec/tnftpd/src/ftpd.c
C othersrc/libexec/tnftpd/src/extern.h
U othersrc/libexec/tnftpd/src/ftpusers.5
N othersrc/libexec/tnftpd/src/pfilter.c
C othersrc/libexec/tnftpd/src/version.h
U othersrc/libexec/tnftpd/src/pathnames.h
U othersrc/libexec/tnftpd/src/logutmp.c
N othersrc/libexec/tnftpd/src/pfilter.h
C othersrc/libexec/tnftpd/src/ftpd.8
C othersrc/libexec/tnftpd/src/Makefile
U othersrc/libexec/tnftpd/src/conf.c
C othersrc/libexec/tnftpd/src/logwtmp.c
C othersrc/libexec/tnftpd/src/cmds.c

9 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jNetBSD:yesterday -jNetBSD othersrc/libexec/tnftpd/src



CVS commit: src/sys/compat/ossaudio

2019-01-29 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Tue Jan 29 12:01:20 UTC 2019

Modified Files:
src/sys/compat/ossaudio: ossaudio.c

Log Message:
Revert a wrong OSS_SNDCTL_DSP_GETOSPACE part of rev1.70.
- 'fragments' is the number of full free blocks and should not be
  negative value.
- 'bytes' should not be rounded down.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/compat/ossaudio/ossaudio.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/compat/ossaudio/ossaudio.c
diff -u src/sys/compat/ossaudio/ossaudio.c:1.70 src/sys/compat/ossaudio/ossaudio.c:1.71
--- src/sys/compat/ossaudio/ossaudio.c:1.70	Fri Mar 24 14:32:29 2017
+++ src/sys/compat/ossaudio/ossaudio.c	Tue Jan 29 12:01:20 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.70 2017/03/24 14:32:29 nat Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.71 2019/01/29 12:01:20 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1997, 2008 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.70 2017/03/24 14:32:29 nat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ossaudio.c,v 1.71 2019/01/29 12:01:20 isaki Exp $");
 
 #include 
 #include 
@@ -619,11 +619,12 @@ oss_ioctl_audio(struct lwp *l, const str
 		}
 		setblocksize(fp, );
 		bufinfo.fragsize = tmpinfo.blocksize;
-		bufinfo.fragments = (tmpinfo.hiwat * tmpinfo.blocksize -
-		(tmpinfo.play.seek + tmpinfo.blocksize -1)) /
+		bufinfo.fragments = tmpinfo.hiwat -
+		(tmpinfo.play.seek + tmpinfo.blocksize - 1) /
 		tmpinfo.blocksize;
 		bufinfo.fragstotal = tmpinfo.hiwat;
-		bufinfo.bytes = bufinfo.fragments * tmpinfo.blocksize;
+		bufinfo.bytes =
+		tmpinfo.hiwat * tmpinfo.blocksize - tmpinfo.play.seek;
 		error = copyout(, SCARG(uap, data), sizeof bufinfo);
 		if (error) {
 			DPRINTF(("%s: SNDCTL_DSP_GETOSPACE = %d\n",



CVS commit: src/lib/libossaudio

2019-01-29 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Tue Jan 29 11:54:02 UTC 2019

Modified Files:
src/lib/libossaudio: ossaudio.c

Log Message:
Revert a wrong SNDCTL_DSP_GETOSPACE part of rev1.33.
- 'fragments' is the number of full free blocks and should not be
  negative value.
- 'bytes' should not be rounded down.
It makes mpv work correctly (fixes a second half of kern/53028).
Reviewed by mlelstv@


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/lib/libossaudio/ossaudio.c

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

Modified files:

Index: src/lib/libossaudio/ossaudio.c
diff -u src/lib/libossaudio/ossaudio.c:1.34 src/lib/libossaudio/ossaudio.c:1.35
--- src/lib/libossaudio/ossaudio.c:1.34	Wed Jan 23 00:08:06 2019
+++ src/lib/libossaudio/ossaudio.c	Tue Jan 29 11:54:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ossaudio.c,v 1.34 2019/01/23 00:08:06 mrg Exp $	*/
+/*	$NetBSD: ossaudio.c,v 1.35 2019/01/29 11:54:02 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: ossaudio.c,v 1.34 2019/01/23 00:08:06 mrg Exp $");
+__RCSID("$NetBSD: ossaudio.c,v 1.35 2019/01/29 11:54:02 isaki Exp $");
 
 /*
  * This is an OSS (Linux) sound API emulator.
@@ -411,11 +411,11 @@ audio_ioctl(int fd, unsigned long com, v
 			return retval;
 		setblocksize(fd, );
 		bufinfo.fragsize = tmpinfo.blocksize;
-		bufinfo.fragments = (tmpinfo.hiwat * tmpinfo.blocksize -
-		(tmpinfo.play.seek + tmpinfo.blocksize -1)) /
-		tmpinfo.blocksize;
+		bufinfo.fragments = tmpinfo.hiwat - (tmpinfo.play.seek
+		+ tmpinfo.blocksize - 1) / tmpinfo.blocksize;
 		bufinfo.fragstotal = tmpinfo.hiwat;
-		bufinfo.bytes = bufinfo.fragments * tmpinfo.blocksize;
+		bufinfo.bytes = tmpinfo.hiwat * tmpinfo.blocksize
+		- tmpinfo.play.seek;
 		*(struct audio_buf_info *)argp = bufinfo;
 		break;
 	case SNDCTL_DSP_GETISPACE:



CVS commit: src/libexec/ftpd

2019-01-29 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Tue Jan 29 11:51:05 UTC 2019

Modified Files:
src/libexec/ftpd: version.h

Log Message:
NetBSD-ftpd 20180428

Update version to "NetBSD-ftpd 20180428" for changes:
- Fix violations of the sequence point rule.
- Check that stat and fstat succeed.
- Support blacklistd(8) hooks.
- Clear utmpx struct before writing it to wtmpx files.
- Fix directory stream leaks.
- Use explicit_memset(3) instead of memset(3) to clear password.
- Fix scope of variable. PR misc/50665.
- Ensure that closing socket exists. CID 603440.
- Add -f option to ftpd to stay in foreground with -D. PR bin/53221.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/libexec/ftpd/version.h

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

Modified files:

Index: src/libexec/ftpd/version.h
diff -u src/libexec/ftpd/version.h:1.75 src/libexec/ftpd/version.h:1.76
--- src/libexec/ftpd/version.h:1.75	Thu Mar 21 00:17:26 2013
+++ src/libexec/ftpd/version.h	Tue Jan 29 11:51:05 2019
@@ -1,6 +1,6 @@
-/*	$NetBSD: version.h,v 1.75 2013/03/21 00:17:26 lukem Exp $	*/
+/*	$NetBSD: version.h,v 1.76 2019/01/29 11:51:05 lukem Exp $	*/
 /*-
- * Copyright (c) 1999-2013 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -29,5 +29,5 @@
  */
 
 #ifndef FTPD_VERSION
-#define	FTPD_VERSION	"NetBSD-ftpd 20110904"
+#define	FTPD_VERSION	"NetBSD-ftpd 20180428"
 #endif



CVS commit: othersrc/libexec/tnftpd/libnetbsd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 11:11:56 UTC 2019

Modified Files:
othersrc/libexec/tnftpd/libnetbsd: fnmatch.c fts_open.c glob.c
strmode.c strsuftollx.c

Log Message:
fix __RCSIDs back to escaped upstream versions


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/libnetbsd/fnmatch.c
cvs rdiff -u -r1.13 -r1.14 othersrc/libexec/tnftpd/libnetbsd/fts_open.c
cvs rdiff -u -r1.7 -r1.8 othersrc/libexec/tnftpd/libnetbsd/glob.c
cvs rdiff -u -r1.4 -r1.5 othersrc/libexec/tnftpd/libnetbsd/strmode.c
cvs rdiff -u -r1.6 -r1.7 othersrc/libexec/tnftpd/libnetbsd/strsuftollx.c

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

Modified files:

Index: othersrc/libexec/tnftpd/libnetbsd/fnmatch.c
diff -u othersrc/libexec/tnftpd/libnetbsd/fnmatch.c:1.5 othersrc/libexec/tnftpd/libnetbsd/fnmatch.c:1.6
--- othersrc/libexec/tnftpd/libnetbsd/fnmatch.c:1.5	Thu Jan 24 02:57:10 2019
+++ othersrc/libexec/tnftpd/libnetbsd/fnmatch.c	Tue Jan 29 11:11:56 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fnmatch.c,v 1.5 2019/01/24 02:57:10 lukem Exp $ */
+/* $NetBSD: fnmatch.c,v 1.6 2019/01/29 11:11:56 lukem Exp $ */
 /* from NetBSD: fnmatch.c,v 1.26 2014/10/12 22:32:33 christos Exp */
 
 /*
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)fnmatch.c	8.2 (Berkeley) 4/16/94";
 #else
-__RCSID("$NetBSD: fnmatch.c,v 1.5 2019/01/24 02:57:10 lukem Exp $");
+__RCSID(" NetBSD: fnmatch.c,v 1.26 2014/10/12 22:32:33 christos Exp ");
 #endif
 #endif /* LIBC_SCCS and not lint */
 

Index: othersrc/libexec/tnftpd/libnetbsd/fts_open.c
diff -u othersrc/libexec/tnftpd/libnetbsd/fts_open.c:1.13 othersrc/libexec/tnftpd/libnetbsd/fts_open.c:1.14
--- othersrc/libexec/tnftpd/libnetbsd/fts_open.c:1.13	Thu Jan 24 02:52:48 2019
+++ othersrc/libexec/tnftpd/libnetbsd/fts_open.c	Tue Jan 29 11:11:56 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: fts_open.c,v 1.13 2019/01/24 02:52:48 lukem Exp $ */
+/* $NetBSD: fts_open.c,v 1.14 2019/01/29 11:11:56 lukem Exp $ */
 /* from NetBSD: fts.c,v 1.49 2016/05/31 07:49:09 pgoyette Exp */
 
 /*-
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)fts.c	8.6 (Berkeley) 8/14/94";
 #else
-__RCSID("$NetBSD: fts_open.c,v 1.13 2019/01/24 02:52:48 lukem Exp $");
+__RCSID(" NetBSD: fts.c,v 1.49 2016/05/31 07:49:09 pgoyette Exp ");
 #endif
 #endif /* LIBC_SCCS and not lint */
 

Index: othersrc/libexec/tnftpd/libnetbsd/glob.c
diff -u othersrc/libexec/tnftpd/libnetbsd/glob.c:1.7 othersrc/libexec/tnftpd/libnetbsd/glob.c:1.8
--- othersrc/libexec/tnftpd/libnetbsd/glob.c:1.7	Thu Jan 24 04:25:23 2019
+++ othersrc/libexec/tnftpd/libnetbsd/glob.c	Tue Jan 29 11:11:56 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: glob.c,v 1.7 2019/01/24 04:25:23 lukem Exp $ */
+/* $NetBSD: glob.c,v 1.8 2019/01/29 11:11:56 lukem Exp $ */
 /* from: NetBSD: glob.c,v 1.38 2017/05/08 14:42:16 christos Exp */
 
 /*
@@ -40,7 +40,7 @@
 #if 0
 static char sccsid[] = "@(#)glob.c	8.3 (Berkeley) 10/13/93";
 #else
-__RCSID("$NetBSD: glob.c,v 1.7 2019/01/24 04:25:23 lukem Exp $");
+__RCSID(" NetBSD: glob.c,v 1.38 2017/05/08 14:42:16 christos Exp ");
 #endif
 #endif /* LIBC_SCCS and not lint */
 

Index: othersrc/libexec/tnftpd/libnetbsd/strmode.c
diff -u othersrc/libexec/tnftpd/libnetbsd/strmode.c:1.4 othersrc/libexec/tnftpd/libnetbsd/strmode.c:1.5
--- othersrc/libexec/tnftpd/libnetbsd/strmode.c:1.4	Tue Jan 29 07:57:17 2019
+++ othersrc/libexec/tnftpd/libnetbsd/strmode.c	Tue Jan 29 11:11:56 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: strmode.c,v 1.4 2019/01/29 07:57:17 lukem Exp $ */
+/* $NetBSD: strmode.c,v 1.5 2019/01/29 11:11:56 lukem Exp $ */
 /* from NetBSD: strmode.c,v 1.19 2012/06/25 22:32:46 abs Exp */
 
 /*-
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)strmode.c	8.3 (Berkeley) 8/15/94";
 #else
-__RCSID("$NetBSD: strmode.c,v 1.4 2019/01/29 07:57:17 lukem Exp $");
+__RCSID(" NetBSD: strmode.c,v 1.19 2012/06/25 22:32:46 abs Exp ");
 #endif
 #endif /* LIBC_SCCS and not lint */
 

Index: othersrc/libexec/tnftpd/libnetbsd/strsuftollx.c
diff -u othersrc/libexec/tnftpd/libnetbsd/strsuftollx.c:1.6 othersrc/libexec/tnftpd/libnetbsd/strsuftollx.c:1.7
--- othersrc/libexec/tnftpd/libnetbsd/strsuftollx.c:1.6	Tue Jan 29 08:25:50 2019
+++ othersrc/libexec/tnftpd/libnetbsd/strsuftollx.c	Tue Jan 29 11:11:56 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: strsuftollx.c,v 1.6 2019/01/29 08:25:50 lukem Exp $ */
+/* $NetBSD: strsuftollx.c,v 1.7 2019/01/29 11:11:56 lukem Exp $ */
 /* from NetBSD: strsuftoll.c,v 1.9 2011/10/22 22:08:47 christos Exp */
 
 /*-
@@ -73,7 +73,7 @@
 #include 
 
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strsuftollx.c,v 1.6 2019/01/29 08:25:50 lukem Exp $");
+__RCSID(" NetBSD: strsuftoll.c,v 1.9 2011/10/22 22:08:47 christos Exp ");
 #endif /* LIBC_SCCS and not lint */
 
 #ifdef _LIBC



CVS commit: src/sys

2019-01-29 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Jan 29 09:28:51 UTC 2019

Modified Files:
src/sys/compat/common: compat_sysv_50_mod.c ieee80211_20.c if_43.c
rtsock_14.c rtsock_50.c rtsock_70.c tty_43.c tty_60.c
uipc_usrreq_70.c usb_subr_30.c vfs_syscalls_10.c
src/sys/compat/netbsd32: netbsd32_compat_50.c netbsd32_kern_proc.c
src/sys/dev/raidframe: rf_compat50.c rf_compat80.c rf_netbsdkintf.c
src/sys/dev/usb: ugen.c uhid.c usb.c
src/sys/dev/wscons: wsevent.c wsevent_50.c
src/sys/fs/puffs: puffs_compat.c puffs_msgif.c
src/sys/kern: compat_stub.c kern_proc.c kern_rndq.c sysv_ipc.c tty.c
tty_ptm.c uipc_usrreq.c vfs_syscalls.c
src/sys/net: if.c rtsock.c rtsock_shared.c
src/sys/net80211: ieee80211_ioctl.c
src/sys/sys: compat_stub.h

Log Message:
Normalize all the compat hooks' names to the form

___hook

NFCI

XXX Note that although this introduces a change in the kernel-to-
XXX module interface, we are NOT bumping the kernel version number.
XXX We will bump the version number once the interface stabilizes.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/common/compat_sysv_50_mod.c \
src/sys/compat/common/uipc_usrreq_70.c \
src/sys/compat/common/usb_subr_30.c \
src/sys/compat/common/vfs_syscalls_10.c
cvs rdiff -u -r1.3 -r1.4 src/sys/compat/common/ieee80211_20.c \
src/sys/compat/common/rtsock_70.c
cvs rdiff -u -r1.18 -r1.19 src/sys/compat/common/if_43.c
cvs rdiff -u -r1.6 -r1.7 src/sys/compat/common/rtsock_14.c \
src/sys/compat/common/tty_60.c
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/common/rtsock_50.c
cvs rdiff -u -r1.32 -r1.33 src/sys/compat/common/tty_43.c
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/netbsd32/netbsd32_compat_50.c
cvs rdiff -u -r1.2 -r1.3 src/sys/compat/netbsd32/netbsd32_kern_proc.c
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/raidframe/rf_compat50.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/raidframe/rf_compat80.c
cvs rdiff -u -r1.359 -r1.360 src/sys/dev/raidframe/rf_netbsdkintf.c
cvs rdiff -u -r1.142 -r1.143 src/sys/dev/usb/ugen.c
cvs rdiff -u -r1.103 -r1.104 src/sys/dev/usb/uhid.c
cvs rdiff -u -r1.175 -r1.176 src/sys/dev/usb/usb.c
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/wscons/wsevent.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/wscons/wsevent_50.c
cvs rdiff -u -r1.5 -r1.6 src/sys/fs/puffs/puffs_compat.c
cvs rdiff -u -r1.102 -r1.103 src/sys/fs/puffs/puffs_msgif.c
cvs rdiff -u -r1.5 -r1.6 src/sys/kern/compat_stub.c
cvs rdiff -u -r1.225 -r1.226 src/sys/kern/kern_proc.c
cvs rdiff -u -r1.91 -r1.92 src/sys/kern/kern_rndq.c
cvs rdiff -u -r1.35 -r1.36 src/sys/kern/sysv_ipc.c
cvs rdiff -u -r1.279 -r1.280 src/sys/kern/tty.c
cvs rdiff -u -r1.38 -r1.39 src/sys/kern/tty_ptm.c
cvs rdiff -u -r1.188 -r1.189 src/sys/kern/uipc_usrreq.c
cvs rdiff -u -r1.519 -r1.520 src/sys/kern/vfs_syscalls.c
cvs rdiff -u -r1.444 -r1.445 src/sys/net/if.c
cvs rdiff -u -r1.245 -r1.246 src/sys/net/rtsock.c
cvs rdiff -u -r1.2 -r1.3 src/sys/net/rtsock_shared.c
cvs rdiff -u -r1.62 -r1.63 src/sys/net80211/ieee80211_ioctl.c
cvs rdiff -u -r1.7 -r1.8 src/sys/sys/compat_stub.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/compat/common/compat_sysv_50_mod.c
diff -u src/sys/compat/common/compat_sysv_50_mod.c:1.2 src/sys/compat/common/compat_sysv_50_mod.c:1.3
--- src/sys/compat/common/compat_sysv_50_mod.c:1.2	Sun Jan 27 02:08:39 2019
+++ src/sys/compat/common/compat_sysv_50_mod.c	Tue Jan 29 09:28:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_sysv_50_mod.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $	*/
+/*	$NetBSD: compat_sysv_50_mod.c,v 1.3 2019/01/29 09:28:50 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_sysv_50_mod.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_sysv_50_mod.c,v 1.3 2019/01/29 09:28:50 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -75,7 +75,7 @@ compat_sysv_50_modcmd(modcmd_t cmd, void
 		if (error != 0) {
 			break;
 		}
-		MODULE_SET_HOOK(sysvipc50_sysctl_hook, "sysv50",
+		MODULE_SET_HOOK(sysvipc_sysctl_50_hook, "sysv50",
 		sysctl_kern_sysvipc50);
 		break;
 
@@ -84,7 +84,7 @@ compat_sysv_50_modcmd(modcmd_t cmd, void
 		if (error != 0) {
 			break;
 		}
-		MODULE_UNSET_HOOK(sysvipc50_sysctl_hook);
+		MODULE_UNSET_HOOK(sysvipc_sysctl_50_hook);
 		break;
 
 	default:
Index: src/sys/compat/common/uipc_usrreq_70.c
diff -u src/sys/compat/common/uipc_usrreq_70.c:1.2 src/sys/compat/common/uipc_usrreq_70.c:1.3
--- src/sys/compat/common/uipc_usrreq_70.c:1.2	Sun Jan 27 02:08:39 2019
+++ src/sys/compat/common/uipc_usrreq_70.c	Tue Jan 29 09:28:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_usrreq_70.c,v 1.2 2019/01/27 02:08:39 pgoyette Exp $	*/
+/*	$NetBSD: uipc_usrreq_70.c,v 1.3 2019/01/29 09:28:50 pgoyette Exp 

CVS commit: src/sys/dev/pci

2019-01-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan 29 09:25:52 UTC 2019

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

Log Message:
 If the secondary bus is configured and the bus mastering is not enabled,
enable it. Suggested by thorpej@.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pci/ppb.c

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

Modified files:

Index: src/sys/dev/pci/ppb.c
diff -u src/sys/dev/pci/ppb.c:1.66 src/sys/dev/pci/ppb.c:1.67
--- src/sys/dev/pci/ppb.c:1.66	Mon Jan 28 04:09:51 2019
+++ src/sys/dev/pci/ppb.c	Tue Jan 29 09:25:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppb.c,v 1.66 2019/01/28 04:09:51 msaitoh Exp $	*/
+/*	$NetBSD: ppb.c,v 1.67 2019/01/29 09:25:52 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.66 2019/01/28 04:09:51 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppb.c,v 1.67 2019/01/29 09:25:52 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ppb.h"
@@ -222,6 +222,7 @@ ppbattach(device_t parent, device_t self
 	char intrbuf[PCI_INTRSTR_LEN];
 #endif
 	pcireg_t busdata, reg;
+	bool second_configured = false;
 
 	pci_aprint_devinfo(pa, NULL);
 
@@ -358,10 +359,72 @@ ppbattach(device_t parent, device_t self
 	}
 #endif /* PPB_USEINTR */
 
-	/* Enable bus master. */
-	reg = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
-	pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
-	reg | PCI_COMMAND_MASTER_ENABLE);
+	/* Configuration test */
+	if (PPB_BUSINFO_SECONDARY(busdata) != 0) {
+		uint32_t base, limit;
+
+		/* I/O region test */
+		reg = pci_conf_read(pc, pa->pa_tag, PCI_BRIDGE_STATIO_REG);
+		base = (reg & PCI_BRIDGE_STATIO_IOBASE_MASK) << 8;
+		limit = ((reg >> PCI_BRIDGE_STATIO_IOLIMIT_SHIFT)
+		& PCI_BRIDGE_STATIO_IOLIMIT_MASK) << 8;
+		limit |= 0x0fff;
+		if (PCI_BRIDGE_IO_32BITS(reg)) {
+			reg = pci_conf_read(pc, pa->pa_tag,
+			PCI_BRIDGE_IOHIGH_REG);
+			base |= ((reg >> PCI_BRIDGE_IOHIGH_BASE_SHIFT)
+			& 0x) << 16;
+			limit |= ((reg >> PCI_BRIDGE_IOHIGH_LIMIT_SHIFT)
+			& 0x) << 16;
+		}
+		if (base < limit) {
+			second_configured = true;
+			goto configure;
+		}
+
+		/* Non-prefetchable memory region test */
+		reg = pci_conf_read(pc, pa->pa_tag, PCI_BRIDGE_MEMORY_REG);
+		base = ((reg >> PCI_BRIDGE_MEMORY_BASE_SHIFT)
+		& PCI_BRIDGE_MEMORY_BASE_MASK) << 20;
+		limit = (((reg >> PCI_BRIDGE_MEMORY_LIMIT_SHIFT)
+		& PCI_BRIDGE_MEMORY_LIMIT_MASK) << 20) | 0x000f;
+		if (base < limit) {
+			second_configured = true;
+			goto configure;
+		}
+
+		/* Prefetchable memory region test */
+		reg = pci_conf_read(pc, pa->pa_tag,
+		PCI_BRIDGE_PREFETCHMEM_REG);
+		base = ((reg >> PCI_BRIDGE_PREFETCHMEM_BASE_SHIFT)
+		& PCI_BRIDGE_PREFETCHMEM_BASE_MASK) << 20;
+		limit = (((reg >> PCI_BRIDGE_PREFETCHMEM_LIMIT_SHIFT)
+			& PCI_BRIDGE_PREFETCHMEM_LIMIT_MASK) << 20) | 0x000f;
+		if (PCI_BRIDGE_PREFETCHMEM_64BITS(reg)) {
+			reg = pci_conf_read(pc, pa->pa_tag,
+			PCI_BRIDGE_IOHIGH_REG);
+			base |= (uint64_t)pci_conf_read(pc, pa->pa_tag,
+			PCI_BRIDGE_PREFETCHBASE32_REG) << 32;
+			limit |= (uint64_t)pci_conf_read(pc, pa->pa_tag,
+			PCI_BRIDGE_PREFETCHLIMIT32_REG) << 32;
+		}
+		if (base < limit) {
+			second_configured = true;
+			goto configure;
+		}
+	}
+
+configure:
+	/*
+	 * If the secondary bus is configured and the bus mastering is not
+	 * enabled, enable it.
+	 */
+	if (second_configured) {
+		reg = pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG);
+		if ((reg & PCI_COMMAND_MASTER_ENABLE) == 0)
+			pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
+			reg | PCI_COMMAND_MASTER_ENABLE);
+	}
 
 	if (!pmf_device_register(self, ppb_suspend, ppb_resume))
 		aprint_error_dev(self, "couldn't establish power handler\n");



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

2019-01-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan 29 08:32:36 UTC 2019

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

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.131 -r1.1.2.132 src/doc/CHANGES-7.0.3

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

Modified files:

Index: src/doc/CHANGES-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.131 src/doc/CHANGES-7.0.3:1.1.2.132
--- src/doc/CHANGES-7.0.3:1.1.2.131	Tue Jan 29 08:09:45 2019
+++ src/doc/CHANGES-7.0.3	Tue Jan 29 08:32:36 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.131 2019/01/29 08:09:45 msaitoh Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.132 2019/01/29 08:32:36 martin Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5704,6 +5704,6 @@ sys/netmpls/mpls_proto.c			1.32
 sys/netnatm/natm.cpatch
 
 	Fix memory leaks pointed out by Ilja Van Sprundel: all
-	sendoob() functions are expted to free both passed
+	sendoob() functions are expected to free both passed
 	mbuf chains.
 	[martin, ticket #1676]



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

2019-01-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan 29 08:32:01 UTC 2019

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

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.38 -r1.1.2.39 src/doc/CHANGES-7.1.3

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

Modified files:

Index: src/doc/CHANGES-7.1.3
diff -u src/doc/CHANGES-7.1.3:1.1.2.38 src/doc/CHANGES-7.1.3:1.1.2.39
--- src/doc/CHANGES-7.1.3:1.1.2.38	Tue Jan 29 08:13:06 2019
+++ src/doc/CHANGES-7.1.3	Tue Jan 29 08:32:01 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.3,v 1.1.2.38 2019/01/29 08:13:06 msaitoh Exp $
+# $NetBSD: CHANGES-7.1.3,v 1.1.2.39 2019/01/29 08:32:01 martin Exp $
 
 A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3
 release:
@@ -396,6 +396,6 @@ sys/netmpls/mpls_proto.c			1.32
 sys/netnatm/natm.cpatch
 
 	Fix memory leaks pointed out by Ilja Van Sprundel: all
-	sendoob() functions are expted to free both passed
+	sendoob() functions are expected to free both passed
 	mbuf chains.
 	[martin, ticket #1676]



CVS commit: [netbsd-7] src/doc

2019-01-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan 29 08:31:24 UTC 2019

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

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.36 -r1.1.2.37 src/doc/CHANGES-7.3

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

Modified files:

Index: src/doc/CHANGES-7.3
diff -u src/doc/CHANGES-7.3:1.1.2.36 src/doc/CHANGES-7.3:1.1.2.37
--- src/doc/CHANGES-7.3:1.1.2.36	Tue Jan 29 08:10:34 2019
+++ src/doc/CHANGES-7.3	Tue Jan 29 08:31:23 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.3,v 1.1.2.36 2019/01/29 08:10:34 msaitoh Exp $
+# $NetBSD: CHANGES-7.3,v 1.1.2.37 2019/01/29 08:31:23 martin Exp $
 
 A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3
 release:
@@ -415,6 +415,6 @@ sys/netmpls/mpls_proto.c			1.32
 sys/netnatm/natm.cpatch
 
 	Fix memory leaks pointed out by Ilja Van Sprundel: all
-	sendoob() functions are expted to free both passed
+	sendoob() functions are expected to free both passed
 	mbuf chains.
 	[martin, ticket #1676]



CVS commit: [netbsd-8] src/doc

2019-01-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Jan 29 08:29:52 UTC 2019

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

Log Message:
Fix typo


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

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

Modified files:

Index: src/doc/CHANGES-8.1
diff -u src/doc/CHANGES-8.1:1.1.2.97 src/doc/CHANGES-8.1:1.1.2.98
--- src/doc/CHANGES-8.1:1.1.2.97	Tue Jan 29 07:05:00 2019
+++ src/doc/CHANGES-8.1	Tue Jan 29 08:29:52 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.1,v 1.1.2.97 2019/01/29 07:05:00 msaitoh Exp $
+# $NetBSD: CHANGES-8.1,v 1.1.2.98 2019/01/29 08:29:52 martin Exp $
 
 A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1
 release:
@@ -2344,6 +2344,6 @@ sys/netmpls/mpls_proto.c			1.32
 sys/netnatm/natm.cpatch
 
 	Fix memory leaks pointed out by Ilja Van Sprundel: all
-	sendoob() functions are expted to free both passed
+	sendoob() functions are expected to free both passed
 	mbuf chains.
 	[martin, ticket #1175]



CVS commit: othersrc/libexec/tnftpd/libnetbsd

2019-01-29 Thread Luke Mewburn
Module Name:othersrc
Committed By:   lukem
Date:   Tue Jan 29 08:25:50 UTC 2019

Modified Files:
othersrc/libexec/tnftpd/libnetbsd: strsuftollx.c

Log Message:
sync to NetBSD strsuftoll.c 1.9

Update from NetBSD src/lib/libc/stdlib/strsuftoll.c 1.1 to 1.9.
Notable changes:
- Minimize changes from upstream NetBSD source
- 1.5: print max rather than min when number parsed is greater than max.
- 1.6: explicitly use base 10, to match comments and dd
- 1.9: Put a recursion limit to avoid DoS attacks (Maksymilian Arciemowicz).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 othersrc/libexec/tnftpd/libnetbsd/strsuftollx.c

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

Modified files:

Index: othersrc/libexec/tnftpd/libnetbsd/strsuftollx.c
diff -u othersrc/libexec/tnftpd/libnetbsd/strsuftollx.c:1.5 othersrc/libexec/tnftpd/libnetbsd/strsuftollx.c:1.6
--- othersrc/libexec/tnftpd/libnetbsd/strsuftollx.c:1.5	Sun Sep 21 16:35:25 2008
+++ othersrc/libexec/tnftpd/libnetbsd/strsuftollx.c	Tue Jan 29 08:25:50 2019
@@ -1,8 +1,8 @@
-/* $NetBSD: strsuftollx.c,v 1.5 2008/09/21 16:35:25 lukem Exp $ */
-/* from NetBSD: strsuftoll.c,v 1.1 2002/11/29 12:58:17 lukem Exp */
+/* $NetBSD: strsuftollx.c,v 1.6 2019/01/29 08:25:50 lukem Exp $ */
+/* from NetBSD: strsuftoll.c,v 1.9 2011/10/22 22:08:47 christos Exp */
 
 /*-
- * Copyright (c) 2001-2002 The NetBSD Foundation, Inc.
+ * Copyright (c) 2001-2002,2004 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -64,34 +64,110 @@
 
 #include "tnftpd.h"
 
+#if 0
+
+#if HAVE_NBTOOL_CONFIG_H
+#include "nbtool_config.h"
+#endif
+
+#include 
+
+#if defined(LIBC_SCCS) && !defined(lint)
+__RCSID("$NetBSD: strsuftollx.c,v 1.6 2019/01/29 08:25:50 lukem Exp $");
+#endif /* LIBC_SCCS and not lint */
+
+#ifdef _LIBC
+#include "namespace.h"
+#endif
+
+#endif
+
+#if !HAVE_STRSUFTOLL
+
+#if 0
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifdef _LIBC
+# ifdef __weak_alias
+__weak_alias(strsuftoll, _strsuftoll)
+__weak_alias(strsuftollx, _strsuftollx)
+# endif
+#endif /* LIBC */
+
+#endif
+
 /*
  * Convert an expression of the following forms to a (u)int64_t.
  * 	1) A positive decimal number.
  *	2) A positive decimal number followed by a b (mult by 512).
  *	3) A positive decimal number followed by a k (mult by 1024).
  *	4) A positive decimal number followed by a m (mult by 1048576).
- *	5) A positive decimal number followed by a w (mult by sizeof int)
- *	6) Two or more positive decimal numbers (with/without k,b or w).
+ *	5) A positive decimal number followed by a g (mult by 1073741824).
+ *	6) A positive decimal number followed by a t (mult by 1099511627776).
+ *	7) A positive decimal number followed by a w (mult by sizeof int)
+ *	8) Two or more positive decimal numbers (with/without k,b or w).
  *	   separated by x (also * for backwards compatibility), specifying
  *	   the product of the indicated values.
- * Returns the result upon successful conversion, or returns with 0
- * and sets ebuf to an appropriate error message.
+ * Returns the result upon successful conversion, or exits with an
+ * appropriate error.
+ * 
  */
+
+#if 0
+
 /* LONGLONG */
 long long
-strsuftollx(const char *desc, const char *val,
-long long min, long long max, char *ebuf, size_t ebuflen)
+strsuftoll(const char *desc, const char *val,
+long long min, long long max)
+{
+	long long result;
+	char	errbuf[100];
+
+	result = strsuftollx(desc, val, min, max, errbuf, sizeof(errbuf));
+	if (*errbuf != '\0')
+		errx(EXIT_FAILURE, "%s", errbuf);
+	return result;
+}
+
+#endif
+
+/*
+ * As strsuftoll(), but returns the error message into the provided buffer
+ * rather than exiting with it.
+ */
+/* LONGLONG */
+static long long
+__strsuftollx(const char *desc, const char *val,
+long long min, long long max, char *ebuf, size_t ebuflen, size_t depth)
 {
 	long long num, t;
 	char	*expr;
 
-	errno = 0;
-	ebuf[0] = '\0';
+	_DIAGASSERT(desc != NULL);
+	_DIAGASSERT(val != NULL);
+	_DIAGASSERT(ebuf != NULL);
+
+	if (depth > 16) {
+		snprintf(ebuf, ebuflen, "%s: Recursion limit exceeded", desc);
+		return 0;
+	}
 
 	while (isspace((unsigned char)*val))	/* Skip leading space */
 		val++;
 
-	num = strtoll(val, , 0);
+	errno = 0;
+	num = strtoll(val, , 10);
 	if (errno == ERANGE)
 		goto erange;			/* Overflow */
 
@@ -108,28 +184,28 @@ strsuftollx(const char *desc, const char
 		break;
 	case 'k':
 		t = num;
-		num *= 1024;			/* 1 kilobyte */
+		num *= 1024;			/* 1 kibibyte */
 		if (t > num)
 			goto erange;
 		++expr;
 		break;
 	case 'm':
 		t = num;
-		num *= 1048576;			/* 1 megabyte */
+		num *= 1048576;			/* 1 mebibyte */
 		if (t > num)
 			goto erange;
 		++expr;
 		break;
 	case 'g':
 		t = num;
-		num *= 1073741824;		/* 1 gigabyte */
+		num *= 1073741824;		/* 1 

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

2019-01-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan 29 08:13:06 UTC 2019

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

Log Message:
ticket #1676.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.37 -r1.1.2.38 src/doc/CHANGES-7.1.3

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

Modified files:

Index: src/doc/CHANGES-7.1.3
diff -u src/doc/CHANGES-7.1.3:1.1.2.37 src/doc/CHANGES-7.1.3:1.1.2.38
--- src/doc/CHANGES-7.1.3:1.1.2.37	Thu Jan 24 14:13:46 2019
+++ src/doc/CHANGES-7.1.3	Tue Jan 29 08:13:06 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.1.3,v 1.1.2.37 2019/01/24 14:13:46 martin Exp $
+# $NetBSD: CHANGES-7.1.3,v 1.1.2.38 2019/01/29 08:13:06 msaitoh Exp $
 
 A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3
 release:
@@ -383,3 +383,19 @@ sys/kern/kern_ntptime.c1.60
 	disclosure.
 	[maxv, ticket #1675]
 
+sys/net/link_proto.c1.37
+sys/netatalk/ddp_usrreq.c			1.72
+sys/netbt/hci_socket.c1.46
+sys/netbt/l2cap_socket.c			1.36
+sys/netbt/rfcomm_socket.c			1.38
+sys/netbt/sco_socket.c1.38
+sys/netinet/tcp_usrreq.c			1.223 via patch
+sys/netinet6/raw_ip6.c1.173
+sys/netinet6/udp6_usrreq.c			1.146
+sys/netmpls/mpls_proto.c			1.32
+sys/netnatm/natm.cpatch
+
+	Fix memory leaks pointed out by Ilja Van Sprundel: all
+	sendoob() functions are expted to free both passed
+	mbuf chains.
+	[martin, ticket #1676]



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

2019-01-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan 29 08:12:18 UTC 2019

Modified Files:
src/sys/net [netbsd-7-1]: link_proto.c
src/sys/netatalk [netbsd-7-1]: ddp_usrreq.c
src/sys/netbt [netbsd-7-1]: hci_socket.c l2cap_socket.c rfcomm_socket.c
sco_socket.c
src/sys/netinet [netbsd-7-1]: tcp_usrreq.c
src/sys/netinet6 [netbsd-7-1]: raw_ip6.c udp6_usrreq.c
src/sys/netmpls [netbsd-7-1]: mpls_proto.c
src/sys/netnatm [netbsd-7-1]: natm.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1676):
sys/net/link_proto.c1.37
sys/netatalk/ddp_usrreq.c   1.72
sys/netbt/hci_socket.c  1.46
sys/netbt/l2cap_socket.c1.36
sys/netbt/rfcomm_socket.c   1.38
sys/netbt/sco_socket.c  1.38
sys/netinet/tcp_usrreq.c1.223 via patch
sys/netinet6/raw_ip6.c  1.173
sys/netinet6/udp6_usrreq.c  1.146
sys/netmpls/mpls_proto.c1.32
sys/netnatm/natm.c  patch

Fix memory leaks pointed out by Ilja Van Sprundel: all
sendoob() functions are expted to free both passed
mbuf chains.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.10.1 src/sys/net/link_proto.c
cvs rdiff -u -r1.63 -r1.63.10.1 src/sys/netatalk/ddp_usrreq.c
cvs rdiff -u -r1.40 -r1.40.10.1 src/sys/netbt/hci_socket.c
cvs rdiff -u -r1.31 -r1.31.10.1 src/sys/netbt/l2cap_socket.c
cvs rdiff -u -r1.33 -r1.33.10.1 src/sys/netbt/rfcomm_socket.c \
src/sys/netbt/sco_socket.c
cvs rdiff -u -r1.200.2.2 -r1.200.2.2.6.1 src/sys/netinet/tcp_usrreq.c
cvs rdiff -u -r1.136.2.1.2.2 -r1.136.2.1.2.3 src/sys/netinet6/raw_ip6.c
cvs rdiff -u -r1.115 -r1.115.10.1 src/sys/netinet6/udp6_usrreq.c
cvs rdiff -u -r1.24 -r1.24.10.1 src/sys/netmpls/mpls_proto.c
cvs rdiff -u -r1.45 -r1.45.10.1 src/sys/netnatm/natm.c

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

Modified files:

Index: src/sys/net/link_proto.c
diff -u src/sys/net/link_proto.c:1.24 src/sys/net/link_proto.c:1.24.10.1
--- src/sys/net/link_proto.c:1.24	Sat Aug  9 05:33:01 2014
+++ src/sys/net/link_proto.c	Tue Jan 29 08:12:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: link_proto.c,v 1.24 2014/08/09 05:33:01 rtr Exp $	*/
+/*	$NetBSD: link_proto.c,v 1.24.10.1 2019/01/29 08:12:17 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.24 2014/08/09 05:33:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.24.10.1 2019/01/29 08:12:17 msaitoh Exp $");
 
 #include 
 #include 
@@ -389,6 +389,9 @@ link_sendoob(struct socket *so, struct m
 {
 	KASSERT(solocked(so));
 
+	m_freem(m);
+	m_freem(control);
+
 	return EOPNOTSUPP;
 }
 

Index: src/sys/netatalk/ddp_usrreq.c
diff -u src/sys/netatalk/ddp_usrreq.c:1.63 src/sys/netatalk/ddp_usrreq.c:1.63.10.1
--- src/sys/netatalk/ddp_usrreq.c:1.63	Sat Aug  9 05:33:01 2014
+++ src/sys/netatalk/ddp_usrreq.c	Tue Jan 29 08:12:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ddp_usrreq.c,v 1.63 2014/08/09 05:33:01 rtr Exp $	 */
+/*	$NetBSD: ddp_usrreq.c,v 1.63.10.1 2019/01/29 08:12:17 msaitoh Exp $	 */
 
 /*
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.63 2014/08/09 05:33:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.63.10.1 2019/01/29 08:12:17 msaitoh Exp $");
 
 #include "opt_mbuftrace.h"
 
@@ -581,8 +581,8 @@ ddp_sendoob(struct socket *so, struct mb
 {
 	KASSERT(solocked(so));
 
-	if (m)
-		m_freem(m);
+	m_freem(m);
+	m_freem(control);
 
 	return EOPNOTSUPP;
 }

Index: src/sys/netbt/hci_socket.c
diff -u src/sys/netbt/hci_socket.c:1.40 src/sys/netbt/hci_socket.c:1.40.10.1
--- src/sys/netbt/hci_socket.c:1.40	Sat Aug  9 05:33:01 2014
+++ src/sys/netbt/hci_socket.c	Tue Jan 29 08:12:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci_socket.c,v 1.40 2014/08/09 05:33:01 rtr Exp $	*/
+/*	$NetBSD: hci_socket.c,v 1.40.10.1 2019/01/29 08:12:17 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.40 2014/08/09 05:33:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.40.10.1 2019/01/29 08:12:17 msaitoh Exp $");
 
 /* load symbolic names */
 #ifdef BLUETOOTH_DEBUG
@@ -712,10 +712,8 @@ hci_sendoob(struct socket *so, struct mb
 {
 	KASSERT(solocked(so));
 
-	if (m)
-		m_freem(m);
-	if (control)
-		m_freem(control);
+	m_freem(m);
+	m_freem(control);
 
 	return EOPNOTSUPP;
 }

Index: src/sys/netbt/l2cap_socket.c
diff -u src/sys/netbt/l2cap_socket.c:1.31 src/sys/netbt/l2cap_socket.c:1.31.10.1
--- src/sys/netbt/l2cap_socket.c:1.31	Sat Aug  9 05:33:01 2014
+++ src/sys/netbt/l2cap_socket.c	Tue Jan 29 

CVS commit: [netbsd-7] src/doc

2019-01-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan 29 08:10:34 UTC 2019

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

Log Message:
 Remove garbage.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.35 -r1.1.2.36 src/doc/CHANGES-7.3

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

Modified files:

Index: src/doc/CHANGES-7.3
diff -u src/doc/CHANGES-7.3:1.1.2.35 src/doc/CHANGES-7.3:1.1.2.36
--- src/doc/CHANGES-7.3:1.1.2.35	Tue Jan 29 07:57:54 2019
+++ src/doc/CHANGES-7.3	Tue Jan 29 08:10:34 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.3,v 1.1.2.35 2019/01/29 07:57:54 msaitoh Exp $
+# $NetBSD: CHANGES-7.3,v 1.1.2.36 2019/01/29 08:10:34 msaitoh Exp $
 
 A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3
 release:
@@ -402,7 +402,6 @@ sys/kern/kern_ntptime.c1.60
 	disclosure.
 	[maxv, ticket #1675]
 
-Pull up following revision(s) (requested by martin in ticket #1676):
 sys/net/link_proto.c1.37
 sys/netatalk/ddp_usrreq.c			1.72
 sys/netbt/hci_socket.c1.46



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

2019-01-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan 29 08:09:45 UTC 2019

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

Log Message:
ticket #1676


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.130 -r1.1.2.131 src/doc/CHANGES-7.0.3

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

Modified files:

Index: src/doc/CHANGES-7.0.3
diff -u src/doc/CHANGES-7.0.3:1.1.2.130 src/doc/CHANGES-7.0.3:1.1.2.131
--- src/doc/CHANGES-7.0.3:1.1.2.130	Thu Jan 24 14:12:40 2019
+++ src/doc/CHANGES-7.0.3	Tue Jan 29 08:09:45 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-7.0.3,v 1.1.2.130 2019/01/24 14:12:40 martin Exp $
+# $NetBSD: CHANGES-7.0.3,v 1.1.2.131 2019/01/29 08:09:45 msaitoh Exp $
 
 A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3
 release:
@@ -5691,3 +5691,19 @@ sys/kern/kern_ntptime.c1.60
 	disclosure.
 	[maxv, ticket #1675]
 
+sys/net/link_proto.c1.37
+sys/netatalk/ddp_usrreq.c			1.72
+sys/netbt/hci_socket.c1.46
+sys/netbt/l2cap_socket.c			1.36
+sys/netbt/rfcomm_socket.c			1.38
+sys/netbt/sco_socket.c1.38
+sys/netinet/tcp_usrreq.c			1.223 via patch
+sys/netinet6/raw_ip6.c1.173
+sys/netinet6/udp6_usrreq.c			1.146
+sys/netmpls/mpls_proto.c			1.32
+sys/netnatm/natm.cpatch
+
+	Fix memory leaks pointed out by Ilja Van Sprundel: all
+	sendoob() functions are expted to free both passed
+	mbuf chains.
+	[martin, ticket #1676]



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

2019-01-29 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan 29 08:09:01 UTC 2019

Modified Files:
src/sys/net [netbsd-7-0]: link_proto.c
src/sys/netatalk [netbsd-7-0]: ddp_usrreq.c
src/sys/netbt [netbsd-7-0]: hci_socket.c l2cap_socket.c rfcomm_socket.c
sco_socket.c
src/sys/netinet [netbsd-7-0]: tcp_usrreq.c
src/sys/netinet6 [netbsd-7-0]: raw_ip6.c udp6_usrreq.c
src/sys/netmpls [netbsd-7-0]: mpls_proto.c
src/sys/netnatm [netbsd-7-0]: natm.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #1676):
sys/net/link_proto.c1.37
sys/netatalk/ddp_usrreq.c   1.72
sys/netbt/hci_socket.c  1.46
sys/netbt/l2cap_socket.c1.36
sys/netbt/rfcomm_socket.c   1.38
sys/netbt/sco_socket.c  1.38
sys/netinet/tcp_usrreq.c1.223 via patch
sys/netinet6/raw_ip6.c  1.173
sys/netinet6/udp6_usrreq.c  1.146
sys/netmpls/mpls_proto.c1.32
sys/netnatm/natm.c  patch

Fix memory leaks pointed out by Ilja Van Sprundel: all
sendoob() functions are expted to free both passed
mbuf chains.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.6.1 src/sys/net/link_proto.c
cvs rdiff -u -r1.63 -r1.63.6.1 src/sys/netatalk/ddp_usrreq.c
cvs rdiff -u -r1.40 -r1.40.6.1 src/sys/netbt/hci_socket.c
cvs rdiff -u -r1.31 -r1.31.6.1 src/sys/netbt/l2cap_socket.c
cvs rdiff -u -r1.33 -r1.33.6.1 src/sys/netbt/rfcomm_socket.c \
src/sys/netbt/sco_socket.c
cvs rdiff -u -r1.200.2.2 -r1.200.2.2.2.1 src/sys/netinet/tcp_usrreq.c
cvs rdiff -u -r1.136.6.2 -r1.136.6.3 src/sys/netinet6/raw_ip6.c
cvs rdiff -u -r1.115 -r1.115.6.1 src/sys/netinet6/udp6_usrreq.c
cvs rdiff -u -r1.24 -r1.24.6.1 src/sys/netmpls/mpls_proto.c
cvs rdiff -u -r1.45 -r1.45.6.1 src/sys/netnatm/natm.c

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

Modified files:

Index: src/sys/net/link_proto.c
diff -u src/sys/net/link_proto.c:1.24 src/sys/net/link_proto.c:1.24.6.1
--- src/sys/net/link_proto.c:1.24	Sat Aug  9 05:33:01 2014
+++ src/sys/net/link_proto.c	Tue Jan 29 08:09:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: link_proto.c,v 1.24 2014/08/09 05:33:01 rtr Exp $	*/
+/*	$NetBSD: link_proto.c,v 1.24.6.1 2019/01/29 08:09:00 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.24 2014/08/09 05:33:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.24.6.1 2019/01/29 08:09:00 msaitoh Exp $");
 
 #include 
 #include 
@@ -389,6 +389,9 @@ link_sendoob(struct socket *so, struct m
 {
 	KASSERT(solocked(so));
 
+	m_freem(m);
+	m_freem(control);
+
 	return EOPNOTSUPP;
 }
 

Index: src/sys/netatalk/ddp_usrreq.c
diff -u src/sys/netatalk/ddp_usrreq.c:1.63 src/sys/netatalk/ddp_usrreq.c:1.63.6.1
--- src/sys/netatalk/ddp_usrreq.c:1.63	Sat Aug  9 05:33:01 2014
+++ src/sys/netatalk/ddp_usrreq.c	Tue Jan 29 08:09:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ddp_usrreq.c,v 1.63 2014/08/09 05:33:01 rtr Exp $	 */
+/*	$NetBSD: ddp_usrreq.c,v 1.63.6.1 2019/01/29 08:09:00 msaitoh Exp $	 */
 
 /*
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.63 2014/08/09 05:33:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ddp_usrreq.c,v 1.63.6.1 2019/01/29 08:09:00 msaitoh Exp $");
 
 #include "opt_mbuftrace.h"
 
@@ -581,8 +581,8 @@ ddp_sendoob(struct socket *so, struct mb
 {
 	KASSERT(solocked(so));
 
-	if (m)
-		m_freem(m);
+	m_freem(m);
+	m_freem(control);
 
 	return EOPNOTSUPP;
 }

Index: src/sys/netbt/hci_socket.c
diff -u src/sys/netbt/hci_socket.c:1.40 src/sys/netbt/hci_socket.c:1.40.6.1
--- src/sys/netbt/hci_socket.c:1.40	Sat Aug  9 05:33:01 2014
+++ src/sys/netbt/hci_socket.c	Tue Jan 29 08:09:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hci_socket.c,v 1.40 2014/08/09 05:33:01 rtr Exp $	*/
+/*	$NetBSD: hci_socket.c,v 1.40.6.1 2019/01/29 08:09:00 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2005 Iain Hibbert.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.40 2014/08/09 05:33:01 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hci_socket.c,v 1.40.6.1 2019/01/29 08:09:00 msaitoh Exp $");
 
 /* load symbolic names */
 #ifdef BLUETOOTH_DEBUG
@@ -712,10 +712,8 @@ hci_sendoob(struct socket *so, struct mb
 {
 	KASSERT(solocked(so));
 
-	if (m)
-		m_freem(m);
-	if (control)
-		m_freem(control);
+	m_freem(m);
+	m_freem(control);
 
 	return EOPNOTSUPP;
 }

Index: src/sys/netbt/l2cap_socket.c
diff -u src/sys/netbt/l2cap_socket.c:1.31 src/sys/netbt/l2cap_socket.c:1.31.6.1
--- src/sys/netbt/l2cap_socket.c:1.31	Sat Aug  9 05:33:01 2014
+++ src/sys/netbt/l2cap_socket.c	Tue Jan 29 08:09:00 2019
@@ -1,4 +1,4 @@