CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Sat Apr 20 05:53:18 UTC 2019 Modified Files: src/sys/dev/usb: ucom.c umodem_common.c umodemvar.h Log Message: fix umodem(4) detach: - ucom(4) needs kpreempt disabled around softint_schedule() - switch a copied printf() to aprint_error_dev() - use static normally in umodem_common.c - remove unused sc_openings in softc, convert sc_dying to real bool - add sc_refcnt, sc_lock and sc_detach_cv to softc. usage is: - sc_dying is protected by sc_lock - sc_detach_cv is matched with sc_lock for cv operations - sc_refcnt is increased in open and decreased in close, any time it is decreased, it is checked for less than zero, and a broadcast performed on sc_detach_cv. detach waits for sc_refcnt. - umodem_param() and umodem_set() check for sc_dying this fixes pullout out an open ucom@umodem. @skrll. XXX: pullup To generate a diff of this commit: cvs rdiff -u -r1.121 -r1.122 src/sys/dev/usb/ucom.c cvs rdiff -u -r1.26 -r1.27 src/sys/dev/usb/umodem_common.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/umodemvar.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/ucom.c diff -u src/sys/dev/usb/ucom.c:1.121 src/sys/dev/usb/ucom.c:1.122 --- src/sys/dev/usb/ucom.c:1.121 Tue Dec 11 14:49:27 2018 +++ src/sys/dev/usb/ucom.c Sat Apr 20 05:53:18 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ucom.c,v 1.121 2018/12/11 14:49:27 jakllsch Exp $ */ +/* $NetBSD: ucom.c,v 1.122 2019/04/20 05:53:18 mrg Exp $ */ /* * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.121 2018/12/11 14:49:27 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.122 2019/04/20 05:53:18 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -441,10 +441,8 @@ ucom_detach(device_t self, int flags) mutex_spin_exit(_lock); } /* Wait for processes to go away. */ - if (cv_timedwait(>sc_detachcv, >sc_lock, hz * 60)) { - printf("%s: %s didn't detach\n", __func__, - device_xname(sc->sc_dev)); - } + if (cv_timedwait(>sc_detachcv, >sc_lock, hz * 60)) + aprint_error_dev(self, ": didn't detach\n"); } softint_disestablish(sc->sc_si); @@ -1271,7 +1269,9 @@ ucomhwiflow(struct tty *tp, int block) if (old && !block) { sc->sc_rx_unblock = 1; + kpreempt_disable(); softint_schedule(sc->sc_si); + kpreempt_enable(); } mutex_exit(>sc_lock); @@ -1339,7 +1339,9 @@ ucomstart(struct tty *tp) SIMPLEQ_INSERT_TAIL(>sc_obuff_full, ub, ub_link); + kpreempt_disable(); softint_schedule(sc->sc_si); + kpreempt_enable(); out: DPRINTF("... done", 0, 0, 0, 0); @@ -1381,7 +1383,9 @@ ucom_write_status(struct ucom_softc *sc, break; case USBD_STALLED: ub->ub_index = 0; + kpreempt_disable(); softint_schedule(sc->sc_si); + kpreempt_enable(); break; case USBD_NORMAL_COMPLETION: usbd_get_xfer_status(ub->ub_xfer, NULL, NULL, , NULL); Index: src/sys/dev/usb/umodem_common.c diff -u src/sys/dev/usb/umodem_common.c:1.26 src/sys/dev/usb/umodem_common.c:1.27 --- src/sys/dev/usb/umodem_common.c:1.26 Fri Jan 4 17:09:26 2019 +++ src/sys/dev/usb/umodem_common.c Sat Apr 20 05:53:18 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: umodem_common.c,v 1.26 2019/01/04 17:09:26 tih Exp $ */ +/* $NetBSD: umodem_common.c,v 1.27 2019/04/20 05:53:18 mrg Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.26 2019/01/04 17:09:26 tih Exp $"); +__KERNEL_RCSID(0, "$NetBSD: umodem_common.c,v 1.27 2019/04/20 05:53:18 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -94,16 +94,16 @@ int umodemdebug = 0; #define UMODEMIBUFSIZE 4096 #define UMODEMOBUFSIZE 4096 -Static usbd_status umodem_set_comm_feature(struct umodem_softc *, +static usbd_status umodem_set_comm_feature(struct umodem_softc *, int, int); -Static usbd_status umodem_set_line_coding(struct umodem_softc *, +static usbd_status umodem_set_line_coding(struct umodem_softc *, usb_cdc_line_state_t *); -Static void umodem_dtr(struct umodem_softc *, int); -Static void umodem_rts(struct umodem_softc *, int); -Static void umodem_break(struct umodem_softc *, int); -Static void umodem_set_line_state(struct umodem_softc *); -Static void umodem_intr(struct usbd_xfer *, void *, usbd_status); +static void umodem_dtr(struct umodem_softc *, int); +static void umodem_rts(struct umodem_softc *, int); +static void umodem_break(struct umodem_softc *, int); +static void umodem_set_line_state(struct umodem_softc *); +static void umodem_intr(struct usbd_xfer *, void *, usbd_status); int umodem_common_attach(device_t self, struct umodem_softc *sc, @@ -120,10 +120,15 @@ umodem_common_attach(device_t self, stru sc->sc_dev = self; sc->sc_udev = dev; sc->sc_ctl_iface = uiaa->uiaa_iface; + sc->sc_refcnt = 0; + sc->sc_dying = false;
CVS commit: src/share/mk
Module Name:src Committed By: kamil Date: Fri Apr 19 22:06:03 UTC 2019 Modified Files: src/share/mk: bsd.README Log Message: Fix typo cost -> host To generate a diff of this commit: cvs rdiff -u -r1.390 -r1.391 src/share/mk/bsd.README Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.README diff -u src/share/mk/bsd.README:1.390 src/share/mk/bsd.README:1.391 --- src/share/mk/bsd.README:1.390 Sun Apr 7 19:32:24 2019 +++ src/share/mk/bsd.README Fri Apr 19 22:06:03 2019 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.README,v 1.390 2019/04/07 19:32:24 christos Exp $ +# $NetBSD: bsd.README,v 1.391 2019/04/19 22:06:03 kamil Exp $ # @(#)bsd.README 8.2 (Berkeley) 4/2/94 This is the README file for the make "include" files for the NetBSD @@ -2126,7 +2126,7 @@ HOST_COMPILE.cc The host c++ compiler l HOST_CPP The host c pre-processor -HOST_CPPFLAGS The cost c pre-processor flags +HOST_CPPFLAGS The host c pre-processor flags HOST_CXX The host c++ compiler
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: kamil Date: Fri Apr 19 21:54:33 UTC 2019 Modified Files: src/tests/lib/libc/sys: t_ptrace_wait.c Log Message: Fix typo in TEST_VFORK_ENABLED This allows building and running vfork(2) test scenarios correctly. To generate a diff of this commit: cvs rdiff -u -r1.110 -r1.111 src/tests/lib/libc/sys/t_ptrace_wait.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/sys/t_ptrace_wait.c diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.110 src/tests/lib/libc/sys/t_ptrace_wait.c:1.111 --- src/tests/lib/libc/sys/t_ptrace_wait.c:1.110 Wed Apr 17 15:54:55 2019 +++ src/tests/lib/libc/sys/t_ptrace_wait.c Fri Apr 19 21:54:32 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: t_ptrace_wait.c,v 1.110 2019/04/17 15:54:55 kamil Exp $ */ +/* $NetBSD: t_ptrace_wait.c,v 1.111 2019/04/19 21:54:32 kamil Exp $ */ /*- * Copyright (c) 2016, 2017, 2018, 2019 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__RCSID("$NetBSD: t_ptrace_wait.c,v 1.110 2019/04/17 15:54:55 kamil Exp $"); +__RCSID("$NetBSD: t_ptrace_wait.c,v 1.111 2019/04/19 21:54:32 kamil Exp $"); #include #include @@ -7011,7 +7011,7 @@ CLONE_TEST2(clone_vfork_signalmasked, CL /// -#if TEST_VFORK_ENABLE +#if TEST_VFORK_ENABLED #if defined(TWAIT_HAVE_PID) static void traceme_vfork_clone_body(int flags)
CVS commit: src/share/mk
Module Name:src Committed By: mrg Date: Fri Apr 19 21:34:26 UTC 2019 Modified Files: src/share/mk: bsd.own.mk Log Message: switch ia64 to GCC 7. scole@ commited a workaround for the one new problem. this leaves ppc64 as the only GCC 6 port left. To generate a diff of this commit: cvs rdiff -u -r1.1131 -r1.1132 src/share/mk/bsd.own.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.1131 src/share/mk/bsd.own.mk:1.1132 --- src/share/mk/bsd.own.mk:1.1131 Thu Apr 18 20:11:57 2019 +++ src/share/mk/bsd.own.mk Fri Apr 19 21:34:26 2019 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.1131 2019/04/18 20:11:57 mrg Exp $ +# $NetBSD: bsd.own.mk,v 1.1132 2019/04/19 21:34:26 mrg Exp $ # This needs to be before bsd.init.mk .if defined(BSD_MK_COMPAT_FILE) @@ -59,7 +59,6 @@ TOOLCHAIN_MISSING?= no # What GCC is used? # .if \ -${MACHINE_CPU} == "ia64" || \ ${MACHINE_ARCH} == "powerpc64" HAVE_GCC?= 6 .endif
CVS commit: src/usr.sbin/makemandb
Module Name:src Committed By: abhinav Date: Fri Apr 19 20:35:14 UTC 2019 Modified Files: src/usr.sbin/makemandb: apropos-utils.c Log Message: Memory allocated by sqlite3_mprintf should be free'd by sqlite3_free This was causing memory corruption thus making apropos(1) fail in some cases. Specifically following options were broken and should be fixed with this commit: -n option was causing a core dump apropos was giving warning when using -l and any of the section numbers as options as reported by paulg on current-users. To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/usr.sbin/makemandb/apropos-utils.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/makemandb/apropos-utils.c diff -u src/usr.sbin/makemandb/apropos-utils.c:1.42 src/usr.sbin/makemandb/apropos-utils.c:1.43 --- src/usr.sbin/makemandb/apropos-utils.c:1.42 Sun Apr 14 07:59:56 2019 +++ src/usr.sbin/makemandb/apropos-utils.c Fri Apr 19 20:35:13 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: apropos-utils.c,v 1.42 2019/04/14 07:59:56 abhinav Exp $ */ +/* $NetBSD: apropos-utils.c,v 1.43 2019/04/19 20:35:13 abhinav Exp $ */ /*- * Copyright (c) 2011 Abhinav Upadhyay * All rights reserved. @@ -31,7 +31,7 @@ */ #include -__RCSID("$NetBSD: apropos-utils.c,v 1.42 2019/04/14 07:59:56 abhinav Exp $"); +__RCSID("$NetBSD: apropos-utils.c,v 1.43 2019/04/19 20:35:13 abhinav Exp $"); #include #include @@ -580,7 +580,7 @@ generate_search_query(query_args *args, if ((temp = sqlite3_mprintf("%Q%c", args->sections[i], c)) == NULL) goto RETURN; concat(_clause, temp); - free(temp); + sqlite3_free(temp); } } @@ -648,9 +648,9 @@ generate_search_query(query_args *args, } RETURN: - free(machine_clause); - free(section_clause); - free(limit_clause); + sqlite3_free(machine_clause); + sqlite3_free(section_clause); + sqlite3_free(limit_clause); return query; }
CVS commit: src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/amlogic
Module Name:src Committed By: jmcneill Date: Fri Apr 19 19:46:46 UTC 2019 Modified Files: src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/amlogic: meson-gxl.dtsi Log Message: Add the clock inputs of the clock controllers, from https://github.com/torvalds/linux/commit/16361ff23e20d2f967456fab9971152331b65117 To generate a diff of this commit: cvs rdiff -u -r1.1.1.7 -r1.2 \ src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi 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/gpl2/dts/dist/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi diff -u src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi:1.1.1.7 src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi:1.2 --- src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi:1.1.1.7 Tue Jan 22 14:57:03 2019 +++ src/sys/external/gpl2/dts/dist/arch/arm64/boot/dts/amlogic/meson-gxl.dtsi Fri Apr 19 19:46:46 2019 @@ -239,6 +239,8 @@ _AO { compatible = "amlogic,meson-gxl-aoclkc", "amlogic,meson-gx-aoclkc"; + clocks = <>, < CLKID_CLK81>; + clock-names = "xtal", "mpeg-clk"; }; _intc { @@ -263,6 +265,8 @@ clkc: clock-controller { compatible = "amlogic,gxl-clkc"; #clock-cells = <1>; + clocks = <>; + clock-names = "xtal"; }; };
CVS commit: src/sys/dev/pci
Module Name:src Committed By: gutteridge Date: Fri Apr 19 19:37:31 UTC 2019 Modified Files: src/sys/dev/pci: if_iwn.c Log Message: if_iwn.c: add a comment noting which PCI IDs are covered by an else statement that loads a specific firmware variant. While here, also amend the formatting of two other comments. To generate a diff of this commit: cvs rdiff -u -r1.90 -r1.91 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.90 src/sys/dev/pci/if_iwn.c:1.91 --- src/sys/dev/pci/if_iwn.c:1.90 Tue Jun 26 06:48:01 2018 +++ src/sys/dev/pci/if_iwn.c Fri Apr 19 19:37:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_iwn.c,v 1.90 2018/06/26 06:48:01 msaitoh Exp $ */ +/* $NetBSD: if_iwn.c,v 1.91 2019/04/19 19:37:31 gutteridge 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.90 2018/06/26 06:48:01 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.91 2019/04/19 19:37:31 gutteridge Exp $"); #define IWN_USE_RBUF /* Use local storage for RX */ #undef IWN_HWCRYPTO /* XXX does not even compile yet */ @@ -523,9 +523,11 @@ iwn_attach(device_t parent __unused, dev ic->ic_opmode = IEEE80211_M_STA; /* default to BSS mode */ ic->ic_state = IEEE80211_S_INIT; - /* Set device capabilities. */ - /* XXX OpenBSD has IEEE80211_C_WEP, IEEE80211_C_RSN, - * and IEEE80211_C_PMGT too. */ + /* + * Set device capabilities. + * XXX OpenBSD has IEEE80211_C_WEP, IEEE80211_C_RSN, and + * IEEE80211_C_PMGT too. + */ ic->ic_caps = IEEE80211_C_IBSS | /* IBSS mode support */ IEEE80211_C_WPA | /* 802.11i */ @@ -622,7 +624,7 @@ iwn_attach(device_t parent __unused, dev /* * XXX for NetBSD, OpenBSD timeout_set replaced by * callout_init and callout_setfunc, above. - */ + */ if (pmf_device_register(self, NULL, iwn_resume)) pmf_class_network_register(self, ifp); @@ -780,6 +782,11 @@ iwn5000_attach(struct iwn_softc *sc, pci sc->fwname = "iwlwifi-6000g2b-6.ucode"; ops->config_bt_coex = iwn_config_bt_coex_adv1; } + /* + * This covers: + * PCI_PRODUCT_INTEL_WIFI_LINK_6005_2X2_1 + * PCI_PRODUCT_INTEL_WIFI_LINK_6005_2X2_2 + */ else sc->fwname = "iwlwifi-6000g2a-5.ucode"; break;
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: jmcneill Date: Fri Apr 19 19:36:26 UTC 2019 Modified Files: src/sys/arch/evbarm/conf: GENERIC64 Log Message: Remove qsphy(4), this 20+ year old PHY driver accidentally attaches to the Meson GXL internal PHY To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sys/arch/evbarm/conf/GENERIC64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/GENERIC64 diff -u src/sys/arch/evbarm/conf/GENERIC64:1.86 src/sys/arch/evbarm/conf/GENERIC64:1.87 --- src/sys/arch/evbarm/conf/GENERIC64:1.86 Fri Apr 19 19:07:55 2019 +++ src/sys/arch/evbarm/conf/GENERIC64 Fri Apr 19 19:36:26 2019 @@ -1,5 +1,5 @@ # -# $NetBSD: GENERIC64,v 1.86 2019/04/19 19:07:55 jmcneill Exp $ +# $NetBSD: GENERIC64,v 1.87 2019/04/19 19:36:26 jmcneill Exp $ # # GENERIC ARM (aarch64) kernel # @@ -286,7 +286,6 @@ makphy* at mii? phy ? # Marvell Semico nsphy* at mii? phy ? # NS83840 PHYs nsphyter* at mii? phy ? # NS83843 PHYs pnaphy* at mii? phy ? # generic HomePNA PHYs -qsphy* at mii? phy ? # Quality Semiconductor QS6612 PHYs rdcphy* at mii? phy ? # RDC R6040 10/100 PHY rgephy* at mii? phy ? # Realtek 8169S/8110S internal PHYs rlphy* at mii? phy ? # Realtek 8139/8201L PHYs
CVS commit: src/doc
Module Name:src Committed By: jmcneill Date: Fri Apr 19 19:09:12 UTC 2019 Modified Files: src/doc: CHANGES Log Message: evbarm: Add support for Amlogic GXL family SoCs. To generate a diff of this commit: cvs rdiff -u -r1.2524 -r1.2525 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/CHANGES diff -u src/doc/CHANGES:1.2524 src/doc/CHANGES:1.2525 --- src/doc/CHANGES:1.2524 Wed Apr 17 23:38:33 2019 +++ src/doc/CHANGES Fri Apr 19 19:09:11 2019 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2524 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2525 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -341,7 +341,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0: bge(4): Add support for BCM5762, BCM5725, BCM5727, BCM57764, BCM57767 and BCM57787 [msaitoh 20190220] bind: Import version 9.13.7. [christos 20190224] - evbarm: Add support for Amlogic S905 SoC. [jmcneill 20190225] + evbarm: Add support for Amlogic GXBB family SoCs. [jmcneill 20190225] jemalloc(3): Import 5.1.0 [christos 20190304] kcov(4): Added driver for kernel coverage tracing [kamil 20190310] mdocml: Import 1.14.5. [christos 20190310] @@ -355,3 +355,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0: npf(7): Include npf_boot rc script which loads npf.boot.conf to protect host during early stages of startup. [sevan 20190410] dhcpcd(8): Import dhcpcd-7.2.0 [roy 20190418] + evbarm: Add support for Amlogic GXL family SoCs. [jmcneill 20190419]
CVS commit: src/sys/arch
Module Name:src Committed By: jmcneill Date: Fri Apr 19 19:07:56 UTC 2019 Modified Files: src/sys/arch/arm/amlogic: files.meson meson_clk.c meson_dwmac.c meson_pinctrl.c meson_pinctrl.h meson_platform.c mesongxbb_aoclkc.c mesongxbb_clkc.c src/sys/arch/evbarm/conf: GENERIC64 Added Files: src/sys/arch/arm/amlogic: mesongxl_pinctrl.c mesongxl_usb2phy.c mesongxl_usb3phy.c Log Message: Add support for Amlogic Meson GXL family SoCs. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/amlogic/files.meson cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/amlogic/meson_clk.c \ src/sys/arch/arm/amlogic/meson_pinctrl.h cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/amlogic/meson_dwmac.c \ src/sys/arch/arm/amlogic/meson_pinctrl.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/amlogic/meson_platform.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/amlogic/mesongxbb_aoclkc.c \ src/sys/arch/arm/amlogic/mesongxbb_clkc.c cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/amlogic/mesongxl_pinctrl.c \ src/sys/arch/arm/amlogic/mesongxl_usb2phy.c \ src/sys/arch/arm/amlogic/mesongxl_usb3phy.c cvs rdiff -u -r1.85 -r1.86 src/sys/arch/evbarm/conf/GENERIC64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/amlogic/files.meson diff -u src/sys/arch/arm/amlogic/files.meson:1.6 src/sys/arch/arm/amlogic/files.meson:1.7 --- src/sys/arch/arm/amlogic/files.meson:1.6 Fri Apr 5 12:11:26 2019 +++ src/sys/arch/arm/amlogic/files.meson Fri Apr 19 19:07:56 2019 @@ -1,4 +1,4 @@ -# $NetBSD: files.meson,v 1.6 2019/04/05 12:11:26 jmcneill Exp $ +# $NetBSD: files.meson,v 1.7 2019/04/19 19:07:56 jmcneill Exp $ # # Configuration info for Amlogic Meson family SoCs # @@ -53,6 +53,7 @@ attach mesonpinctrl at fdt with meson_pi file arch/arm/amlogic/meson_pinctrl.c meson_pinctrl file arch/arm/amlogic/meson8b_pinctrl.c meson_pinctrl & soc_meson8b file arch/arm/amlogic/mesongxbb_pinctrl.c meson_pinctrl & soc_mesongxbb +file arch/arm/amlogic/mesongxl_pinctrl.c meson_pinctrl & soc_mesongxl # Meson8b SDHC device mesonsdhc: sdmmcbus @@ -74,6 +75,16 @@ device mesonusbphy attach mesonusbphy at fdt with meson_usbphy file arch/arm/amlogic/meson_usbphy.c meson_usbphy +# Meson GXL USB2 PHY +device mesongxlu2phy +attach mesongxlu2phy at fdt with mesongxl_usb2phy +file arch/arm/amlogic/mesongxl_usb2phy.c mesongxl_usb2phy + +# Meson GXL USB3 PHY +device mesongxlu3phy +attach mesongxlu3phy at fdt with mesongxl_usb3phy +file arch/arm/amlogic/mesongxl_usb3phy.c mesongxl_usb3phy + # RTC device mesonrtc attach mesonrtc at fdt with meson_rtc @@ -96,4 +107,6 @@ file arch/arm/amlogic/meson_wdt.c meson # SOC parameters defflag opt_soc.h SOC_MESON defflag opt_soc.h SOC_MESON8B: SOC_MESON -defflag opt_soc.h SOC_MESONGXBB: SOC_MESON +defflag opt_soc.h SOC_MESONGX: SOC_MESON +defflag opt_soc.h SOC_MESONGXBB: SOC_MESONGX +defflag opt_soc.h SOC_MESONGXL: SOC_MESONGX Index: src/sys/arch/arm/amlogic/meson_clk.c diff -u src/sys/arch/arm/amlogic/meson_clk.c:1.2 src/sys/arch/arm/amlogic/meson_clk.c:1.3 --- src/sys/arch/arm/amlogic/meson_clk.c:1.2 Mon Feb 25 19:30:17 2019 +++ src/sys/arch/arm/amlogic/meson_clk.c Fri Apr 19 19:07:56 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: meson_clk.c,v 1.2 2019/02/25 19:30:17 jmcneill Exp $ */ +/* $NetBSD: meson_clk.c,v 1.3 2019/04/19 19:07:56 jmcneill Exp $ */ /*- * Copyright (c) 2017-2019 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: meson_clk.c,v 1.2 2019/02/25 19:30:17 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: meson_clk.c,v 1.3 2019/04/19 19:07:56 jmcneill Exp $"); #include #include @@ -157,7 +157,7 @@ meson_clk_clock_get_rate(void *priv, str clkp_parent = clk_get_parent(clkp); if (clkp_parent == NULL) { - aprint_error("%s: no parent for %s\n", __func__, clk->base.name); + aprint_debug("%s: no parent for %s\n", __func__, clk->base.name); return 0; } @@ -174,7 +174,7 @@ meson_clk_clock_set_rate(void *priv, str if (clkp->flags & CLK_SET_RATE_PARENT) { clkp_parent = clk_get_parent(clkp); if (clkp_parent == NULL) { - aprint_error("%s: no parent for %s\n", __func__, clk->base.name); + aprint_debug("%s: no parent for %s\n", __func__, clk->base.name); return ENXIO; } return clk_set_rate(clkp_parent, rate); @@ -196,7 +196,7 @@ meson_clk_clock_round_rate(void *priv, s if (clkp->flags & CLK_SET_RATE_PARENT) { clkp_parent = clk_get_parent(clkp); if (clkp_parent == NULL) { - aprint_error("%s: no parent for %s\n", __func__, clk->base.name); + aprint_debug("%s: no parent for %s\n", __func__, clk->base.name); return 0; } return clk_round_rate(clkp_parent, rate); Index: src/sys/arch/arm/amlogic/meson_pinctrl.h diff -u src/sys/arch/arm/amlogic/meson_pinctrl.h:1.2 src/sys/arch/arm/amlogic/meson_pinctrl.h:1.3 ---
CVS commit: src/sys/dev/fdt
Module Name:src Committed By: jmcneill Date: Fri Apr 19 19:05:56 UTC 2019 Modified Files: src/sys/dev/fdt: dwc3_fdt.c Log Message: Add support for Meson GXL USB3 controller To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/dev/fdt/dwc3_fdt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/fdt/dwc3_fdt.c diff -u src/sys/dev/fdt/dwc3_fdt.c:1.6 src/sys/dev/fdt/dwc3_fdt.c:1.7 --- src/sys/dev/fdt/dwc3_fdt.c:1.6 Sun Aug 12 19:10:14 2018 +++ src/sys/dev/fdt/dwc3_fdt.c Fri Apr 19 19:05:56 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dwc3_fdt.c,v 1.6 2018/08/12 19:10:14 jmcneill Exp $ */ +/* $NetBSD: dwc3_fdt.c,v 1.7 2019/04/19 19:05:56 jmcneill Exp $ */ /*- * Copyright (c) 2018 Jared McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.6 2018/08/12 19:10:14 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.7 2019/04/19 19:05:56 jmcneill Exp $"); #include #include @@ -197,6 +197,7 @@ dwc3_fdt_match(device_t parent, cfdata_t { const char * const compatible[] = { "allwinner,sun50i-h6-dwc3", + "amlogic,meson-gxl-dwc3", "rockchip,rk3328-dwc3", "rockchip,rk3399-dwc3", "samsung,exynos5250-dwusb3", @@ -272,12 +273,10 @@ dwc3_fdt_attach(device_t parent, device_ aprint_normal(" (rev. %d.%03x)\n", rev >> 12, rev & 0xfff); /* Enable PHY devices */ - phy = fdtbus_phy_get(dwc3_phandle, "usb2-phy"); - if (phy && fdtbus_phy_enable(phy, true) != 0) - aprint_error_dev(self, "couldn't enable usb2-phy\n"); - phy = fdtbus_phy_get(dwc3_phandle, "usb3-phy"); - if (phy && fdtbus_phy_enable(phy, true) != 0) - aprint_error_dev(self, "couldn't enable usb3-phy\n"); + for (n = 0; (phy = fdtbus_phy_get_index(dwc3_phandle, n)) != NULL; n++) { + if (fdtbus_phy_enable(phy, true) != 0) + aprint_error_dev(self, "couldn't enable phy #%d\n", n); + } dwc3_fdt_soft_reset(sc); dwc3_fdt_enable_phy(sc, dwc3_phandle);
CVS commit: src/etc/rc.d
Module Name:src Committed By: leot Date: Fri Apr 19 18:36:25 UTC 2019 Modified Files: src/etc/rc.d: npf Log Message: Do not start npf again at reboot (it is started via npf_boot) To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/etc/rc.d/npf 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/npf diff -u src/etc/rc.d/npf:1.3 src/etc/rc.d/npf:1.4 --- src/etc/rc.d/npf:1.3 Thu Nov 1 06:06:14 2012 +++ src/etc/rc.d/npf Fri Apr 19 18:36:25 2019 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: npf,v 1.3 2012/11/01 06:06:14 mrg Exp $ +# $NetBSD: npf,v 1.4 2019/04/19 18:36:25 leot Exp $ # # Public Domain. # @@ -36,7 +36,11 @@ npf_start() echo "Enabling NPF." npf_cfg_check /sbin/npfctl reload - /sbin/npfctl start + + # The npf_boot script has enabled npf already. + if [ "$autoboot" != "yes" ]; then + /sbin/npfctl start + fi } npf_stop()
CVS commit: src/sys/arch/ia64/ia64
Module Name:src Committed By: scole Date: Fri Apr 19 16:28:32 UTC 2019 Modified Files: src/sys/arch/ia64/ia64: machdep.c Log Message: In map_vhpt(), read pmap_vhpt_log2size before any memory translation instructions to avoid "Data Nested TLB faults" with GCC 7.4.0 To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/sys/arch/ia64/ia64/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/ia64/ia64/machdep.c diff -u src/sys/arch/ia64/ia64/machdep.c:1.42 src/sys/arch/ia64/ia64/machdep.c:1.43 --- src/sys/arch/ia64/ia64/machdep.c:1.42 Sat Apr 6 03:06:25 2019 +++ src/sys/arch/ia64/ia64/machdep.c Fri Apr 19 16:28:32 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.42 2019/04/06 03:06:25 thorpej Exp $ */ +/* $NetBSD: machdep.c,v 1.43 2019/04/19 16:28:32 scole Exp $ */ /*- * Copyright (c) 2003,2004 Marcel Moolenaar @@ -267,18 +267,24 @@ map_vhpt(uintptr_t vhpt) pt_entry_t pte; uint64_t psr; + /* + * XXX read pmap_vhpt_log2size before any memory translation + * instructions to avoid "Data Nested TLB faults". Not + * exactly sure why this is needed with GCC 7.4 + */ + register uint64_t log2size = pmap_vhpt_log2size << 2; + pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY | PTE_PL_KERN | PTE_AR_RW; pte |= vhpt & PTE_PPN_MASK; -__asm __volatile("ptr.d %0,%1" :: "r"(vhpt), - "r"(pmap_vhpt_log2size << 2)); +__asm __volatile("ptr.d %0,%1" :: "r"(vhpt), "r"(log2size)); __asm __volatile("mov %0=psr" : "=r"(psr)); __asm __volatile("rsm psr.ic|psr.i"); ia64_srlz_i(); ia64_set_ifa(vhpt); -ia64_set_itir(pmap_vhpt_log2size << 2); + ia64_set_itir(log2size); ia64_srlz_d(); __asm __volatile("itr.d dtr[%0]=%1" :: "r"(3), "r"(pte)); __asm __volatile("mov psr.l=%0" :: "r" (psr));
CVS commit: [netbsd-7-0] src/doc
Module Name:src Committed By: martin Date: Fri Apr 19 16:05:05 UTC 2019 Modified Files: src/doc [netbsd-7-0]: CHANGES-7.0.3 Log Message: Ticket #1689 To generate a diff of this commit: cvs rdiff -u -r1.1.2.139 -r1.1.2.140 src/doc/CHANGES-7.0.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-7.0.3 diff -u src/doc/CHANGES-7.0.3:1.1.2.139 src/doc/CHANGES-7.0.3:1.1.2.140 --- src/doc/CHANGES-7.0.3:1.1.2.139 Tue Apr 16 03:57:12 2019 +++ src/doc/CHANGES-7.0.3 Fri Apr 19 16:05:05 2019 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.0.3,v 1.1.2.139 2019/04/16 03:57:12 msaitoh Exp $ +# $NetBSD: CHANGES-7.0.3,v 1.1.2.140 2019/04/19 16:05:05 martin Exp $ A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3 release: @@ -5778,3 +5778,13 @@ sys/kern/sys_mqueue.c1.44 mq_send1: fix argument validation and reject too large lengths early. Discovered by Andy Nguyen. [martin, ticket #1688] + +sys/compat/common/uipc_syscalls_40.c 1.19 (patch) +sys/compat/linux/common/linux_socket.c 1.145 (patch) +sys/compat/linux32/common/linux32_socket.c 1.30 (patch) +sys/net/if.c 1.449 (patch) + + Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes + of stack disclosure. + [christos, ticket #1689] +
CVS commit: [netbsd-7-0] src/sys
Module Name:src Committed By: martin Date: Fri Apr 19 16:03:09 UTC 2019 Modified Files: src/sys/compat/common [netbsd-7-0]: uipc_syscalls_40.c src/sys/compat/linux/common [netbsd-7-0]: linux_socket.c src/sys/compat/linux32/common [netbsd-7-0]: linux32_socket.c src/sys/net [netbsd-7-0]: if.c Log Message: Pull up following revision(s) via patch (requested by christos in ticket #1689): sys/compat/linux/common/linux_socket.c: revision 1.145 sys/net/if.c: revision 1.449 sys/compat/linux32/common/linux32_socket.c: revision 1.30 sys/compat/common/uipc_syscalls_40.c: revision 1.19 Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes of stack disclosure. From Andy Nguyen, many thanks! - Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes of stack disclosure. From Andy Nguyen, many thanks! This is the compat code part pointed out by ozaki-r@ To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.7.34.1 src/sys/compat/common/uipc_syscalls_40.c cvs rdiff -u -r1.119.2.1 -r1.119.2.1.2.1 \ src/sys/compat/linux/common/linux_socket.c cvs rdiff -u -r1.18 -r1.18.4.1 src/sys/compat/linux32/common/linux32_socket.c cvs rdiff -u -r1.290.2.1 -r1.290.2.1.2.1 src/sys/net/if.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/common/uipc_syscalls_40.c diff -u src/sys/compat/common/uipc_syscalls_40.c:1.7 src/sys/compat/common/uipc_syscalls_40.c:1.7.34.1 --- src/sys/compat/common/uipc_syscalls_40.c:1.7 Wed Jan 19 10:21:16 2011 +++ src/sys/compat/common/uipc_syscalls_40.c Fri Apr 19 16:03:09 2019 @@ -1,9 +1,9 @@ -/* $NetBSD: uipc_syscalls_40.c,v 1.7 2011/01/19 10:21:16 tsutsui Exp $ */ +/* $NetBSD: uipc_syscalls_40.c,v 1.7.34.1 2019/04/19 16:03:09 martin Exp $ */ /* written by Pavel Cahyna, 2006. Public domain. */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.7 2011/01/19 10:21:16 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.7.34.1 2019/04/19 16:03:09 martin Exp $"); /* * System call interface to the socket abstraction. @@ -39,6 +39,7 @@ compat_ifconf(u_long cmd, void *data) int space, error = 0; const int sz = (int)sizeof(ifr); + memset(, 0, sizeof(ifr)); if ((ifrp = ifc->ifc_req) == NULL) space = 0; else Index: src/sys/compat/linux/common/linux_socket.c diff -u src/sys/compat/linux/common/linux_socket.c:1.119.2.1 src/sys/compat/linux/common/linux_socket.c:1.119.2.1.2.1 --- src/sys/compat/linux/common/linux_socket.c:1.119.2.1 Sat Jan 17 12:10:54 2015 +++ src/sys/compat/linux/common/linux_socket.c Fri Apr 19 16:03:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.119.2.1 2015/01/17 12:10:54 martin Exp $ */ +/* $NetBSD: linux_socket.c,v 1.119.2.1.2.1 2019/04/19 16:03:08 martin Exp $ */ /*- * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.119.2.1 2015/01/17 12:10:54 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.119.2.1.2.1 2019/04/19 16:03:08 martin Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -1124,6 +1124,7 @@ linux_getifconf(struct lwp *l, register_ if (error) return error; + memset(, 0, sizeof(ifr)); ifrp = ifc.ifc_req; if (ifrp == NULL) space = 0; Index: src/sys/compat/linux32/common/linux32_socket.c diff -u src/sys/compat/linux32/common/linux32_socket.c:1.18 src/sys/compat/linux32/common/linux32_socket.c:1.18.4.1 --- src/sys/compat/linux32/common/linux32_socket.c:1.18 Sat May 17 21:26:20 2014 +++ src/sys/compat/linux32/common/linux32_socket.c Fri Apr 19 16:03:09 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_socket.c,v 1.18 2014/05/17 21:26:20 rmind Exp $ */ +/* $NetBSD: linux32_socket.c,v 1.18.4.1 2019/04/19 16:03:09 martin Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.18 2014/05/17 21:26:20 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.18.4.1 2019/04/19 16:03:09 martin Exp $"); #include #include @@ -423,6 +423,7 @@ linux32_getifconf(struct lwp *l, registe if (error) return error; + memset(, 0, sizeof(ifr)); ifrp = NETBSD32PTR64(ifc.ifc_req); if (ifrp == NULL) space = 0; Index: src/sys/net/if.c diff -u src/sys/net/if.c:1.290.2.1 src/sys/net/if.c:1.290.2.1.2.1 --- src/sys/net/if.c:1.290.2.1 Tue Nov 11 12:20:28 2014 +++ src/sys/net/if.c Fri Apr 19 16:03:08 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.290.2.1 2014/11/11 12:20:28 martin Exp $ */ +/* $NetBSD: if.c,v 1.290.2.1.2.1 2019/04/19 16:03:08 martin Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.290.2.1 2014/11/11 12:20:28 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v
CVS commit: [netbsd-7-1] src/doc
Module Name:src Committed By: martin Date: Fri Apr 19 16:02:50 UTC 2019 Modified Files: src/doc [netbsd-7-1]: CHANGES-7.1.3 Log Message: Ticket #1689 To generate a diff of this commit: cvs rdiff -u -r1.1.2.46 -r1.1.2.47 src/doc/CHANGES-7.1.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-7.1.3 diff -u src/doc/CHANGES-7.1.3:1.1.2.46 src/doc/CHANGES-7.1.3:1.1.2.47 --- src/doc/CHANGES-7.1.3:1.1.2.46 Tue Apr 16 03:57:33 2019 +++ src/doc/CHANGES-7.1.3 Fri Apr 19 16:02:50 2019 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.1.3,v 1.1.2.46 2019/04/16 03:57:33 msaitoh Exp $ +# $NetBSD: CHANGES-7.1.3,v 1.1.2.47 2019/04/19 16:02:50 martin Exp $ A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3 release: @@ -470,3 +470,13 @@ sys/kern/sys_mqueue.c1.44 mq_send1: fix argument validation and reject too large lengths early. Discovered by Andy Nguyen. [martin, ticket #1688] + +sys/compat/common/uipc_syscalls_40.c 1.19 (patch) +sys/compat/linux/common/linux_socket.c 1.145 (patch) +sys/compat/linux32/common/linux32_socket.c 1.30 (patch) +sys/net/if.c 1.449 (patch) + + Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes + of stack disclosure. + [christos, ticket #1689] +
CVS commit: [netbsd-7-1] src/sys
Module Name:src Committed By: martin Date: Fri Apr 19 16:02:24 UTC 2019 Modified Files: src/sys/compat/common [netbsd-7-1]: uipc_syscalls_40.c src/sys/compat/linux/common [netbsd-7-1]: linux_socket.c src/sys/compat/linux32/common [netbsd-7-1]: linux32_socket.c src/sys/net [netbsd-7-1]: if.c Log Message: Pull up following revision(s) via patch (requested by christos in ticket #1689): sys/compat/linux/common/linux_socket.c: revision 1.145 sys/net/if.c: revision 1.449 sys/compat/linux32/common/linux32_socket.c: revision 1.30 sys/compat/common/uipc_syscalls_40.c: revision 1.19 Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes of stack disclosure. From Andy Nguyen, many thanks! - Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes of stack disclosure. From Andy Nguyen, many thanks! This is the compat code part pointed out by ozaki-r@ To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.7.38.1 src/sys/compat/common/uipc_syscalls_40.c cvs rdiff -u -r1.119.2.1 -r1.119.2.1.6.1 \ src/sys/compat/linux/common/linux_socket.c cvs rdiff -u -r1.18 -r1.18.8.1 src/sys/compat/linux32/common/linux32_socket.c cvs rdiff -u -r1.290.2.1 -r1.290.2.1.6.1 src/sys/net/if.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/common/uipc_syscalls_40.c diff -u src/sys/compat/common/uipc_syscalls_40.c:1.7 src/sys/compat/common/uipc_syscalls_40.c:1.7.38.1 --- src/sys/compat/common/uipc_syscalls_40.c:1.7 Wed Jan 19 10:21:16 2011 +++ src/sys/compat/common/uipc_syscalls_40.c Fri Apr 19 16:02:24 2019 @@ -1,9 +1,9 @@ -/* $NetBSD: uipc_syscalls_40.c,v 1.7 2011/01/19 10:21:16 tsutsui Exp $ */ +/* $NetBSD: uipc_syscalls_40.c,v 1.7.38.1 2019/04/19 16:02:24 martin Exp $ */ /* written by Pavel Cahyna, 2006. Public domain. */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.7 2011/01/19 10:21:16 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.7.38.1 2019/04/19 16:02:24 martin Exp $"); /* * System call interface to the socket abstraction. @@ -39,6 +39,7 @@ compat_ifconf(u_long cmd, void *data) int space, error = 0; const int sz = (int)sizeof(ifr); + memset(, 0, sizeof(ifr)); if ((ifrp = ifc->ifc_req) == NULL) space = 0; else Index: src/sys/compat/linux/common/linux_socket.c diff -u src/sys/compat/linux/common/linux_socket.c:1.119.2.1 src/sys/compat/linux/common/linux_socket.c:1.119.2.1.6.1 --- src/sys/compat/linux/common/linux_socket.c:1.119.2.1 Sat Jan 17 12:10:54 2015 +++ src/sys/compat/linux/common/linux_socket.c Fri Apr 19 16:02:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.119.2.1 2015/01/17 12:10:54 martin Exp $ */ +/* $NetBSD: linux_socket.c,v 1.119.2.1.6.1 2019/04/19 16:02:24 martin Exp $ */ /*- * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.119.2.1 2015/01/17 12:10:54 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.119.2.1.6.1 2019/04/19 16:02:24 martin Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -1124,6 +1124,7 @@ linux_getifconf(struct lwp *l, register_ if (error) return error; + memset(, 0, sizeof(ifr)); ifrp = ifc.ifc_req; if (ifrp == NULL) space = 0; Index: src/sys/compat/linux32/common/linux32_socket.c diff -u src/sys/compat/linux32/common/linux32_socket.c:1.18 src/sys/compat/linux32/common/linux32_socket.c:1.18.8.1 --- src/sys/compat/linux32/common/linux32_socket.c:1.18 Sat May 17 21:26:20 2014 +++ src/sys/compat/linux32/common/linux32_socket.c Fri Apr 19 16:02:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_socket.c,v 1.18 2014/05/17 21:26:20 rmind Exp $ */ +/* $NetBSD: linux32_socket.c,v 1.18.8.1 2019/04/19 16:02:24 martin Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.18 2014/05/17 21:26:20 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.18.8.1 2019/04/19 16:02:24 martin Exp $"); #include #include @@ -423,6 +423,7 @@ linux32_getifconf(struct lwp *l, registe if (error) return error; + memset(, 0, sizeof(ifr)); ifrp = NETBSD32PTR64(ifc.ifc_req); if (ifrp == NULL) space = 0; Index: src/sys/net/if.c diff -u src/sys/net/if.c:1.290.2.1 src/sys/net/if.c:1.290.2.1.6.1 --- src/sys/net/if.c:1.290.2.1 Tue Nov 11 12:20:28 2014 +++ src/sys/net/if.c Fri Apr 19 16:02:24 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.290.2.1 2014/11/11 12:20:28 martin Exp $ */ +/* $NetBSD: if.c,v 1.290.2.1.6.1 2019/04/19 16:02:24 martin Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.290.2.1 2014/11/11 12:20:28 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: martin Date: Fri Apr 19 16:02:02 UTC 2019 Modified Files: src/doc [netbsd-7]: CHANGES-7.3 Log Message: Ticket #1689 To generate a diff of this commit: cvs rdiff -u -r1.1.2.47 -r1.1.2.48 src/doc/CHANGES-7.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-7.3 diff -u src/doc/CHANGES-7.3:1.1.2.47 src/doc/CHANGES-7.3:1.1.2.48 --- src/doc/CHANGES-7.3:1.1.2.47 Tue Apr 16 08:12:58 2019 +++ src/doc/CHANGES-7.3 Fri Apr 19 16:02:01 2019 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.3,v 1.1.2.47 2019/04/16 08:12:58 martin Exp $ +# $NetBSD: CHANGES-7.3,v 1.1.2.48 2019/04/19 16:02:01 martin Exp $ A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3 release: @@ -523,3 +523,12 @@ sys/external/bsd/drm2/pci/drm_pci.c 1.3 Don't try to interpret the second half of a 64-bit BAR as another one. [dholland, ticket #1673] +sys/compat/common/uipc_syscalls_40.c 1.19 (patch) +sys/compat/linux/common/linux_socket.c 1.145 (patch) +sys/compat/linux32/common/linux32_socket.c 1.30 (patch) +sys/net/if.c 1.449 (patch) + + Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes + of stack disclosure. + [christos, ticket #1689] +
CVS commit: [netbsd-7] src/sys
Module Name:src Committed By: martin Date: Fri Apr 19 16:01:34 UTC 2019 Modified Files: src/sys/compat/common [netbsd-7]: uipc_syscalls_40.c src/sys/compat/linux/common [netbsd-7]: linux_socket.c src/sys/compat/linux32/common [netbsd-7]: linux32_socket.c src/sys/net [netbsd-7]: if.c Log Message: Pull up following revision(s) via patch (requested by christos in ticket #1689): sys/compat/linux/common/linux_socket.c: revision 1.145 sys/net/if.c: revision 1.449 sys/compat/linux32/common/linux32_socket.c: revision 1.30 sys/compat/common/uipc_syscalls_40.c: revision 1.19 Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes of stack disclosure. From Andy Nguyen, many thanks! - Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes of stack disclosure. From Andy Nguyen, many thanks! This is the compat code part pointed out by ozaki-r@ To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.7.32.1 src/sys/compat/common/uipc_syscalls_40.c cvs rdiff -u -r1.119.2.1 -r1.119.2.2 \ src/sys/compat/linux/common/linux_socket.c cvs rdiff -u -r1.18 -r1.18.2.1 src/sys/compat/linux32/common/linux32_socket.c cvs rdiff -u -r1.290.2.1 -r1.290.2.2 src/sys/net/if.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/common/uipc_syscalls_40.c diff -u src/sys/compat/common/uipc_syscalls_40.c:1.7 src/sys/compat/common/uipc_syscalls_40.c:1.7.32.1 --- src/sys/compat/common/uipc_syscalls_40.c:1.7 Wed Jan 19 10:21:16 2011 +++ src/sys/compat/common/uipc_syscalls_40.c Fri Apr 19 16:01:34 2019 @@ -1,9 +1,9 @@ -/* $NetBSD: uipc_syscalls_40.c,v 1.7 2011/01/19 10:21:16 tsutsui Exp $ */ +/* $NetBSD: uipc_syscalls_40.c,v 1.7.32.1 2019/04/19 16:01:34 martin Exp $ */ /* written by Pavel Cahyna, 2006. Public domain. */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.7 2011/01/19 10:21:16 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.7.32.1 2019/04/19 16:01:34 martin Exp $"); /* * System call interface to the socket abstraction. @@ -39,6 +39,7 @@ compat_ifconf(u_long cmd, void *data) int space, error = 0; const int sz = (int)sizeof(ifr); + memset(, 0, sizeof(ifr)); if ((ifrp = ifc->ifc_req) == NULL) space = 0; else Index: src/sys/compat/linux/common/linux_socket.c diff -u src/sys/compat/linux/common/linux_socket.c:1.119.2.1 src/sys/compat/linux/common/linux_socket.c:1.119.2.2 --- src/sys/compat/linux/common/linux_socket.c:1.119.2.1 Sat Jan 17 12:10:54 2015 +++ src/sys/compat/linux/common/linux_socket.c Fri Apr 19 16:01:34 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.119.2.1 2015/01/17 12:10:54 martin Exp $ */ +/* $NetBSD: linux_socket.c,v 1.119.2.2 2019/04/19 16:01:34 martin Exp $ */ /*- * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.119.2.1 2015/01/17 12:10:54 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.119.2.2 2019/04/19 16:01:34 martin Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -1124,6 +1124,7 @@ linux_getifconf(struct lwp *l, register_ if (error) return error; + memset(, 0, sizeof(ifr)); ifrp = ifc.ifc_req; if (ifrp == NULL) space = 0; Index: src/sys/compat/linux32/common/linux32_socket.c diff -u src/sys/compat/linux32/common/linux32_socket.c:1.18 src/sys/compat/linux32/common/linux32_socket.c:1.18.2.1 --- src/sys/compat/linux32/common/linux32_socket.c:1.18 Sat May 17 21:26:20 2014 +++ src/sys/compat/linux32/common/linux32_socket.c Fri Apr 19 16:01:34 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_socket.c,v 1.18 2014/05/17 21:26:20 rmind Exp $ */ +/* $NetBSD: linux32_socket.c,v 1.18.2.1 2019/04/19 16:01:34 martin Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.18 2014/05/17 21:26:20 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.18.2.1 2019/04/19 16:01:34 martin Exp $"); #include #include @@ -423,6 +423,7 @@ linux32_getifconf(struct lwp *l, registe if (error) return error; + memset(, 0, sizeof(ifr)); ifrp = NETBSD32PTR64(ifc.ifc_req); if (ifrp == NULL) space = 0; Index: src/sys/net/if.c diff -u src/sys/net/if.c:1.290.2.1 src/sys/net/if.c:1.290.2.2 --- src/sys/net/if.c:1.290.2.1 Tue Nov 11 12:20:28 2014 +++ src/sys/net/if.c Fri Apr 19 16:01:34 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.290.2.1 2014/11/11 12:20:28 martin Exp $ */ +/* $NetBSD: if.c,v 1.290.2.2 2019/04/19 16:01:34 martin Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.290.2.1 2014/11/11 12:20:28 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.290.2.2 2019/04/19 16:01:34 martin Exp
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Fri Apr 19 09:14:40 UTC 2019 Modified Files: src/doc [netbsd-8]: CHANGES-8.1 Log Message: Tickets #1232 and #1233 To generate a diff of this commit: cvs rdiff -u -r1.1.2.129 -r1.1.2.130 src/doc/CHANGES-8.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-8.1 diff -u src/doc/CHANGES-8.1:1.1.2.129 src/doc/CHANGES-8.1:1.1.2.130 --- src/doc/CHANGES-8.1:1.1.2.129 Wed Apr 17 15:58:12 2019 +++ src/doc/CHANGES-8.1 Fri Apr 19 09:14:40 2019 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.1,v 1.1.2.129 2019/04/17 15:58:12 martin Exp $ +# $NetBSD: CHANGES-8.1,v 1.1.2.130 2019/04/19 09:14:40 martin Exp $ A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1 release: @@ -2845,3 +2845,18 @@ sys/arch/i386/stand/efiboot/efidisk.c 1 efiboot: Don't panic when BLOCK_IO_PROTOCOL is not found. [nonaka, ticket #1231] +usr.sbin/npf/npfctl/npf_bpf_comp.c 1.12 +usr.sbin/npf/npfctl/npf_build.c 1.48 + + Ensure default TCP flags are applied to rules like 'pass stateful all'. + [tih, ticket #1232] + +sys/compat/common/uipc_syscalls_40.c 1.19 +sys/compat/linux/common/linux_socket.c 1.145 +sys/compat/linux32/common/linux32_socket.c 1.30 +sys/net/if.c 1.449 + + Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes + of stack disclosure. + [christos, ticket #1233] +
CVS commit: [netbsd-8] src/sys
Module Name:src Committed By: martin Date: Fri Apr 19 09:12:58 UTC 2019 Modified Files: src/sys/compat/common [netbsd-8]: uipc_syscalls_40.c src/sys/compat/linux/common [netbsd-8]: linux_socket.c src/sys/compat/linux32/common [netbsd-8]: linux32_socket.c src/sys/net [netbsd-8]: if.c Log Message: Pull up following revision(s) (requested by christos in ticket #1233): sys/compat/linux/common/linux_socket.c: revision 1.145 sys/net/if.c: revision 1.449 sys/compat/linux32/common/linux32_socket.c: revision 1.30 sys/compat/common/uipc_syscalls_40.c: revision 1.19 Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes of stack disclosure. From Andy Nguyen, many thanks! - Zero out the ifreq struct for SIOCGIFCONF to avoid up to 127 bytes of stack disclosure. From Andy Nguyen, many thanks! This is the compat code part pointed out by ozaki-r@ To generate a diff of this commit: cvs rdiff -u -r1.13.6.2 -r1.13.6.3 src/sys/compat/common/uipc_syscalls_40.c cvs rdiff -u -r1.138.6.3 -r1.138.6.4 \ src/sys/compat/linux/common/linux_socket.c cvs rdiff -u -r1.27.6.2 -r1.27.6.3 \ src/sys/compat/linux32/common/linux32_socket.c cvs rdiff -u -r1.394.2.15 -r1.394.2.16 src/sys/net/if.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/common/uipc_syscalls_40.c diff -u src/sys/compat/common/uipc_syscalls_40.c:1.13.6.2 src/sys/compat/common/uipc_syscalls_40.c:1.13.6.3 --- src/sys/compat/common/uipc_syscalls_40.c:1.13.6.2 Mon Dec 4 13:55:00 2017 +++ src/sys/compat/common/uipc_syscalls_40.c Fri Apr 19 09:12:58 2019 @@ -1,9 +1,9 @@ -/* $NetBSD: uipc_syscalls_40.c,v 1.13.6.2 2017/12/04 13:55:00 martin Exp $ */ +/* $NetBSD: uipc_syscalls_40.c,v 1.13.6.3 2019/04/19 09:12:58 martin Exp $ */ /* written by Pavel Cahyna, 2006. Public domain. */ #include -__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.13.6.2 2017/12/04 13:55:00 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_40.c,v 1.13.6.3 2019/04/19 09:12:58 martin Exp $"); /* * System call interface to the socket abstraction. @@ -42,6 +42,7 @@ compat_ifconf(u_long cmd, void *data) int bound; struct psref psref; + memset(, 0, sizeof(ifr)); if (docopy) { space = ifc->ifc_len; ifrp = ifc->ifc_req; Index: src/sys/compat/linux/common/linux_socket.c diff -u src/sys/compat/linux/common/linux_socket.c:1.138.6.3 src/sys/compat/linux/common/linux_socket.c:1.138.6.4 --- src/sys/compat/linux/common/linux_socket.c:1.138.6.3 Sat Dec 8 12:24:18 2018 +++ src/sys/compat/linux/common/linux_socket.c Fri Apr 19 09:12:58 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.138.6.3 2018/12/08 12:24:18 martin Exp $ */ +/* $NetBSD: linux_socket.c,v 1.138.6.4 2019/04/19 09:12:58 martin Exp $ */ /*- * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.138.6.3 2018/12/08 12:24:18 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.138.6.4 2019/04/19 09:12:58 martin Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -1152,6 +1152,7 @@ linux_getifconf(struct lwp *l, register_ if (error) return error; + memset(, 0, sizeof(ifr)); docopy = ifc.ifc_req != NULL; if (docopy) { space = ifc.ifc_len; Index: src/sys/compat/linux32/common/linux32_socket.c diff -u src/sys/compat/linux32/common/linux32_socket.c:1.27.6.2 src/sys/compat/linux32/common/linux32_socket.c:1.27.6.3 --- src/sys/compat/linux32/common/linux32_socket.c:1.27.6.2 Sat May 12 10:29:08 2018 +++ src/sys/compat/linux32/common/linux32_socket.c Fri Apr 19 09:12:58 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_socket.c,v 1.27.6.2 2018/05/12 10:29:08 martin Exp $ */ +/* $NetBSD: linux32_socket.c,v 1.27.6.3 2019/04/19 09:12:58 martin Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.27.6.2 2018/05/12 10:29:08 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.27.6.3 2019/04/19 09:12:58 martin Exp $"); #include #include @@ -431,6 +431,7 @@ linux32_getifconf(struct lwp *l, registe if (error) return error; + memset(, 0, sizeof(ifr)); docopy = NETBSD32PTR64(ifc.ifc_req) != NULL; if (docopy) { space = ifc.ifc_len; Index: src/sys/net/if.c diff -u src/sys/net/if.c:1.394.2.15 src/sys/net/if.c:1.394.2.16 --- src/sys/net/if.c:1.394.2.15 Tue Nov 6 14:38:58 2018 +++ src/sys/net/if.c Fri Apr 19 09:12:58 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.394.2.15 2018/11/06 14:38:58 martin Exp $ */ +/* $NetBSD: if.c,v 1.394.2.16 2019/04/19 09:12:58 martin Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.394.2.15 2018/11/06 14:38:58 martin Exp $");
CVS commit: [netbsd-8] src/usr.sbin/npf/npfctl
Module Name:src Committed By: martin Date: Fri Apr 19 09:10:50 UTC 2019 Modified Files: src/usr.sbin/npf/npfctl [netbsd-8]: npf_bpf_comp.c npf_build.c Log Message: Pull up following revision(s) (requested by tih in ticket #1232): usr.sbin/npf/npfctl/npf_build.c: revision 1.48 usr.sbin/npf/npfctl/npf_bpf_comp.c: revision 1.12 Summary: Ensure default TCP flags are applied to rules like 'pass stateful all' The documented default "flags S/SAFR" for stateful rules that affect TCP packets but don't specify any flags, doesn't actually get applied to a rule like "pass stateful out all". The big problem with this is that when you then do a "block return-rst" for an incoming packet, the generated RST packet will create state for the connection attempt it's blocking, so that a second attempt from the same source will pass. This change makes the default flags actually apply to such simple rules. It also fixes a related bug in the code generation for the flag matching, where part of the action could erroneously be omitted. Reviewed by Closes PR bin/54124 Pullup to NetBSD 8 To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.10.6.1 src/usr.sbin/npf/npfctl/npf_bpf_comp.c cvs rdiff -u -r1.44 -r1.44.4.1 src/usr.sbin/npf/npfctl/npf_build.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/npf/npfctl/npf_bpf_comp.c diff -u src/usr.sbin/npf/npfctl/npf_bpf_comp.c:1.10 src/usr.sbin/npf/npfctl/npf_bpf_comp.c:1.10.6.1 --- src/usr.sbin/npf/npfctl/npf_bpf_comp.c:1.10 Tue Dec 27 22:35:33 2016 +++ src/usr.sbin/npf/npfctl/npf_bpf_comp.c Fri Apr 19 09:10:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: npf_bpf_comp.c,v 1.10 2016/12/27 22:35:33 rmind Exp $ */ +/* $NetBSD: npf_bpf_comp.c,v 1.10.6.1 2019/04/19 09:10:49 martin Exp $ */ /*- * Copyright (c) 2010-2014 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__RCSID("$NetBSD: npf_bpf_comp.c,v 1.10 2016/12/27 22:35:33 rmind Exp $"); +__RCSID("$NetBSD: npf_bpf_comp.c,v 1.10.6.1 2019/04/19 09:10:49 martin Exp $"); #include #include @@ -567,10 +567,8 @@ npfctl_bpf_tcpfl(npf_bpf_t *ctx, uint8_t }; add_insns(ctx, insns_cmp, __arraycount(insns_cmp)); - if (!checktcp) { - uint32_t mwords[] = { BM_TCPFL, 2, tf, tf_mask}; - done_block(ctx, mwords, sizeof(mwords)); - } + uint32_t mwords[] = { BM_TCPFL, 2, tf, tf_mask}; + done_block(ctx, mwords, sizeof(mwords)); } /* Index: src/usr.sbin/npf/npfctl/npf_build.c diff -u src/usr.sbin/npf/npfctl/npf_build.c:1.44 src/usr.sbin/npf/npfctl/npf_build.c:1.44.4.1 --- src/usr.sbin/npf/npfctl/npf_build.c:1.44 Thu Jan 19 20:18:17 2017 +++ src/usr.sbin/npf/npfctl/npf_build.c Fri Apr 19 09:10:49 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: npf_build.c,v 1.44 2017/01/19 20:18:17 rmind Exp $ */ +/* $NetBSD: npf_build.c,v 1.44.4.1 2019/04/19 09:10:49 martin Exp $ */ /*- * Copyright (c) 2011-2017 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__RCSID("$NetBSD: npf_build.c,v 1.44 2017/01/19 20:18:17 rmind Exp $"); +__RCSID("$NetBSD: npf_build.c,v 1.44.4.1 2019/04/19 09:10:49 martin Exp $"); #include #include @@ -317,7 +317,7 @@ static bool npfctl_build_code(nl_rule_t *rl, sa_family_t family, const opt_proto_t *op, const filt_opts_t *fopts) { - bool noproto, noaddrs, noports, need_tcpudp = false; + bool noproto, noaddrs, noports, nostate, need_tcpudp = false; const addr_port_t *apfrom = >fo_from; const addr_port_t *apto = >fo_to; const int proto = op->op_proto; @@ -329,7 +329,8 @@ npfctl_build_code(nl_rule_t *rl, sa_fami noproto = family == AF_UNSPEC && proto == -1 && !op->op_opts; noaddrs = !apfrom->ap_netaddr && !apto->ap_netaddr; noports = !apfrom->ap_portrange && !apto->ap_portrange; - if (noproto && noaddrs && noports) { + nostate = !(npf_rule_getattr(rl) & NPF_RULE_STATEFUL); + if (noproto && noaddrs && noports && nostate) { return false; }