CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 06:46:35 UTC 2019

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

Log Message:
missed commit should be paired with if_ure.c 1.20.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/if_urevar.h

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



CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 06:46:35 UTC 2019

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

Log Message:
missed commit should be paired with if_ure.c 1.20.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/usb/if_urevar.h

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

Modified files:

Index: src/sys/dev/usb/if_urevar.h
diff -u src/sys/dev/usb/if_urevar.h:1.4 src/sys/dev/usb/if_urevar.h:1.5
--- src/sys/dev/usb/if_urevar.h:1.4	Sun Aug  4 09:03:46 2019
+++ src/sys/dev/usb/if_urevar.h	Fri Aug  9 06:46:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urevar.h,v 1.4 2019/08/04 09:03:46 mrg Exp $	*/
+/*	$NetBSD: if_urevar.h,v 1.5 2019/08/09 06:46:35 mrg Exp $	*/
 
 /*	$OpenBSD: if_urereg.h,v 1.5 2018/11/02 21:32:30 jcs Exp $	*/
 /*-
@@ -79,19 +79,11 @@ struct ure_txpkt {
 #define URE_RX_LIST_CNT		4
 #endif
 
-struct ure_softc {
-	struct usbnet		ure_un;
-
-	u_int			ure_flags;
-#define	URE_FLAG_LINK		0x0001
+/* usbnet::un_flags values */
+#define	URE_FLAG_VER_4C00	0x0001
+#define	URE_FLAG_VER_4C10	0x0002
+#define	URE_FLAG_VER_5C00	0x0004
+#define	URE_FLAG_VER_5C10	0x0008
+#define	URE_FLAG_VER_5C20	0x0010
+#define	URE_FLAG_VER_5C30	0x0020
 #define	URE_FLAG_8152		0x1000	/* RTL8152 */
-
-	u_int			ure_chip;
-#define	URE_CHIP_VER_4C00	0x01
-#define	URE_CHIP_VER_4C10	0x02
-#define	URE_CHIP_VER_5C00	0x04
-#define	URE_CHIP_VER_5C10	0x08
-#define	URE_CHIP_VER_5C20	0x10
-#define	URE_CHIP_VER_5C30	0x20
-
-};



CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 06:44:42 UTC 2019

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

Log Message:
switch to usbnet as softc, using un_flags.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/usb/if_udav.c

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

Modified files:

Index: src/sys/dev/usb/if_udav.c
diff -u src/sys/dev/usb/if_udav.c:1.63 src/sys/dev/usb/if_udav.c:1.64
--- src/sys/dev/usb/if_udav.c:1.63	Fri Aug  9 01:17:33 2019
+++ src/sys/dev/usb/if_udav.c	Fri Aug  9 06:44:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_udav.c,v 1.63 2019/08/09 01:17:33 mrg Exp $	*/
+/*	$NetBSD: if_udav.c,v 1.64 2019/08/09 06:44:42 mrg Exp $	*/
 /*	$nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $	*/
 
 /*
@@ -45,7 +45,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.63 2019/08/09 01:17:33 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.64 2019/08/09 06:44:42 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -59,16 +59,11 @@ __KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 
 #include 
 #include 
 
-struct udav_softc {
-	struct usbnet		sc_un;
-	uint16_t		sc_flags;
-};
-
 /* Function declarations */
 int	udav_match(device_t, cfdata_t, void *);
 void	udav_attach(device_t, device_t, void *);
 
-CFATTACH_DECL_NEW(udav, sizeof(struct udav_softc), udav_match, udav_attach,
+CFATTACH_DECL_NEW(udav, sizeof(struct usbnet), udav_match, udav_attach,
 usbnet_detach, usbnet_activate);
 
 static void udav_chip_init(struct usbnet *);
@@ -87,15 +82,15 @@ static void udav_setiff(struct usbnet *)
 static void udav_setiff_locked(struct usbnet *);
 static void udav_reset(struct usbnet *);
 
-static int udav_csr_read(struct udav_softc *, int, void *, int);
-static int udav_csr_write(struct udav_softc *, int, void *, int);
-static int udav_csr_read1(struct udav_softc *, int);
-static int udav_csr_write1(struct udav_softc *, int, unsigned char);
+static int udav_csr_read(struct usbnet *, int, void *, int);
+static int udav_csr_write(struct usbnet *, int, void *, int);
+static int udav_csr_read1(struct usbnet *, int);
+static int udav_csr_write1(struct usbnet *, int, unsigned char);
 
 #if 0
-static int udav_mem_read(struct udav_softc *, int, void *, int);
-static int udav_mem_write(struct udav_softc *, int, void *, int);
-static int udav_mem_write1(struct udav_softc *, int, unsigned char);
+static int udav_mem_read(struct usbnet *, int, void *, int);
+static int udav_mem_write(struct usbnet *, int, void *, int);
+static int udav_mem_write1(struct usbnet *, int, unsigned char);
 #endif
 
 /* Macros */
@@ -108,11 +103,11 @@ int udavdebug = 10;
 #define DPRINTFN(n, x)
 #endif
 
-#define	UDAV_SETBIT(sc, reg, x)	\
-	udav_csr_write1(sc, reg, udav_csr_read1(sc, reg) | (x))
+#define	UDAV_SETBIT(un, reg, x)	\
+	udav_csr_write1(un, reg, udav_csr_read1(un, reg) | (x))
 
-#define	UDAV_CLRBIT(sc, reg, x)	\
-	udav_csr_write1(sc, reg, udav_csr_read1(sc, reg) & ~(x))
+#define	UDAV_CLRBIT(un, reg, x)	\
+	udav_csr_write1(un, reg, udav_csr_read1(un, reg) & ~(x))
 
 static const struct udav_type {
 	struct usb_devno udav_dev;
@@ -165,8 +160,7 @@ udav_match(device_t parent, cfdata_t mat
 void
 udav_attach(device_t parent, device_t self, void *aux)
 {
-	struct udav_softc *sc = device_private(self);
-	struct usbnet * const un = &sc->sc_un;
+	struct usbnet * const un = device_private(self);
 	struct usb_attach_arg *uaa = aux;
 	struct usbd_device *dev = uaa->uaa_device;
 	struct usbd_interface *iface;
@@ -176,9 +170,6 @@ udav_attach(device_t parent, device_t se
 	char *devinfop;
 	int i;
 
-	/* Switch to usbnet for device_private() */
-	self->dv_private = un;
-
 	aprint_naive("\n");
 	aprint_normal("\n");
 	devinfop = usbd_devinfo_alloc(dev, 0);
@@ -187,7 +178,7 @@ udav_attach(device_t parent, device_t se
 
 	un->un_dev = self;
 	un->un_udev = dev;
-	un->un_sc = sc;
+	un->un_sc = un;
 	un->un_ops = &udav_ops;
 
 	/* Move the device into the configured state. */
@@ -207,7 +198,7 @@ udav_attach(device_t parent, device_t se
 	}
 
 	un->un_iface = iface;
-	sc->sc_flags = udav_lookup(uaa->uaa_vendor,
+	un->un_flags = udav_lookup(uaa->uaa_vendor,
 	uaa->uaa_product)->udav_flags;
 
 	/* get interface descriptor */
@@ -252,14 +243,14 @@ udav_attach(device_t parent, device_t se
 
 	/* Get Ethernet Address */
 	usbnet_lock_mii(un);
-	err = udav_csr_read(sc, UDAV_PAR, un->un_eaddr, ETHER_ADDR_LEN);
+	err = udav_csr_read(un, UDAV_PAR, un->un_eaddr, ETHER_ADDR_LEN);
 	usbnet_unlock_mii(un);
 	if (err) {
 		aprint_error_dev(self, "read MAC address failed\n");
 		return;
 	}
 
-	bool have_mii = !ISSET(sc->sc_flags, UDAV_NO_PHY);
+	bool have_mii = !ISSET(un->un_flags, UDAV_NO_PHY);
 	if (!have_mii)
 		un->un_link = 1;
 
@@ -273,14 +264,11 @@ udav_attach(device_t parent, device_t se
 #if 0
 /* read memory */
 static int
-udav_mem_read(struct udav_softc *sc, int offset, void *buf, int len)
+udav_mem_read(struct usbn

CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 06:44:42 UTC 2019

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

Log Message:
switch to usbnet as softc, using un_flags.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/usb/if_udav.c

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



CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 06:38:39 UTC 2019

Modified Files:
src/sys/dev/usb: TODO files.usb if_urndis.c

Log Message:
switch urndis(4) to usbnet.  thanks to maya@ for testing and helping
fix the few issues in the conversion.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/usb/TODO
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/usb/files.usb
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/usb/if_urndis.c

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

Modified files:

Index: src/sys/dev/usb/TODO
diff -u src/sys/dev/usb/TODO:1.49 src/sys/dev/usb/TODO:1.50
--- src/sys/dev/usb/TODO:1.49	Fri Aug  9 02:56:51 2019
+++ src/sys/dev/usb/TODO	Fri Aug  9 06:38:39 2019
@@ -73,7 +73,7 @@ Factor out the common code from the Ethe
 	if_upl - patch available
 	if_ure - done
 	if_url - patch available
-	if_urndis - patch available, probably works
+	if_urndis - done
 
 Get rid of hcpriv.
 

Index: src/sys/dev/usb/files.usb
diff -u src/sys/dev/usb/files.usb:1.161 src/sys/dev/usb/files.usb:1.162
--- src/sys/dev/usb/files.usb:1.161	Wed Aug  7 19:21:48 2019
+++ src/sys/dev/usb/files.usb	Fri Aug  9 06:38:39 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.usb,v 1.161 2019/08/07 19:21:48 skrll Exp $
+#	$NetBSD: files.usb,v 1.162 2019/08/09 06:38:39 mrg Exp $
 #
 # Config file and device description for machine-independent USB code.
 # Included by ports that need it.  Ports that use it must provide
@@ -528,7 +528,7 @@ attach	uyurex at uhidbus
 file	dev/usb/uyurex.c		uyurex
 
 # Microsoft RNDIS
-device	urndis: arp, ether, ifnet
+device	urndis: arp, ether, ifnet, usbnet
 attach	urndis at usbifif
 file	dev/usb/if_urndis.c		urndis
 

Index: src/sys/dev/usb/if_urndis.c
diff -u src/sys/dev/usb/if_urndis.c:1.25 src/sys/dev/usb/if_urndis.c:1.26
--- src/sys/dev/usb/if_urndis.c:1.25	Thu Aug  8 18:03:40 2019
+++ src/sys/dev/usb/if_urndis.c	Fri Aug  9 06:38:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urndis.c,v 1.25 2019/08/08 18:03:40 mrg Exp $ */
+/*	$NetBSD: if_urndis.c,v 1.26 2019/08/09 06:38:39 mrg Exp $ */
 /*	$OpenBSD: if_urndis.c,v 1.31 2011/07/03 15:47:17 matthew Exp $ */
 
 /*
@@ -21,7 +21,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.25 2019/08/08 18:03:40 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.26 2019/08/09 06:38:39 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -29,28 +29,10 @@ __KERNEL_RCSID(0, "$NetBSD: if_urndis.c,
 
 #include 
 #include 
-#include 
-#include 
-#include 
 #include 
 #include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
+
+#include 
 #include 
 #include 
 
@@ -60,48 +42,16 @@ __KERNEL_RCSID(0, "$NetBSD: if_urndis.c,
 #define RNDIS_TX_LIST_CNT	1
 #define RNDIS_BUFSZ		1562
 
-struct urndis_softc;
-
-struct urndis_chain {
-	struct urndis_softc	*sc_softc;
-	struct usbd_xfer	*sc_xfer;
-	char			*sc_buf;
-	struct mbuf		*sc_mbuf;
-};
-
-struct urndis_cdata {
-	struct urndis_chain	sc_rx_chain[RNDIS_RX_LIST_CNT];
-	struct urndis_chain	sc_tx_chain[RNDIS_TX_LIST_CNT];
-	int			sc_tx_cnt;
-};
-
-#define GET_IFP(sc) (&(sc)->sc_ec.ec_if)
 struct urndis_softc {
-	device_t			sc_dev;
+	struct usbnet			sc_un;
 
-	charsc_attached;
-	intsc_dying;
-	struct ethercom			sc_ec;
+	intsc_ifaceno_ctl;
 
 	/* RNDIS device info */
 	uint32_t			sc_filter;
 	uint32_t			sc_maxppt;
 	uint32_t			sc_maxtsz;
 	uint32_t			sc_palign;
-
-	/* USB goo */
-	struct usbd_device *		sc_udev;
-	intsc_ifaceno_ctl;
-	struct usbd_interface *		sc_iface_ctl;
-	struct usbd_interface *		sc_iface_data;
-
-	struct timeval			sc_rx_notice;
-	intsc_bulkin_no;
-	struct usbd_pipe *		sc_bulkin_pipe;
-	intsc_bulkout_no;
-	struct usbd_pipe *		sc_bulkout_pipe;
-
-	struct urndis_cdata		sc_data;
 };
 
 #ifdef URNDIS_DEBUG
@@ -110,69 +60,45 @@ struct urndis_softc {
 #define DPRINTF(x)
 #endif
 
-#define DEVNAME(sc)	(device_xname(sc->sc_dev))
+#define DEVNAME(un)	(device_xname(un->un_dev))
 
 #define URNDIS_RESPONSE_LEN 0x400
 
-
-static int urndis_newbuf(struct urndis_softc *, struct urndis_chain *);
-
-static int urndis_ioctl(struct ifnet *, unsigned long, void *);
 #if 0
 static void urndis_watchdog(struct ifnet *);
 #endif
 
-static void urndis_start(struct ifnet *);
-static void urndis_rxeof(struct usbd_xfer *, void *, usbd_status);
-static void urndis_txeof(struct usbd_xfer *, void *, usbd_status);
-static int urndis_rx_list_init(struct urndis_softc *);
-static int urndis_tx_list_init(struct urndis_softc *);
-
 static int urndis_init(struct ifnet *);
-static void urndis_stop(struct ifnet *);
+static void urndis_rx_loop(struct usbnet *, struct usbd_xfer *,
+			   struct usbnet_chain *, uint32_t);
+static unsigned urndis_tx_prepare(struct usbnet *, struct mbuf *,
+  struct usbnet_chain *);
+
+static int urndis_init_un(struct ifnet *, struct usbnet *);
 
-static usbd_status 

CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 06:38:39 UTC 2019

Modified Files:
src/sys/dev/usb: TODO files.usb if_urndis.c

Log Message:
switch urndis(4) to usbnet.  thanks to maya@ for testing and helping
fix the few issues in the conversion.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/usb/TODO
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/usb/files.usb
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/usb/if_urndis.c

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



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

2019-08-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  9 06:27:21 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: cikd.h evergreend.h nid.h
radeon_mode.h radeon_reg.h radeon_si_smc.c radeon_uvd_v1_0.c
radeon_uvd_v2_2.c radeon_uvd_v4_2.c sid.h

Log Message:
 Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/drm/radeon/cikd.h \
src/sys/external/bsd/drm2/dist/drm/radeon/evergreend.h \
src/sys/external/bsd/drm2/dist/drm/radeon/nid.h \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_reg.h \
src/sys/external/bsd/drm2/dist/drm/radeon/sid.h
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_mode.h
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_si_smc.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v2_2.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v4_2.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/cikd.h
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/cikd.h:1.2 src/sys/external/bsd/drm2/dist/drm/radeon/cikd.h:1.3
--- src/sys/external/bsd/drm2/dist/drm/radeon/cikd.h:1.2	Mon Aug 27 04:58:35 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/cikd.h	Fri Aug  9 06:27:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cikd.h,v 1.2 2018/08/27 04:58:35 riastradh Exp $	*/
+/*	$NetBSD: cikd.h,v 1.3 2019/08/09 06:27:21 msaitoh Exp $	*/
 
 /*
  * Copyright 2012 Advanced Micro Devices, Inc.
@@ -809,7 +809,7 @@
 #   define IH_WPTR_WRITEBACK_ENABLE   (1 << 8)
 #   define IH_WPTR_WRITEBACK_TIMER(x) ((x) << 9) /* log2 */
 #   define IH_WPTR_OVERFLOW_ENABLE(1 << 16)
-#   define IH_WPTR_OVERFLOW_CLEAR (1 << 31)
+#   define IH_WPTR_OVERFLOW_CLEAR (1U << 31)
 #define IH_RB_BASE0x3e04
 #define IH_RB_RPTR0x3e08
 #define IH_RB_WPTR0x3e0c
@@ -1308,7 +1308,7 @@
 #define		RB_BLKSZ(x)	((x) << 8)
 #define		BUF_SWAP_32BIT	(2 << 16)
 #define		RB_NO_UPDATE	(1 << 27)
-#define		RB_RPTR_WR_ENA	(1 << 31)
+#define		RB_RPTR_WR_ENA	(1U << 31)
 
 #define	CP_RB0_RPTR_ADDR0xC10C
 #define		RB_RPTR_SWAP_32BIT(2 << 0)
@@ -1357,7 +1357,7 @@
 #define CP_CPF_DEBUG0xC200
 
 #define CP_PQ_WPTR_POLL_CNTL0xC20C
-#define		WPTR_POLL_EN  			(1 << 31)
+#define		WPTR_POLL_EN  			(1U << 31)
 
 #define CP_ME1_PIPE0_INT_CNTL   0xC214
 #define CP_ME1_PIPE1_INT_CNTL   0xC218
@@ -1518,7 +1518,7 @@
 #define		DOORBELL_SOURCE  			(1 << 28)
 #define		DOORBELL_SCHD_HIT  			(1 << 29)
 #define		DOORBELL_EN  			(1 << 30)
-#define		DOORBELL_HIT  			(1 << 31)
+#define		DOORBELL_HIT  			(1U << 31)
 #define CP_HQD_PQ_WPTR0xC954
 #define CP_HQD_PQ_CONTROL 0xC958
 #define		QUEUE_SIZE(x)((x) << 0)
@@ -1530,7 +1530,7 @@
 #define		UNORD_DISPATCH  			(1 << 28)
 #define		ROQ_PQ_IB_FLIP  			(1 << 29)
 #define		PRIV_STATE  			(1 << 30)
-#define		KMD_QUEUE  (1 << 31)
+#define		KMD_QUEUE  (1U << 31)
 
 #define CP_HQD_IB_BASE_ADDR0xC95Cu
 #define CP_HQD_IB_BASE_ADDR_HI			0xC960u
@@ -1634,7 +1634,7 @@
 #define		SE_INDEX(x) 			((x) << 16)
 #define		SH_BROADCAST_WRITES  		(1 << 29)
 #define		INSTANCE_BROADCAST_WRITES  		(1 << 30)
-#define		SE_BROADCAST_WRITES  		(1 << 31)
+#define		SE_BROADCAST_WRITES  		(1U << 31)
 
 #define	VGT_ESGS_RING_SIZE0x30900
 #define	VGT_GSVS_RING_SIZE0x30904
@@ -1661,8 +1661,8 @@
 #define		CGTS_OVERRIDE(1 << 21)
 #define		CGTS_LS_OVERRIDE			(1 << 22)
 #define		ON_MONITOR_ADD_EN			(1 << 23)
-#define		ON_MONITOR_ADD(x)			((x) << 24)
-#define		ON_MONITOR_ADD_MASK			(0xff << 24)
+#define		ON_MONITOR_ADD(x)			((uint32_t)(x) << 24)
+#define		ON_MONITOR_ADD_MASK			(0xffU << 24)
 
 #define	CGTS_TCC_DISABLE0x3c00c
 #define	CGTS_USER_TCC_DISABLE0x3c010
@@ -1674,10 +1674,10 @@
 /*
  * PM4
  */
-#define	PACKET_TYPE0	0
-#define	PACKET_TYPE1	1
-#define	PACKET_TYPE2	2
-#define	PACKET_TYPE3	3
+#define	PACKET_TYPE0	0U
+#define	PACKET_TYPE1	1U
+#define	PACKET_TYPE2	2U
+#define	PACKET_TYPE3	3U
 
 #define CP_PACKET_GET_TYPE(h) (((h) >> 30) & 3)
 #define CP_PACKET_GET_COUNT(h) (((h) >> 16) & 0x3FFF)
Index: src/sys/external/bsd/drm2/dist/drm/radeon/evergreend.h
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/evergreend.h:1.2 src/sys/external/bsd/drm2/dist/drm/radeon/evergreend.h:1.3
--- src/sys/external/

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

2019-08-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  9 06:27:21 UTC 2019

Modified Files:
src/sys/external/bsd/drm2/dist/drm/radeon: cikd.h evergreend.h nid.h
radeon_mode.h radeon_reg.h radeon_si_smc.c radeon_uvd_v1_0.c
radeon_uvd_v2_2.c radeon_uvd_v4_2.c sid.h

Log Message:
 Use unsigned to avoid undefined behavior. Found by kUBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/drm2/dist/drm/radeon/cikd.h \
src/sys/external/bsd/drm2/dist/drm/radeon/evergreend.h \
src/sys/external/bsd/drm2/dist/drm/radeon/nid.h \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_reg.h \
src/sys/external/bsd/drm2/dist/drm/radeon/sid.h
cvs rdiff -u -r1.4 -r1.5 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_mode.h
cvs rdiff -u -r1.1 -r1.2 \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_si_smc.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v1_0.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v2_2.c \
src/sys/external/bsd/drm2/dist/drm/radeon/radeon_uvd_v4_2.c

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



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  9 06:21:01 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #33):
usr.sbin/sysinst/disks.c: revision 1.50
Do not even consider to fsck partitions where we do not know the file
system type. Add v7fs support.


To generate a diff of this commit:
cvs rdiff -u -r1.44.2.5 -r1.44.2.6 src/usr.sbin/sysinst/disks.c

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

Modified files:

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.44.2.5 src/usr.sbin/sysinst/disks.c:1.44.2.6
--- src/usr.sbin/sysinst/disks.c:1.44.2.5	Fri Aug  9 06:20:12 2019
+++ src/usr.sbin/sysinst/disks.c	Fri Aug  9 06:21:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.5 2019/08/09 06:20:12 msaitoh Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.6 2019/08/09 06:21:00 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1121,6 +1121,8 @@ make_filesystems(struct install_partitio
 		 */
 		ptn = &install->infos[i];
 		parts = ptn->parts;
+		newfs = NULL;
+		fsname = NULL;
 
 		if (ptn->size == 0 || parts == NULL|| ptn->type == PT_swap)
 			continue;			
@@ -1136,7 +1138,6 @@ make_filesystems(struct install_partitio
 		parts->pscheme->get_part_device(parts, ptn->cur_part_id,
 		rdev, sizeof rdev, &partno, raw_dev_name, true);
 
-		newfs = NULL;
 		switch (ptn->fs_type) {
 		case FS_APPLEUFS:
 			asprintf(&newfs, "/sbin/newfs");
@@ -1168,6 +1169,11 @@ make_filesystems(struct install_partitio
 			mnt_opts = "-tsysvbfs";
 			fsname = "sysvbfs";
 			break;
+		case FS_V7:
+			asprintf(&newfs, "/sbin/newfs_v7fs");
+			mnt_opts = "-tv7fs";
+			fsname = "v7fs";
+			break;
 		case FS_EX2FS:
 			asprintf(&newfs, "/sbin/newfs_ext2fs");
 			mnt_opts = "-text2fs";
@@ -1192,7 +1198,8 @@ make_filesystems(struct install_partitio
 error = run_program(RUN_DISPLAY | RUN_PROGRESS,
 			"%s %s", newfs, rdev);
 			}
-		} else if (ptn->instflags & (PUIINST_MOUNT|PUIINST_BOOT)) {
+		} else if ((ptn->instflags & (PUIINST_MOUNT|PUIINST_BOOT))
+		&& fsname != NULL) {
 			/* We'd better check it isn't dirty */
 			error = fsck_preen(devdev, fsname, false);
 		}



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  9 06:21:01 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #33):
usr.sbin/sysinst/disks.c: revision 1.50
Do not even consider to fsck partitions where we do not know the file
system type. Add v7fs support.


To generate a diff of this commit:
cvs rdiff -u -r1.44.2.5 -r1.44.2.6 src/usr.sbin/sysinst/disks.c

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



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  9 06:20:12 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #32):
usr.sbin/sysinst/disks.c: revision 1.49
Do not try to fsck partitions we are never going to mount.
Found by Andreas Gustafsson's baremetal test bed.


To generate a diff of this commit:
cvs rdiff -u -r1.44.2.4 -r1.44.2.5 src/usr.sbin/sysinst/disks.c

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



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-08-08 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug  9 06:20:12 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: disks.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #32):
usr.sbin/sysinst/disks.c: revision 1.49
Do not try to fsck partitions we are never going to mount.
Found by Andreas Gustafsson's baremetal test bed.


To generate a diff of this commit:
cvs rdiff -u -r1.44.2.4 -r1.44.2.5 src/usr.sbin/sysinst/disks.c

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

Modified files:

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.44.2.4 src/usr.sbin/sysinst/disks.c:1.44.2.5
--- src/usr.sbin/sysinst/disks.c:1.44.2.4	Thu Aug  8 05:53:03 2019
+++ src/usr.sbin/sysinst/disks.c	Fri Aug  9 06:20:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.44.2.4 2019/08/08 05:53:03 msaitoh Exp $ */
+/*	$NetBSD: disks.c,v 1.44.2.5 2019/08/09 06:20:12 msaitoh Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1192,7 +1192,7 @@ make_filesystems(struct install_partitio
 error = run_program(RUN_DISPLAY | RUN_PROGRESS,
 			"%s %s", newfs, rdev);
 			}
-		} else {
+		} else if (ptn->instflags & (PUIINST_MOUNT|PUIINST_BOOT)) {
 			/* We'd better check it isn't dirty */
 			error = fsck_preen(devdev, fsname, false);
 		}



Re: CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-08 Thread maya
On Thu, Aug 08, 2019 at 08:22:21PM +0200, Martin Husemann wrote:
> On Thu, Aug 08, 2019 at 09:13:37PM +0300, Andreas Gustafsson wrote:
> > The image already has an empty /usr/libdata/debug.  The increase in
> > size when MKDEBUG is enabled is spread out over various other
> > directories, notably /usr/lib.  For example,
> > 
> >   /usr/lib  405182 kB -> 866276 kB
> >   /usr/bin   53426 kB ->  63140 kB
> > 
> > The largest file in /usr/lib is libstdc++_pic.a, which grows from
> > 4.3 MB to 27 MB.
> 
> Heh - nice, didn't think about that.
> 
> How about: remove all *.a files from those images?
> Is there a tool to strip CTF from binaries?
> 
> Martin

I guess not a lot of people use the amd64 .img files as an alternate
sysinst for remote setups. where you reboot to rescue, dd it to disk,
then reboot to a complete netbsd install.


re: CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-08 Thread matthew green
> Other libraries also have _pic.a files that are much larger than the
> others versions.  Is there a bug that causes them not to be CTF-converted,
> or is this deliberate?

the _pic.a libraries are special case we could choose to stop
shipping.  they're useful if someone wants to build a special
case application for some reason (tm), but almost never used
by the vast majority of people.

they're created as part of create the .so, and the .so has
its debug info moved out, but apparently we've never created
any makefile or sets infrastructure to do this for _pic.a.

perhaps we should choose not to install them by default.

you can turn it off already with MKPICINSTALL=no.


.mrg.


re: CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-08 Thread matthew green
Martin Husemann writes:
> On Thu, Aug 08, 2019 at 09:13:37PM +0300, Andreas Gustafsson wrote:
> > The image already has an empty /usr/libdata/debug.  The increase in
> > size when MKDEBUG is enabled is spread out over various other
> > directories, notably /usr/lib.  For example,
> > 
> >   /usr/lib  405182 kB -> 866276 kB
> >   /usr/bin   53426 kB ->  63140 kB
> > 
> > The largest file in /usr/lib is libstdc++_pic.a, which grows from
> > 4.3 MB to 27 MB.
> 
> Heh - nice, didn't think about that.
> 
> How about: remove all *.a files from those images?

start with *_pic.a? :)

those are really rarely used, even on normal installs.


.mrg.


CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 02:56:51 UTC 2019

Modified Files:
src/sys/dev/usb: TODO

Log Message:
update ethernet driver notes: mark udav as done, and every thing
except umb(4) as patch available, with urndis probably working
(need to test the latest change before being commited.)

still need testers for:  aue, cue, kue, mue, upl and url.
no umb patch yet.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/usb/TODO

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



CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 02:56:51 UTC 2019

Modified Files:
src/sys/dev/usb: TODO

Log Message:
update ethernet driver notes: mark udav as done, and every thing
except umb(4) as patch available, with urndis probably working
(need to test the latest change before being commited.)

still need testers for:  aue, cue, kue, mue, upl and url.
no umb patch yet.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/usb/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/dev/usb/TODO
diff -u src/sys/dev/usb/TODO:1.48 src/sys/dev/usb/TODO:1.49
--- src/sys/dev/usb/TODO:1.48	Wed Aug  7 07:08:02 2019
+++ src/sys/dev/usb/TODO	Fri Aug  9 02:56:51 2019
@@ -59,24 +59,21 @@ Stylistic changes:
 	use usb_ and usbd_ consistently
 	rearrange the contents and names of some files (Nick)
 
-Change what's done at watchdog timeout inb if_{a,c,k}ue.c; what we have
-now doesn't work because it's done in an interrupt context.
-
 Factor out the common code from the Ethernet drivers and reuse that.
-	if_aue
+	if_aue - patch available
 	if_axe - done
 	if_axen - done
 	if_cdce - done
-	if_cue
-	if_kue
-	if_mue
+	if_cue - patch available
+	if_kue - patch available
+	if_mue - patch available
 	if_smsc - done
-	if_udav
+	if_udav - done
 	if_umb - maybe too special?
-	if_upl
+	if_upl - patch available
 	if_ure - done
-	if_url
-	if_urndis
+	if_url - patch available
+	if_urndis - patch available, probably works
 
 Get rid of hcpriv.
 



CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 02:52:59 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_cdce.c if_ure.c

Log Message:
use new un_flags member of usbnet:
- axen(4) and cdce(4) are now able to use struct usbnet directly
  as softc, udav also done but untested


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/usb/if_ure.c

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

Modified files:

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.107 src/sys/dev/usb/if_axe.c:1.108
--- src/sys/dev/usb/if_axe.c:1.107	Fri Aug  9 01:17:33 2019
+++ src/sys/dev/usb/if_axe.c	Fri Aug  9 02:52:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.107 2019/08/09 01:17:33 mrg Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.108 2019/08/09 02:52:59 mrg Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.107 2019/08/09 01:17:33 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.108 2019/08/09 02:52:59 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -113,7 +113,7 @@ struct axe_type {
 struct axe_softc {
 	struct usbnet		axe_un;
 
-	uint32_t		axe_flags;	/* copied from axe_type */
+	/* usbnet:un_flags values */
 #define AX178		__BIT(0)	/* AX88178 */
 #define AX772		__BIT(1)	/* AX88772 */
 #define AX772A		__BIT(2)	/* AX88772A */
@@ -128,11 +128,11 @@ struct axe_softc {
 
 };
 
-#define	AXE_IS_178_FAMILY(sc)		  \
-	((sc)->axe_flags & (AX772 | AX772A | AX772B | AX178))
+#define	AXE_IS_178_FAMILY(un)\
+	((un)->un_flags & (AX772 | AX772A | AX772B | AX178))
 
-#define	AXE_IS_772(sc)			  \
-	((sc)->axe_flags & (AX772 | AX772A | AX772B))
+#define	AXE_IS_772(un)	\
+	((un)->un_flags & (AX772 | AX772A | AX772B))
 
 #define AX_RXCSUM	\
 (IFCAP_CSUM_IPv4_Rx | \
@@ -340,7 +340,7 @@ axe_mii_read_reg(struct usbnet *un, int 
 	}
 
 	*val = le16toh(data);
-	if (AXE_IS_772(sc) && reg == MII_BMSR) {
+	if (AXE_IS_772(un) && reg == MII_BMSR) {
 		/*
 		 * BMSR of AX88772 indicates that it supports extended
 		 * capability but the extended status register is
@@ -388,7 +388,7 @@ axe_mii_statchg_cb(struct ifnet *ifp)
 	un->un_link = false;
 	if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) {
 		val |= AXE_MEDIA_FULL_DUPLEX;
-		if (AXE_IS_178_FAMILY(sc)) {
+		if (AXE_IS_178_FAMILY(un)) {
 			if ((IFM_OPTIONS(mii->mii_media_active) &
 			IFM_ETH_TXPAUSE) != 0)
 val |= AXE_178_MEDIA_TXFLOW_CONTROL_EN;
@@ -397,9 +397,9 @@ axe_mii_statchg_cb(struct ifnet *ifp)
 val |= AXE_178_MEDIA_RXFLOW_CONTROL_EN;
 		}
 	}
-	if (AXE_IS_178_FAMILY(sc)) {
+	if (AXE_IS_178_FAMILY(un)) {
 		val |= AXE_178_MEDIA_RX_EN | AXE_178_MEDIA_MAGIC;
-		if (sc->axe_flags & AX178)
+		if (un->un_flags & AX178)
 			val |= AXE_178_MEDIA_ENCK;
 		switch (IFM_SUBTYPE(mii->mii_media_active)) {
 		case IFM_1000_T:
@@ -504,13 +504,13 @@ axe_ax_init(struct usbnet *un)
 
 	int cmd = AXE_178_CMD_READ_NODEID;
 
-	if (sc->axe_flags & AX178) {
+	if (un->un_flags & AX178) {
 		axe_ax88178_init(sc);
-	} else if (sc->axe_flags & AX772) {
+	} else if (un->un_flags & AX772) {
 		axe_ax88772_init(sc);
-	} else if (sc->axe_flags & AX772A) {
+	} else if (un->un_flags & AX772A) {
 		axe_ax88772a_init(sc);
-	} else if (sc->axe_flags & AX772B) {
+	} else if (un->un_flags & AX772B) {
 		axe_ax88772b_init(sc);
 		return;
 	} else {
@@ -894,7 +894,7 @@ axe_attach(device_t parent, device_t sel
 		return;
 	}
 
-	sc->axe_flags = axe_lookup(uaa->uaa_vendor, uaa->uaa_product)->axe_flags;
+	un->un_flags = axe_lookup(uaa->uaa_vendor, uaa->uaa_product)->axe_flags;
 
 	err = usbd_device2interface_handle(dev, AXE_IFACE_IDX, &un->un_iface);
 	if (err) {
@@ -905,7 +905,7 @@ axe_attach(device_t parent, device_t sel
 	id = usbd_get_interface_descriptor(un->un_iface);
 
 	/* decide on what our bufsize will be */
-	if (AXE_IS_178_FAMILY(sc))
+	if (AXE_IS_178_FAMILY(un))
 		bufsz = (un->un_udev->ud_speed == USB_SPEED_HIGH) ?
 		AXE_178_MAX_BUFSZ : AXE_178_MIN_BUFSZ;
 	else
@@ -966,7 +966,7 @@ axe_attach(device_t parent, device_t sel
 	/*
 	 * Fetch IPG values.
 	 */
-	if (sc->axe_flags & (AX772A | AX772B)) {
+	if (un->un_flags & (AX772A | AX772B)) {
 		/* Set IPG values. */
 		sc->axe_ipgs[0] = AXE_IPG0_DEFAULT;
 		sc->axe_ipgs[1] = AXE_IPG1_DEFAULT;
@@ -981,9 +981,9 @@ axe_attach(device_t parent, device_t sel
 
 	usbnet_unlock_mii(un);
 
-	if (AXE_IS_178_FAMILY(sc))
+	if (AXE_IS_178_FAMILY(un))
 		usbnet_ec(un)->ec_capabilities = ETHERCAP_VLAN_MTU;
-	if (sc->axe_flags & AX772B) {
+	if (un->un_flags & AX772B) {
 		struct ifnet *ifp = usbnet_ifp(un);
 
 		ifp->if_capabilities =
@@ -1001,7 +1001,7 @@ axe_attach(device_t parent, device_t sel
 		 */
 	}
 	u_int adv_p

CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 02:52:59 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_cdce.c if_ure.c

Log Message:
use new un_flags member of usbnet:
- axen(4) and cdce(4) are now able to use struct usbnet directly
  as softc, udav also done but untested


To generate a diff of this commit:
cvs rdiff -u -r1.107 -r1.108 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/usb/if_ure.c

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



CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 02:14:35 UTC 2019

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

Log Message:
ride 9.99.5 bump: add un_flags here.  many of the softc's only have
a flags member to control device-specific issues, and this means
they can use "struct usbnet" as their softc directly.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/usb/usbnet.h

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



CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 02:14:35 UTC 2019

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

Log Message:
ride 9.99.5 bump: add un_flags here.  many of the softc's only have
a flags member to control device-specific issues, and this means
they can use "struct usbnet" as their softc directly.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/usb/usbnet.h

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

Modified files:

Index: src/sys/dev/usb/usbnet.h
diff -u src/sys/dev/usb/usbnet.h:1.7 src/sys/dev/usb/usbnet.h:1.8
--- src/sys/dev/usb/usbnet.h:1.7	Fri Aug  9 01:17:33 2019
+++ src/sys/dev/usb/usbnet.h	Fri Aug  9 02:14:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbnet.h,v 1.7 2019/08/09 01:17:33 mrg Exp $	*/
+/*	$NetBSD: usbnet.h,v 1.8 2019/08/09 02:14:35 mrg Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -192,6 +192,7 @@ struct usbnet {
 	device_t		un_dev;
 	struct usbd_interface	*un_iface;
 	struct usbd_device *	un_udev;
+
 	krndsource_t		un_rndsrc;
 	struct usbnet_ops	*un_ops;
 
@@ -207,6 +208,9 @@ struct usbnet {
 	struct callout		un_stat_ch;
 	int			un_if_flags;
 
+	/* This is for driver to use. */
+	unsigned		un_flags;
+
 	/*
 	 * - un_lock protects most of the structure
 	 * - un_miilock must be held to access this device's MII bus
@@ -350,6 +354,5 @@ int	usbnet_activate(device_t, devact_t);
 
 /* stop backend */
 void	usbnet_stop(struct usbnet *, struct ifnet *, int);
-void	usbnet_stop_locked(struct usbnet *, struct ifnet *, int);
 
 #endif /* _DEV_USB_USBNET_H */



CVS commit: src/sys

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 01:17:33 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_cdce.c if_smsc.c if_udav.c
if_ure.c usbnet.c usbnet.h
src/sys/sys: param.h

Log Message:
update usbnet some:
- move rx/tx xfer flags into usbnet_cdata
- move the callbacks into usbnet_ops structure
- move rx/tx xfer flags arguments from usbnet_init_rx_tx()
  and move them all into usbnet_attach() arguments
- s/miibus/mii/ in some places for consistency

other clean up:
- create wrapper functions for callbacks, move knowledge about
  special handling (OK to be missing, error eating) there.
- use cdata pointer if already available
- provide some more macros (will be real functions later) for
  accessing usbnet members, use existing ones more

bump kernel version.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/usb/if_udav.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/usbnet.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/usb/usbnet.h
cvs rdiff -u -r1.603 -r1.604 src/sys/sys/param.h

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



CVS commit: src/sys

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug  9 01:17:33 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_cdce.c if_smsc.c if_udav.c
if_ure.c usbnet.c usbnet.h
src/sys/sys: param.h

Log Message:
update usbnet some:
- move rx/tx xfer flags into usbnet_cdata
- move the callbacks into usbnet_ops structure
- move rx/tx xfer flags arguments from usbnet_init_rx_tx()
  and move them all into usbnet_attach() arguments
- s/miibus/mii/ in some places for consistency

other clean up:
- create wrapper functions for callbacks, move knowledge about
  special handling (OK to be missing, error eating) there.
- use cdata pointer if already available
- provide some more macros (will be real functions later) for
  accessing usbnet members, use existing ones more

bump kernel version.


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.58 -r1.59 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.48 -r1.49 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/usb/if_udav.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/usbnet.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/usb/usbnet.h
cvs rdiff -u -r1.603 -r1.604 src/sys/sys/param.h

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

Modified files:

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.106 src/sys/dev/usb/if_axe.c:1.107
--- src/sys/dev/usb/if_axe.c:1.106	Tue Aug  6 01:42:22 2019
+++ src/sys/dev/usb/if_axe.c	Fri Aug  9 01:17:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.106 2019/08/06 01:42:22 mrg Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.107 2019/08/09 01:17:33 mrg Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.106 2019/08/06 01:42:22 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.107 2019/08/09 01:17:33 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -261,19 +261,33 @@ void	axe_attach(device_t, device_t, void
 CFATTACH_DECL_NEW(axe, sizeof(struct axe_softc),
 	axe_match, axe_attach, usbnet_detach, usbnet_activate);
 
+static void	axe_stop_cb(struct ifnet *, int);
+static int	axe_ioctl_cb(struct ifnet *, u_long, void *);
+static int	axe_init(struct ifnet *);
+static usbd_status axe_mii_read_reg(struct usbnet *, int, int, uint16_t *);
+static usbd_status axe_mii_write_reg(struct usbnet *, int, int, uint16_t);
+static void	axe_mii_statchg_cb(struct ifnet *);
 static void	axe_rx_loop_cb(struct usbnet *, struct usbd_xfer *,
 			   struct usbnet_chain *, uint32_t);
 static unsigned axe_tx_prepare_cb(struct usbnet *, struct mbuf *,
   struct usbnet_chain *);
-static int	axe_init(struct ifnet *);
-static void	axe_stop_cb(struct ifnet *, int);
-static int	axe_ioctl_cb(struct ifnet *, u_long, void *);
 
 static void	axe_ax88178_init(struct axe_softc *);
 static void	axe_ax88772_init(struct axe_softc *);
 static void	axe_ax88772a_init(struct axe_softc *);
 static void	axe_ax88772b_init(struct axe_softc *);
 
+static struct usbnet_ops axe_ops = {
+	.uno_stop = axe_stop_cb,
+	.uno_ioctl = axe_ioctl_cb,
+	.uno_read_reg = axe_mii_read_reg,
+	.uno_write_reg = axe_mii_write_reg,
+	.uno_statchg = axe_mii_statchg_cb,
+	.uno_tx_prepare = axe_tx_prepare_cb,
+	.uno_rx_loop = axe_rx_loop_cb,
+	.uno_init = axe_init,
+};
+
 static usbd_status
 axe_cmd(struct axe_softc *sc, int cmd, int index, int val, void *buf)
 {
@@ -284,7 +298,7 @@ axe_cmd(struct axe_softc *sc, int cmd, i
 
 	usbnet_isowned_mii(un);
 
-	if (un->un_dying)
+	if (usbnet_isdying(un))
 		return -1;
 
 	DPRINTFN(20, "cmd %#jx index %#jx val %#jx", cmd, index, val, 0);
@@ -364,10 +378,10 @@ axe_mii_statchg_cb(struct ifnet *ifp)
 
 	struct usbnet * const un = ifp->if_softc;
 	struct axe_softc * const sc = usbnet_softc(un);
-	struct mii_data *mii = &un->un_mii;
+	struct mii_data *mii = usbnet_mii(un);
 	int val, err;
 
-	if (un->un_dying)
+	if (usbnet_isdying(un))
 		return;
 
 	val = 0;
@@ -425,7 +439,7 @@ axe_setiff_locked(struct usbnet *un)
 
 	usbnet_isowned_mii(un);
 
-	if (un->un_dying)
+	if (usbnet_isdying(un))
 		return;
 
 	if (axe_cmd(sc, AXE_CMD_RXCTL_READ, 0, 0, &rxmode)) {
@@ -516,7 +530,7 @@ axe_reset(struct usbnet *un)
 
 	usbnet_isowned_mii(un);
 
-	if (un->un_dying)
+	if (usbnet_isdying(un))
 		return;
 
 	/*
@@ -871,16 +885,7 @@ axe_attach(device_t parent, device_t sel
 	un->un_dev = self;
 	un->un_udev = dev;
 	un->un_sc = sc;
-	un->un_stop_cb = axe_stop_cb;
-	un->un_ioctl_cb = axe_ioctl_cb;
-	un->un_read_reg_cb = axe_mii_read_reg;
-	un->un_write_reg_cb = axe_mii_write_reg;
-	un->un_statchg_cb = axe_mii_statchg_cb;
-	un->un_tx_prepare_cb = axe_tx_prepare_cb;
-	un->un_rx_loop_cb = axe_rx_loop_cb;
-	un->un_init_cb = axe_init;
-	un->un_rx_xfer_flags = USBD_SHORT_XFER_OK;
-	un->un_tx_xfer_fla

Re: CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-08 Thread Greg Troxel
Andreas Gustafsson  writes:

> I really don't like the general idea of introducing differences
> between images and systems installed through sysinst.  It's confusing
> for users, and also means that testing of one is less likely to apply
> to the other.

Agreed strongly.

In addition, I don't like it that images have stuff in /boot in the DOS
partition that can't be found in some obvious place, like /usr/mdec.
But I haven't gotten around to trying to fix it either so I get it that
ENOPATCH.


Re: CVS commit: src/sys/dev/usb

2019-08-08 Thread sc dying
On Wed, Aug 7, 2019 at 7:06 AM Nick Hudson  wrote:
>
> Module Name:src
> Committed By:   skrll
> Date:   Wed Aug  7 07:05:54 UTC 2019
>
> Modified Files:
> src/sys/dev/usb: if_smsc.c
> Removed Files:
> src/sys/dev/usb: if_smscvar.h
>
> Log Message:
> Convert smsc(4) to usbnet

Should buflen in smsc_rxeof_loop() be initialised as `pktlen - ETHER_ALIGN'
if it is instead of m_adj(ETHER_ALIGN) ?


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

2019-08-08 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Thu Aug  8 21:29:16 UTC 2019

Modified Files:
src/usr.sbin/npf/npfctl: npf_bpf_comp.c npf_build.c npfctl.h

Log Message:
NPF: fix BPF byte-code generation for a port-range used in a group.
Resolved PR/52609 and PR/54169.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/npf/npfctl/npf_bpf_comp.c
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/npf/npfctl/npf_build.c
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/npf/npfctl/npfctl.h

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

Modified files:

Index: src/usr.sbin/npf/npfctl/npf_bpf_comp.c
diff -u src/usr.sbin/npf/npfctl/npf_bpf_comp.c:1.13 src/usr.sbin/npf/npfctl/npf_bpf_comp.c:1.14
--- src/usr.sbin/npf/npfctl/npf_bpf_comp.c:1.13	Tue Jul 23 00:52:02 2019
+++ src/usr.sbin/npf/npfctl/npf_bpf_comp.c	Thu Aug  8 21:29:15 2019
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2010-2014 The NetBSD Foundation, Inc.
+ * Copyright (c) 2010-2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This material is based upon work partially supported by The
@@ -29,10 +29,60 @@
 
 /*
  * BPF byte-code generation for NPF rules.
+ *
+ * Overview
+ *
+ *	Each NPF rule is compiled into BPF micro-program.  There is a
+ *	BPF byte-code fragment for each higher-level filtering logic,
+ *	e.g. to match L4 protocol, IP/mask, etc.  The generation process
+ *	combines multiple BPF-byte code fragments into one program.
+ *
+ * Basic case
+ *
+ *	Consider a basic case, where all filters should match.  They
+ *	are expressed as logical conjunction, e.g.:
+ *
+ *		A and B and C and D
+ *
+ *	Each test (filter) criterion can be evaluated to true (match) or
+ *	false (no match) and the logic is as follows:
+ *
+ *	- If the value is true, then jump to the "next" test (offset 0).
+ *
+ *	- If the value is false, then jump to the JUMP_MAGIC value (0xff).
+ *	This "magic" value is used to indicate that it will have to be
+ *	patched at a later stage.
+ *
+ *	Once all byte-code fragments are combined into one, then there
+ *	are two additional steps:
+ *
+ *	- Two instructions are appended at the end of the program: return
+ *	"success" followed by return "failure".
+ *
+ *	- All jumps with the JUMP_MAGIC value are patched to point to the
+ *	"return failure" instruction.
+ *
+ *	Therefore, if all filter criteria will match, then the first
+ *	instruction will be reached, indicating a successful match of the
+ *	rule.  Otherwise, if any of the criteria will not match, it will
+ *	take the failure path and the rule will not matching.
+ *
+ * Grouping
+ *
+ *	Filters can have groups, which are have a meaning of logical
+ *	disjunction, e.g.:
+ *
+ *		A and B and (C or D)
+ *
+ *	In such case, the logic inside the group has to be inverted i.e.
+ *	the jump values swapped.  If the test value is true, then jump
+ *	out of the group; if false, then jump "next".  At the end of the
+ *	group, an addition failure path is appended and the JUMP_MAGIC
+ *	uses within the group are patched to jump past the said path.
  */
 
 #include 
-__RCSID("$NetBSD: npf_bpf_comp.c,v 1.13 2019/07/23 00:52:02 rmind Exp $");
+__RCSID("$NetBSD: npf_bpf_comp.c,v 1.14 2019/08/08 21:29:15 rmind Exp $");
 
 #include 
 #include 
@@ -75,7 +125,10 @@ struct npf_bpf {
 	sa_family_t		af;
 	uint32_t		flags;
 
-	/* The current group offset and block number. */
+	/*
+	 * The current group offset (counted in BPF instructions)
+	 * and block number at the start of the group.
+	 */
 	bool			ingroup;
 	u_int			goff;
 	u_int			gblock;
@@ -120,6 +173,7 @@ fixup_jumps(npf_bpf_t *ctx, u_int start,
 	for (u_int i = start; i < end; i++) {
 		struct bpf_insn *insn = &bp->bf_insns[i];
 		const u_int fail_off = end - i;
+		bool seen_magic = false;
 
 		if (fail_off >= JUMP_MAGIC) {
 			errx(EXIT_FAILURE, "BPF generation error: "
@@ -128,15 +182,37 @@ fixup_jumps(npf_bpf_t *ctx, u_int start,
 		if (BPF_CLASS(insn->code) != BPF_JMP) {
 			continue;
 		}
-		if (swap) {
+		if (BPF_OP(insn->code) == BPF_JA) {
+			/*
+			 * BPF_JA can be used to jump to the failure path.
+			 * If we are swapping i.e. inside the group, then
+			 * jump "next"; groups have a failure path appended
+			 * at their end.
+			 */
+			if (insn->k == JUMP_MAGIC) {
+insn->k = swap ? 0 : fail_off;
+			}
+			continue;
+		}
+
+		/*
+		 * Fixup the "magic" value.  Swap only the "magic" jumps.
+		 */
+
+		if (insn->jt == JUMP_MAGIC) {
+			insn->jt = fail_off;
+			seen_magic = true;
+		}
+		if (insn->jf == JUMP_MAGIC) {
+			insn->jf = fail_off;
+			seen_magic = true;
+		}
+
+		if (seen_magic && swap) {
 			uint8_t jt = insn->jt;
 			insn->jt = insn->jf;
 			insn->jf = jt;
 		}
-		if (insn->jt == JUMP_MAGIC)
-			insn->jt = fail_off;
-		if (insn->jf == JUMP_MAGIC)
-			insn->jf = fail_off;
 	}
 }
 
@@ -225,11 +301,11 @@ npfctl_bpf_destroy(npf_bpf_t *ctx)
 }
 
 /*
- * npfctl_bpf_group: begin a logical group.  It merely uses logical
+ * npfctl_

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

2019-08-08 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Thu Aug  8 21:29:16 UTC 2019

Modified Files:
src/usr.sbin/npf/npfctl: npf_bpf_comp.c npf_build.c npfctl.h

Log Message:
NPF: fix BPF byte-code generation for a port-range used in a group.
Resolved PR/52609 and PR/54169.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/npf/npfctl/npf_bpf_comp.c
cvs rdiff -u -r1.50 -r1.51 src/usr.sbin/npf/npfctl/npf_build.c
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/npf/npfctl/npfctl.h

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



CVS commit: src/sbin/reboot

2019-08-08 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Aug  8 21:14:12 UTC 2019

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

Log Message:
reboot: fix arg order for logwtmpx(3)

Matches the correct order from init(1).

Thanks to Sascha Wildner 


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sbin/reboot/reboot.c

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

Modified files:

Index: src/sbin/reboot/reboot.c
diff -u src/sbin/reboot/reboot.c:1.40 src/sbin/reboot/reboot.c:1.41
--- src/sbin/reboot/reboot.c:1.40	Sun Nov  4 22:28:16 2012
+++ src/sbin/reboot/reboot.c	Thu Aug  8 21:14:12 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: reboot.c,v 1.40 2012/11/04 22:28:16 christos Exp $	*/
+/*	$NetBSD: reboot.c,v 1.41 2019/08/08 21:14:12 roy Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -40,7 +40,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)reboot.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: reboot.c,v 1.40 2012/11/04 22:28:16 christos Exp $");
+__RCSID("$NetBSD: reboot.c,v 1.41 2019/08/08 21:14:12 roy Exp $");
 #endif
 #endif /* not lint */
 
@@ -169,7 +169,7 @@ main(int argc, char *argv[])
 	logwtmp("~", "shutdown", "");
 #endif
 #ifdef SUPPORT_UTMPX
-	logwtmpx("~", "shutdown", "", INIT_PROCESS, 0);
+	logwtmpx("~", "shutdown", "", 0, INIT_PROCESS);
 #endif
 
 	/*



CVS commit: src/sbin/reboot

2019-08-08 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Aug  8 21:14:12 UTC 2019

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

Log Message:
reboot: fix arg order for logwtmpx(3)

Matches the correct order from init(1).

Thanks to Sascha Wildner 


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sbin/reboot/reboot.c

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



Re: CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-08 Thread Andreas Gustafsson
Martin Husemann wrote:
> How about: remove all *.a files from those images?
> Is there a tool to strip CTF from binaries?

I really don't like the general idea of introducing differences
between images and systems installed through sysinst.  It's confusing
for users, and also means that testing of one is less likely to apply
to the other.

I see that libstdc++_pic.a is much larger than the other versions of
the same library:

   # cd /usr/lib
   # ls -al libstdc*
   -r--r--r--  1 root  wheel   4539634 Aug  8 14:00 libstdc++.a
   lrwxr-xr-x  1 root  wheel16 Aug  8 14:00 libstdc++.so -> 
libstdc++.so.9.0
   lrwxr-xr-x  1 root  wheel16 Aug  8 14:00 libstdc++.so.9 -> 
libstdc++.so.9.0
   -r--r--r--  1 root  wheel   2030136 Aug  8 14:00 libstdc++.so.9.0
   -r--r--r--  1 root  wheel   4787754 Aug  8 14:00 libstdc++_p.a
   -r--r--r--  1 root  wheel  28835160 Aug  8 14:00 libstdc++_pic.a

and that it contains .debug_info sections, which the others don't:

  # size -A -d libstdc++_pic.a | fgrep .debug_info | wc -l
   173
  # size -A -d libstdc++.a | fgrep .debug_info | wc -l
 0

Other libraries also have _pic.a files that are much larger than the
others versions.  Is there a bug that causes them not to be CTF-converted,
or is this deliberate?
-- 
Andreas Gustafsson, g...@netbsd.org


Re: CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-08 Thread Martin Husemann
On Thu, Aug 08, 2019 at 09:13:37PM +0300, Andreas Gustafsson wrote:
> The image already has an empty /usr/libdata/debug.  The increase in
> size when MKDEBUG is enabled is spread out over various other
> directories, notably /usr/lib.  For example,
> 
>   /usr/lib  405182 kB -> 866276 kB
>   /usr/bin   53426 kB ->  63140 kB
> 
> The largest file in /usr/lib is libstdc++_pic.a, which grows from
> 4.3 MB to 27 MB.

Heh - nice, didn't think about that.

How about: remove all *.a files from those images?
Is there a tool to strip CTF from binaries?

Martin


Re: CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-08 Thread Andreas Gustafsson
Martin Husemann wrote:
> I would like to see this images created w/o /usr/libdata/debug/ (as we
> do for ISO images, some of which we even strip more), but I have not
> yet found an easy way to hack that into the image creation process.

The image already has an empty /usr/libdata/debug.  The increase in
size when MKDEBUG is enabled is spread out over various other
directories, notably /usr/lib.  For example,

  /usr/lib  405182 kB -> 866276 kB
  /usr/bin   53426 kB ->  63140 kB

The largest file in /usr/lib is libstdc++_pic.a, which grows from
4.3 MB to 27 MB.

The largest file in /usr/bin is gdb, which grows from 7.8M to 12M.
"size -A -d" shows most of the growth is CTF.  Is there a corresponding
tool to look at the sizes of sections in a ".a" library?

In any case, the kernel has only grown from 23M to 26M, so this growth
looks like it's mostly a userland issue and unrelated to the removal of
"-U DEBUG" from etc/Makefile.
-- 
Andreas Gustafsson, g...@netbsd.org


CVS commit: src/sys/kern

2019-08-08 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Aug  8 18:08:41 UTC 2019

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

Log Message:
When modules are unloaded, we call sysctl_teardown() before calling
the module's modcmd(CMD_FINI) code.  If the modcmd() call returns an
error, we attempted to re-instate the module's sysctl stuff.

This doesn't work well for built-in modulesi (where "unload" actually
means "disable"), since they don't have any ``struct kobj''.

So check first, and don't try to find the __link_set_sysctl_funcs for
built-in modules.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/sys/kern/kern_module.c

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

Modified files:

Index: src/sys/kern/kern_module.c
diff -u src/sys/kern/kern_module.c:1.137 src/sys/kern/kern_module.c:1.138
--- src/sys/kern/kern_module.c:1.137	Wed Aug  7 00:38:02 2019
+++ src/sys/kern/kern_module.c	Thu Aug  8 18:08:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_module.c,v 1.137 2019/08/07 00:38:02 pgoyette Exp $	*/
+/*	$NetBSD: kern_module.c,v 1.138 2019/08/08 18:08:41 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.137 2019/08/07 00:38:02 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.138 2019/08/08 18:08:41 pgoyette Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -949,7 +949,7 @@ module_do_builtin(const module_t *pmod, 
 /*
  * module_load_sysctl
  *
- * Check to see if the module has any SYSCTL_SETUP() routine(s)
+ * Check to see if a non-builtin module has any SYSCTL_SETUP() routine(s)
  * registered.  If so, call it (them).
  */
 
@@ -961,6 +961,13 @@ module_load_sysctl(module_t *mod)
 	size_t ls_size, count;
 	int error;
 
+	/*
+	 * Built-in modules don't have a mod_kobj so we cannot search
+	 * for their link_set_sysctl_funcs
+	 */
+	if (mod->mod_source == MODULE_SOURCE_KERNEL)
+		return;
+
 	error = kobj_find_section(mod->mod_kobj, "link_set_sysctl_funcs",
 	&ls_start, &ls_size);
 	if (error == 0) {



CVS commit: src/sys/kern

2019-08-08 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Aug  8 18:08:41 UTC 2019

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

Log Message:
When modules are unloaded, we call sysctl_teardown() before calling
the module's modcmd(CMD_FINI) code.  If the modcmd() call returns an
error, we attempted to re-instate the module's sysctl stuff.

This doesn't work well for built-in modulesi (where "unload" actually
means "disable"), since they don't have any ``struct kobj''.

So check first, and don't try to find the __link_set_sysctl_funcs for
built-in modules.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/sys/kern/kern_module.c

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



CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug  8 18:03:41 UTC 2019

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

Log Message:
fix arm64 build (new le32toh() call needs sys/endian.h which is
probably include by some other header on amd64?)


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/usb/if_urndis.c

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

Modified files:

Index: src/sys/dev/usb/if_urndis.c
diff -u src/sys/dev/usb/if_urndis.c:1.24 src/sys/dev/usb/if_urndis.c:1.25
--- src/sys/dev/usb/if_urndis.c:1.24	Thu Aug  8 06:16:40 2019
+++ src/sys/dev/usb/if_urndis.c	Thu Aug  8 18:03:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urndis.c,v 1.24 2019/08/08 06:16:40 maya Exp $ */
+/*	$NetBSD: if_urndis.c,v 1.25 2019/08/08 18:03:40 mrg Exp $ */
 /*	$OpenBSD: if_urndis.c,v 1.31 2011/07/03 15:47:17 matthew Exp $ */
 
 /*
@@ -21,7 +21,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.24 2019/08/08 06:16:40 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.25 2019/08/08 18:03:40 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -37,6 +37,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_urndis.c,
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 



CVS commit: src/sys/dev/usb

2019-08-08 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug  8 18:03:41 UTC 2019

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

Log Message:
fix arm64 build (new le32toh() call needs sys/endian.h which is
probably include by some other header on amd64?)


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/usb/if_urndis.c

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



CVS commit: src

2019-08-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug  8 16:06:14 UTC 2019

Modified Files:
src/distrib/sets/lists/modules: mi
src/sys/modules: Makefile
Added Files:
src/sys/modules/if_udav: Makefile if_udav.ioconf

Log Message:
Build an if_udav module (untested)


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.223 -r1.224 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_udav/Makefile \
src/sys/modules/if_udav/if_udav.ioconf

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

Modified files:

Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.123 src/distrib/sets/lists/modules/mi:1.124
--- src/distrib/sets/lists/modules/mi:1.123	Wed Jul 31 09:13:16 2019
+++ src/distrib/sets/lists/modules/mi	Thu Aug  8 16:06:14 2019
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.123 2019/07/31 09:13:16 mrg Exp $
+# $NetBSD: mi,v 1.124 2019/08/08 16:06:14 skrll Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -232,6 +232,8 @@
 ./@MODULEDIR@/if_tap/if_tap.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_tunbase-kernel-modules	kmod
 ./@MODULEDIR@/if_tun/if_tun.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/if_udavbase-kernel-modules	kmod
+./@MODULEDIR@/if_udav/if_udav.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_urebase-kernel-modules	kmod
 ./@MODULEDIR@/if_ure/if_ure.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/if_vioifbase-obsolete		obsolete

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.223 src/sys/modules/Makefile:1.224
--- src/sys/modules/Makefile:1.223	Wed Jul 31 09:13:16 2019
+++ src/sys/modules/Makefile	Thu Aug  8 16:06:14 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.223 2019/07/31 09:13:16 mrg Exp $
+#	$NetBSD: Makefile,v 1.224 2019/08/08 16:06:14 skrll Exp $
 
 .include 
 
@@ -89,6 +89,7 @@ SUBDIR+=	if_stf
 SUBDIR+=	if_strip
 SUBDIR+=	if_tap tap
 SUBDIR+=	if_tun tun
+SUBDIR+=	if_udav
 SUBDIR+=	if_ure
 SUBDIR+=	if_vlan
 SUBDIR+=	iic

Added files:

Index: src/sys/modules/if_udav/Makefile
diff -u /dev/null src/sys/modules/if_udav/Makefile:1.1
--- /dev/null	Thu Aug  8 16:06:14 2019
+++ src/sys/modules/if_udav/Makefile	Thu Aug  8 16:06:14 2019
@@ -0,0 +1,11 @@
+# $NetBSD: Makefile,v 1.1 2019/08/08 16:06:14 skrll Exp $
+
+.include "../Makefile.inc"
+
+.PATH:	${S}/dev/usb
+
+KMOD=	if_udav
+IOCONF=	if_udav.ioconf
+SRCS=	if_udav.c
+
+.include 
Index: src/sys/modules/if_udav/if_udav.ioconf
diff -u /dev/null src/sys/modules/if_udav/if_udav.ioconf:1.1
--- /dev/null	Thu Aug  8 16:06:14 2019
+++ src/sys/modules/if_udav/if_udav.ioconf	Thu Aug  8 16:06:14 2019
@@ -0,0 +1,10 @@
+# $NetBSD: if_udav.ioconf,v 1.1 2019/08/08 16:06:14 skrll Exp $
+
+ioconf udav
+
+include "conf/files"
+include "dev/usb/files.usb"
+
+pseudo-root usbdevif*
+
+udav* at usbdevif?



CVS commit: src

2019-08-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug  8 16:06:14 UTC 2019

Modified Files:
src/distrib/sets/lists/modules: mi
src/sys/modules: Makefile
Added Files:
src/sys/modules/if_udav: Makefile if_udav.ioconf

Log Message:
Build an if_udav module (untested)


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.223 -r1.224 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/if_udav/Makefile \
src/sys/modules/if_udav/if_udav.ioconf

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



CVS commit: src/sys/external/bsd/ipf/netinet

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 14:38:53 UTC 2019

Modified Files:
src/sys/external/bsd/ipf/netinet: fil.c

Log Message:
PR/54443: Edgar Fu�: ip mistakenly regards UDP packet with checksum field
0x as bad


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/external/bsd/ipf/netinet/fil.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/ipf/netinet/fil.c
diff -u src/sys/external/bsd/ipf/netinet/fil.c:1.29 src/sys/external/bsd/ipf/netinet/fil.c:1.30
--- src/sys/external/bsd/ipf/netinet/fil.c:1.29	Fri Jun 28 19:25:12 2019
+++ src/sys/external/bsd/ipf/netinet/fil.c	Thu Aug  8 10:38:53 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fil.c,v 1.29 2019/06/28 23:25:12 christos Exp $	*/
+/*	$NetBSD: fil.c,v 1.30 2019/08/08 14:38:53 christos Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -141,7 +141,7 @@ extern struct timeout ipf_slowtimer_ch;
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.29 2019/06/28 23:25:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fil.c,v 1.30 2019/08/08 14:38:53 christos Exp $");
 #else
 static const char sccsid[] = "@(#)fil.c	1.36 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: fil.c,v 1.1.1.2 2012/07/22 13:45:07 darrenr Exp $";
@@ -6536,8 +6536,11 @@ ipf_checkl4sum(fr_info_t *fin)
 		/*NOTREACHED*/
 	}
 
-	if (csump != NULL)
+	if (csump != NULL) {
 		hdrsum = *csump;
+		if (fin->fin_p == IPPROTO_UDP && hdrsum == 0x)
+			hdrsum = 0x;
+	}
 
 	if (dosum) {
 		sum = fr_cksum(fin, fin->fin_ip, fin->fin_p, fin->fin_dp);



CVS commit: src/sys/external/bsd/ipf/netinet

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 14:38:53 UTC 2019

Modified Files:
src/sys/external/bsd/ipf/netinet: fil.c

Log Message:
PR/54443: Edgar Fu�: ip mistakenly regards UDP packet with checksum field
0x as bad


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/external/bsd/ipf/netinet/fil.c

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



CVS commit: src/external/bsd/compiler_rt

2019-08-08 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Aug  8 14:00:33 UTC 2019

Added Files:
src/external/bsd/compiler_rt: Makefile
src/external/bsd/compiler_rt/lib: Makefile
src/external/bsd/compiler_rt/lib/clang: Makefile
src/external/bsd/compiler_rt/lib/clang/include: Makefile
src/external/bsd/compiler_rt/lib/clang/include/sanitizer: Makefile
src/external/bsd/compiler_rt/lib/clang/include/xray: Makefile
src/external/bsd/compiler_rt/lib/clang/lib: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd: Makefile common.mk
gen_dynamic_list.sh m32.mk m64.mk shared_deps.mk sources.mk syms.mk
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-dynamic-m32:
Makefile shlib_version
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-dynamic-m64:
Makefile shlib_version
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m32: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-preinit-m32:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-preinit-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m32:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/dd-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/dyndd-m64: Makefile
shlib_version
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/fuzzer-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/fuzzer_no_main-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan_cxx-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m32:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan_cxx-m64:
Makefile

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-dynamic-m32:
Makefile shlib_version

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-dynamic-m64:
Makefile shlib_version
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-m32:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-m64:
Makefile

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-dynamic-m32:
Makefile shlib_version

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-dynamic-m64:
Makefile shlib_version
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-m32:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-m64:
Makefile

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone_cxx-m32:
Makefile

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone_cxx-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-basic-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-fdr-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-profiling-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/share: Makefile

Log Message:
Add compiler-rt build rules for LLVM sanitizers &co

Add build rules for LLVM in all the supported variations for NetBSD/amd64:

 - asan
 - xray
 - tsan, dd
 - libfuzzer
 - msan
 - safestack
 - ubsan

These build rules compile functional sanitizers.

The build rules are still not hooked into the distribution build, as there
is pending work on backporting improvements for the llvm-8 branch needed
for netbsd-9 and newer.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/compiler_rt/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/compiler_rt/lib/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/compiler_rt/lib/clang/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/compiler_rt/lib/clang/include/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/compiler_rt/lib/clang/include/sanitizer/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/compiler_rt/lib/clang/include/xray/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/compiler_rt/lib/clang/lib/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/Makefile \
src/external/bsd/compiler_rt/lib/cla

CVS commit: src/external/bsd/compiler_rt

2019-08-08 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Aug  8 14:00:33 UTC 2019

Added Files:
src/external/bsd/compiler_rt: Makefile
src/external/bsd/compiler_rt/lib: Makefile
src/external/bsd/compiler_rt/lib/clang: Makefile
src/external/bsd/compiler_rt/lib/clang/include: Makefile
src/external/bsd/compiler_rt/lib/clang/include/sanitizer: Makefile
src/external/bsd/compiler_rt/lib/clang/include/xray: Makefile
src/external/bsd/compiler_rt/lib/clang/lib: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd: Makefile common.mk
gen_dynamic_list.sh m32.mk m64.mk shared_deps.mk sources.mk syms.mk
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-dynamic-m32:
Makefile shlib_version
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-dynamic-m64:
Makefile shlib_version
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m32: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-preinit-m32:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan-preinit-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m32:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/asan_cxx-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/dd-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/dyndd-m64: Makefile
shlib_version
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/fuzzer-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/fuzzer_no_main-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/msan_cxx-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m32:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/safestack-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/tsan_cxx-m64:
Makefile

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-dynamic-m32:
Makefile shlib_version

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-dynamic-m64:
Makefile shlib_version
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-m32:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_minimal-m64:
Makefile

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-dynamic-m32:
Makefile shlib_version

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-dynamic-m64:
Makefile shlib_version
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-m32:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone-m64:
Makefile

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone_cxx-m32:
Makefile

src/external/bsd/compiler_rt/lib/clang/lib/netbsd/ubsan_standalone_cxx-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-basic-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-fdr-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-m64: Makefile
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/xray-profiling-m64:
Makefile
src/external/bsd/compiler_rt/lib/clang/share: Makefile

Log Message:
Add compiler-rt build rules for LLVM sanitizers &co

Add build rules for LLVM in all the supported variations for NetBSD/amd64:

 - asan
 - xray
 - tsan, dd
 - libfuzzer
 - msan
 - safestack
 - ubsan

These build rules compile functional sanitizers.

The build rules are still not hooked into the distribution build, as there
is pending work on backporting improvements for the llvm-8 branch needed
for netbsd-9 and newer.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/external/bsd/compiler_rt/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/compiler_rt/lib/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/compiler_rt/lib/clang/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/compiler_rt/lib/clang/include/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/compiler_rt/lib/clang/include/sanitizer/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/compiler_rt/lib/clang/include/xray/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/compiler_rt/lib/clang/lib/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/Makefile \
src/external/bsd/compiler_rt/lib/cla

CVS commit: src/doc

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 13:52:14 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenLDAP


To generate a diff of this commit:
cvs rdiff -u -r1.1641 -r1.1642 src/doc/3RDPARTY
cvs rdiff -u -r1.2564 -r1.2565 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1641 src/doc/3RDPARTY:1.1642
--- src/doc/3RDPARTY:1.1641	Thu Aug  1 09:45:54 2019
+++ src/doc/3RDPARTY	Thu Aug  8 09:52:13 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1641 2019/08/01 13:45:54 msaitoh Exp $
+#	$NetBSD: 3RDPARTY,v 1.1642 2019/08/08 13:52:13 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1005,12 +1005,12 @@ Notes:
 We have lots of local fixes.
 
 Package:	OpenLDAP
-Version:	2.4.45
-Current Vers:	2.4.47
+Version:	2.4.48
+Current Vers:	2.4.48
 Maintainer:	OpenLDAP Foundation
 Archive Site:	http://www.openldap.org/
 Home Page:	http://www.openldap.org/
-Date:		2019-01-09
+Date:		2019-08-08
 Mailing List:
 Responsible:
 License:	BSD (3-clause)

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2564 src/doc/CHANGES:1.2565
--- src/doc/CHANGES:1.2564	Tue Jul 30 11:56:53 2019
+++ src/doc/CHANGES	Thu Aug  8 09:52:14 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2564 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2565 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -24,3 +24,5 @@
 # 
 
 Changes from NetBSD 9.0 to NetBSD 10.0:
+openldap: Import 2.4.48. [christos 20180808]
+



CVS commit: src/doc

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 13:52:14 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new OpenLDAP


To generate a diff of this commit:
cvs rdiff -u -r1.1641 -r1.1642 src/doc/3RDPARTY
cvs rdiff -u -r1.2564 -r1.2565 src/doc/CHANGES

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



CVS commit: src/external/bsd/openldap

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 13:50:58 UTC 2019

Modified Files:
src/external/bsd/openldap/dist/build: mkversion
src/external/bsd/openldap/dist/clients/tools: common.c
src/external/bsd/openldap/dist/include: Makefile.in ldap_pvt.h
ldap_queue.h portable.hin
src/external/bsd/openldap/dist/libraries/libldap: os-ip.c os-local.c
tls_o.c
src/external/bsd/openldap/dist/libraries/liblutil: detach.c md5.c
passwd.c
src/external/bsd/openldap/dist/libraries/librewrite: session.c
src/external/bsd/openldap/dist/servers/slapd: filter.c
src/external/bsd/openldap/dist/servers/slapd/overlays: deref.c
src/external/bsd/openldap/include: ldap_features.h portable.h
Removed Files:
src/external/bsd/openldap/dist/doc/man/man5: slapd-ldbm.5
src/external/bsd/openldap/dist/tests/scripts:
test058-syncrepl-asymmetric

Log Message:
merge conflicts.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/openldap/dist/build/mkversion
cvs rdiff -u -r1.7 -r1.8 \
src/external/bsd/openldap/dist/clients/tools/common.c
cvs rdiff -u -r1.1.1.6 -r0 \
src/external/bsd/openldap/dist/doc/man/man5/slapd-ldbm.5
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/openldap/dist/include/Makefile.in \
src/external/bsd/openldap/dist/include/portable.hin
cvs rdiff -u -r1.1.1.7 -r1.2 \
src/external/bsd/openldap/dist/include/ldap_pvt.h
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/openldap/dist/include/ldap_queue.h
cvs rdiff -u -r1.8 -r1.9 \
src/external/bsd/openldap/dist/libraries/libldap/os-ip.c
cvs rdiff -u -r1.9 -r1.10 \
src/external/bsd/openldap/dist/libraries/libldap/os-local.c
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/openldap/dist/libraries/libldap/tls_o.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/openldap/dist/libraries/liblutil/detach.c \
src/external/bsd/openldap/dist/libraries/liblutil/md5.c
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/openldap/dist/libraries/liblutil/passwd.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/openldap/dist/libraries/librewrite/session.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/openldap/dist/servers/slapd/filter.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c
cvs rdiff -u -r1.1.1.5 -r0 \
src/external/bsd/openldap/dist/tests/scripts/test058-syncrepl-asymmetric
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/openldap/include/ldap_features.h
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/openldap/include/portable.h

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

Modified files:

Index: src/external/bsd/openldap/dist/build/mkversion
diff -u src/external/bsd/openldap/dist/build/mkversion:1.7 src/external/bsd/openldap/dist/build/mkversion:1.8
--- src/external/bsd/openldap/dist/build/mkversion:1.7	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/build/mkversion	Thu Aug  8 09:50:56 2019
@@ -3,7 +3,7 @@
 # $OpenLDAP$
 ## This work is part of OpenLDAP Software .
 ##
-## Copyright 1998-2017 The OpenLDAP Foundation.
+## Copyright 1998-2019 The OpenLDAP Foundation.
 ## All rights reserved.
 ##
 ## Redistribution and use in source and binary forms, with or without
@@ -50,11 +50,16 @@ if test $# != 1 ; then
 fi
 
 APPLICATION=$1
+#if [ -n "${SOURCE_DATE_EPOCH}" ]; then
+   WHOWHERE="openldap"
+#else
+#   WHOWHERE="$USER@$(uname -n):$(pwd)"
+#fi
 
 cat << __EOF__
 /* This work is part of OpenLDAP Software .
  *
- * Copyright 1998-2017 The OpenLDAP Foundation.
+ * Copyright 1998-2019 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -67,7 +72,7 @@ cat << __EOF__
  */
 
 static const char copyright[] =
-"Copyright 1998-2017 The OpenLDAP Foundation.  All rights reserved.\n"
+"Copyright 1998-2019 The OpenLDAP Foundation.  All rights reserved.\n"
 "COPYING RESTRICTIONS APPLY\n";
 
 $static $const char $SYMBOL[] =

Index: src/external/bsd/openldap/dist/clients/tools/common.c
diff -u src/external/bsd/openldap/dist/clients/tools/common.c:1.7 src/external/bsd/openldap/dist/clients/tools/common.c:1.8
--- src/external/bsd/openldap/dist/clients/tools/common.c:1.7	Mon Feb  5 20:57:23 2018
+++ src/external/bsd/openldap/dist/clients/tools/common.c	Thu Aug  8 09:50:56 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: common.c,v 1.7 2018/02/06 01:57:23 christos Exp $	*/
+/*	$NetBSD: common.c,v 1.8 2019/08/08 13:50:56 christos Exp $	*/
 
 /* common.c - common routines for the ldap client tools */
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software .
  *
- * Copyright 1998-2017 The OpenLDAP Foundation.
+ * Copyright 1998-2019 The OpenLDAP Foundation.
  * Portions Copyright 2003 Kurt D. Zeilenga.
  * Portions Copyright 2003 IBM Corporation.
  * All rights re

CVS commit: src/external/bsd/openldap

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 13:50:58 UTC 2019

Modified Files:
src/external/bsd/openldap/dist/build: mkversion
src/external/bsd/openldap/dist/clients/tools: common.c
src/external/bsd/openldap/dist/include: Makefile.in ldap_pvt.h
ldap_queue.h portable.hin
src/external/bsd/openldap/dist/libraries/libldap: os-ip.c os-local.c
tls_o.c
src/external/bsd/openldap/dist/libraries/liblutil: detach.c md5.c
passwd.c
src/external/bsd/openldap/dist/libraries/librewrite: session.c
src/external/bsd/openldap/dist/servers/slapd: filter.c
src/external/bsd/openldap/dist/servers/slapd/overlays: deref.c
src/external/bsd/openldap/include: ldap_features.h portable.h
Removed Files:
src/external/bsd/openldap/dist/doc/man/man5: slapd-ldbm.5
src/external/bsd/openldap/dist/tests/scripts:
test058-syncrepl-asymmetric

Log Message:
merge conflicts.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/openldap/dist/build/mkversion
cvs rdiff -u -r1.7 -r1.8 \
src/external/bsd/openldap/dist/clients/tools/common.c
cvs rdiff -u -r1.1.1.6 -r0 \
src/external/bsd/openldap/dist/doc/man/man5/slapd-ldbm.5
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/openldap/dist/include/Makefile.in \
src/external/bsd/openldap/dist/include/portable.hin
cvs rdiff -u -r1.1.1.7 -r1.2 \
src/external/bsd/openldap/dist/include/ldap_pvt.h
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/openldap/dist/include/ldap_queue.h
cvs rdiff -u -r1.8 -r1.9 \
src/external/bsd/openldap/dist/libraries/libldap/os-ip.c
cvs rdiff -u -r1.9 -r1.10 \
src/external/bsd/openldap/dist/libraries/libldap/os-local.c
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/openldap/dist/libraries/libldap/tls_o.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/openldap/dist/libraries/liblutil/detach.c \
src/external/bsd/openldap/dist/libraries/liblutil/md5.c
cvs rdiff -u -r1.6 -r1.7 \
src/external/bsd/openldap/dist/libraries/liblutil/passwd.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/openldap/dist/libraries/librewrite/session.c
cvs rdiff -u -r1.5 -r1.6 \
src/external/bsd/openldap/dist/servers/slapd/filter.c
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/openldap/dist/servers/slapd/overlays/deref.c
cvs rdiff -u -r1.1.1.5 -r0 \
src/external/bsd/openldap/dist/tests/scripts/test058-syncrepl-asymmetric
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/openldap/include/ldap_features.h
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/openldap/include/portable.h

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



CVS commit: src/usr.sbin/sysinst

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 13:45:19 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
Do not even consider to fsck partitions where we do not know the file
system type. Add v7fs support.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/sysinst/disks.c

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

Modified files:

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.49 src/usr.sbin/sysinst/disks.c:1.50
--- src/usr.sbin/sysinst/disks.c:1.49	Thu Aug  8 11:41:16 2019
+++ src/usr.sbin/sysinst/disks.c	Thu Aug  8 13:45:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.49 2019/08/08 11:41:16 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.50 2019/08/08 13:45:19 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1121,6 +1121,8 @@ make_filesystems(struct install_partitio
 		 */
 		ptn = &install->infos[i];
 		parts = ptn->parts;
+		newfs = NULL;
+		fsname = NULL;
 
 		if (ptn->size == 0 || parts == NULL|| ptn->type == PT_swap)
 			continue;			
@@ -1136,7 +1138,6 @@ make_filesystems(struct install_partitio
 		parts->pscheme->get_part_device(parts, ptn->cur_part_id,
 		rdev, sizeof rdev, &partno, raw_dev_name, true);
 
-		newfs = NULL;
 		switch (ptn->fs_type) {
 		case FS_APPLEUFS:
 			asprintf(&newfs, "/sbin/newfs");
@@ -1168,6 +1169,11 @@ make_filesystems(struct install_partitio
 			mnt_opts = "-tsysvbfs";
 			fsname = "sysvbfs";
 			break;
+		case FS_V7:
+			asprintf(&newfs, "/sbin/newfs_v7fs");
+			mnt_opts = "-tv7fs";
+			fsname = "v7fs";
+			break;
 		case FS_EX2FS:
 			asprintf(&newfs, "/sbin/newfs_ext2fs");
 			mnt_opts = "-text2fs";
@@ -1192,7 +1198,8 @@ make_filesystems(struct install_partitio
 error = run_program(RUN_DISPLAY | RUN_PROGRESS,
 			"%s %s", newfs, rdev);
 			}
-		} else if (ptn->instflags & (PUIINST_MOUNT|PUIINST_BOOT)) {
+		} else if ((ptn->instflags & (PUIINST_MOUNT|PUIINST_BOOT))
+		&& fsname != NULL) {
 			/* We'd better check it isn't dirty */
 			error = fsck_preen(devdev, fsname, false);
 		}



CVS commit: src/usr.sbin/sysinst

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 13:45:19 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
Do not even consider to fsck partitions where we do not know the file
system type. Add v7fs support.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/usr.sbin/sysinst/disks.c

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



CVS import: src/external/bsd/openldap/dist

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 13:31:56 UTC 2019

Update of /cvsroot/src/external/bsd/openldap/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv11099

Log Message:
OpenLDAP 2.4.48 (2019/07/24)
Added libldap OpenSSL Elliptic Curve support (ITS#7595)
Added libldap Expose OpenLDAP specific interfaces via openldap.h 
(ITS#8671)
Added slapd-monitor support for slapd-mdb (ITS#7770)
Fixed liblber leaks (ITS#8727)
Fixed liblber with partial flush (ITS#8864)
Fixed libldap ASYNC TLS so it works (ITS#8957,ITS#8980)
Fixed libldap ASYNC connections with Solaris 10 (ITS#8968)
Fixed libldap with SASL_NOCANON=on and ldapi connections (ITS#7585)
Fixed libldap to be able to unset syncrepl TLS options (ITS#7042)
Fixed libldap race condition in ldap_int_initialize (ITS#7996, ITS#8450)
Fixed libldap return code in ldap_create_assertion_control_value 
(ITS#8674)
Fixed libldap to correctly disable IPv6 when configured to do so 
(ITS#8754)
Fixed libldap to correctly close TLS connection (ITS#8755)
Fixed libldap_r handling of deprecated OpenSSL function (ITS#8353)
Fixed liblunicode case correspondance (ITS#8508)
Fixed slapd with an idletimeout of less than four seconds (ITS#8952)
Fixed slapd config parser variable for Windows64 (ITS#9012)
Fixed slapd syncrepl fallback handling with delta-syncrepl (ITS#9015)
Fixed slapd telephoneNumberNormalize, cert DN validation (ITS#8999)
Fixed slapd syncrepl for relax with delta-syncrepl (ITS#8037)
Fixed slapd to restrict rootDN proxyauthz to its own databases 
(ITS#9038)
Fixed slapd to initialize SASL SSF per connection (ITS#9052)
Fixed slapo-accesslog with SLAP_MOD_SOFT modifications (ITS#8990)
Fixed slapd-ldap starttls connections timeout behavior (ITS#8963)
Fixed slapd-ldap segfault when entry result doesn't match filter 
(ITS#8997)
Fixed slapd-meta conversion from slapd.conf to cn=config (ITS#8743)
Fixed slapd-meta assertion when network interface goes down (ITS#8841)
Fixed slapd-mdb fix bitshift integer overflow (ITS#8989)
Fixed slapd-mdb index cleanup with cn=config (ITS#8472)
Fixed slapd-mdb to improve performance with alias deref (ITS#7657)
Fixed slapo-accesslog possible assert with exops (ITS#8971)
Fixed slapo-chain to correctly reject multiple chaining URIs (ITS#8637)
Fixed slapo-chain conversion from slapd.conf to cn=config (ITS#8799)
Fixed slapo-memberof conversion from slapd.conf to cn=config (ITS#8663)
Fixed slapo-memberof for group name change to itself (ITS#9000)
Fixed slapo-ppolicy behavior when pwdInHistory is changed (ITS#8349)
Fixed slapo-rwm to not free original filter (ITS#8964)
Fixed slapo-syncprov contextCSN generation (ITS#9015)
Build Environment
Fixed slapd to only link to BDB libraries with static build 
(ITS#8948)
Fixed libldap implicit declaration with LDAP_CONNECTIONLESS 
(ITS#8794)
Fixed libldap double inclusion of limits.h in cyrus.c (ITS#9041)
Documentation
General - Fixed minor typos (ITS#8764, ITS#8761)
admin24 - Miscellaneous updates promoting mdb and fixing 
examples (ITS#9031)
slapd.access(5) - Note MDB is the primary backend (ITS#8881)
slapd.backends(5) - Note MDB is the recommended backend 
(ITS#8771)
slapd-ldap(5) - Document starttls parameter (ITS#8693)
Contrib
Added slapo-lastbind capability to forward authTimestamp 
updates (ITS#7721)

OpenLDAP 2.4.47 Release (2018/12/19)
Added slapd-sock DN qualifier for subtrees to be processed (ITS#8051)
Added slapd-sock ability to send extended operations to external 
listeners (ITS#8714)
Fixed liblber to avoid incremental access to user-supplied bv in dupbv 
(ITS#8752)
Fixed libldap dn to domain parsing with bad input (ITS#8842)
Fixed slapd slapcat to correctly honor -g option (ITS#8667)
Fixed slapd to correctly handle NO_SUCH_OBJECT with dynamic groups 
(ITS#8923)
Fixed slapd to check status of rdnNormalize (ITS#8932)
Fixed slapd cn=config when modifying slapo-syncprov config (ITS#8616)
Fixed slapd sasl authz-policy "all" behavior (ITS#8909)
Fixed slapd sasl minor typo (ITS#8918)
Fixed slapd to correctly hide hidden DBs in the rootDSE (ITS#8912)
Fixed slapd domainScope control to match Microsoft specification 
(ITS#8840)
Fixed slapd-bdb/hdb/mdb to not convert certain IDLs to ranges (ITS#8868)
Fixed slapo-accesslog deadlock during cleanup (ITS#8752)
Fixed slapo-memberof cn=config modifications (ITS#8663)
Fixed slapo-ppolicy with multimaster replication (ITS#8927)
Fixed slapo

CVS import: src/external/bsd/openldap/dist

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 13:31:56 UTC 2019

Update of /cvsroot/src/external/bsd/openldap/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv11099

Log Message:
OpenLDAP 2.4.48 (2019/07/24)
Added libldap OpenSSL Elliptic Curve support (ITS#7595)
Added libldap Expose OpenLDAP specific interfaces via openldap.h 
(ITS#8671)
Added slapd-monitor support for slapd-mdb (ITS#7770)
Fixed liblber leaks (ITS#8727)
Fixed liblber with partial flush (ITS#8864)
Fixed libldap ASYNC TLS so it works (ITS#8957,ITS#8980)
Fixed libldap ASYNC connections with Solaris 10 (ITS#8968)
Fixed libldap with SASL_NOCANON=on and ldapi connections (ITS#7585)
Fixed libldap to be able to unset syncrepl TLS options (ITS#7042)
Fixed libldap race condition in ldap_int_initialize (ITS#7996, ITS#8450)
Fixed libldap return code in ldap_create_assertion_control_value 
(ITS#8674)
Fixed libldap to correctly disable IPv6 when configured to do so 
(ITS#8754)
Fixed libldap to correctly close TLS connection (ITS#8755)
Fixed libldap_r handling of deprecated OpenSSL function (ITS#8353)
Fixed liblunicode case correspondance (ITS#8508)
Fixed slapd with an idletimeout of less than four seconds (ITS#8952)
Fixed slapd config parser variable for Windows64 (ITS#9012)
Fixed slapd syncrepl fallback handling with delta-syncrepl (ITS#9015)
Fixed slapd telephoneNumberNormalize, cert DN validation (ITS#8999)
Fixed slapd syncrepl for relax with delta-syncrepl (ITS#8037)
Fixed slapd to restrict rootDN proxyauthz to its own databases 
(ITS#9038)
Fixed slapd to initialize SASL SSF per connection (ITS#9052)
Fixed slapo-accesslog with SLAP_MOD_SOFT modifications (ITS#8990)
Fixed slapd-ldap starttls connections timeout behavior (ITS#8963)
Fixed slapd-ldap segfault when entry result doesn't match filter 
(ITS#8997)
Fixed slapd-meta conversion from slapd.conf to cn=config (ITS#8743)
Fixed slapd-meta assertion when network interface goes down (ITS#8841)
Fixed slapd-mdb fix bitshift integer overflow (ITS#8989)
Fixed slapd-mdb index cleanup with cn=config (ITS#8472)
Fixed slapd-mdb to improve performance with alias deref (ITS#7657)
Fixed slapo-accesslog possible assert with exops (ITS#8971)
Fixed slapo-chain to correctly reject multiple chaining URIs (ITS#8637)
Fixed slapo-chain conversion from slapd.conf to cn=config (ITS#8799)
Fixed slapo-memberof conversion from slapd.conf to cn=config (ITS#8663)
Fixed slapo-memberof for group name change to itself (ITS#9000)
Fixed slapo-ppolicy behavior when pwdInHistory is changed (ITS#8349)
Fixed slapo-rwm to not free original filter (ITS#8964)
Fixed slapo-syncprov contextCSN generation (ITS#9015)
Build Environment
Fixed slapd to only link to BDB libraries with static build 
(ITS#8948)
Fixed libldap implicit declaration with LDAP_CONNECTIONLESS 
(ITS#8794)
Fixed libldap double inclusion of limits.h in cyrus.c (ITS#9041)
Documentation
General - Fixed minor typos (ITS#8764, ITS#8761)
admin24 - Miscellaneous updates promoting mdb and fixing 
examples (ITS#9031)
slapd.access(5) - Note MDB is the primary backend (ITS#8881)
slapd.backends(5) - Note MDB is the recommended backend 
(ITS#8771)
slapd-ldap(5) - Document starttls parameter (ITS#8693)
Contrib
Added slapo-lastbind capability to forward authTimestamp 
updates (ITS#7721)

OpenLDAP 2.4.47 Release (2018/12/19)
Added slapd-sock DN qualifier for subtrees to be processed (ITS#8051)
Added slapd-sock ability to send extended operations to external 
listeners (ITS#8714)
Fixed liblber to avoid incremental access to user-supplied bv in dupbv 
(ITS#8752)
Fixed libldap dn to domain parsing with bad input (ITS#8842)
Fixed slapd slapcat to correctly honor -g option (ITS#8667)
Fixed slapd to correctly handle NO_SUCH_OBJECT with dynamic groups 
(ITS#8923)
Fixed slapd to check status of rdnNormalize (ITS#8932)
Fixed slapd cn=config when modifying slapo-syncprov config (ITS#8616)
Fixed slapd sasl authz-policy "all" behavior (ITS#8909)
Fixed slapd sasl minor typo (ITS#8918)
Fixed slapd to correctly hide hidden DBs in the rootDSE (ITS#8912)
Fixed slapd domainScope control to match Microsoft specification 
(ITS#8840)
Fixed slapd-bdb/hdb/mdb to not convert certain IDLs to ranges (ITS#8868)
Fixed slapo-accesslog deadlock during cleanup (ITS#8752)
Fixed slapo-memberof cn=config modifications (ITS#8663)
Fixed slapo-ppolicy with multimaster replication (ITS#8927)
Fixed slapo

CVS commit: [netbsd-9] src/doc

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 11:52:59 UTC 2019

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

Log Message:
Tickets #30 and #31


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

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

Modified files:

Index: src/doc/CHANGES-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.10 src/doc/CHANGES-9.0:1.1.2.11
--- src/doc/CHANGES-9.0:1.1.2.10	Thu Aug  8 05:54:48 2019
+++ src/doc/CHANGES-9.0	Thu Aug  8 11:52:58 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.10 2019/08/08 05:54:48 msaitoh Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.11 2019/08/08 11:52:58 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -341,3 +341,18 @@ usr.sbin/sysinst/disks.c			1.48
 	When creating the /etc/fstab for new installs, the sense of the
 	"noauto" flag was inverted.
 	[martin, ticket #29]
+
+etc/rc.d/automount1.2
+etc/rc.d/automountd1.2
+etc/rc.d/autounmountd1.2
+etc/rc.d/ip6addrctl1.3
+
+	Add $_rc_subr_loaded before ". /etc/rc.subr" for speedup and
+	consistency.
+	[nakayama, ticket #30]
+
+etc/mtree/NetBSD.dist.base			1.201
+
+	/etc/namedb: sync user and group with etc/mtree/special.
+	[nakayama, ticket #31]
+



CVS commit: [netbsd-9] src/doc

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 11:52:59 UTC 2019

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

Log Message:
Tickets #30 and #31


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

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



CVS commit: [netbsd-9] src/etc/mtree

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 11:52:14 UTC 2019

Modified Files:
src/etc/mtree [netbsd-9]: NetBSD.dist.base

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #31):

etc/mtree/NetBSD.dist.base: revision 1.201

Change uname and gname to sync with etc/mtree/special.
It was missing in rev 1.195 changes.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.200.2.1 src/etc/mtree/NetBSD.dist.base

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



CVS commit: [netbsd-9] src/etc/mtree

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 11:52:14 UTC 2019

Modified Files:
src/etc/mtree [netbsd-9]: NetBSD.dist.base

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #31):

etc/mtree/NetBSD.dist.base: revision 1.201

Change uname and gname to sync with etc/mtree/special.
It was missing in rev 1.195 changes.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.200.2.1 src/etc/mtree/NetBSD.dist.base

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

Modified files:

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.200 src/etc/mtree/NetBSD.dist.base:1.200.2.1
--- src/etc/mtree/NetBSD.dist.base:1.200	Wed Jul 24 06:53:42 2019
+++ src/etc/mtree/NetBSD.dist.base	Thu Aug  8 11:52:14 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.200 2019/07/24 06:53:42 wiz Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.200.2.1 2019/08/08 11:52:14 martin Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -1271,7 +1271,7 @@
 ./var/chroot/named
 ./var/chroot/named/dev
 ./var/chroot/named/etc
-./var/chroot/named/etc/namedb
+./var/chroot/named/etc/namedb		mode=0755 uname=named gname=named
 ./var/chroot/named/etc/namedb/cache	mode=0775 uname=named gname=named
 ./var/chroot/named/etc/namedb/keys	type=dir mode=0775 uname=named gname=named
 ./var/chroot/named/etc/namedb/nta	type=dir mode=0775 uname=named gname=named



CVS commit: [netbsd-9] src/etc/rc.d

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 11:48:59 UTC 2019

Modified Files:
src/etc/rc.d [netbsd-9]: automount automountd autounmountd ip6addrctl

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #30):

etc/rc.d/autounmountd: revision 1.2
etc/rc.d/ip6addrctl: revision 1.3
etc/rc.d/automountd: revision 1.2
etc/rc.d/automount: revision 1.2

Add $_rc_subr_loaded before ". /etc/rc.subr" for speedup and consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.6.1 src/etc/rc.d/automount src/etc/rc.d/automountd \
src/etc/rc.d/autounmountd
cvs rdiff -u -r1.2 -r1.2.18.1 src/etc/rc.d/ip6addrctl

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



CVS commit: [netbsd-9] src/etc/rc.d

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 11:48:59 UTC 2019

Modified Files:
src/etc/rc.d [netbsd-9]: automount automountd autounmountd ip6addrctl

Log Message:
Pull up following revision(s) (requested by nakayama in ticket #30):

etc/rc.d/autounmountd: revision 1.2
etc/rc.d/ip6addrctl: revision 1.3
etc/rc.d/automountd: revision 1.2
etc/rc.d/automount: revision 1.2

Add $_rc_subr_loaded before ". /etc/rc.subr" for speedup and consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.6.1 src/etc/rc.d/automount src/etc/rc.d/automountd \
src/etc/rc.d/autounmountd
cvs rdiff -u -r1.2 -r1.2.18.1 src/etc/rc.d/ip6addrctl

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

Modified files:

Index: src/etc/rc.d/automount
diff -u src/etc/rc.d/automount:1.1 src/etc/rc.d/automount:1.1.6.1
--- src/etc/rc.d/automount:1.1	Tue Jan  9 03:31:14 2018
+++ src/etc/rc.d/automount	Thu Aug  8 11:48:58 2019
@@ -1,13 +1,13 @@
 #!/bin/sh
 #
-# $NetBSD: automount,v 1.1 2018/01/09 03:31:14 christos Exp $
+# $NetBSD: automount,v 1.1.6.1 2019/08/08 11:48:58 martin Exp $
 #
 
 # PROVIDE: automount
 # REQUIRE: automountd
 # KEYWORD: nojail shutdown
 
-. /etc/rc.subr
+$_rc_subr_loaded . /etc/rc.subr
 
 name="automount"
 rcvar="autofs"
Index: src/etc/rc.d/automountd
diff -u src/etc/rc.d/automountd:1.1 src/etc/rc.d/automountd:1.1.6.1
--- src/etc/rc.d/automountd:1.1	Tue Jan  9 03:31:14 2018
+++ src/etc/rc.d/automountd	Thu Aug  8 11:48:58 2019
@@ -1,13 +1,13 @@
 #!/bin/sh
 #
-# $NetBSD: automountd,v 1.1 2018/01/09 03:31:14 christos Exp $
+# $NetBSD: automountd,v 1.1.6.1 2019/08/08 11:48:58 martin Exp $
 #
 
 # PROVIDE: automountd
 # REQUIRE: DAEMON
 # KEYWORD: nojail
 
-. /etc/rc.subr
+$_rc_subr_loaded . /etc/rc.subr
 
 name="automountd"
 rcvar="autofs"
Index: src/etc/rc.d/autounmountd
diff -u src/etc/rc.d/autounmountd:1.1 src/etc/rc.d/autounmountd:1.1.6.1
--- src/etc/rc.d/autounmountd:1.1	Tue Jan  9 03:31:14 2018
+++ src/etc/rc.d/autounmountd	Thu Aug  8 11:48:58 2019
@@ -7,7 +7,7 @@
 # REQUIRE: DAEMON
 # KEYWORD: nojail
 
-. /etc/rc.subr
+$_rc_subr_loaded . /etc/rc.subr
 
 name="autounmountd"
 rcvar="autofs"

Index: src/etc/rc.d/ip6addrctl
diff -u src/etc/rc.d/ip6addrctl:1.2 src/etc/rc.d/ip6addrctl:1.2.18.1
--- src/etc/rc.d/ip6addrctl:1.2	Wed Dec 23 04:38:00 2015
+++ src/etc/rc.d/ip6addrctl	Thu Aug  8 11:48:58 2019
@@ -6,7 +6,7 @@
 # PROVIDE: ip6addrctl
 # REQUIRE: root bootconf mountcritlocal tty
 
-. /etc/rc.subr
+$_rc_subr_loaded . /etc/rc.subr
 
 name="ip6addrctl"
 rcvar="ip6addrctl"



CVS commit: src/usr.sbin/sysinst

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 11:41:16 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
Do not try to fsck partitions we are never going to mount.
Found by Andreas Gustafsson's baremetal test bed.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/sysinst/disks.c

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

Modified files:

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.48 src/usr.sbin/sysinst/disks.c:1.49
--- src/usr.sbin/sysinst/disks.c:1.48	Wed Aug  7 10:12:32 2019
+++ src/usr.sbin/sysinst/disks.c	Thu Aug  8 11:41:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.48 2019/08/07 10:12:32 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.49 2019/08/08 11:41:16 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1192,7 +1192,7 @@ make_filesystems(struct install_partitio
 error = run_program(RUN_DISPLAY | RUN_PROGRESS,
 			"%s %s", newfs, rdev);
 			}
-		} else {
+		} else if (ptn->instflags & (PUIINST_MOUNT|PUIINST_BOOT)) {
 			/* We'd better check it isn't dirty */
 			error = fsck_preen(devdev, fsname, false);
 		}



CVS commit: src/usr.sbin/sysinst

2019-08-08 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Aug  8 11:41:16 UTC 2019

Modified Files:
src/usr.sbin/sysinst: disks.c

Log Message:
Do not try to fsck partitions we are never going to mount.
Found by Andreas Gustafsson's baremetal test bed.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/sysinst/disks.c

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



Re: CVS commit: src/distrib/amd64/liveimage/emuimage

2019-08-08 Thread Martin Husemann
On Wed, Aug 07, 2019 at 07:59:36AM +, Andreas Gustafsson wrote:
> Module Name:  src
> Committed By: gson
> Date: Wed Aug  7 07:59:36 UTC 2019
> 
> Modified Files:
>   src/distrib/amd64/liveimage/emuimage: Makefile
> 
> Log Message:
> The amd64 live image no longer fits in 2 GB when built with with
> MKDEBUG, as releases are.  Bump the size to just under 4 GB (as in
> 4*10^9, not 4*2^30), the next larger common USB thumb drive size.

I would like to see this images created w/o /usr/libdata/debug/ (as we
do for ISO images, some of which we even strip more), but I have not
yet found an easy way to hack that into the image creation process.

Any pointers welcome ;-)

Or does someone see a good use for the debug info on them (by default)?
During testing I often gathererd cores on these images but could easily
analyze them on another machine.

Martin 


CVS commit: src/external/bsd/wpa/dist/src/eap_common

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 09:56:41 UTC 2019

Modified Files:
src/external/bsd/wpa/dist/src/eap_common: eap_pwd_common.c

Log Message:
EAP-pwd: Run through prf result processing even if it >= prime

This reduces differences in timing and memory access within the
hunting-and-pecking loop for ECC groups that have a prime that is not
close to a power of two (e.g., Brainpool curves).

Signed-off-by: Jouni Malinen 
(cherry picked from commit cd803299ca485eb857e37c88f973fccfbb8600e5)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c

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



CVS commit: src/external/bsd/wpa/dist/src/eap_common

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 09:56:41 UTC 2019

Modified Files:
src/external/bsd/wpa/dist/src/eap_common: eap_pwd_common.c

Log Message:
EAP-pwd: Run through prf result processing even if it >= prime

This reduces differences in timing and memory access within the
hunting-and-pecking loop for ECC groups that have a prime that is not
close to a power of two (e.g., Brainpool curves).

Signed-off-by: Jouni Malinen 
(cherry picked from commit cd803299ca485eb857e37c88f973fccfbb8600e5)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c

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

Modified files:

Index: src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c
diff -u src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c:1.4 src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c:1.5
--- src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c:1.4	Thu Aug  8 04:58:40 2019
+++ src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c	Thu Aug  8 05:56:41 2019
@@ -142,6 +142,8 @@ int compute_password_element(EAP_PWD_gro
 	struct crypto_bignum *x_candidate = NULL, *cofactor = NULL;
 	const struct crypto_bignum *prime;
 	u8 mask, found_ctr = 0, is_odd = 0;
+	int cmp_prime;
+	unsigned int in_range;
 
 	if (grp->pwe)
 		return -1;
@@ -234,8 +236,13 @@ int compute_password_element(EAP_PWD_gro
 		if (primebitlen % 8)
 			buf_shift_right(prfbuf, primebytelen,
 	8 - primebitlen % 8);
-		if (const_time_memcmp(prfbuf, prime_bin, primebytelen) >= 0)
-			continue;
+		cmp_prime = const_time_memcmp(prfbuf, prime_bin, primebytelen);
+		/* Create a const_time mask for selection based on prf result
+		 * being smaller than prime. */
+		in_range = const_time_fill_msb((unsigned int) cmp_prime);
+		/* The algorithm description would skip the next steps if
+		 * cmp_prime >= 0, but go through them regardless to minimize
+		 * externally observable differences in behavior. */
 
 		crypto_bignum_deinit(x_candidate, 1);
 		x_candidate = crypto_bignum_init_set(prfbuf, primebytelen);
@@ -298,7 +305,7 @@ int compute_password_element(EAP_PWD_gro
 			goto fail;
 		mask = const_time_eq(res, check);
 		found_ctr = const_time_select_u8(found, found_ctr, ctr);
-		found |= mask;
+		found |= mask & in_range;
 	}
 	if (found == 0) {
 		wpa_printf(MSG_INFO,



CVS commit: src/external/bsd/wpa/dist/src/common

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 09:56:10 UTC 2019

Modified Files:
src/external/bsd/wpa/dist/src/common: sae.c

Log Message:
SAE: Run through prf result processing even if it >= prime

This reduces differences in timing and memory access within the
hunting-and-pecking loop for ECC groups that have a prime that is not
close to a power of two (e.g., Brainpool curves).

Signed-off-by: Jouni Malinen 
(cherry picked from commit 147bf7b88a9c231322b5b574263071ca6dbb0503)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/wpa/dist/src/common/sae.c

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

Modified files:

Index: src/external/bsd/wpa/dist/src/common/sae.c
diff -u src/external/bsd/wpa/dist/src/common/sae.c:1.8 src/external/bsd/wpa/dist/src/common/sae.c:1.9
--- src/external/bsd/wpa/dist/src/common/sae.c:1.8	Thu Aug  8 04:55:48 2019
+++ src/external/bsd/wpa/dist/src/common/sae.c	Thu Aug  8 05:56:10 2019
@@ -281,6 +281,8 @@ static int sae_test_pwd_seed_ecc(struct 
 	struct crypto_bignum *y_sqr, *x_cand;
 	int res;
 	size_t bits;
+	int cmp_prime;
+	unsigned int in_range;
 
 	wpa_hexdump_key(MSG_DEBUG, "SAE: pwd-seed", pwd_seed, SHA256_MAC_LEN);
 
@@ -294,8 +296,13 @@ static int sae_test_pwd_seed_ecc(struct 
 	wpa_hexdump_key(MSG_DEBUG, "SAE: pwd-value",
 			pwd_value, sae->tmp->prime_len);
 
-	if (const_time_memcmp(pwd_value, prime, sae->tmp->prime_len) >= 0)
-		return 0;
+	cmp_prime = const_time_memcmp(pwd_value, prime, sae->tmp->prime_len);
+	/* Create a const_time mask for selection based on prf result
+	 * being smaller than prime. */
+	in_range = const_time_fill_msb((unsigned int) cmp_prime);
+	/* The algorithm description would skip the next steps if
+	 * cmp_prime >= 0 (reutnr 0 here), but go through them regardless to
+	 * minimize externally observable differences in behavior. */
 
 	x_cand = crypto_bignum_init_set(pwd_value, sae->tmp->prime_len);
 	if (!x_cand)
@@ -307,7 +314,9 @@ static int sae_test_pwd_seed_ecc(struct 
 
 	res = is_quadratic_residue_blind(sae, prime, bits, qr, qnr, y_sqr);
 	crypto_bignum_deinit(y_sqr, 1);
-	return res;
+	if (res < 0)
+		return res;
+	return const_time_select_int(in_range, res, 0);
 }
 
 



CVS commit: src/external/bsd/wpa/dist/src/common

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 09:56:10 UTC 2019

Modified Files:
src/external/bsd/wpa/dist/src/common: sae.c

Log Message:
SAE: Run through prf result processing even if it >= prime

This reduces differences in timing and memory access within the
hunting-and-pecking loop for ECC groups that have a prime that is not
close to a power of two (e.g., Brainpool curves).

Signed-off-by: Jouni Malinen 
(cherry picked from commit 147bf7b88a9c231322b5b574263071ca6dbb0503)


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/wpa/dist/src/common/sae.c

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



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

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 09:55:32 UTC 2019

Modified Files:
src/external/bsd/wpa/dist/src/crypto: crypto_openssl.c

Log Message:
OpenSSL: Use BN_bn2binpad() or BN_bn2bin_padded() if available

This converts crypto_bignum_to_bin() to use the OpenSSL/BoringSSL
functions BN_bn2binpad()/BN_bn2bin_padded(), when available, to avoid
differences in runtime and memory access patterns depending on the
leading bytes of the BIGNUM value.

OpenSSL 1.0.2 and LibreSSL do not include such functions, so those cases
are still using the previous implementation where the BN_num_bytes()
call may result in different memory access pattern.

Signed-off-by: Jouni Malinen 
(cherry picked from commit 1e237903f5b5d3117342daf006c5878cdb45e3d3)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/wpa/dist/src/crypto/crypto_openssl.c

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

Modified files:

Index: src/external/bsd/wpa/dist/src/crypto/crypto_openssl.c
diff -u src/external/bsd/wpa/dist/src/crypto/crypto_openssl.c:1.3 src/external/bsd/wpa/dist/src/crypto/crypto_openssl.c:1.4
--- src/external/bsd/wpa/dist/src/crypto/crypto_openssl.c:1.3	Wed Apr 10 13:56:43 2019
+++ src/external/bsd/wpa/dist/src/crypto/crypto_openssl.c	Thu Aug  8 05:55:32 2019
@@ -1227,7 +1227,13 @@ void crypto_bignum_deinit(struct crypto_
 int crypto_bignum_to_bin(const struct crypto_bignum *a,
 			 u8 *buf, size_t buflen, size_t padlen)
 {
+#ifdef OPENSSL_IS_BORINGSSL
+#else /* OPENSSL_IS_BORINGSSL */
+#if OPENSSL_VERSION_NUMBER >= 0x1010L && !defined(LIBRESSL_VERSION_NUMBER)
+#else
 	int num_bytes, offset;
+#endif
+#endif /* OPENSSL_IS_BORINGSSL */
 
 	if (TEST_FAIL())
 		return -1;
@@ -1235,6 +1241,14 @@ int crypto_bignum_to_bin(const struct cr
 	if (padlen > buflen)
 		return -1;
 
+#ifdef OPENSSL_IS_BORINGSSL
+	if (BN_bn2bin_padded(buf, padlen, (const BIGNUM *) a) == 0)
+		return -1;
+	return padlen;
+#else /* OPENSSL_IS_BORINGSSL */
+#if OPENSSL_VERSION_NUMBER >= 0x1010L && !defined(LIBRESSL_VERSION_NUMBER)
+	return BN_bn2binpad((const BIGNUM *) a, buf, padlen);
+#else
 	num_bytes = BN_num_bytes((const BIGNUM *) a);
 	if ((size_t) num_bytes > buflen)
 		return -1;
@@ -1247,6 +1261,8 @@ int crypto_bignum_to_bin(const struct cr
 	BN_bn2bin((const BIGNUM *) a, buf + offset);
 
 	return num_bytes + offset;
+#endif
+#endif /* OPENSSL_IS_BORINGSSL */
 }
 
 



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

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 09:55:32 UTC 2019

Modified Files:
src/external/bsd/wpa/dist/src/crypto: crypto_openssl.c

Log Message:
OpenSSL: Use BN_bn2binpad() or BN_bn2bin_padded() if available

This converts crypto_bignum_to_bin() to use the OpenSSL/BoringSSL
functions BN_bn2binpad()/BN_bn2bin_padded(), when available, to avoid
differences in runtime and memory access patterns depending on the
leading bytes of the BIGNUM value.

OpenSSL 1.0.2 and LibreSSL do not include such functions, so those cases
are still using the previous implementation where the BN_num_bytes()
call may result in different memory access pattern.

Signed-off-by: Jouni Malinen 
(cherry picked from commit 1e237903f5b5d3117342daf006c5878cdb45e3d3)


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/wpa/dist/src/crypto/crypto_openssl.c

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



CVS commit: src/external/bsd/wpa/dist/src/eap_common

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 08:58:40 UTC 2019

Modified Files:
src/external/bsd/wpa/dist/src/eap_common: eap_pwd_common.c

Log Message:
EAP-pwd: Use const_time_memcmp() for pwd_value >= prime comparison

This reduces timing and memory access pattern differences for an
operation that could depend on the used password.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c

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

Modified files:

Index: src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c
diff -u src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c:1.3 src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c:1.4
--- src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c:1.3	Wed Apr 10 13:57:15 2019
+++ src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c	Thu Aug  8 04:58:40 2019
@@ -131,6 +131,7 @@ int compute_password_element(EAP_PWD_gro
 	u8 qnr_bin[MAX_ECC_PRIME_LEN];
 	u8 qr_or_qnr_bin[MAX_ECC_PRIME_LEN];
 	u8 x_bin[MAX_ECC_PRIME_LEN];
+	u8 prime_bin[MAX_ECC_PRIME_LEN];
 	struct crypto_bignum *tmp1 = NULL, *tmp2 = NULL, *pm1 = NULL;
 	struct crypto_hash *hash;
 	unsigned char pwe_digest[SHA256_MAC_LEN], *prfbuf = NULL, ctr;
@@ -148,6 +149,11 @@ int compute_password_element(EAP_PWD_gro
 	os_memset(x_bin, 0, sizeof(x_bin));
 
 	prime = crypto_ec_get_prime(grp->group);
+	primebitlen = crypto_ec_prime_len_bits(grp->group);
+	primebytelen = crypto_ec_prime_len(grp->group);
+	if (crypto_bignum_to_bin(prime, prime_bin, sizeof(prime_bin),
+ primebytelen) < 0)
+		return -1;
 	cofactor = crypto_bignum_init();
 	grp->pwe = crypto_ec_point_init(grp->group);
 	tmp1 = crypto_bignum_init();
@@ -163,8 +169,6 @@ int compute_password_element(EAP_PWD_gro
 			   "curve");
 		goto fail;
 	}
-	primebitlen = crypto_ec_prime_len_bits(grp->group);
-	primebytelen = crypto_ec_prime_len(grp->group);
 	if ((prfbuf = os_malloc(primebytelen)) == NULL) {
 		wpa_printf(MSG_INFO, "EAP-pwd: unable to malloc space for prf "
 			   "buffer");
@@ -230,6 +234,8 @@ int compute_password_element(EAP_PWD_gro
 		if (primebitlen % 8)
 			buf_shift_right(prfbuf, primebytelen,
 	8 - primebitlen % 8);
+		if (const_time_memcmp(prfbuf, prime_bin, primebytelen) >= 0)
+			continue;
 
 		crypto_bignum_deinit(x_candidate, 1);
 		x_candidate = crypto_bignum_init_set(prfbuf, primebytelen);
@@ -239,9 +245,6 @@ int compute_password_element(EAP_PWD_gro
 			goto fail;
 		}
 
-		if (crypto_bignum_cmp(x_candidate, prime) >= 0)
-			continue;
-
 		wpa_hexdump_key(MSG_DEBUG, "EAP-pwd: x_candidate",
 prfbuf, primebytelen);
 		const_time_select_bin(found, x_bin, prfbuf, primebytelen,



CVS commit: src/external/bsd/wpa/dist/src/eap_common

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 08:58:40 UTC 2019

Modified Files:
src/external/bsd/wpa/dist/src/eap_common: eap_pwd_common.c

Log Message:
EAP-pwd: Use const_time_memcmp() for pwd_value >= prime comparison

This reduces timing and memory access pattern differences for an
operation that could depend on the used password.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/wpa/dist/src/eap_common/eap_pwd_common.c

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



CVS commit: src/external/bsd/wpa/dist/src/common

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 08:55:48 UTC 2019

Modified Files:
src/external/bsd/wpa/dist/src/common: sae.c

Log Message:
SAE: Use const_time_memcmp() for pwd_value >= prime comparison

This reduces timing and memory access pattern differences for an
operation that could depend on the used password.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/wpa/dist/src/common/sae.c

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

Modified files:

Index: src/external/bsd/wpa/dist/src/common/sae.c
diff -u src/external/bsd/wpa/dist/src/common/sae.c:1.7 src/external/bsd/wpa/dist/src/common/sae.c:1.8
--- src/external/bsd/wpa/dist/src/common/sae.c:1.7	Wed Apr 10 14:01:08 2019
+++ src/external/bsd/wpa/dist/src/common/sae.c	Thu Aug  8 04:55:48 2019
@@ -294,7 +294,7 @@ static int sae_test_pwd_seed_ecc(struct 
 	wpa_hexdump_key(MSG_DEBUG, "SAE: pwd-value",
 			pwd_value, sae->tmp->prime_len);
 
-	if (os_memcmp(pwd_value, prime, sae->tmp->prime_len) >= 0)
+	if (const_time_memcmp(pwd_value, prime, sae->tmp->prime_len) >= 0)
 		return 0;
 
 	x_cand = crypto_bignum_init_set(pwd_value, sae->tmp->prime_len);



CVS commit: src/external/bsd/wpa/dist/src/common

2019-08-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Aug  8 08:55:48 UTC 2019

Modified Files:
src/external/bsd/wpa/dist/src/common: sae.c

Log Message:
SAE: Use const_time_memcmp() for pwd_value >= prime comparison

This reduces timing and memory access pattern differences for an
operation that could depend on the used password.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/wpa/dist/src/common/sae.c

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