CVS commit: src/sys/dev/pcmcia

2019-10-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Oct 11 04:25:11 UTC 2019

Modified Files:
src/sys/dev/pcmcia: if_malo_pcmcia.c

Log Message:
Delete unused var (made redundant in previous commit).   Unbreak build.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pcmcia/if_malo_pcmcia.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/pcmcia/if_malo_pcmcia.c
diff -u src/sys/dev/pcmcia/if_malo_pcmcia.c:1.22 src/sys/dev/pcmcia/if_malo_pcmcia.c:1.23
--- src/sys/dev/pcmcia/if_malo_pcmcia.c:1.22	Thu Oct 10 23:37:13 2019
+++ src/sys/dev/pcmcia/if_malo_pcmcia.c	Fri Oct 11 04:25:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_malo_pcmcia.c,v 1.22 2019/10/10 23:37:13 bad Exp $	*/
+/*	$NetBSD: if_malo_pcmcia.c,v 1.23 2019/10/11 04:25:11 kre Exp $	*/
 /*  $OpenBSD: if_malo.c,v 1.65 2009/03/29 21:53:53 sthen Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_malo_pcmcia.c,v 1.22 2019/10/10 23:37:13 bad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_malo_pcmcia.c,v 1.23 2019/10/11 04:25:11 kre Exp $");
 
 #ifdef _MODULE
 #include 
@@ -1308,7 +1308,6 @@ cmalo_cmd_rsp_hwspec(struct malo_softc *
 	struct ieee80211com *ic = >sc_ic;
 	struct malo_cmd_header *hdr = (struct malo_cmd_header *)sc->sc_cmd;
 	struct malo_cmd_body_spec *body;
-	int i;
 
 	body = (struct malo_cmd_body_spec *)(hdr + 1);
 



CVS commit: src/sys/dev/pcmcia

2019-10-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Fri Oct 11 04:25:11 UTC 2019

Modified Files:
src/sys/dev/pcmcia: if_malo_pcmcia.c

Log Message:
Delete unused var (made redundant in previous commit).   Unbreak build.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/pcmcia/if_malo_pcmcia.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/mii

2019-10-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 11 03:40:01 UTC 2019

Modified Files:
src/sys/dev/mii: rgephy.c

Log Message:
Make new rgephy_linkup() function and share it like FreeBSD.
No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/mii/rgephy.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/mii/rgephy.c
diff -u src/sys/dev/mii/rgephy.c:1.55 src/sys/dev/mii/rgephy.c:1.56
--- src/sys/dev/mii/rgephy.c:1.55	Wed Jun  5 17:50:06 2019
+++ src/sys/dev/mii/rgephy.c	Fri Oct 11 03:40:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rgephy.c,v 1.55 2019/06/05 17:50:06 triaxx Exp $	*/
+/*	$NetBSD: rgephy.c,v 1.56 2019/10/11 03:40:01 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2003
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.55 2019/06/05 17:50:06 triaxx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.56 2019/10/11 03:40:01 msaitoh Exp $");
 
 
 /*
@@ -75,6 +75,7 @@ static int	rgephy_service(struct mii_sof
 static void	rgephy_status(struct mii_softc *);
 static int	rgephy_mii_phy_auto(struct mii_softc *);
 static void	rgephy_reset(struct mii_softc *);
+static bool	rgephy_linkup(struct mii_softc *);
 static void	rgephy_loop(struct mii_softc *);
 static void	rgephy_load_dspcode(struct mii_softc *);
 
@@ -295,26 +296,9 @@ rgephy_service(struct mii_softc *sc, str
 		 * need to restart the autonegotiation process.  Read
 		 * the BMSR twice in case it's latched.
 		 */
-		if (sc->mii_mpd_rev >= RGEPHY_8211F) {
-			/* RTL8211F */
-			PHY_READ(sc, RGEPHY_MII_PHYSR, );
-			if (reg & RGEPHY_PHYSR_LINK) {
-sc->mii_ticks = 0;
-break;
-			}
-		} else if (sc->mii_mpd_rev >= RGEPHY_8211B) {
-			/* RTL8211B(L) */
-			PHY_READ(sc, RGEPHY_MII_SSR, );
-			if (reg & RGEPHY_SSR_LINK) {
-sc->mii_ticks = 0;
-break;
-			}
-		} else {
-			PHY_READ(sc, RTK_GMEDIASTAT, );
-			if ((reg & RTK_GMEDIASTAT_LINK) != 0) {
-sc->mii_ticks = 0;
-break;
-			}
+		if (rgephy_linkup(sc)) {
+			sc->mii_ticks = 0;
+			break;
 		}
 
 		/* Announce link loss right after it happens. */
@@ -345,6 +329,29 @@ rgephy_service(struct mii_softc *sc, str
 	return 0;
 }
 
+static bool
+rgephy_linkup(struct mii_softc *sc)
+{
+	bool linkup = false;
+	uint16_t reg;
+
+	if (sc->mii_mpd_rev >= RGEPHY_8211F) {
+		PHY_READ(sc, RGEPHY_MII_PHYSR, );
+		if (reg & RGEPHY_PHYSR_LINK)
+			linkup = true;
+	} else if (sc->mii_mpd_rev >= RGEPHY_8211B) {
+		PHY_READ(sc, RGEPHY_MII_SSR, );
+		if (reg & RGEPHY_SSR_LINK)
+			linkup = true;
+	} else {
+		PHY_READ(sc, RTK_GMEDIASTAT, );
+		if ((reg & RTK_GMEDIASTAT_LINK) != 0)
+			linkup = true;
+	}
+
+	return linkup;
+}
+
 static void
 rgephy_status(struct mii_softc *sc)
 {
@@ -354,19 +361,8 @@ rgephy_status(struct mii_softc *sc)
 	mii->mii_media_status = IFM_AVALID;
 	mii->mii_media_active = IFM_ETHER;
 
-	if (sc->mii_mpd_rev >= RGEPHY_8211F) {
-		PHY_READ(sc, RGEPHY_MII_PHYSR, );
-		if (physr & RGEPHY_PHYSR_LINK)
-			mii->mii_media_status |= IFM_ACTIVE;
-	} else if (sc->mii_mpd_rev >= RGEPHY_8211B) {
-		PHY_READ(sc, RGEPHY_MII_SSR, );
-		if (ssr & RGEPHY_SSR_LINK)
-			mii->mii_media_status |= IFM_ACTIVE;
-	} else {
-		PHY_READ(sc, RTK_GMEDIASTAT, );
-		if ((gstat & RTK_GMEDIASTAT_LINK) != 0)
-			mii->mii_media_status |= IFM_ACTIVE;
-	}
+	if (rgephy_linkup(sc))
+		mii->mii_media_status |= IFM_ACTIVE;
 
 	PHY_READ(sc, MII_BMSR, );
 	PHY_READ(sc, MII_BMCR, );



CVS commit: src/sys/dev/mii

2019-10-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 11 03:40:01 UTC 2019

Modified Files:
src/sys/dev/mii: rgephy.c

Log Message:
Make new rgephy_linkup() function and share it like FreeBSD.
No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/mii/rgephy.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/pcmcia

2019-10-10 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 10 23:37:13 UTC 2019

Modified Files:
src/sys/dev/pcmcia: if_malo_pcmcia.c

Log Message:
if we can memcpy to body->macaddr, we can memcpy from it.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pcmcia/if_malo_pcmcia.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/pcmcia/if_malo_pcmcia.c
diff -u src/sys/dev/pcmcia/if_malo_pcmcia.c:1.21 src/sys/dev/pcmcia/if_malo_pcmcia.c:1.22
--- src/sys/dev/pcmcia/if_malo_pcmcia.c:1.21	Tue Mar  5 08:25:02 2019
+++ src/sys/dev/pcmcia/if_malo_pcmcia.c	Thu Oct 10 23:37:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_malo_pcmcia.c,v 1.21 2019/03/05 08:25:02 msaitoh Exp $	*/
+/*	$NetBSD: if_malo_pcmcia.c,v 1.22 2019/10/10 23:37:13 bad Exp $	*/
 /*  $OpenBSD: if_malo.c,v 1.65 2009/03/29 21:53:53 sthen Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_malo_pcmcia.c,v 1.21 2019/03/05 08:25:02 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_malo_pcmcia.c,v 1.22 2019/10/10 23:37:13 bad Exp $");
 
 #ifdef _MODULE
 #include 
@@ -1313,8 +1313,7 @@ cmalo_cmd_rsp_hwspec(struct malo_softc *
 	body = (struct malo_cmd_body_spec *)(hdr + 1);
 
 	/* get our MAC address */
-	for (i = 0; i < ETHER_ADDR_LEN; i++)
-		ic->ic_myaddr[i] = body->macaddr[i];
+	memcpy(ic->ic_myaddr, body->macaddr, ETHER_ADDR_LEN);
 
 	return 0;
 }



CVS commit: src/sys/dev/pcmcia

2019-10-10 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 10 23:37:13 UTC 2019

Modified Files:
src/sys/dev/pcmcia: if_malo_pcmcia.c

Log Message:
if we can memcpy to body->macaddr, we can memcpy from it.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pcmcia/if_malo_pcmcia.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-10-10 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 10 23:30:02 UTC 2019

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

Log Message:
use ether_snprintf instead of open coding it.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/usb/if_urtwn.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_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.72 src/sys/dev/usb/if_urtwn.c:1.73
--- src/sys/dev/usb/if_urtwn.c:1.72	Mon Aug 19 07:20:07 2019
+++ src/sys/dev/usb/if_urtwn.c	Thu Oct 10 23:30:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.72 2019/08/19 07:20:07 mrg Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.73 2019/10/10 23:30:02 bad Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.72 2019/08/19 07:20:07 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.73 2019/10/10 23:30:02 bad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1340,10 +1340,8 @@ urtwn_dump_rom(struct urtwn_softc *sc, s
 	rp->usb_opt, rp->ep_setting, rp->usb_phy);
 
 	aprint_normal_dev(sc->sc_dev,
-	"macaddr %02x:%02x:%02x:%02x:%02x:%02x\n",
-	rp->macaddr[0], rp->macaddr[1],
-	rp->macaddr[2], rp->macaddr[3],
-	rp->macaddr[4], rp->macaddr[5]);
+	"macaddr %s\n",
+	ether_sprintf(rp->macaddr));
 
 	aprint_normal_dev(sc->sc_dev,
 	"string %s, subcustomer_id 0x%x\n",



CVS commit: src/sys/dev/usb

2019-10-10 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 10 23:30:02 UTC 2019

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

Log Message:
use ether_snprintf instead of open coding it.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sys/dev/usb/if_urtwn.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/pci

2019-10-10 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 10 22:34:42 UTC 2019

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

Log Message:
magic number police. use ETHER_ADDR_LEN.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/dev/pci/if_iwn.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/pci

2019-10-10 Thread Christoph Badura
Module Name:src
Committed By:   bad
Date:   Thu Oct 10 22:34:42 UTC 2019

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

Log Message:
magic number police. use ETHER_ADDR_LEN.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/dev/pci/if_iwn.c

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

Modified files:

Index: src/sys/dev/pci/if_iwn.c
diff -u src/sys/dev/pci/if_iwn.c:1.91 src/sys/dev/pci/if_iwn.c:1.92
--- src/sys/dev/pci/if_iwn.c:1.91	Fri Apr 19 19:37:31 2019
+++ src/sys/dev/pci/if_iwn.c	Thu Oct 10 22:34:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwn.c,v 1.91 2019/04/19 19:37:31 gutteridge Exp $	*/
+/*	$NetBSD: if_iwn.c,v 1.92 2019/10/10 22:34:42 bad Exp $	*/
 /*	$OpenBSD: if_iwn.c,v 1.135 2014/09/10 07:22:09 dcoppa Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.91 2019/04/19 19:37:31 gutteridge Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.92 2019/10/10 22:34:42 bad Exp $");
 
 #define IWN_USE_RBUF	/* Use local storage for RX */
 #undef IWN_HWCRYPTO	/* XXX does not even compile yet */
@@ -1568,7 +1568,7 @@ iwn_read_eeprom(struct iwn_softc *sc)
 		sc->rxchainmask = IWN_RFCFG_RXANTMSK(sc->rfcfg);
 
 	/* Read MAC address. */
-	iwn_read_prom_data(sc, IWN_EEPROM_MAC, ic->ic_myaddr, 6);
+	iwn_read_prom_data(sc, IWN_EEPROM_MAC, ic->ic_myaddr, ETHER_ADDR_LEN);
 
 	/* Read adapter-specific information from EEPROM. */
 	ops->read_eeprom(sc);



CVS commit: src/external/bsd/ipf/dist/man

2019-10-10 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Oct 10 22:06:35 UTC 2019

Modified Files:
src/external/bsd/ipf/dist/man: ipf.5

Log Message:
Typo.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ipf/dist/man/ipf.5

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



CVS commit: src/external/bsd/ipf/dist/man

2019-10-10 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Thu Oct 10 22:06:35 UTC 2019

Modified Files:
src/external/bsd/ipf/dist/man: ipf.5

Log Message:
Typo.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ipf/dist/man/ipf.5

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/ipf/dist/man/ipf.5
diff -u src/external/bsd/ipf/dist/man/ipf.5:1.5 src/external/bsd/ipf/dist/man/ipf.5:1.6
--- src/external/bsd/ipf/dist/man/ipf.5:1.5	Mon Dec 28 19:32:22 2015
+++ src/external/bsd/ipf/dist/man/ipf.5	Thu Oct 10 22:06:35 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ipf.5,v 1.5 2015/12/28 19:32:22 khorben Exp $
+.\"	$NetBSD: ipf.5,v 1.6 2019/10/10 22:06:35 uwe Exp $
 .\"
 .TH IPF 5
 .SH NAME
@@ -880,7 +880,7 @@ through without needing to explicitly al
 An example of how this is done is as follows:
 .PP
 .nf
-pass in proto udp from any prot = 2049 to any with frags keep fags
+pass in proto udp from any prot = 2049 to any with frags keep frags
 .fi
 .SH Building a tree of rules
 .PP



CVS commit: src/doc

2019-10-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Oct 10 18:23:43 UTC 2019

Modified Files:
src/doc: 3RDPARTY

Log Message:
delete bozohttpd entry; netbsd has been the master source for
bozohttpd releases since 2011.


To generate a diff of this commit:
cvs rdiff -u -r1.1659 -r1.1660 src/doc/3RDPARTY

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.1659 src/doc/3RDPARTY:1.1660
--- src/doc/3RDPARTY:1.1659	Wed Oct  9 23:04:33 2019
+++ src/doc/3RDPARTY	Thu Oct 10 18:23:43 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1659 2019/10/09 23:04:33 sevan Exp $
+#	$NetBSD: 3RDPARTY,v 1.1660 2019/10/10 18:23:43 mrg Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -194,20 +194,6 @@ Todo[3]: net/base64.c is imported from b
 Todo[4]: Re-entrant functions of net/*
 Todo[5]: Reconcile the doc directory.
 
-Package:	bozohttpd
-Version:	20190228
-Current Vers:	20190228
-Maintainer:	m...@eterna.com.au
-Archive Site:	ftp://ftp.NetBSD.org/pub/NetBSD/packages/distfiles/LOCAL_PORTS/
-Home Page:	http://eterna.com.au/bozohttpd/
-Date:		2019-01-09
-Mailing List:
-Responsible:	mrg
-License:	BSD
-Location:	libexec/httpd
-Notes:
-Delete "queue.h" from the distribution.
-
 Package:	bsd-family-tree
 Version:	349295
 Current Vers:	349295



CVS commit: src/doc

2019-10-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Oct 10 18:23:43 UTC 2019

Modified Files:
src/doc: 3RDPARTY

Log Message:
delete bozohttpd entry; netbsd has been the master source for
bozohttpd releases since 2011.


To generate a diff of this commit:
cvs rdiff -u -r1.1659 -r1.1660 src/doc/3RDPARTY

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



CVS commit: [netbsd-9] src/doc

2019-10-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 10 17:33:23 UTC 2019

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

Log Message:
Tickets #294 - #298


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.72 -r1.1.2.73 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.72 src/doc/CHANGES-9.0:1.1.2.73
--- src/doc/CHANGES-9.0:1.1.2.72	Tue Oct  8 17:06:28 2019
+++ src/doc/CHANGES-9.0	Thu Oct 10 17:33:23 2019
@@ -1,5 +1,5 @@
 
-# $NetBSD: CHANGES-9.0,v 1.1.2.72 2019/10/08 17:06:28 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.73 2019/10/10 17:33:23 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -4356,3 +4356,29 @@ sys/dev/pci/ixgbe/ixv.c1.139
 	ixv(4): set MTU correctly if mtu > 1500.
 	[msaitoh, ticket #293]
 
+sys/kern/sysv_shm.c1.140,1.141
+
+	Revert rev 1.139 und implement a simpler fix for the
+	race between shmat() and shmdt().
+	[chs, ticket #294]
+
+etc/services	1.102
+
+	Sync with latest from IANA.
+	[sevan, ticket #295]
+
+etc/namedb/root.cache1.25
+
+	Update to 2019093001.
+	[sevan, ticket #296]
+
+sys/netatalk/at_var.h1.9
+
+	Prevent stack information leak.
+	[maxv, ticket #297]
+
+sys/arch/x86/pci/if_vmx.c			1.51
+
+	Fix a kassert failure in vmxnet3_transmit().
+	[knakahara, ticket #298]
+



CVS commit: [netbsd-9] src/doc

2019-10-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 10 17:33:23 UTC 2019

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

Log Message:
Tickets #294 - #298


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.72 -r1.1.2.73 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/sys/arch/x86/pci

2019-10-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 10 17:32:15 UTC 2019

Modified Files:
src/sys/arch/x86/pci [netbsd-9]: if_vmx.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #298):

sys/arch/x86/pci/if_vmx.c: revision 1.51

Fix kassert failure in vmxnet3_transmit(). Pointed out by ryo@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.45.2.3 -r1.45.2.4 src/sys/arch/x86/pci/if_vmx.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/sys/arch/x86/pci

2019-10-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 10 17:32:15 UTC 2019

Modified Files:
src/sys/arch/x86/pci [netbsd-9]: if_vmx.c

Log Message:
Pull up following revision(s) (requested by knakahara in ticket #298):

sys/arch/x86/pci/if_vmx.c: revision 1.51

Fix kassert failure in vmxnet3_transmit(). Pointed out by ryo@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.45.2.3 -r1.45.2.4 src/sys/arch/x86/pci/if_vmx.c

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

Modified files:

Index: src/sys/arch/x86/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.45.2.3 src/sys/arch/x86/pci/if_vmx.c:1.45.2.4
--- src/sys/arch/x86/pci/if_vmx.c:1.45.2.3	Mon Sep 30 15:42:03 2019
+++ src/sys/arch/x86/pci/if_vmx.c	Thu Oct 10 17:32:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.45.2.3 2019/09/30 15:42:03 martin Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.45.2.4 2019/10/10 17:32:15 martin Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.45.2.3 2019/09/30 15:42:03 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.45.2.4 2019/10/10 17:32:15 martin Exp $");
 
 #include 
 #include 
@@ -3276,7 +3276,9 @@ vmxnet3_transmit(struct ifnet *ifp, stru
 		vmxnet3_transmit_locked(ifp, txq);
 		VMXNET3_TXQ_UNLOCK(txq);
 	} else {
+		kpreempt_disable();
 		softint_schedule(txq->vxtxq_si);
+		kpreempt_enable();
 	}
 
 	return 0;



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

2019-10-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 10 17:30:02 UTC 2019

Modified Files:
src/sys/netatalk [netbsd-9]: at_var.h

Log Message:
Pull up following revision(s) (requested by maxv in ticket #297):

sys/netatalk/at_var.h: revision 1.9

Memset to prevent stack info leak.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.6.1 src/sys/netatalk/at_var.h

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

Modified files:

Index: src/sys/netatalk/at_var.h
diff -u src/sys/netatalk/at_var.h:1.8 src/sys/netatalk/at_var.h:1.8.6.1
--- src/sys/netatalk/at_var.h:1.8	Thu Apr 19 21:50:10 2018
+++ src/sys/netatalk/at_var.h	Thu Oct 10 17:30:02 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: at_var.h,v 1.8 2018/04/19 21:50:10 christos Exp $	 */
+/*	$NetBSD: at_var.h,v 1.8.6.1 2019/10/10 17:30:02 martin Exp $	 */
 
 /*
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -75,13 +75,13 @@ sockaddr_at_init1(struct sockaddr_at *sa
 {
 	sat->sat_port = port;
 	sat->sat_addr = *addr;
-	memset(>sat_range, 0, sizeof(sat->sat_range));
 }
 
 static __inline void
 sockaddr_at_init(struct sockaddr_at *sat, const struct at_addr *addr,
 uint8_t port)
 {
+	memset(sat, 0, sizeof(*sat));
 	sat->sat_family = AF_APPLETALK;
 	sat->sat_len = sizeof(*sat);
 	sockaddr_at_init1(sat, addr, port);
@@ -92,7 +92,8 @@ sockaddr_at_alloc(const struct at_addr *
 {
 	struct sockaddr *sa;
 
-	sa = sockaddr_alloc(AF_APPLETALK, sizeof(struct sockaddr_at), flags);
+	sa = sockaddr_alloc(AF_APPLETALK, sizeof(struct sockaddr_at),
+	flags | M_ZERO);
 
 	if (sa == NULL)
 		return NULL;



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

2019-10-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 10 17:30:02 UTC 2019

Modified Files:
src/sys/netatalk [netbsd-9]: at_var.h

Log Message:
Pull up following revision(s) (requested by maxv in ticket #297):

sys/netatalk/at_var.h: revision 1.9

Memset to prevent stack info leak.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.6.1 src/sys/netatalk/at_var.h

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/namedb

2019-10-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 10 17:27:23 UTC 2019

Modified Files:
src/etc/namedb [netbsd-9]: root.cache

Log Message:
Pull up following revision(s) (requested by sevan in ticket #296):

etc/namedb/root.cache: revision 1.25

Update to 2019093001


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.2.1 src/etc/namedb/root.cache

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

Modified files:

Index: src/etc/namedb/root.cache
diff -u src/etc/namedb/root.cache:1.24 src/etc/namedb/root.cache:1.24.2.1
--- src/etc/namedb/root.cache:1.24	Sat Jan  5 21:47:40 2019
+++ src/etc/namedb/root.cache	Thu Oct 10 17:27:23 2019
@@ -1,90 +1,90 @@
-;	$NetBSD: root.cache,v 1.24 2019/01/05 21:47:40 christos Exp $
-;   This file holds the information on root name servers needed to
+;	$NetBSD: root.cache,v 1.24.2.1 2019/10/10 17:27:23 martin Exp $
+;   This file holds the information on root name servers needed to 
 ;   initialize cache of Internet domain name servers
 ;   (e.g. reference this file in the "cache  .  "
-;   configuration file of BIND domain name servers).
-;
-;   This file is made available by InterNIC
+;   configuration file of BIND domain name servers). 
+; 
+;   This file is made available by InterNIC 
 ;   under anonymous FTP as
-;   file/domain/named.cache
+;   file/domain/named.cache 
 ;   on server   FTP.INTERNIC.NET
 ;   -OR-RS.INTERNIC.NET
-;
-;   last update: November 14, 2018
-;   related version of root zone: 2018111402
-;
-; FORMERLY NS.INTERNIC.NET
+; 
+;   last update: September 30, 2019 
+;   related version of root zone: 2019093001
+; 
+; FORMERLY NS.INTERNIC.NET 
 ;
 .360  NSA.ROOT-SERVERS.NET.
 A.ROOT-SERVERS.NET.  360  A 198.41.0.4
 A.ROOT-SERVERS.NET.  360    2001:503:ba3e::2:30
-;
-; FORMERLY NS1.ISI.EDU
+; 
+; FORMERLY NS1.ISI.EDU 
 ;
 .360  NSB.ROOT-SERVERS.NET.
 B.ROOT-SERVERS.NET.  360  A 199.9.14.201
 B.ROOT-SERVERS.NET.  360    2001:500:200::b
-;
-; FORMERLY C.PSI.NET
+; 
+; FORMERLY C.PSI.NET 
 ;
 .360  NSC.ROOT-SERVERS.NET.
 C.ROOT-SERVERS.NET.  360  A 192.33.4.12
 C.ROOT-SERVERS.NET.  360    2001:500:2::c
-;
-; FORMERLY TERP.UMD.EDU
+; 
+; FORMERLY TERP.UMD.EDU 
 ;
 .360  NSD.ROOT-SERVERS.NET.
 D.ROOT-SERVERS.NET.  360  A 199.7.91.13
 D.ROOT-SERVERS.NET.  360    2001:500:2d::d
-;
+; 
 ; FORMERLY NS.NASA.GOV
 ;
 .360  NSE.ROOT-SERVERS.NET.
 E.ROOT-SERVERS.NET.  360  A 192.203.230.10
 E.ROOT-SERVERS.NET.  360    2001:500:a8::e
-;
+; 
 ; FORMERLY NS.ISC.ORG
 ;
 .360  NSF.ROOT-SERVERS.NET.
 F.ROOT-SERVERS.NET.  360  A 192.5.5.241
 F.ROOT-SERVERS.NET.  360    2001:500:2f::f
-;
+; 
 ; FORMERLY NS.NIC.DDN.MIL
 ;
 .360  NSG.ROOT-SERVERS.NET.
 G.ROOT-SERVERS.NET.  360  A 192.112.36.4
 G.ROOT-SERVERS.NET.  360    2001:500:12::d0d
-;
+; 
 ; FORMERLY AOS.ARL.ARMY.MIL
 ;
 .360  NSH.ROOT-SERVERS.NET.
 H.ROOT-SERVERS.NET.  360  A 198.97.190.53
 H.ROOT-SERVERS.NET.  360    2001:500:1::53
-;
+; 
 ; FORMERLY NIC.NORDU.NET
 ;
 .360  NSI.ROOT-SERVERS.NET.
 I.ROOT-SERVERS.NET.  360  A 192.36.148.17
 I.ROOT-SERVERS.NET.  360    2001:7fe::53
-;
+; 
 ; OPERATED BY VERISIGN, INC.
 ;
 .360  NSJ.ROOT-SERVERS.NET.
 J.ROOT-SERVERS.NET.  360  A 192.58.128.30
 J.ROOT-SERVERS.NET.  360    2001:503:c27::2:30
-;
+; 
 ; OPERATED BY RIPE NCC
 ;
 .360  NSK.ROOT-SERVERS.NET.
 K.ROOT-SERVERS.NET.  360  A 193.0.14.129
 K.ROOT-SERVERS.NET.  360    2001:7fd::1
-;
+; 
 ; OPERATED BY ICANN
 ;
 .360  NSL.ROOT-SERVERS.NET.
 L.ROOT-SERVERS.NET.  360  A 199.7.83.42
 L.ROOT-SERVERS.NET.  360    2001:500:9f::42
-;
+; 
 ; OPERATED BY WIDE
 ;
 .360  NSM.ROOT-SERVERS.NET.



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

2019-10-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 10 17:27:23 UTC 2019

Modified Files:
src/etc/namedb [netbsd-9]: root.cache

Log Message:
Pull up following revision(s) (requested by sevan in ticket #296):

etc/namedb/root.cache: revision 1.25

Update to 2019093001


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.2.1 src/etc/namedb/root.cache

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

2019-10-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 10 17:25:48 UTC 2019

Modified Files:
src/etc [netbsd-9]: services

Log Message:
Pull up following revision(s) (requested by sevan in ticket #295):

etc/services: revision 1.102

sync with latest from IANA


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.101.2.1 src/etc/services

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

diffs are larger than 1MB and have been omitted


CVS commit: [netbsd-9] src/etc

2019-10-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 10 17:25:48 UTC 2019

Modified Files:
src/etc [netbsd-9]: services

Log Message:
Pull up following revision(s) (requested by sevan in ticket #295):

etc/services: revision 1.102

sync with latest from IANA


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.101.2.1 src/etc/services

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



CVS commit: [netbsd-9] src/sys/kern

2019-10-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 10 17:23:45 UTC 2019

Modified Files:
src/sys/kern [netbsd-9]: sysv_shm.c

Log Message:
Pull up following revision(s) (requested by chs in ticket #294):

sys/kern/sysv_shm.c: revision 1.140,1.141

revert rev 1.139 (fixing a race between shmat() and shmdt())
that approach turned out to be too complicated.

 -

simpler fix for the race between shmat() and shmdt():
change shmat() to hold shm_lock until it is completely done.


To generate a diff of this commit:
cvs rdiff -u -r1.135.2.3 -r1.135.2.4 src/sys/kern/sysv_shm.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/sys/kern

2019-10-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 10 17:23:45 UTC 2019

Modified Files:
src/sys/kern [netbsd-9]: sysv_shm.c

Log Message:
Pull up following revision(s) (requested by chs in ticket #294):

sys/kern/sysv_shm.c: revision 1.140,1.141

revert rev 1.139 (fixing a race between shmat() and shmdt())
that approach turned out to be too complicated.

 -

simpler fix for the race between shmat() and shmdt():
change shmat() to hold shm_lock until it is completely done.


To generate a diff of this commit:
cvs rdiff -u -r1.135.2.3 -r1.135.2.4 src/sys/kern/sysv_shm.c

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

Modified files:

Index: src/sys/kern/sysv_shm.c
diff -u src/sys/kern/sysv_shm.c:1.135.2.3 src/sys/kern/sysv_shm.c:1.135.2.4
--- src/sys/kern/sysv_shm.c:1.135.2.3	Thu Oct  3 17:20:33 2019
+++ src/sys/kern/sysv_shm.c	Thu Oct 10 17:23:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysv_shm.c,v 1.135.2.3 2019/10/03 17:20:33 martin Exp $	*/
+/*	$NetBSD: sysv_shm.c,v 1.135.2.4 2019/10/10 17:23:45 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2007 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sysv_shm.c,v 1.135.2.3 2019/10/03 17:20:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sysv_shm.c,v 1.135.2.4 2019/10/10 17:23:45 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sysv.h"
@@ -87,7 +87,6 @@ struct shmmap_entry {
 	SLIST_ENTRY(shmmap_entry) next;
 	vaddr_t va;
 	int shmid;
-	bool busy;
 };
 
 int			shm_nused		__cacheline_aligned;
@@ -314,10 +313,8 @@ sys_shmdt(struct lwp *l, const struct sy
 	struct uvm_object *uobj;
 	struct shmid_ds *shmseg;
 	size_t size;
-	int segnum;
 
 	mutex_enter(_lock);
-restart:
 	/* In case of reallocation, we will wait for completion */
 	while (__predict_false(shm_realloc_state))
 		cv_wait(_realloc_cv, _lock);
@@ -349,18 +346,12 @@ restart:
 		}
 	}
 
-	segnum = IPCID_TO_IX(shmmap_se->shmid);
-	if (shmmap_se->busy) {
-		cv_wait(_cv[segnum], _lock);
-		goto restart;
-	}
-
 	SHMPRINTF(("shmdt: vm %p: remove %d @%lx\n",
 	p->p_vmspace, shmmap_se->shmid, shmmap_se->va));
 
 	/* Delete the entry from shm map */
 	uobj = shm_delete_mapping(shmmap_s, shmmap_se);
-	shmseg = [segnum];
+	shmseg = [IPCID_TO_IX(shmmap_se->shmid)];
 	size = (shmseg->shm_segsz + PGOFSET) & ~PGOFSET;
 	mutex_exit(_lock);
 
@@ -395,13 +386,10 @@ sys_shmat(struct lwp *l, const struct sy
 	vaddr_t attach_va;
 	vm_prot_t prot;
 	vsize_t size;
-	int segnum;
 
 	/* Allocate a new map entry and set it */
 	shmmap_se = kmem_alloc(sizeof(struct shmmap_entry), KM_SLEEP);
 	shmmap_se->shmid = SCARG(uap, shmid);
-	shmmap_se->busy = true;
-	segnum = IPCID_TO_IX(shmmap_se->shmid);
 
 	mutex_enter(_lock);
 	/* In case of reallocation, we will wait for completion */
@@ -449,44 +437,30 @@ sys_shmat(struct lwp *l, const struct sy
 
 	/*
 	 * Create a map entry, add it to the list and increase the counters.
-	 * The lock will be dropped before the mapping, disable reallocation.
 	 */
 	shmmap_s = shmmap_getprivate(p);
 	SLIST_INSERT_HEAD(_s->entries, shmmap_se, next);
 	shmmap_s->nitems++;
 	shmseg->shm_lpid = p->p_pid;
 	shmseg->shm_nattch++;
-	shm_realloc_disable++;
 
 	/*
-	 * Add a reference to the uvm object while we hold the
-	 * shm_lock.
+	 * Map the segment into the address space.
 	 */
 	uobj = shmseg->_shm_internal;
 	uao_reference(uobj);
-	mutex_exit(_lock);
-
-	/*
-	 * Drop the shm_lock to map it into the address space, and lock
-	 * the memory, if needed (XXX where does this lock memory?).
-	 */
 	error = uvm_map(>vm_map, _va, size, uobj, 0, 0,
 	UVM_MAPFLAG(prot, prot, UVM_INH_SHARE, UVM_ADV_RANDOM, flags));
 	if (error)
 		goto err_detach;
 
 	/* Set the new address, and update the time */
-	mutex_enter(_lock);
 	shmmap_se->va = attach_va;
-	shmmap_se->busy = false;
 	shmseg->shm_atime = time_second;
-	shm_realloc_disable--;
 	retval[0] = attach_va;
 	SHMPRINTF(("shmat: vm %p: add %d @%lx\n",
 	p->p_vmspace, shmmap_se->shmid, attach_va));
-	cv_broadcast(_cv[segnum]);
 err:
-	cv_broadcast(_realloc_cv);
 	mutex_exit(_lock);
 	if (error && shmmap_se) {
 		kmem_free(shmmap_se, sizeof(struct shmmap_entry));
@@ -495,11 +469,7 @@ err:
 
 err_detach:
 	uao_detach(uobj);
-	mutex_enter(_lock);
 	uobj = shm_delete_mapping(shmmap_s, shmmap_se);
-	shm_realloc_disable--;
-	cv_broadcast(_cv[segnum]);
-	cv_broadcast(_realloc_cv);
 	mutex_exit(_lock);
 	if (uobj != NULL) {
 		uao_detach(uobj);



CVS commit: src/sys

2019-10-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Oct 10 13:45:14 UTC 2019

Modified Files:
src/sys/kern: subr_asan.c
src/sys/sys: systm.h

Log Message:
Add KASAN instrumentation on ucas and ufetch.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/kern/subr_asan.c
cvs rdiff -u -r1.286 -r1.287 src/sys/sys/systm.h

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

Modified files:

Index: src/sys/kern/subr_asan.c
diff -u src/sys/kern/subr_asan.c:1.15 src/sys/kern/subr_asan.c:1.16
--- src/sys/kern/subr_asan.c:1.15	Fri Oct  4 06:27:42 2019
+++ src/sys/kern/subr_asan.c	Thu Oct 10 13:45:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_asan.c,v 1.15 2019/10/04 06:27:42 maxv Exp $	*/
+/*	$NetBSD: subr_asan.c,v 1.16 2019/10/10 13:45:14 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018-2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.15 2019/10/04 06:27:42 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.16 2019/10/10 13:45:14 maxv Exp $");
 
 #include 
 #include 
@@ -559,6 +559,109 @@ kasan_copyoutstr(const void *kaddr, void
 
 /* -- */
 
+#undef _ucas_32
+#undef _ucas_32_mp
+#undef _ucas_64
+#undef _ucas_64_mp
+#undef _ufetch_8
+#undef _ufetch_16
+#undef _ufetch_32
+#undef _ufetch_64
+
+int _ucas_32(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
+int kasan__ucas_32(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
+int
+kasan__ucas_32(volatile uint32_t *uaddr, uint32_t old, uint32_t new,
+uint32_t *ret)
+{
+	kasan_shadow_check((unsigned long)ret, sizeof(*ret), true,
+	__RET_ADDR);
+	return _ucas_32(uaddr, old, new, ret);
+}
+
+#ifdef __HAVE_UCAS_MP
+int _ucas_32_mp(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
+int kasan__ucas_32_mp(volatile uint32_t *, uint32_t, uint32_t, uint32_t *);
+int
+kasan__ucas_32_mp(volatile uint32_t *uaddr, uint32_t old, uint32_t new,
+uint32_t *ret)
+{
+	kasan_shadow_check((unsigned long)ret, sizeof(*ret), true,
+	__RET_ADDR);
+	return _ucas_32_mp(uaddr, old, new, ret);
+}
+#endif
+
+#ifdef _LP64
+int _ucas_64(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
+int kasan__ucas_64(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
+int
+kasan__ucas_64(volatile uint64_t *uaddr, uint64_t old, uint64_t new,
+uint64_t *ret)
+{
+	kasan_shadow_check((unsigned long)ret, sizeof(*ret), true,
+	__RET_ADDR);
+	return _ucas_64(uaddr, old, new, ret);
+}
+
+#ifdef __HAVE_UCAS_MP
+int _ucas_64_mp(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
+int kasan__ucas_64_mp(volatile uint64_t *, uint64_t, uint64_t, uint64_t *);
+int
+kasan__ucas_64_mp(volatile uint64_t *uaddr, uint64_t old, uint64_t new,
+uint64_t *ret)
+{
+	kasan_shadow_check((unsigned long)ret, sizeof(*ret), true,
+	__RET_ADDR);
+	return _ucas_64_mp(uaddr, old, new, ret);
+}
+#endif
+#endif
+
+int _ufetch_8(const uint8_t *, uint8_t *);
+int kasan__ufetch_8(const uint8_t *, uint8_t *);
+int
+kasan__ufetch_8(const uint8_t *uaddr, uint8_t *valp)
+{
+	kasan_shadow_check((unsigned long)valp, sizeof(*valp), true,
+	__RET_ADDR);
+	return _ufetch_8(uaddr, valp);
+}
+
+int _ufetch_16(const uint16_t *, uint16_t *);
+int kasan__ufetch_16(const uint16_t *, uint16_t *);
+int
+kasan__ufetch_16(const uint16_t *uaddr, uint16_t *valp)
+{
+	kasan_shadow_check((unsigned long)valp, sizeof(*valp), true,
+	__RET_ADDR);
+	return _ufetch_16(uaddr, valp);
+}
+
+int _ufetch_32(const uint32_t *, uint32_t *);
+int kasan__ufetch_32(const uint32_t *, uint32_t *);
+int
+kasan__ufetch_32(const uint32_t *uaddr, uint32_t *valp)
+{
+	kasan_shadow_check((unsigned long)valp, sizeof(*valp), true,
+	__RET_ADDR);
+	return _ufetch_32(uaddr, valp);
+}
+
+#ifdef _LP64
+int _ufetch_64(const uint64_t *, uint64_t *);
+int kasan__ufetch_64(const uint64_t *, uint64_t *);
+int
+kasan__ufetch_64(const uint64_t *uaddr, uint64_t *valp)
+{
+	kasan_shadow_check((unsigned long)valp, sizeof(*valp), true,
+	__RET_ADDR);
+	return _ufetch_64(uaddr, valp);
+}
+#endif
+
+/* -- */
+
 #undef atomic_add_32
 #undef atomic_add_int
 #undef atomic_add_long

Index: src/sys/sys/systm.h
diff -u src/sys/sys/systm.h:1.286 src/sys/sys/systm.h:1.287
--- src/sys/sys/systm.h:1.286	Tue Jul 23 17:39:36 2019
+++ src/sys/sys/systm.h	Thu Oct 10 13:45:14 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: systm.h,v 1.286 2019/07/23 17:39:36 rin Exp $	*/
+/*	$NetBSD: systm.h,v 1.287 2019/10/10 13:45:14 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -43,6 +43,7 @@
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
 #include "opt_gprof.h"
+#include "opt_kasan.h"
 #include "opt_kleak.h"
 #include "opt_wsdisplay_compat.h"
 #endif
@@ -319,74 +320,102 @@ int	copyout_vmspace(struct vmspace *, co
 int	ioctl_copyin(int ioctlflags, const 

CVS commit: src/sys

2019-10-10 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Oct 10 13:45:14 UTC 2019

Modified Files:
src/sys/kern: subr_asan.c
src/sys/sys: systm.h

Log Message:
Add KASAN instrumentation on ucas and ufetch.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/kern/subr_asan.c
cvs rdiff -u -r1.286 -r1.287 src/sys/sys/systm.h

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



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

2019-10-10 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Oct 10 08:55:08 UTC 2019

Modified Files:
src/sys/arch/x86/pci: if_vmx.c

Log Message:
Fix kassert failure in vmxnet3_transmit(). Pointed out by ryo@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/x86/pci/if_vmx.c

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



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

2019-10-10 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Oct 10 08:55:08 UTC 2019

Modified Files:
src/sys/arch/x86/pci: if_vmx.c

Log Message:
Fix kassert failure in vmxnet3_transmit(). Pointed out by ryo@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/x86/pci/if_vmx.c

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

Modified files:

Index: src/sys/arch/x86/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.50 src/sys/arch/x86/pci/if_vmx.c:1.51
--- src/sys/arch/x86/pci/if_vmx.c:1.50	Mon Sep 30 07:13:54 2019
+++ src/sys/arch/x86/pci/if_vmx.c	Thu Oct 10 08:55:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.50 2019/09/30 07:13:54 knakahara Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.51 2019/10/10 08:55:08 knakahara Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.50 2019/09/30 07:13:54 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.51 2019/10/10 08:55:08 knakahara Exp $");
 
 #include 
 #include 
@@ -3276,7 +3276,9 @@ vmxnet3_transmit(struct ifnet *ifp, stru
 		vmxnet3_transmit_locked(ifp, txq);
 		VMXNET3_TXQ_UNLOCK(txq);
 	} else {
+		kpreempt_disable();
 		softint_schedule(txq->vxtxq_si);
+		kpreempt_enable();
 	}
 
 	return 0;



CVS commit: src/lib/libc

2019-10-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Oct 10 08:37:16 UTC 2019

Modified Files:
src/lib/libc/net: Makefile.inc
src/lib/libc/resolv: Makefile.inc
src/lib/libc/rpc: Makefile.inc

Log Message:
More cases to disable gcc-8 warnings only when we're using gcc>=8


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/lib/libc/net/Makefile.inc
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/resolv/Makefile.inc
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/rpc/Makefile.inc

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



CVS commit: src/lib/libc

2019-10-10 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu Oct 10 08:37:16 UTC 2019

Modified Files:
src/lib/libc/net: Makefile.inc
src/lib/libc/resolv: Makefile.inc
src/lib/libc/rpc: Makefile.inc

Log Message:
More cases to disable gcc-8 warnings only when we're using gcc>=8


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/lib/libc/net/Makefile.inc
cvs rdiff -u -r1.6 -r1.7 src/lib/libc/resolv/Makefile.inc
cvs rdiff -u -r1.24 -r1.25 src/lib/libc/rpc/Makefile.inc

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

Modified files:

Index: src/lib/libc/net/Makefile.inc
diff -u src/lib/libc/net/Makefile.inc:1.89 src/lib/libc/net/Makefile.inc:1.90
--- src/lib/libc/net/Makefile.inc:1.89	Wed Oct  9 23:39:20 2019
+++ src/lib/libc/net/Makefile.inc	Thu Oct 10 08:37:16 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.89 2019/10/09 23:39:20 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.90 2019/10/10 08:37:16 kre Exp $
 #	@(#)Makefile.inc	8.2 (Berkeley) 9/5/93
 
 # net sources
@@ -30,7 +30,7 @@ LPREFIX=_nsyy
 YPREFIX=_nsyy
 YHEADER=1
 
-.if ${ACTIVE_CC} == "gcc"
+.if defined(HAVE_GCC) && ${HAVE_GCC} >= 8 && ${ACTIVE_CC} == "gcc"
 COPTS.getaddrinfo.c += -Wno-error=stringop-overflow
 .endif
 

Index: src/lib/libc/resolv/Makefile.inc
diff -u src/lib/libc/resolv/Makefile.inc:1.6 src/lib/libc/resolv/Makefile.inc:1.7
--- src/lib/libc/resolv/Makefile.inc:1.6	Wed Oct  9 23:39:20 2019
+++ src/lib/libc/resolv/Makefile.inc	Thu Oct 10 08:37:16 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.6 2019/10/09 23:39:20 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.7 2019/10/10 08:37:16 kre Exp $
 
 # net sources
 .PATH: ${.CURDIR}/resolv
@@ -10,6 +10,6 @@ SRCS+=	h_errno.c herror.c res_comp.c res
 # For COMPAT__RES
 SRCS+=	res_compat.c
 
-.if ${ACTIVE_CC} == "gcc"
+.if defined(HAVE_GCC) && ${HAVE_GCC} >= 8 && ${ACTIVE_CC} == "gcc"
 COPTS.res_query.c += -Wno-error=stringop-overflow
 .endif

Index: src/lib/libc/rpc/Makefile.inc
diff -u src/lib/libc/rpc/Makefile.inc:1.24 src/lib/libc/rpc/Makefile.inc:1.25
--- src/lib/libc/rpc/Makefile.inc:1.24	Wed Oct  9 23:39:20 2019
+++ src/lib/libc/rpc/Makefile.inc	Thu Oct 10 08:37:16 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.24 2019/10/09 23:39:20 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.25 2019/10/10 08:37:16 kre Exp $
 
 # librpc sources
 .PATH:	${.CURDIR}/rpc
@@ -18,7 +18,7 @@ SRCS+=	auth_none.c auth_unix.c authunix_
 
 CPPFLAGS+=	-DPORTMAP
 
-.if ${ACTIVE_CC} == "gcc"
+.if defined(HAVE_GCC) && ${HAVE_GCC} >= 8 && ${ACTIVE_CC} == "gcc"
 COPTS.clnt_bcast.c += -Wno-error=cast-function-type
 COPTS.clnt_generic.c += -Wno-error=cast-function-type
 COPTS.clnt_vc.c += -Wno-error=cast-function-type