From owner-svn-src-projects@freebsd.org Mon Jun 20 22:06:00 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 877A9AC44C0 for ; Mon, 20 Jun 2016 22:06:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A64926FD; Mon, 20 Jun 2016 22:06:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5KM5xBs031205; Mon, 20 Jun 2016 22:05:59 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5KM5xDN031203; Mon, 20 Jun 2016 22:05:59 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606202205.u5KM5xDN031203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 20 Jun 2016 22:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302033 - projects/vnet/sys/netpfil/pf X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 22:06:00 -0000 Author: bz Date: Mon Jun 20 22:05:59 2016 New Revision: 302033 URL: https://svnweb.freebsd.org/changeset/base/302033 Log: Free counters after the other things as we still update them during teardown; this avoids memory modified after free panics. Add missing locks around a few places to avoid race conditions. Set some cached 'kif' values to NULL before freeing it so we will not try to access freed memory anymore. Add V_pf_vnet_active in addition to hooked and running to indicate the state of the VNET. We need a dedicated flag mostly for external events. Add various checks for kif being valid, and V_pf_vnet_active being true on global external events to avoid running code for VNETs shutting down. Having some simple ruleset with state and a hundred or so connections this seems getting stable now. Sponsored by: The FreeBSD Foundation Modified: projects/vnet/sys/netpfil/pf/pf_if.c projects/vnet/sys/netpfil/pf/pf_ioctl.c Modified: projects/vnet/sys/netpfil/pf/pf_if.c ============================================================================== --- projects/vnet/sys/netpfil/pf/pf_if.c Mon Jun 20 19:00:47 2016 (r302032) +++ projects/vnet/sys/netpfil/pf/pf_if.c Mon Jun 20 22:05:59 2016 (r302033) @@ -58,6 +58,9 @@ static VNET_DEFINE(long, pfi_update); #define V_pfi_update VNET(pfi_update) #define PFI_BUFFER_MAX 0x10000 +VNET_DECLARE(int, pf_vnet_active); +#define V_pf_vnet_active VNET(pf_vnet_active) + static VNET_DEFINE(struct pfr_addr *, pfi_buffer); static VNET_DEFINE(int, pfi_buffer_cnt); static VNET_DEFINE(int, pfi_buffer_max); @@ -152,18 +155,26 @@ pfi_initialize(void) void pfi_cleanup_vnet(void) { - struct pfi_kif *p; + struct pfi_kif *kif; + + PF_RULES_WASSERT(); V_pfi_all = NULL; - while ((p = RB_MIN(pfi_ifhead, &V_pfi_ifs))) { - RB_REMOVE(pfi_ifhead, &V_pfi_ifs, p); - free(p, PFI_MTYPE); + while ((kif = RB_MIN(pfi_ifhead, &V_pfi_ifs))) { + RB_REMOVE(pfi_ifhead, &V_pfi_ifs, kif); + if (kif->pfik_group) + kif->pfik_group->ifg_pf_kif = NULL; + if (kif->pfik_ifp) + kif->pfik_ifp->if_pf_kif = NULL; + free(kif, PFI_MTYPE); } - while ((p = LIST_FIRST(&V_pfi_unlinked_kifs))) { - LIST_REMOVE(p, pfik_list); - free(p, PFI_MTYPE); + mtx_lock(&pfi_unlnkdkifs_mtx); + while ((kif = LIST_FIRST(&V_pfi_unlinked_kifs))) { + LIST_REMOVE(kif, pfik_list); + free(kif, PFI_MTYPE); } + mtx_unlock(&pfi_unlnkdkifs_mtx); free(V_pfi_buffer, PFI_MTYPE); } @@ -678,7 +689,7 @@ pfi_update_status(const char *name, stru bzero(pfs->bcounters, sizeof(pfs->bcounters)); } TAILQ_FOREACH(ifgm, &ifg_members, ifgm_next) { - if (ifgm->ifgm_ifp == NULL) + if (ifgm->ifgm_ifp == NULL || ifgm->ifgm_ifp->if_pf_kif == NULL) continue; p = (struct pfi_kif *)ifgm->ifgm_ifp->if_pf_kif; @@ -790,6 +801,11 @@ pfi_attach_ifnet_event(void *arg __unuse { CURVNET_SET(ifp->if_vnet); + if (V_pf_vnet_active == 0) { + /* Avoid teardown race in the least expensie way. */ + CURVNET_RESTORE(); + return; + } pfi_attach_ifnet(ifp); #ifdef ALTQ PF_RULES_WLOCK(); @@ -804,7 +820,15 @@ pfi_detach_ifnet_event(void *arg __unuse { struct pfi_kif *kif = (struct pfi_kif *)ifp->if_pf_kif; + if (kif == NULL) + return; + CURVNET_SET(ifp->if_vnet); + if (V_pf_vnet_active == 0) { + /* Avoid teardown race in the least expensie way. */ + CURVNET_RESTORE(); + return; + } PF_RULES_WLOCK(); V_pfi_update++; pfi_kif_update(kif); @@ -823,6 +847,11 @@ pfi_attach_group_event(void *arg , struc { CURVNET_SET((struct vnet *)arg); + if (V_pf_vnet_active == 0) { + /* Avoid teardown race in the least expensie way. */ + CURVNET_RESTORE(); + return; + } pfi_attach_ifgroup(ifg); CURVNET_RESTORE(); } @@ -832,9 +861,14 @@ pfi_change_group_event(void *arg, char * { struct pfi_kif *kif; - kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); - CURVNET_SET((struct vnet *)arg); + if (V_pf_vnet_active == 0) { + /* Avoid teardown race in the least expensie way. */ + CURVNET_RESTORE(); + return; + } + + kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); PF_RULES_WLOCK(); V_pfi_update++; kif = pfi_kif_attach(kif, gname); @@ -848,7 +882,15 @@ pfi_detach_group_event(void *arg, struct { struct pfi_kif *kif = (struct pfi_kif *)ifg->ifg_pf_kif; + if (kif == NULL) + return; + CURVNET_SET((struct vnet *)arg); + if (V_pf_vnet_active == 0) { + /* Avoid teardown race in the least expensie way. */ + CURVNET_RESTORE(); + return; + } PF_RULES_WLOCK(); V_pfi_update++; @@ -861,8 +903,15 @@ pfi_detach_group_event(void *arg, struct static void pfi_ifaddr_event(void *arg __unused, struct ifnet *ifp) { + if (ifp->if_pf_kif == NULL) + return; CURVNET_SET(ifp->if_vnet); + if (V_pf_vnet_active == 0) { + /* Avoid teardown race in the least expensie way. */ + CURVNET_RESTORE(); + return; + } PF_RULES_WLOCK(); if (ifp && ifp->if_pf_kif) { V_pfi_update++; Modified: projects/vnet/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- projects/vnet/sys/netpfil/pf/pf_ioctl.c Mon Jun 20 19:00:47 2016 (r302032) +++ projects/vnet/sys/netpfil/pf/pf_ioctl.c Mon Jun 20 22:05:59 2016 (r302033) @@ -188,6 +188,15 @@ static struct cdevsw pf_cdevsw = { static volatile VNET_DEFINE(int, pf_pfil_hooked); #define V_pf_pfil_hooked VNET(pf_pfil_hooked) + +/* + * We need a flag that is neither hooked nor running to know when + * the VNET is "valid". We primarily need this to control (global) + * external event, e.g., eventhandlers. + */ +VNET_DEFINE(int, pf_vnet_active); +#define V_pf_vnet_active VNET(pf_vnet_active) + int pf_end_threads; struct rwlock pf_rules_lock; @@ -3465,21 +3474,6 @@ shutdown_pf(void) u_int32_t t[5]; char nn = '\0'; - V_pf_status.running = 0; - - counter_u64_free(V_pf_default_rule.states_cur); - counter_u64_free(V_pf_default_rule.states_tot); - counter_u64_free(V_pf_default_rule.src_nodes); - - for (int i = 0; i < PFRES_MAX; i++) - counter_u64_free(V_pf_status.counters[i]); - for (int i = 0; i < LCNT_MAX; i++) - counter_u64_free(V_pf_status.lcounters[i]); - for (int i = 0; i < FCNT_MAX; i++) - counter_u64_free(V_pf_status.fcounters[i]); - for (int i = 0; i < SCNT_MAX; i++) - counter_u64_free(V_pf_status.scounters[i]); - do { if ((error = pf_begin_rules(&t[0], PF_RULESET_SCRUB, &nn)) != 0) { @@ -3531,6 +3525,20 @@ shutdown_pf(void) /* status does not use malloced mem so no need to cleanup */ /* fingerprints and interfaces have their own cleanup code */ + + /* Free counters last as we updated them during shutdown. */ + counter_u64_free(V_pf_default_rule.states_cur); + counter_u64_free(V_pf_default_rule.states_tot); + counter_u64_free(V_pf_default_rule.src_nodes); + + for (int i = 0; i < PFRES_MAX; i++) + counter_u64_free(V_pf_status.counters[i]); + for (int i = 0; i < LCNT_MAX; i++) + counter_u64_free(V_pf_status.lcounters[i]); + for (int i = 0; i < FCNT_MAX; i++) + counter_u64_free(V_pf_status.fcounters[i]); + for (int i = 0; i < SCNT_MAX; i++) + counter_u64_free(V_pf_status.scounters[i]); } while(0); return (error); @@ -3698,6 +3706,7 @@ pf_load_vnet(void) VNET_LIST_RUNLOCK(); pfattach_vnet(); + V_pf_vnet_active = 1; } static int @@ -3729,6 +3738,7 @@ pf_unload_vnet() { int error; + V_pf_vnet_active = 0; V_pf_status.running = 0; swi_remove(V_pf_swi_cookie); error = dehook_pf(); @@ -3749,7 +3759,9 @@ pf_unload_vnet() PF_RULES_WUNLOCK(); pf_normalize_cleanup(); + PF_RULES_WLOCK(); pfi_cleanup_vnet(); + PF_RULES_WUNLOCK(); pfr_cleanup(); pf_osfp_flush(); pf_cleanup(); From owner-svn-src-projects@freebsd.org Tue Jun 21 15:27:04 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B332AC5E3C for ; Tue, 21 Jun 2016 15:27:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B62C31C45; Tue, 21 Jun 2016 15:27:03 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5LFR3KF026100; Tue, 21 Jun 2016 15:27:03 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LFR0dv026077; Tue, 21 Jun 2016 15:27:00 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606211527.u5LFR0dv026077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 21 Jun 2016 15:27:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302057 - in projects/vnet: . bin/csh bin/setfacl contrib/atf contrib/blacklist/bin contrib/blacklist/libexec contrib/bmake contrib/ipfilter/man contrib/jemalloc contrib/jemalloc/doc co... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 15:27:04 -0000 Author: bz Date: Tue Jun 21 15:26:59 2016 New Revision: 302057 URL: https://svnweb.freebsd.org/changeset/base/302057 Log: MfH @r302054 After merging the ordering changes to HEAD. Sponsored by: The FreeBSD Foundation Added: projects/vnet/contrib/llvm/tools/clang/tools/clang-format/ - copied from r302054, head/contrib/llvm/tools/clang/tools/clang-format/ projects/vnet/crypto/openssh/blacklist.c - copied unchanged from r302054, head/crypto/openssh/blacklist.c projects/vnet/crypto/openssh/blacklist_client.h - copied unchanged from r302054, head/crypto/openssh/blacklist_client.h projects/vnet/lib/clang/libclangformat/ - copied from r302054, head/lib/clang/libclangformat/ projects/vnet/lib/clang/libclangtoolingcore/ - copied from r302054, head/lib/clang/libclangtoolingcore/ projects/vnet/share/man/man4/iser.4 - copied unchanged from r302054, head/share/man/man4/iser.4 projects/vnet/share/msgdef/sr_Cyrl_RS.UTF-8.src - copied unchanged from r302054, head/share/msgdef/sr_Cyrl_RS.UTF-8.src projects/vnet/share/timedef/sr_Cyrl_RS.UTF-8.src - copied unchanged from r302054, head/share/timedef/sr_Cyrl_RS.UTF-8.src projects/vnet/sys/boot/fdt/dts/arm/pcduino3b.dts - copied unchanged from r302054, head/sys/boot/fdt/dts/arm/pcduino3b.dts projects/vnet/sys/cam/nvme/ - copied from r302054, head/sys/cam/nvme/ projects/vnet/sys/net/mppc.h - copied unchanged from r302054, head/sys/net/mppc.h projects/vnet/sys/net/mppcc.c - copied unchanged from r302054, head/sys/net/mppcc.c projects/vnet/sys/net/mppcd.c - copied unchanged from r302054, head/sys/net/mppcd.c projects/vnet/tools/build/futimens.c - copied unchanged from r302054, head/tools/build/futimens.c projects/vnet/tools/build/options/WITHOUT_BLACKLIST - copied unchanged from r302054, head/tools/build/options/WITHOUT_BLACKLIST projects/vnet/tools/build/options/WITHOUT_BLACKLIST_SUPPORT - copied unchanged from r302054, head/tools/build/options/WITHOUT_BLACKLIST_SUPPORT projects/vnet/tools/build/stat.h - copied unchanged from r302054, head/tools/build/stat.h projects/vnet/tools/build/utimensat.c - copied unchanged from r302054, head/tools/build/utimensat.c projects/vnet/tools/tools/decioctl/ - copied from r302054, head/tools/tools/decioctl/ projects/vnet/usr.bin/clang/clang-format/ - copied from r302054, head/usr.bin/clang/clang-format/ projects/vnet/usr.bin/truss/amd64-linux.c - copied unchanged from r302054, head/usr.bin/truss/amd64-linux.c projects/vnet/usr.sbin/bsdconfig/networking/wlanconfig - copied unchanged from r302054, head/usr.sbin/bsdconfig/networking/wlanconfig projects/vnet/usr.sbin/bsdconfig/share/media/wlan.subr - copied unchanged from r302054, head/usr.sbin/bsdconfig/share/media/wlan.subr projects/vnet/usr.sbin/bsdinstall/partedit/partedit_arm64.c - copied unchanged from r302054, head/usr.sbin/bsdinstall/partedit/partedit_arm64.c Deleted: projects/vnet/lib/libpam/libpam/pam_debug_log.c projects/vnet/share/msgdef/bg_BG.UTF-8.src projects/vnet/share/msgdef/sl_SI.UTF-8.src projects/vnet/share/msgdef/sr_Latn_RS.ISO8859-2.src projects/vnet/share/numericdef/sr_Latn_RS.UTF-8.src projects/vnet/share/timedef/en_HK.UTF-8.src projects/vnet/sys/arm64/conf/GENERIC-INTRNG Modified: projects/vnet/Makefile projects/vnet/Makefile.inc1 projects/vnet/Makefile.libcompat projects/vnet/ObsoleteFiles.inc projects/vnet/bin/csh/Makefile projects/vnet/bin/setfacl/file.c projects/vnet/contrib/atf/config.h projects/vnet/contrib/blacklist/bin/blacklistctl.8 projects/vnet/contrib/blacklist/bin/blacklistctl.c projects/vnet/contrib/blacklist/bin/blacklistd.8 projects/vnet/contrib/blacklist/bin/blacklistd.conf.5 projects/vnet/contrib/blacklist/libexec/blacklistd-helper projects/vnet/contrib/bmake/ChangeLog projects/vnet/contrib/bmake/Makefile projects/vnet/contrib/bmake/README projects/vnet/contrib/bmake/config.h.in projects/vnet/contrib/bmake/configure projects/vnet/contrib/bmake/configure.in projects/vnet/contrib/bmake/dir.c projects/vnet/contrib/bmake/hash.h projects/vnet/contrib/bmake/main.c projects/vnet/contrib/bmake/make.h projects/vnet/contrib/bmake/meta.c projects/vnet/contrib/ipfilter/man/ipf.8 projects/vnet/contrib/jemalloc/ChangeLog projects/vnet/contrib/jemalloc/FREEBSD-diffs projects/vnet/contrib/jemalloc/VERSION projects/vnet/contrib/jemalloc/doc/jemalloc.3 projects/vnet/contrib/jemalloc/include/jemalloc/internal/jemalloc_internal.h projects/vnet/contrib/jemalloc/include/jemalloc/internal/prof.h projects/vnet/contrib/jemalloc/include/jemalloc/jemalloc.h projects/vnet/contrib/jemalloc/src/arena.c projects/vnet/contrib/jemalloc/src/chunk.c projects/vnet/contrib/jemalloc/src/chunk_mmap.c projects/vnet/contrib/jemalloc/src/huge.c projects/vnet/contrib/jemalloc/src/jemalloc.c projects/vnet/contrib/jemalloc/src/nstime.c projects/vnet/contrib/ldns-host/Makefile projects/vnet/contrib/ldns-host/ldns-host.1 projects/vnet/contrib/ldns-host/ldns-host.c projects/vnet/contrib/libc-vis/unvis.c projects/vnet/contrib/libc-vis/vis.3 projects/vnet/contrib/libc-vis/vis.c projects/vnet/contrib/libc-vis/vis.h projects/vnet/contrib/netbsd-tests/lib/libc/db/t_db.sh projects/vnet/contrib/netbsd-tests/lib/libc/string/t_memcpy.c projects/vnet/contrib/tcpdump/addrtoname.c projects/vnet/contrib/tcpdump/config.h.in projects/vnet/contrib/tcpdump/configure projects/vnet/contrib/tcpdump/tcpdump.c projects/vnet/crypto/openssh/auth-pam.c projects/vnet/crypto/openssh/auth.c projects/vnet/crypto/openssh/auth1.c projects/vnet/crypto/openssh/auth2.c projects/vnet/crypto/openssh/packet.c projects/vnet/crypto/openssh/sshd.c projects/vnet/etc/Makefile projects/vnet/etc/defaults/rc.conf projects/vnet/etc/mtree/BSD.include.dist projects/vnet/etc/nsswitch.conf projects/vnet/etc/rc.d/Makefile projects/vnet/gnu/lib/libsupc++/Version.map projects/vnet/gnu/usr.bin/cc/cc_tools/Makefile projects/vnet/gnu/usr.bin/cc/cc_tools/Makefile.dep projects/vnet/gnu/usr.bin/groff/src/libs/libbib/Makefile.depend projects/vnet/include/Makefile projects/vnet/include/netdb.h projects/vnet/kerberos5/Makefile.inc projects/vnet/kerberos5/tools/asn1_compile/Makefile.depend projects/vnet/lib/Makefile projects/vnet/lib/clang/Makefile projects/vnet/lib/libc/gen/Symbol.map projects/vnet/lib/libc/gen/getnetgrent.3 projects/vnet/lib/libc/gen/getnetgrent.c projects/vnet/lib/libc/gen/utime.3 projects/vnet/lib/libc/resolv/res_init.c projects/vnet/lib/libc/rpc/getnetpath.c projects/vnet/lib/libc/rpc/rpc_callmsg.c projects/vnet/lib/libc/rpc/rpc_prot.c projects/vnet/lib/libc/rpc/rpcb_clnt.c projects/vnet/lib/libc/rpc/rpcb_prot.c projects/vnet/lib/libc/rpc/rpcb_st_xdr.c projects/vnet/lib/libc/stdio/vfscanf.c projects/vnet/lib/libc/sys/pdfork.2 projects/vnet/lib/libc/sys/utimes.2 projects/vnet/lib/libcasper/libcasper/libcasper_impl.h projects/vnet/lib/libcasper/libcasper/libcasper_service.c projects/vnet/lib/libcasper/libcasper/libcasper_service.h projects/vnet/lib/libcasper/libcasper/service.c projects/vnet/lib/libcasper/libcasper/zygote.c projects/vnet/lib/libcasper/services/cap_dns/cap_dns.c projects/vnet/lib/libcasper/services/cap_grp/cap_grp.c projects/vnet/lib/libcasper/services/cap_pwd/cap_pwd.c projects/vnet/lib/libcasper/services/cap_random/cap_random.c projects/vnet/lib/libcasper/services/cap_sysctl/cap_sysctl.c projects/vnet/lib/libclang_rt/asan_cxx/Makefile.depend projects/vnet/lib/libclang_rt/profile/Makefile.depend projects/vnet/lib/libclang_rt/safestack/Makefile.depend projects/vnet/lib/libpam/Makefile.inc projects/vnet/lib/libpam/libpam/Makefile projects/vnet/lib/libpam/libpam/security/pam_mod_misc.h projects/vnet/lib/libpam/static_libpam/Makefile.depend projects/vnet/lib/libusb/Makefile projects/vnet/lib/libusb/libusb.3 projects/vnet/lib/libusb/libusb.h projects/vnet/lib/libusb/libusb10.c projects/vnet/lib/libusb/libusb10_desc.c projects/vnet/lib/libusb/libusb20.c projects/vnet/lib/libusb/libusb20_int.h projects/vnet/lib/msun/src/math.h projects/vnet/libexec/Makefile projects/vnet/libexec/fingerd/Makefile.depend projects/vnet/libexec/ftpd/Makefile.depend projects/vnet/libexec/rlogind/Makefile.depend projects/vnet/libexec/rshd/Makefile.depend projects/vnet/release/Makefile.ec2 projects/vnet/release/doc/en_US.ISO8859-1/relnotes/article.xml projects/vnet/release/scripts/mm-mtree.sh projects/vnet/release/tools/arm.subr projects/vnet/release/tools/ec2.conf projects/vnet/sbin/ifconfig/ifconfig.8 projects/vnet/sbin/ifconfig/ifieee80211.c projects/vnet/sbin/pfctl/parse.y projects/vnet/sbin/pfctl/pfctl_parser.c projects/vnet/secure/usr.sbin/sshd/Makefile projects/vnet/secure/usr.sbin/sshd/Makefile.depend projects/vnet/share/man/man3/tree.3 projects/vnet/share/man/man4/Makefile projects/vnet/share/man/man4/ahci.4 projects/vnet/share/man/man4/apic.4 projects/vnet/share/man/man4/atp.4 projects/vnet/share/man/man4/atrtc.4 projects/vnet/share/man/man4/bcma.4 projects/vnet/share/man/man4/bhnd.4 projects/vnet/share/man/man4/bhyve.4 projects/vnet/share/man/man4/bpf.4 projects/vnet/share/man/man4/cmx.4 projects/vnet/share/man/man4/cxgbe.4 projects/vnet/share/man/man4/dcons.4 projects/vnet/share/man/man4/devctl.4 projects/vnet/share/man/man4/fdt.4 projects/vnet/share/man/man4/fdtbus.4 projects/vnet/share/man/man4/hpet.4 projects/vnet/share/man/man4/hptrr.4 projects/vnet/share/man/man4/iicbus.4 projects/vnet/share/man/man4/inet.4 projects/vnet/share/man/man4/ip.4 projects/vnet/share/man/man4/ipmi.4 projects/vnet/share/man/man4/iscsi.4 projects/vnet/share/man/man4/ixl.4 projects/vnet/share/man/man4/ixlv.4 projects/vnet/share/man/man4/ksyms.4 projects/vnet/share/man/man4/man4.arm/cgem.4 projects/vnet/share/man/man4/man4.arm/mge.4 projects/vnet/share/man/man4/mdio.4 projects/vnet/share/man/man4/mfi.4 projects/vnet/share/man/man4/mpr.4 projects/vnet/share/man/man4/mpt.4 projects/vnet/share/man/man4/nand.4 projects/vnet/share/man/man4/ng_atm.4 projects/vnet/share/man/man4/ng_bridge.4 projects/vnet/share/man/man4/ng_car.4 projects/vnet/share/man/man4/ng_deflate.4 projects/vnet/share/man/man4/ng_hub.4 projects/vnet/share/man/man4/ng_mppc.4 projects/vnet/share/man/man4/ng_netflow.4 projects/vnet/share/man/man4/ng_pptpgre.4 projects/vnet/share/man/man4/ng_pred1.4 projects/vnet/share/man/man4/ng_tag.4 projects/vnet/share/man/man4/nvd.4 projects/vnet/share/man/man4/nvme.4 projects/vnet/share/man/man4/nvram2env.4 projects/vnet/share/man/man4/oce.4 projects/vnet/share/man/man4/pass.4 projects/vnet/share/man/man4/pf.4 projects/vnet/share/man/man4/proto.4 projects/vnet/share/man/man4/psm.4 projects/vnet/share/man/man4/pts.4 projects/vnet/share/man/man4/puc.4 projects/vnet/share/man/man4/qlxgbe.4 projects/vnet/share/man/man4/qlxge.4 projects/vnet/share/man/man4/random.4 projects/vnet/share/man/man4/rum.4 projects/vnet/share/man/man4/sdhci.4 projects/vnet/share/man/man4/sfxge.4 projects/vnet/share/man/man4/siba.4 projects/vnet/share/man/man4/siftr.4 projects/vnet/share/man/man4/simplebus.4 projects/vnet/share/man/man4/snd_hda.4 projects/vnet/share/man/man4/stf.4 projects/vnet/share/man/man4/u3g.4 projects/vnet/share/man/man4/unix.4 projects/vnet/share/man/man4/urtwn.4 projects/vnet/share/man/man4/usb_template.4 projects/vnet/share/man/man4/usfs.4 projects/vnet/share/man/man4/vale.4 projects/vnet/share/man/man4/virtio_scsi.4 projects/vnet/share/man/man4/vlan.4 projects/vnet/share/man/man4/witness.4 projects/vnet/share/man/man5/ar.5 projects/vnet/share/man/man5/devfs.rules.5 projects/vnet/share/man/man5/elf.5 projects/vnet/share/man/man5/nandfs.5 projects/vnet/share/man/man5/nsswitch.conf.5 projects/vnet/share/man/man5/pf.conf.5 projects/vnet/share/man/man5/quota.user.5 projects/vnet/share/man/man5/rc.conf.5 projects/vnet/share/man/man5/src.conf.5 projects/vnet/share/man/man8/nanobsd.8 projects/vnet/share/man/man9/BUS_NEW_PASS.9 projects/vnet/share/man/man9/EVENTHANDLER.9 projects/vnet/share/man/man9/SYSCALL_MODULE.9 projects/vnet/share/man/man9/bpf.9 projects/vnet/share/man/man9/counter.9 projects/vnet/share/man/man9/firmware.9 projects/vnet/share/man/man9/kqueue.9 projects/vnet/share/man/man9/lock.9 projects/vnet/share/man/man9/locking.9 projects/vnet/share/man/man9/pmap.9 projects/vnet/share/man/man9/stack.9 projects/vnet/share/man/man9/sysctl.9 projects/vnet/share/man/man9/timeout.9 projects/vnet/share/man/man9/usbdi.9 projects/vnet/share/man/man9/vn_fullpath.9 projects/vnet/share/man/man9/zone.9 projects/vnet/share/misc/committers-ports.dot projects/vnet/share/misc/committers-src.dot projects/vnet/share/mk/bsd.crunchgen.mk projects/vnet/share/mk/bsd.dep.mk projects/vnet/share/mk/bsd.init.mk projects/vnet/share/mk/bsd.lib.mk projects/vnet/share/mk/bsd.subdir.mk projects/vnet/share/mk/local.sys.mk projects/vnet/share/mk/src.opts.mk projects/vnet/share/mk/sys.mk projects/vnet/share/monetdef/sr_Latn_RS.UTF-8.src projects/vnet/share/msgdef/Makefile projects/vnet/share/msgdef/sr_Cyrl_RS.ISO8859-5.src projects/vnet/share/msgdef/sr_Latn_RS.UTF-8.src projects/vnet/share/numericdef/Makefile projects/vnet/share/timedef/Makefile projects/vnet/share/timedef/ar_JO.UTF-8.src projects/vnet/share/timedef/ar_MA.UTF-8.src projects/vnet/share/timedef/ar_SA.UTF-8.src projects/vnet/share/timedef/be_BY.CP1131.src projects/vnet/share/timedef/be_BY.CP1251.src projects/vnet/share/timedef/be_BY.ISO8859-5.src projects/vnet/share/timedef/be_BY.UTF-8.src projects/vnet/share/timedef/bg_BG.CP1251.src projects/vnet/share/timedef/bg_BG.UTF-8.src projects/vnet/share/timedef/ca_IT.ISO8859-15.src projects/vnet/share/timedef/ca_IT.UTF-8.src projects/vnet/share/timedef/el_GR.ISO8859-7.src projects/vnet/share/timedef/el_GR.UTF-8.src projects/vnet/share/timedef/en_SG.UTF-8.src projects/vnet/share/timedef/en_US.UTF-8.src projects/vnet/share/timedef/es_AR.ISO8859-1.src projects/vnet/share/timedef/es_CR.UTF-8.src projects/vnet/share/timedef/es_ES.ISO8859-15.src projects/vnet/share/timedef/es_ES.UTF-8.src projects/vnet/share/timedef/fi_FI.ISO8859-15.src projects/vnet/share/timedef/fi_FI.UTF-8.src projects/vnet/share/timedef/fr_BE.ISO8859-15.src projects/vnet/share/timedef/fr_BE.UTF-8.src projects/vnet/share/timedef/he_IL.UTF-8.src projects/vnet/share/timedef/hi_IN.ISCII-DEV.src projects/vnet/share/timedef/hi_IN.UTF-8.src projects/vnet/share/timedef/is_IS.ISO8859-15.src projects/vnet/share/timedef/is_IS.UTF-8.src projects/vnet/share/timedef/ko_KR.UTF-8.src projects/vnet/share/timedef/ko_KR.eucKR.src projects/vnet/share/timedef/nl_BE.UTF-8.src projects/vnet/share/timedef/sl_SI.ISO8859-2.src projects/vnet/share/timedef/sl_SI.UTF-8.src projects/vnet/share/timedef/sr_Cyrl_RS.ISO8859-5.src projects/vnet/share/timedef/sr_Latn_RS.ISO8859-2.src (contents, props changed) projects/vnet/share/timedef/sr_Latn_RS.UTF-8.src (contents, props changed) projects/vnet/share/timedef/tr_TR.ISO8859-9.src projects/vnet/share/timedef/tr_TR.UTF-8.src projects/vnet/share/timedef/zh_Hans_CN.GB2312.src projects/vnet/share/timedef/zh_Hans_CN.GBK.src projects/vnet/share/timedef/zh_Hans_CN.UTF-8.src projects/vnet/share/timedef/zh_Hans_CN.eucCN.src projects/vnet/share/timedef/zh_Hant_HK.UTF-8.src projects/vnet/share/timedef/zh_Hant_TW.Big5.src projects/vnet/share/timedef/zh_Hant_TW.UTF-8.src projects/vnet/share/zoneinfo/Makefile projects/vnet/sys/amd64/amd64/pmap.c projects/vnet/sys/amd64/amd64/vm_machdep.c projects/vnet/sys/amd64/cloudabi64/cloudabi64_sysvec.c projects/vnet/sys/arm/arm/cpufunc.c projects/vnet/sys/arm/arm/genassym.c projects/vnet/sys/arm/arm/mp_machdep.c projects/vnet/sys/arm/arm/swtch-v6.S projects/vnet/sys/arm/arm/vm_machdep.c projects/vnet/sys/arm/include/_types.h projects/vnet/sys/arm/include/armreg.h projects/vnet/sys/arm/include/proc.h projects/vnet/sys/arm64/arm64/vm_machdep.c projects/vnet/sys/arm64/cloudabi64/cloudabi64_sysvec.c projects/vnet/sys/arm64/conf/GENERIC projects/vnet/sys/boot/efi/Makefile.inc projects/vnet/sys/boot/efi/libefi/efi_console.c projects/vnet/sys/boot/efi/libefi/efipart.c projects/vnet/sys/boot/zfs/zfs.c projects/vnet/sys/cam/ata/ata_da.c projects/vnet/sys/cam/cam_ccb.h projects/vnet/sys/cam/cam_xpt.c projects/vnet/sys/cam/cam_xpt_internal.h projects/vnet/sys/cam/scsi/scsi_da.c projects/vnet/sys/cddl/compat/opensolaris/sys/dnlc.h projects/vnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c projects/vnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c projects/vnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c projects/vnet/sys/compat/linprocfs/linprocfs.c projects/vnet/sys/compat/linux/linux_fork.c projects/vnet/sys/compat/linuxkpi/common/src/linux_idr.c projects/vnet/sys/conf/files projects/vnet/sys/conf/files.amd64 projects/vnet/sys/conf/kern.opts.mk projects/vnet/sys/conf/kern.post.mk projects/vnet/sys/conf/newvers.sh projects/vnet/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h projects/vnet/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c projects/vnet/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c projects/vnet/sys/contrib/dev/ath/ath_hal/ar9300/ar9300reg.h projects/vnet/sys/dev/acpica/acpi_thermal.c projects/vnet/sys/dev/ath/if_ath_alq.h projects/vnet/sys/dev/ath/if_ath_rx_edma.c projects/vnet/sys/dev/ath/if_ath_sysctl.c projects/vnet/sys/dev/ath/if_ath_tx_edma.c projects/vnet/sys/dev/bhnd/bcma/bcma_nexus.c projects/vnet/sys/dev/bhnd/bhnd.h projects/vnet/sys/dev/bhnd/bhnd_nexus.c projects/vnet/sys/dev/bhnd/bhnd_subr.c projects/vnet/sys/dev/bhnd/cores/chipc/chipc.c projects/vnet/sys/dev/bhnd/cores/chipc/chipc_private.h projects/vnet/sys/dev/bhnd/cores/chipc/chipc_subr.c projects/vnet/sys/dev/bhnd/cores/pci/bhnd_pci.c projects/vnet/sys/dev/bhnd/cores/pci/bhnd_pci_hostb.c projects/vnet/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c projects/vnet/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c projects/vnet/sys/dev/bhnd/siba/siba.c projects/vnet/sys/dev/bhnd/siba/siba_bhndb.c projects/vnet/sys/dev/bhnd/siba/siba_nexus.c projects/vnet/sys/dev/bhnd/siba/siba_subr.c projects/vnet/sys/dev/bhnd/siba/sibareg.h projects/vnet/sys/dev/bhnd/siba/sibavar.h projects/vnet/sys/dev/cpuctl/cpuctl.c projects/vnet/sys/dev/cxgbe/adapter.h projects/vnet/sys/dev/cxgbe/iw_cxgbe/cm.c projects/vnet/sys/dev/cxgbe/t4_sge.c projects/vnet/sys/dev/cxgbe/tom/t4_cpl_io.c projects/vnet/sys/dev/cxgbe/tom/t4_ddp.c projects/vnet/sys/dev/dwc/if_dwc.c projects/vnet/sys/dev/dwc/if_dwc.h projects/vnet/sys/dev/flash/mx25l.c projects/vnet/sys/dev/hyperv/vmbus/hv_channel.c projects/vnet/sys/dev/hyperv/vmbus/hv_connection.c projects/vnet/sys/dev/hyperv/vmbus/hv_vmbus_priv.h projects/vnet/sys/dev/hyperv/vmbus/vmbus.c projects/vnet/sys/dev/hyperv/vmbus/vmbus_reg.h projects/vnet/sys/dev/hyperv/vmbus/vmbus_var.h projects/vnet/sys/dev/ioat/ioat.c projects/vnet/sys/dev/iscsi/iscsi_ioctl.h projects/vnet/sys/dev/iwm/if_iwm.c projects/vnet/sys/dev/iwm/if_iwmvar.h projects/vnet/sys/dev/mii/miidevs projects/vnet/sys/dev/mii/smscphy.c projects/vnet/sys/dev/mps/mps.c projects/vnet/sys/dev/mps/mps_config.c projects/vnet/sys/dev/mps/mps_sas.c projects/vnet/sys/dev/mps/mps_sas_lsi.c projects/vnet/sys/dev/mps/mps_user.c projects/vnet/sys/dev/mps/mpsvar.h projects/vnet/sys/dev/ntb/if_ntb/if_ntb.c projects/vnet/sys/dev/nvme/nvme.h projects/vnet/sys/dev/nvme/nvme_ctrlr.c projects/vnet/sys/dev/nvme/nvme_ns_cmd.c projects/vnet/sys/dev/nvme/nvme_private.h projects/vnet/sys/dev/ral/rt2860.c projects/vnet/sys/dev/ral/rt2860reg.h projects/vnet/sys/dev/rtwn/if_rtwn.c projects/vnet/sys/dev/sfxge/common/ef10_nvram.c projects/vnet/sys/dev/sfxge/sfxge_ev.c projects/vnet/sys/dev/sfxge/sfxge_port.c projects/vnet/sys/dev/sfxge/sfxge_tx.c projects/vnet/sys/dev/sfxge/sfxge_version.h projects/vnet/sys/dev/urtwn/if_urtwn.c projects/vnet/sys/dev/urtwn/if_urtwnvar.h projects/vnet/sys/dev/xen/timer/timer.c projects/vnet/sys/fs/devfs/devfs_vnops.c projects/vnet/sys/fs/ext2fs/ext2_alloc.c projects/vnet/sys/fs/ext2fs/ext2_bmap.c projects/vnet/sys/fs/ext2fs/ext2_extents.h projects/vnet/sys/fs/ext2fs/ext2_vfsops.c projects/vnet/sys/fs/ext2fs/ext2fs.h projects/vnet/sys/fs/nfsclient/nfs_clvfsops.c projects/vnet/sys/fs/nfsclient/nfs_clvnops.c projects/vnet/sys/i386/i386/vm_machdep.c projects/vnet/sys/kern/init_main.c projects/vnet/sys/kern/kern_exec.c projects/vnet/sys/kern/kern_fail.c projects/vnet/sys/kern/kern_fork.c projects/vnet/sys/kern/kern_jail.c projects/vnet/sys/kern/kern_kthread.c projects/vnet/sys/kern/kern_linker.c projects/vnet/sys/kern/kern_sig.c projects/vnet/sys/kern/kern_thr.c projects/vnet/sys/kern/kern_thread.c projects/vnet/sys/kern/subr_prf.c projects/vnet/sys/kern/sys_procdesc.c projects/vnet/sys/kern/sys_socket.c projects/vnet/sys/kern/sysv_msg.c projects/vnet/sys/kern/vfs_aio.c projects/vnet/sys/kern/vfs_mount.c projects/vnet/sys/kern/vfs_subr.c projects/vnet/sys/mips/broadcom/bcm_mipscore.c projects/vnet/sys/mips/mips/swtch.S projects/vnet/sys/mips/mips/vm_machdep.c projects/vnet/sys/modules/Makefile projects/vnet/sys/modules/bwn/Makefile projects/vnet/sys/modules/bwn_pci/Makefile projects/vnet/sys/modules/dtb/allwinner/Makefile projects/vnet/sys/modules/netgraph/mppc/Makefile projects/vnet/sys/modules/siba_bwn/Makefile projects/vnet/sys/modules/tcp/fastpath/Makefile projects/vnet/sys/net/if.c projects/vnet/sys/net/if_bridge.c projects/vnet/sys/net/if_lagg.c projects/vnet/sys/net/iflib.c projects/vnet/sys/net/pfvar.h projects/vnet/sys/net80211/ieee80211_ddb.c projects/vnet/sys/net80211/ieee80211_freebsd.h projects/vnet/sys/net80211/ieee80211_hostap.c projects/vnet/sys/net80211/ieee80211_node.c projects/vnet/sys/net80211/ieee80211_node.h projects/vnet/sys/net80211/ieee80211_output.c projects/vnet/sys/net80211/ieee80211_superg.c projects/vnet/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c projects/vnet/sys/netgraph/bluetooth/l2cap/ng_l2cap_ulpi.c projects/vnet/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c projects/vnet/sys/netinet/in.c projects/vnet/sys/netinet/in.h projects/vnet/sys/netinet/ip_fastfwd.c projects/vnet/sys/netinet/ip_input.c projects/vnet/sys/netinet/ip_output.c projects/vnet/sys/netinet/sctp_input.c projects/vnet/sys/netinet/sctp_output.c projects/vnet/sys/netinet/sctp_structs.h projects/vnet/sys/netinet/sctputil.c projects/vnet/sys/netinet/tcp_input.c projects/vnet/sys/netinet/tcp_stacks/fastpath.c projects/vnet/sys/netinet/udp_usrreq.c projects/vnet/sys/netinet6/in6.c projects/vnet/sys/netinet6/in6_ifattach.c projects/vnet/sys/netinet6/in6_ifattach.h projects/vnet/sys/netinet6/in6_var.h projects/vnet/sys/netinet6/ip6_forward.c projects/vnet/sys/netinet6/ip6_input.c projects/vnet/sys/netinet6/ip6_output.c projects/vnet/sys/netinet6/udp6_usrreq.c projects/vnet/sys/netpfil/pf/pf.c projects/vnet/sys/netpfil/pf/pf_ioctl.c projects/vnet/sys/nlm/nlm_advlock.c projects/vnet/sys/ofed/drivers/infiniband/core/iwcm.c projects/vnet/sys/powerpc/powerpc/exec_machdep.c projects/vnet/sys/powerpc/powerpc/vm_machdep.c projects/vnet/sys/riscv/include/riscvreg.h projects/vnet/sys/riscv/riscv/vm_machdep.c projects/vnet/sys/rpc/clnt_bck.c projects/vnet/sys/rpc/rpcb_clnt.c projects/vnet/sys/security/audit/audit_bsm.c projects/vnet/sys/sparc64/sparc64/vm_machdep.c projects/vnet/sys/sys/aio.h projects/vnet/sys/sys/param.h projects/vnet/sys/sys/proc.h projects/vnet/sys/sys/procdesc.h projects/vnet/sys/sys/sdt.h projects/vnet/sys/sys/vnode.h projects/vnet/sys/vm/swap_pager.c projects/vnet/targets/pseudo/clang/Makefile.depend projects/vnet/tests/sys/acl/Makefile projects/vnet/tools/build/Makefile projects/vnet/tools/build/mk/OptionalObsoleteFiles.inc projects/vnet/tools/build/options/WITH_META_MODE projects/vnet/tools/tools/locale/tools/cldr2def.pl projects/vnet/usr.bin/ar/ar.1 projects/vnet/usr.bin/ar/ar.c projects/vnet/usr.bin/awk/Makefile projects/vnet/usr.bin/bmake/Makefile projects/vnet/usr.bin/bmake/config.h projects/vnet/usr.bin/calendar/calendars/calendar.freebsd projects/vnet/usr.bin/clang/Makefile projects/vnet/usr.bin/mkimg/Makefile projects/vnet/usr.bin/random/randomize_fd.c projects/vnet/usr.bin/truss/Makefile projects/vnet/usr.bin/xinstall/tests/install_test.sh projects/vnet/usr.bin/xinstall/xinstall.c projects/vnet/usr.sbin/Makefile projects/vnet/usr.sbin/bsdconfig/include/messages.subr projects/vnet/usr.sbin/bsdconfig/networking/INDEX projects/vnet/usr.sbin/bsdconfig/networking/Makefile projects/vnet/usr.sbin/bsdconfig/networking/include/messages.subr projects/vnet/usr.sbin/bsdconfig/networking/networking projects/vnet/usr.sbin/bsdconfig/networking/share/device.subr projects/vnet/usr.sbin/bsdconfig/share/media/Makefile projects/vnet/usr.sbin/bsdinstall/partedit/gpart_ops.c projects/vnet/usr.sbin/bsdinstall/scripts/wlanconfig projects/vnet/usr.sbin/bsdinstall/scripts/zfsboot projects/vnet/usr.sbin/cpucontrol/cpucontrol.c projects/vnet/usr.sbin/ctld/ctld.h projects/vnet/usr.sbin/ctld/login.c projects/vnet/usr.sbin/extattr/tests/extattr_test.sh projects/vnet/usr.sbin/iscsid/iscsid.h projects/vnet/usr.sbin/iscsid/login.c projects/vnet/usr.sbin/makefs/cd9660.c projects/vnet/usr.sbin/makefs/ffs.c projects/vnet/usr.sbin/makefs/ffs/mkfs.c projects/vnet/usr.sbin/makefs/ffs/newfs_extern.h projects/vnet/usr.sbin/makefs/makefs.8 projects/vnet/usr.sbin/makefs/makefs.c projects/vnet/usr.sbin/makefs/makefs.h projects/vnet/usr.sbin/makefs/walk.c projects/vnet/usr.sbin/rpc.lockd/lockd_lock.c projects/vnet/usr.sbin/rpcbind/rpcb_stat.c projects/vnet/usr.sbin/rpcbind/rpcb_svc_com.c projects/vnet/usr.sbin/rpcbind/tests/addrmerge_test.c projects/vnet/usr.sbin/services_mkdb/services_mkdb.8 projects/vnet/usr.sbin/sysrc/sysrc.8 projects/vnet/usr.sbin/tcpdump/tcpdump/config.h Directory Properties: projects/vnet/ (props changed) projects/vnet/contrib/atf/ (props changed) projects/vnet/contrib/bmake/ (props changed) projects/vnet/contrib/ipfilter/ (props changed) projects/vnet/contrib/ldns-host/ (props changed) projects/vnet/contrib/libc-vis/ (props changed) projects/vnet/contrib/llvm/ (props changed) projects/vnet/contrib/llvm/tools/clang/ (props changed) projects/vnet/contrib/tcpdump/ (props changed) projects/vnet/crypto/openssh/ (props changed) projects/vnet/gnu/lib/ (props changed) projects/vnet/gnu/usr.bin/cc/cc_tools/ (props changed) projects/vnet/sys/cddl/contrib/opensolaris/ (props changed) Modified: projects/vnet/Makefile ============================================================================== --- projects/vnet/Makefile Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/Makefile Tue Jun 21 15:26:59 2016 (r302057) @@ -133,12 +133,27 @@ TGTS= all all-man buildenv buildenvvars create-world-packages create-kernel-packages create-packages \ packages installconfig real-packages sign-packages package-pkg +# XXX: r156740: This can't work since bsd.subdir.mk is not included ever. +# It will only work for SUBDIR_TARGETS in make.conf. TGTS+= ${SUBDIR_TARGETS} BITGTS= files includes BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/} TGTS+= ${BITGTS} +# Only some targets are allowed to use meta mode. Others get it +# disabled. In some cases, such as 'install', meta mode can be dangerous +# as a cookie may be used to prevent redundant installations (such as +# for WORLDTMP staging). For DESTDIR=/ we always want to install though. +# For other cases, such as delete-old-libs, meta mode may break +# the interactive tty prompt. The safest route is to just whitelist +# the ones that benefit from it. +META_TGT_WHITELIST+= \ + _* build32 buildfiles buildincludes buildkernel buildsoft \ + buildworld everything kernel-toolchains kernel kernels libraries \ + native-xtools showconfig tinderbox toolchain toolchains universe \ + world worlds xdev xdev-build + .ORDER: buildworld installworld .ORDER: buildworld distributeworld .ORDER: buildworld buildkernel @@ -194,14 +209,24 @@ SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk _MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} -# Must disable META_MODE when installing to avoid missing anything. The -# main problem is that buildworld will create cookies for install targets -# since they are being installed into WORLDTMP. This avoids unneeded and -# redundant restaging but is dangerous for user install targets. -.if make(distrib*) || make(*install*) +# Only allow meta mode for the whitelisted targets. See META_TGT_WHITELIST +# above. +.for _tgt in ${META_TGT_WHITELIST} +.if make(${_tgt}) +_CAN_USE_META_MODE?= yes +.endif +.endfor +.if !defined(_CAN_USE_META_MODE) _MAKE+= MK_META_MODE=no .unexport META_MODE -.endif +.elif defined(MK_META_MODE) && ${MK_META_MODE} == "yes" +.if !exists(/dev/filemon) && !defined(NO_FILEMON) && !make(showconfig) +# Require filemon be loaded to provide a working incremental build +.error ${.newline}ERROR: The filemon module (/dev/filemon) is not loaded. \ + ${.newline}ERROR: WITH_META_MODE is enabled but requires filemon for an incremental build. \ + ${.newline}ERROR: 'kldload filemon' or pass -DNO_FILEMON to suppress this error. +.endif # !exists(/dev/filemon) && !defined(NO_FILEMON) +.endif # !defined(_CAN_USE_META_MODE) # Guess machine architecture from machine type, and vice versa. .if !defined(TARGET_ARCH) && defined(TARGET) @@ -274,7 +299,7 @@ CHECK_TIME!= find ${.CURDIR}/sys/sys/par # not included. One can argue that this target doesn't build everything # then. # -world: upgrade_checks +world: upgrade_checks .PHONY @echo "--------------------------------------------------------------" @echo ">>> make world started on ${STARTTIME}" @echo "--------------------------------------------------------------" @@ -300,7 +325,7 @@ world: upgrade_checks @echo " (started ${STARTTIME})" @echo "--------------------------------------------------------------" .else -world: +world: .PHONY @echo "WARNING: make world will overwrite your existing FreeBSD" @echo "installation without also building and installing a new" @echo "kernel. This can be dangerous. Please read the handbook," @@ -317,13 +342,13 @@ world: # # Short hand for `make buildkernel installkernel' # -kernel: buildkernel installkernel +kernel: buildkernel installkernel .PHONY # # Perform a few tests to determine if the installed tools are adequate # for building the world. # -upgrade_checks: +upgrade_checks: .PHONY .if defined(NEED_MAKE_UPGRADE) @${_+_}(cd ${.CURDIR} && ${MAKE} ${WANT_MAKE:S,^f,,}) .endif @@ -359,19 +384,19 @@ regress: .PHONY tinderbox toolchains kernel-toolchains kernels worlds: upgrade_checks -tinderbox: +tinderbox: .PHONY @cd ${.CURDIR}; ${SUB_MAKE} DOING_TINDERBOX=YES universe -toolchains: +toolchains: .PHONY @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=toolchain universe -kernel-toolchains: +kernel-toolchains: .PHONY @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=kernel-toolchain universe -kernels: +kernels: .PHONY @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=buildkernel universe -worlds: +worlds: .PHONY @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=buildworld universe # @@ -393,13 +418,13 @@ TARGET_ARCHES_pc98?= i386 TARGET_ARCHES_${target}?= ${target} .endfor -# XXX Add arm64 to universe only if we have an external binutils installed. +# XXX Remove arm64 from universe if the required binutils package is missing. # It does not build with the in-tree linker. -.if !exists(/usr/local/aarch64-freebsd/bin/ld) && empty(${TARGETS}) +.if !exists(/usr/local/aarch64-freebsd/bin/ld) && ${TARGETS:Marm64} _UNIVERSE_TARGETS:= ${_UNIVERSE_TARGETS:Narm64} -universe: universe_arm64_skip -universe_epilogue: universe_arm64_skip -universe_arm64_skip: universe_prologue +universe: universe_arm64_skip .PHONY +universe_epilogue: universe_arm64_skip .PHONY +universe_arm64_skip: universe_prologue .PHONY @echo ">> arm64 skipped - install aarch64-binutils port or package to build" .endif @@ -437,16 +462,16 @@ universe_prologue: .PHONY .for target in ${_UNIVERSE_TARGETS} universe: universe_${target} universe_epilogue: universe_${target} -universe_${target}: universe_${target}_prologue -universe_${target}_prologue: universe_prologue +universe_${target}: universe_${target}_prologue .PHONY +universe_${target}_prologue: universe_prologue .PHONY @echo ">> ${target} started on `LC_ALL=C date`" -universe_${target}_worlds: +universe_${target}_worlds: .PHONY .if !defined(MAKE_JUST_KERNELS) -universe_${target}_done: universe_${target}_worlds +universe_${target}_done: universe_${target}_worlds .PHONY .for target_arch in ${TARGET_ARCHES_${target}} -universe_${target}_worlds: universe_${target}_${target_arch} -universe_${target}_${target_arch}: universe_${target}_prologue .MAKE +universe_${target}_worlds: universe_${target}_${target_arch} .PHONY +universe_${target}_${target_arch}: universe_${target}_prologue .MAKE .PHONY @echo ">> ${target}.${target_arch} ${UNIVERSE_TARGET} started on `LC_ALL=C date`" @(cd ${.CURDIR} && env __MAKE_CONF=/dev/null \ ${SUB_MAKE} ${JFLAG} ${UNIVERSE_TARGET} \ @@ -461,9 +486,9 @@ universe_${target}_${target_arch}: unive .endif # !MAKE_JUST_KERNELS .if !defined(MAKE_JUST_WORLDS) -universe_${target}_done: universe_${target}_kernels -universe_${target}_kernels: universe_${target}_worlds -universe_${target}_kernels: universe_${target}_prologue .MAKE +universe_${target}_done: universe_${target}_kernels .PHONY +universe_${target}_kernels: universe_${target}_worlds .PHONY +universe_${target}_kernels: universe_${target}_prologue .MAKE .PHONY .if exists(${KERNSRCDIR}/${target}/conf/NOTES) @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ ${SUB_MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ @@ -479,7 +504,7 @@ universe_${target}: universe_${target}_d universe_${target}_done: @echo ">> ${target} completed on `LC_ALL=C date`" .endfor -universe_kernels: universe_kernconfs +universe_kernels: universe_kernconfs .PHONY .if !defined(TARGET) TARGET!= uname -m .endif @@ -493,7 +518,7 @@ KERNCONFS!= cd ${KERNSRCDIR}/${TARGET}/c -type f -maxdepth 0 \ ! -name DEFAULTS ! -name NOTES | \ ${_THINNER} -universe_kernconfs: +universe_kernconfs: .PHONY .for kernel in ${KERNCONFS} TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR}/${TARGET}/conf && \ config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null | \ @@ -527,7 +552,7 @@ universe_epilogue: .PHONY .endif .endif -buildLINT: +buildLINT: .PHONY ${MAKE} -C ${.CURDIR}/sys/${_TARGET}/conf LINT .if defined(.PARSEDIR) Modified: projects/vnet/Makefile.inc1 ============================================================================== --- projects/vnet/Makefile.inc1 Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/Makefile.inc1 Tue Jun 21 15:26:59 2016 (r302057) @@ -543,9 +543,12 @@ TARGET_ABI= gnueabi .endif .endif .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc -# GCC requires -isystem and -L when using a cross-compiler. +# GCC requires -isystem and -L when using a cross-compiler. --sysroot +# won't set header path and -L is used to ensure the base library path +# is added before the port PREFIX library path. XCFLAGS+= -isystem ${WORLDTMP}/usr/include -L${WORLDTMP}/usr/lib # Force using libc++ for external GCC. +# XXX: This should be checking MK_GNUCXX == no XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ -L${WORLDTMP}/../lib/libc++ .else @@ -646,6 +649,8 @@ _worldtmp: .PHONY mtree -deU -f ${.CURDIR}/etc/mtree/BSD.groff.dist \ -p ${WORLDTMP}/legacy/usr >/dev/null .endif + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ + -p ${WORLDTMP}/legacy/usr/include >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ -p ${WORLDTMP}/usr >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ Modified: projects/vnet/Makefile.libcompat ============================================================================== --- projects/vnet/Makefile.libcompat Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/Makefile.libcompat Tue Jun 21 15:26:59 2016 (r302057) @@ -19,7 +19,7 @@ LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH MACHINE_CPU="i686 mmx sse sse2" LIB32WMAKEFLAGS= \ AS="${XAS} --32" \ - LD="${XLD} -m elf_i386_fbsd -Y P,${LIBCOMPATTMP}/usr/lib32" \ + LD="${XLD} -m elf_i386_fbsd -L${LIBCOMPATTMP}/usr/lib32" \ OBJCOPY="${XOBJCOPY}" .elif ${TARGET_ARCH} == "powerpc64" @@ -72,13 +72,21 @@ LIBCOMPATCFLAGS+= ${LIBCOMPATCPUFLAGS} \ # -B is needed to find /usr/lib32/crti.o for GCC and /usr/libsoft/crti.o for # Clang/GCC. LIBCOMPATCFLAGS+= -B${LIBCOMPATTMP}/usr/lib${libcompat} + .if defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc -# GCC requires -isystem when using a cross-compiler. +# GCC requires -isystem when using a cross-compiler and --sysroot. Note that +# Makefile.inc1 only applies this with an external compiler but libcompat +# always does since even in-tree GCC 4.2 needs this to override the built-in +# sysroot path which --sysroot does not actually do for headers. LIBCOMPATCFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include # Force using libc++ for external GCC. +# XXX: This should be checking MK_GNUCXX == no +.if ${MK_CROSS_COMPILER} == "no" || \ + (${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no") LIBCOMPATCXXFLAGS+= -isystem ${LIBCOMPATTMP}/usr/include/c++/v1 -std=c++11 \ -nostdinc++ -L${LIBCOMPAT_OBJTREE}${.CURDIR}/lib/libc++ .endif +.endif # Yes, the flags are redundant. LIBCOMPATWMAKEENV+= MAKEOBJDIRPREFIX=${LIBCOMPAT_OBJTREE} \ Modified: projects/vnet/ObsoleteFiles.inc ============================================================================== --- projects/vnet/ObsoleteFiles.inc Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/ObsoleteFiles.inc Tue Jun 21 15:26:59 2016 (r302057) @@ -38,6 +38,57 @@ # xargs -n1 | sort | uniq -d; # done +# 20160608: removed pam_verbose_error +OLD_LIBS+=usr/lib/libpam.so.5 +OLD_LIBS+=usr/lib/pam_chroot.so.5 +OLD_LIBS+=usr/lib/pam_deny.so.5 +OLD_LIBS+=usr/lib/pam_echo.so.5 +OLD_LIBS+=usr/lib/pam_exec.so.5 +OLD_LIBS+=usr/lib/pam_ftpusers.so.5 +OLD_LIBS+=usr/lib/pam_group.so.5 +OLD_LIBS+=usr/lib/pam_guest.so.5 +OLD_LIBS+=usr/lib/pam_krb5.so.5 +OLD_LIBS+=usr/lib/pam_ksu.so.5 +OLD_LIBS+=usr/lib/pam_lastlog.so.5 +OLD_LIBS+=usr/lib/pam_login_access.so.5 +OLD_LIBS+=usr/lib/pam_nologin.so.5 +OLD_LIBS+=usr/lib/pam_opie.so.5 +OLD_LIBS+=usr/lib/pam_opieaccess.so.5 +OLD_LIBS+=usr/lib/pam_passwdqc.so.5 +OLD_LIBS+=usr/lib/pam_permit.so.5 +OLD_LIBS+=usr/lib/pam_radius.so.5 +OLD_LIBS+=usr/lib/pam_rhosts.so.5 +OLD_LIBS+=usr/lib/pam_rootok.so.5 +OLD_LIBS+=usr/lib/pam_securetty.so.5 +OLD_LIBS+=usr/lib/pam_self.so.5 +OLD_LIBS+=usr/lib/pam_ssh.so.5 +OLD_LIBS+=usr/lib/pam_tacplus.so.5 +OLD_LIBS+=usr/lib/pam_unix.so.5 +OLD_LIBS+=usr/lib32/libpam.so.5 +OLD_LIBS+=usr/lib32/pam_chroot.so.5 +OLD_LIBS+=usr/lib32/pam_deny.so.5 +OLD_LIBS+=usr/lib32/pam_echo.so.5 +OLD_LIBS+=usr/lib32/pam_exec.so.5 +OLD_LIBS+=usr/lib32/pam_ftpusers.so.5 +OLD_LIBS+=usr/lib32/pam_group.so.5 +OLD_LIBS+=usr/lib32/pam_guest.so.5 +OLD_LIBS+=usr/lib32/pam_krb5.so.5 +OLD_LIBS+=usr/lib32/pam_ksu.so.5 +OLD_LIBS+=usr/lib32/pam_lastlog.so.5 +OLD_LIBS+=usr/lib32/pam_login_access.so.5 +OLD_LIBS+=usr/lib32/pam_nologin.so.5 +OLD_LIBS+=usr/lib32/pam_opie.so.5 +OLD_LIBS+=usr/lib32/pam_opieaccess.so.5 +OLD_LIBS+=usr/lib32/pam_passwdqc.so.5 +OLD_LIBS+=usr/lib32/pam_permit.so.5 +OLD_LIBS+=usr/lib32/pam_radius.so.5 +OLD_LIBS+=usr/lib32/pam_rhosts.so.5 +OLD_LIBS+=usr/lib32/pam_rootok.so.5 +OLD_LIBS+=usr/lib32/pam_securetty.so.5 +OLD_LIBS+=usr/lib32/pam_self.so.5 +OLD_LIBS+=usr/lib32/pam_ssh.so.5 +OLD_LIBS+=usr/lib32/pam_tacplus.so.5 +OLD_LIBS+=usr/lib32/pam_unix.so.5 # 20160523: remove extranous ALTQ files OLD_FILES+=usr/include/altq/altq_codel.h OLD_FILES+=usr/include/altq/altq_fairq.h Modified: projects/vnet/bin/csh/Makefile ============================================================================== --- projects/vnet/bin/csh/Makefile Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/bin/csh/Makefile Tue Jun 21 15:26:59 2016 (r302057) @@ -136,7 +136,7 @@ sh.err.h: sh.err.c grep 'ERR_' ${.ALLSRC} | grep '^#define' >> ${.TARGET} @echo '#endif /* _h_sh_err */' >> ${.TARGET} -tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h +tc.const.h: tc.const.c sh.char.h config.h config_f.h sh.types.h sh.err.h ${BUILD_TOOLS_META} @rm -f ${.TARGET} @echo '/* Do not edit this file, make creates it. */' > ${.TARGET} @echo '#ifndef _h_tc_const' >> ${.TARGET} Modified: projects/vnet/bin/setfacl/file.c ============================================================================== --- projects/vnet/bin/setfacl/file.c Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/bin/setfacl/file.c Tue Jun 21 15:26:59 2016 (r302057) @@ -43,13 +43,12 @@ acl_t get_acl_from_file(const char *filename) { FILE *file; + size_t len; char buf[BUFSIZ+1]; if (filename == NULL) err(1, "(null) filename in get_acl_from_file()"); - bzero(&buf, sizeof(buf)); - if (strcmp(filename, "-") == 0) { if (have_stdin != 0) err(1, "cannot specify more than one stdin"); @@ -61,7 +60,8 @@ get_acl_from_file(const char *filename) err(1, "fopen() %s failed", filename); } - fread(buf, sizeof(buf) - 1, (size_t)1, file); + len = fread(buf, (size_t)1, sizeof(buf) - 1, file); + buf[len] = '\0'; if (ferror(file) != 0) { fclose(file); err(1, "error reading from %s", filename); Modified: projects/vnet/contrib/atf/config.h ============================================================================== --- projects/vnet/contrib/atf/config.h Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/atf/config.h Tue Jun 21 15:26:59 2016 (r302057) @@ -2,10 +2,10 @@ /* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if basename takes a constant pointer */ -#define HAVE_CONST_BASENAME 1 +/* #undef HAVE_CONST_BASENAME */ /* Define to 1 if dirname takes a constant pointer */ -#define HAVE_CONST_DIRNAME 1 +/* #undef HAVE_CONST_DIRNAME */ /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 Modified: projects/vnet/contrib/blacklist/bin/blacklistctl.8 ============================================================================== --- projects/vnet/contrib/blacklist/bin/blacklistctl.8 Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/blacklist/bin/blacklistctl.8 Tue Jun 21 15:26:59 2016 (r302057) @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 29, 2015 +.Dd June 7, 2016 .Dt BLACKLISTCTL 8 .Os .Sh NAME @@ -75,7 +75,11 @@ will first attempt to remove the existin it to make sure that there is only one rule active. .Sh HISTORY .Nm -appeared in +first appeared in .Nx 7 . +.Fx support for +.Nm +was implemented in +.Fx 11 . .Sh AUTHORS .An Christos Zoulas Modified: projects/vnet/contrib/blacklist/bin/blacklistctl.c ============================================================================== --- projects/vnet/contrib/blacklist/bin/blacklistctl.c Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/blacklist/bin/blacklistctl.c Tue Jun 21 15:26:59 2016 (r302057) @@ -96,10 +96,10 @@ main(int argc, char *argv[]) break; case 'b': blocked = 1; + break; case 'D': dbname = optarg; break; - break; case 'd': debug++; break; Modified: projects/vnet/contrib/blacklist/bin/blacklistd.8 ============================================================================== --- projects/vnet/contrib/blacklist/bin/blacklistd.8 Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/blacklist/bin/blacklistd.8 Tue Jun 21 15:26:59 2016 (r302057) @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 4, 2015 +.Dd June 7, 2016 .Dt BLACKLISTD 8 .Os .Sh NAME @@ -216,7 +216,11 @@ Socket to receive connection notificatio .Xr syslogd 8 .Sh HISTORY .Nm -appeared in +first appeared in .Nx 7 . +.Fx support for +.Nm +was implemented in +.Fx 11 . .Sh AUTHORS .An Christos Zoulas Modified: projects/vnet/contrib/blacklist/bin/blacklistd.conf.5 ============================================================================== --- projects/vnet/contrib/blacklist/bin/blacklistd.conf.5 Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/blacklist/bin/blacklistd.conf.5 Tue Jun 21 15:26:59 2016 (r302057) @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 29, 2015 +.Dd June 7, 2016 .Dt BLACKLISTD.CONF 5 .Os .Sh NAME @@ -216,7 +216,11 @@ bnx0:ssh * * * * 3 6h .Xr blacklistd 8 .Sh HISTORY .Nm -appeared in +first appeared in .Nx 7 . +.Fx support for +.Nm +was implemented in +.Fx 11 . .Sh AUTHORS .An Christos Zoulas Modified: projects/vnet/contrib/blacklist/libexec/blacklistd-helper ============================================================================== --- projects/vnet/contrib/blacklist/libexec/blacklistd-helper Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/blacklist/libexec/blacklistd-helper Tue Jun 21 15:26:59 2016 (r302057) @@ -10,12 +10,20 @@ # $7 id pf= -for f in npf pf; do - if [ -f "/etc/$f.conf" ]; then - pf="$f" - break - fi -done +if [ -f "/etc/ipfw-blacklist.rc" ]; then + pf="ipfw" + . /etc/ipfw-blacklist.rc + ipfw_offset=${ipfw_offset:-2000} +fi + +if [ -z "$pf" ]; then + for f in npf pf ipf; do + if [ -f "/etc/$f.conf" ]; then + pf="$f" + break + fi + done +fi if [ -z "$pf" ]; then echo "$0: Unsupported packet filter" 1>&2 @@ -43,6 +51,21 @@ esac case "$1" in add) case "$pf" in + ipf) + /sbin/ipfstat -io | /sbin/ipf -I -f - >/dev/null 2>&1 + echo block in quick $proto from $addr/$mask to \ + any port=$6 head port$6 | \ + /sbin/ipf -I -f - -s >/dev/null 2>&1 + ;; + ipfw) + # use $ipfw_offset+$port for rule number + rule=$(($ipfw_offset + $6)) + tname="port$6" + /sbin/ipfw table $tname create type addr 2>/dev/null + /sbin/ipfw -q table $tname add "$addr/$mask" + /sbin/ipfw -q add $rule drop $3 from "table("$tname")" to \ + any dst-port $6 + ;; npf) /sbin/npfctl rule "$2" add block in final $proto from \ "$addr/$mask" to any $port @@ -57,6 +80,15 @@ add) ;; rem) case "$pf" in + ipf) + /sbin/ipfstat -io | /sbin/ipf -I -f - >/dev/null 2>&1 + echo block in quick $proto from $addr/$mask to \ + any port=$6 head port$6 | \ + /sbin/ipf -I -r -f - -s >/dev/null 2>&1 + ;; + ipfw) + /sbin/ipfw table "port$6" delete "$addr/$mask" 2>/dev/null + ;; npf) /sbin/npfctl rule "$2" rem-id "$7" ;; @@ -66,7 +98,13 @@ rem) esac ;; flush) - case "$pf" in + case "$pf" in + ipf) + /sbin/ipf -Z -I -Fi -s > /dev/null + ;; + ipfw) + /sbin/ipfw table "port$6" flush 2>/dev/null + ;; npf) /sbin/npfctl rule "$2" flush ;; Modified: projects/vnet/contrib/bmake/ChangeLog ============================================================================== --- projects/vnet/contrib/bmake/ChangeLog Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/bmake/ChangeLog Tue Jun 21 15:26:59 2016 (r302057) @@ -1,3 +1,9 @@ +2016-06-06 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160606 + Merge with NetBSD make, pick up + o dir.c: extend mtimes cache to others via cached_stat() + 2016-06-04 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20160604 Modified: projects/vnet/contrib/bmake/Makefile ============================================================================== --- projects/vnet/contrib/bmake/Makefile Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/bmake/Makefile Tue Jun 21 15:26:59 2016 (r302057) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.66 2016/06/04 22:21:15 sjg Exp $ +# $Id: Makefile,v 1.67 2016/06/07 00:46:12 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160604 +_MAKE_VERSION= 20160606 PROG= bmake Modified: projects/vnet/contrib/bmake/README ============================================================================== --- projects/vnet/contrib/bmake/README Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/bmake/README Tue Jun 21 15:26:59 2016 (r302057) @@ -1,47 +1,52 @@ bmake + ***** -This directory contains a port of the BSD make tool (from NetBSD) -I have run it on SunOS,Solaris,HP-UX,AIX,IRIX,FreeBSD and Linux. +This directory contains a port of the BSD make tool (from NetBSD). +Since 1993 I have run it on AIX, BSDi, Darwin, FreeBSD, HP-UX, IRIX, +Linux, Minix, OSF, Solaris, SunOS and even UTS. +Others have run it on many more systems. -Version 3 was re-worked from scratch to better facilitate -importing newer make(1) versions from NetBSD. The original code base -was NetBSD-1.0, so version 3 was built by doing a fresh import of the -NetBSD-1.0 usr.bin/make, adding the autoconf and other portability -patches to sync it with bmake v2, and then NetBSD's make -of Feb 20, 2000 was imported and conflicts dealt with. -NetBSD's make was again imported on June 6 and December 15, 2000. +Currently each release is tested on NetBSD, FreeBSD, Solaris and Linux. -In 2003 bmake switched to a date based version (first was 20030714) +Since 2003 bmake switched to a date based version (first was 20030714) which generally represents the date it was last merged with NetBSD's make. Since then, NetBSD's make is imported within a week of any interesting changes, so that bmake tracks it very closely. -Building: +Building +======== -The preferred way to bootstrap bmake is: +The preferred way to bootstrap bmake is:: -./bmake/boot-strap + ./bmake/boot-strap there are a number of args - most of which get passed to configure, eg. +:: -./bmake/boot-strap --prefix=/opt + ./bmake/boot-strap --prefix=/opt see the boot-strap script for details. +For folk that hate to read anything, since 20121212 you can also use +the GNU standard process of:: + + ./configure; make; make install + To make much use of bmake you will need the bsd.*.mk macros or my -portable *.mk macros. See +portable *.mk macros which are included with bmake since 20121212 +and separately available from http://www.crufty.net/ftp/pub/sjg/mk.tar.gz which will be links to the latest versions. -On a non-BSD system, you would want to unpack mk[-YYYYmmdd].tar.gz in -the same directory as bmake (so ./mk and ./bmake exist), and -./bmake/boot-strap will do the rest. +Porting +======= + +If you encounter a system that bmake does not build or work on *out of +the box*, I welcome patches. +If you can provide access to a suitable machine - even better. -If you want to do it all by hand then read boot-strap first to get the -idea. +More info can be found at http://www.crufty.net/help/sjg/bmake.htm -Even if you have an earlier version of bmake installed, use boot-strap -to ensure that all goes well. +--sjg ---sjg Modified: projects/vnet/contrib/bmake/config.h.in ============================================================================== --- projects/vnet/contrib/bmake/config.h.in Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/bmake/config.h.in Tue Jun 21 15:26:59 2016 (r302057) @@ -324,6 +324,9 @@ /* Define to empty if `const' does not conform to ANSI C. */ #undef const +/* Define to `int' if does not define. */ +#undef mode_t + /* Define to `long int' if does not define. */ #undef off_t Modified: projects/vnet/contrib/bmake/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: projects/vnet/contrib/bmake/configure.in ============================================================================== --- projects/vnet/contrib/bmake/configure.in Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/bmake/configure.in Tue Jun 21 15:26:59 2016 (r302057) @@ -1,11 +1,11 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.56 2015/10/25 05:20:48 sjg Exp $ +dnl $Id: configure.in,v 1.57 2016/06/07 00:49:44 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl AC_PREREQ(2.50) -AC_INIT([bmake], [20151022], [sjg@NetBSD.org]) +AC_INIT([bmake], [20160606], [sjg@NetBSD.org]) AC_CONFIG_HEADERS(config.h) dnl make srcdir absolute @@ -148,6 +148,7 @@ dnl Checks for typedefs, structures, and AC_C___ATTRIBUTE__ AC_C_BIGENDIAN AC_C_CONST +AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T Modified: projects/vnet/contrib/bmake/dir.c ============================================================================== --- projects/vnet/contrib/bmake/dir.c Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/bmake/dir.c Tue Jun 21 15:26:59 2016 (r302057) @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $ */ +/* $NetBSD: dir.c,v 1.68 2016/06/07 00:40:00 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.68 2016/06/07 00:40:00 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.67 2013/03/05 22:01:43 christos Exp $"); +__RCSID("$NetBSD: dir.c,v 1.68 2016/06/07 00:40:00 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -244,6 +244,7 @@ static Hash_Table mtimes; /* Results o * be two rules to update a single file, so this * should be ok, but... */ +static Hash_Table lmtimes; /* same as mtimes but for lstat */ static int DirFindName(const void *, const void *); static int DirMatchFiles(const char *, Path *, Lst); @@ -256,6 +257,80 @@ static char *DirLookupSubdir(Path *, con static char *DirFindDot(Boolean, const char *, const char *); static char *DirLookupAbs(Path *, const char *, const char *); + +/* + * We use stat(2) a lot, cache the results + * mtime and mode are all we care about. + */ +struct cache_st { + time_t mtime; + mode_t mode; +}; + +/* minimize changes below */ +static time_t +Hash_GetTimeValue(Hash_Entry *entry) +{ + struct cache_st *cst; + + cst = entry->clientPtr; + return cst->mtime; +} + +#define CST_LSTAT 1 +#define CST_UPDATE 2 + +static int +cached_stats(Hash_Table *htp, const char *pathname, struct stat *st, int flags) +{ + Hash_Entry *entry; + struct cache_st *cst; + int rc; + + if (!pathname || !pathname[0]) + return -1; + + entry = Hash_FindEntry(htp, pathname); + + if (entry && (flags & CST_UPDATE) == 0) { + cst = entry->clientPtr; + + memset(st, 0, sizeof(*st)); + st->st_mtime = cst->mtime; + st->st_mode = cst->mode; + return 0; + } + + rc = (flags & CST_LSTAT) ? lstat(pathname, st) : stat(pathname, st); + if (rc == -1) + return -1; + + if (st->st_mtime == 0) + st->st_mtime = 1; /* avoid confusion with missing file */ + + if (!entry) + entry = Hash_CreateEntry(htp, pathname, NULL); + if (!entry->clientPtr) + entry->clientPtr = bmake_malloc(sizeof(*cst)); + cst = entry->clientPtr; + cst->mtime = st->st_mtime; + cst->mode = st->st_mode; + + return 0; +} + +int +cached_stat(const char *pathname, void *st) +{ + return cached_stats(&mtimes, pathname, st, 0); +} + +int +cached_lstat(const char *pathname, void *st) +{ + return cached_stats(&lmtimes, pathname, st, CST_LSTAT); +} + /*- *----------------------------------------------------------------------- * Dir_Init -- @@ -274,6 +349,7 @@ Dir_Init(const char *cdname) dirSearchPath = Lst_Init(FALSE); openDirectories = Lst_Init(FALSE); Hash_InitTable(&mtimes, 0); + Hash_InitTable(&lmtimes, 0); Dir_InitCur(cdname); @@ -901,7 +977,6 @@ static char * DirLookupSubdir(Path *p, const char *name) { struct stat stb; /* Buffer for stat, if necessary */ - Hash_Entry *entry; /* Entry for mtimes table */ char *file; /* the current filename to check */ if (p != dot) { @@ -917,9 +992,7 @@ DirLookupSubdir(Path *p, const char *nam fprintf(debug_file, "checking %s ...\n", file); } - if (stat(file, &stb) == 0) { - if (stb.st_mtime == 0) - stb.st_mtime = 1; + if (cached_stat(file, &stb) == 0) { /* * Save the modification time so if it's needed, we don't have * to fetch it again. @@ -928,8 +1001,6 @@ DirLookupSubdir(Path *p, const char *nam fprintf(debug_file, " Caching %s for %s\n", Targ_FmtTime(stb.st_mtime), file); } - entry = Hash_CreateEntry(&mtimes, file, NULL); - Hash_SetTimeValue(entry, stb.st_mtime); nearmisses += 1; return (file); } @@ -1312,15 +1383,11 @@ Dir_FindFile(const char *name, Lst path) fprintf(debug_file, " got it (in mtime cache)\n"); } return(bmake_strdup(name)); - } else if (stat(name, &stb) == 0) { - if (stb.st_mtime == 0) - stb.st_mtime = 1; - entry = Hash_CreateEntry(&mtimes, name, NULL); + } else if (cached_stat(name, &stb) == 0) { if (DEBUG(DIR)) { fprintf(debug_file, " Caching %s for %s\n", Targ_FmtTime(stb.st_mtime), name); } - Hash_SetTimeValue(entry, stb.st_mtime); return (bmake_strdup(name)); } else { if (DEBUG(DIR)) { @@ -1368,7 +1435,7 @@ Dir_FindHereOrAbove(char *here, char *se /* try and stat(2) it ... */ snprintf(try, sizeof(try), "%s/%s", dirbase, search_path); - if (stat(try, &st) != -1) { + if (cached_stat(try, &st) != -1) { /* * success! if we found a file, chop off * the filename so we return a directory. @@ -1489,12 +1556,12 @@ Dir_MTime(GNode *gn, Boolean recheck) else entry = NULL; if (entry != NULL) { + stb.st_mtime = Hash_GetTimeValue(entry); if (DEBUG(DIR)) { fprintf(debug_file, "Using cached time %s for %s\n", - Targ_FmtTime(Hash_GetTimeValue(entry)), fullName); + Targ_FmtTime(stb.st_mtime), fullName); } - stb.st_mtime = Hash_GetTimeValue(entry); - } else if (stat(fullName, &stb) < 0) { + } else if (cached_stats(&mtimes, fullName, &stb, recheck ? CST_UPDATE : 0) < 0) { if (gn->type & OP_MEMBER) { if (fullName != gn->path) free(fullName); @@ -1502,18 +1569,8 @@ Dir_MTime(GNode *gn, Boolean recheck) } else { stb.st_mtime = 0; } - } else { - if (stb.st_mtime == 0) { - /* - * 0 handled specially by the code, if the time is really 0, - * return something else instead - */ - stb.st_mtime = 1; - } - entry = Hash_CreateEntry(&mtimes, fullName, NULL); - Hash_SetTimeValue(entry, stb.st_mtime); } - + if (fullName && gn->path == NULL) { gn->path = fullName; } Modified: projects/vnet/contrib/bmake/hash.h ============================================================================== --- projects/vnet/contrib/bmake/hash.h Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/bmake/hash.h Tue Jun 21 15:26:59 2016 (r302057) @@ -1,4 +1,4 @@ -/* $NetBSD: hash.h,v 1.10 2009/01/24 10:59:09 dsl Exp $ */ +/* $NetBSD: hash.h,v 1.11 2016/06/07 00:40:00 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -89,10 +89,7 @@ typedef struct Hash_Entry { struct Hash_Entry *next; /* Used to link together all the * entries associated with the same * bucket. */ - union { - void *clientPtr; /* Arbitrary pointer */ - time_t clientTime; /* Arbitrary Time */ - } clientInfo; + void *clientPtr; /* Arbitrary pointer */ unsigned namehash; /* hash value of key */ char name[1]; /* key string */ } Hash_Entry; @@ -125,8 +122,7 @@ typedef struct Hash_Search { * Hash_Entry *h; */ -#define Hash_GetValue(h) ((h)->clientInfo.clientPtr) -#define Hash_GetTimeValue(h) ((h)->clientInfo.clientTime) +#define Hash_GetValue(h) ((h)->clientPtr) /* * Hash_SetValue(h, val); @@ -134,8 +130,7 @@ typedef struct Hash_Search { * char *val; */ -#define Hash_SetValue(h, val) ((h)->clientInfo.clientPtr = (val)) -#define Hash_SetTimeValue(h, val) ((h)->clientInfo.clientTime = (val)) +#define Hash_SetValue(h, val) ((h)->clientPtr = (val)) /* * Hash_Size(n) returns the number of words in an object of n bytes Modified: projects/vnet/contrib/bmake/main.c ============================================================================== --- projects/vnet/contrib/bmake/main.c Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/bmake/main.c Tue Jun 21 15:26:59 2016 (r302057) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $ */ +/* $NetBSD: main.c,v 1.247 2016/06/05 01:39:17 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.247 2016/06/05 01:39:17 christos Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.245 2016/06/03 01:21:59 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.247 2016/06/05 01:39:17 christos Exp $"); #endif #endif /* not lint */ #endif @@ -1906,15 +1906,11 @@ cached_realpath(const char *pathname, ch rp = Var_Value(pathname, cache, &cp); if (rp) { /* a hit */ - if (resolved) - strlcpy(resolved, rp, MAXPATHLEN); - else - resolved = bmake_strdup(rp); - } else { - if ((rp = realpath(pathname, resolved))) { - Var_Set(pathname, rp, cache, 0); - } + strlcpy(resolved, rp, MAXPATHLEN); + } else if ((rp = realpath(pathname, resolved))) { + Var_Set(pathname, rp, cache, 0); } + free(cp); return rp ? resolved : NULL; } Modified: projects/vnet/contrib/bmake/make.h ============================================================================== --- projects/vnet/contrib/bmake/make.h Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/bmake/make.h Tue Jun 21 15:26:59 2016 (r302057) @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.99 2016/06/03 01:21:59 sjg Exp $ */ +/* $NetBSD: make.h,v 1.100 2016/06/07 00:40:00 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -506,6 +506,8 @@ void Main_ExportMAKEFLAGS(Boolean); Boolean Main_SetObjdir(const char *); int mkTempFile(const char *, char **); int str2Lst_Append(Lst, char *, const char *); +int cached_lstat(const char *, void *); +int cached_stat(const char *, void *); #define VARF_UNDEFERR 1 #define VARF_WANTRES 2 Modified: projects/vnet/contrib/bmake/meta.c ============================================================================== --- projects/vnet/contrib/bmake/meta.c Tue Jun 21 15:18:22 2016 (r302056) +++ projects/vnet/contrib/bmake/meta.c Tue Jun 21 15:26:59 2016 (r302057) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.60 2016/06/04 22:17:14 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.61 2016/06/07 00:40:00 sjg Exp $ */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Tue Jun 21 15:29:07 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A9F5AC5EF9 for ; Tue, 21 Jun 2016 15:29:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37F162006; Tue, 21 Jun 2016 15:29:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5LFT631026412; Tue, 21 Jun 2016 15:29:06 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LFT6vR026411; Tue, 21 Jun 2016 15:29:06 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606211529.u5LFT6vR026411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 21 Jun 2016 15:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302059 - projects/vnet/sys/netpfil/pf X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 15:29:07 -0000 Author: bz Date: Tue Jun 21 15:29:06 2016 New Revision: 302059 URL: https://svnweb.freebsd.org/changeset/base/302059 Log: Fix SVN mis-merge that slipped through. Sponsored by: The FreeBSD Foundation Modified: projects/vnet/sys/netpfil/pf/pf_ioctl.c Modified: projects/vnet/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- projects/vnet/sys/netpfil/pf/pf_ioctl.c Tue Jun 21 15:27:16 2016 (r302058) +++ projects/vnet/sys/netpfil/pf/pf_ioctl.c Tue Jun 21 15:29:06 2016 (r302059) @@ -3846,5 +3846,5 @@ static moduledata_t pf_mod = { 0 }; -DECLARE_MODULE(pf, pf_mod, SI_SUB_PROTO_FIREWALL, SI_ORDER_FIRST); +DECLARE_MODULE(pf, pf_mod, SI_SUB_PROTO_FIREWALL, SI_ORDER_SECOND); MODULE_VERSION(pf, PF_MODVER); From owner-svn-src-projects@freebsd.org Wed Jun 22 12:12:17 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFB72AC5156 for ; Wed, 22 Jun 2016 12:12:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76CE82CF1; Wed, 22 Jun 2016 12:12:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5MCCGEB088401; Wed, 22 Jun 2016 12:12:16 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MCCDCL088370; Wed, 22 Jun 2016 12:12:13 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606221212.u5MCCDCL088370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 22 Jun 2016 12:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302085 - in projects/vnet: . contrib/libarchive contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarc... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 12:12:17 -0000 Author: bz Date: Wed Jun 22 12:12:13 2016 New Revision: 302085 URL: https://svnweb.freebsd.org/changeset/base/302085 Log: MfH @r302084 Includes the if_detach_internal() fix for non-VIMAGE kernels. Sponsored by: The FreeBSD Foundation Added: projects/vnet/contrib/libarchive/cpio/test/test_missing_file.c - copied unchanged from r302083, head/contrib/libarchive/cpio/test/test_missing_file.c projects/vnet/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.c - copied unchanged from r302083, head/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.c projects/vnet/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.rar.uu - copied unchanged from r302083, head/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.rar.uu projects/vnet/contrib/libarchive/libarchive/test/test_write_format_gnutar_filenames.c - copied unchanged from r302083, head/contrib/libarchive/libarchive/test/test_write_format_gnutar_filenames.c projects/vnet/contrib/libarchive/tar/test/test_missing_file.c - copied unchanged from r302083, head/contrib/libarchive/tar/test/test_missing_file.c projects/vnet/lib/libusb/libusb10_hotplug.c - copied unchanged from r302083, head/lib/libusb/libusb10_hotplug.c Modified: projects/vnet/Makefile projects/vnet/contrib/libarchive/NEWS projects/vnet/contrib/libarchive/cat/test/main.c projects/vnet/contrib/libarchive/cpio/cpio.c projects/vnet/contrib/libarchive/cpio/test/main.c projects/vnet/contrib/libarchive/cpio/test/test_option_version.c projects/vnet/contrib/libarchive/libarchive/archive.h projects/vnet/contrib/libarchive/libarchive/archive_entry.h projects/vnet/contrib/libarchive/libarchive/archive_entry_xattr.c projects/vnet/contrib/libarchive/libarchive/archive_ppmd7.c projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_7zip.c projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_lha.c projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_mtree.c projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_rar.c projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_warc.c projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_zip.c projects/vnet/contrib/libarchive/libarchive/archive_write_filter.3 projects/vnet/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c projects/vnet/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c projects/vnet/contrib/libarchive/libarchive/archive_write_set_options.3 projects/vnet/contrib/libarchive/libarchive/libarchive-formats.5 projects/vnet/contrib/libarchive/libarchive/libarchive_changes.3 projects/vnet/contrib/libarchive/libarchive/test/main.c projects/vnet/contrib/libarchive/libarchive_fe/passphrase.c projects/vnet/contrib/libarchive/tar/test/main.c projects/vnet/contrib/libarchive/tar/write.c projects/vnet/lib/libarchive/tests/Makefile projects/vnet/lib/libusb/Makefile projects/vnet/lib/libusb/libusb.3 projects/vnet/lib/libusb/libusb.h projects/vnet/lib/libusb/libusb10.c projects/vnet/lib/libusb/libusb10.h projects/vnet/share/man/man4/syscons.4 projects/vnet/share/man/man4/vt.4 projects/vnet/share/mk/bsd.dep.mk projects/vnet/share/mk/bsd.prog.mk projects/vnet/share/mk/sys.mk projects/vnet/sys/arm/include/param.h projects/vnet/sys/arm64/arm64/trap.c projects/vnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c projects/vnet/sys/conf/kern.post.mk projects/vnet/sys/dev/ath/if_ath_tx_edma.c projects/vnet/sys/dev/cxgbe/tom/t4_ddp.c projects/vnet/sys/dev/usb/controller/xhci.c projects/vnet/sys/dev/usb/controller/xhci.h projects/vnet/sys/dev/usb/controller/xhcireg.h projects/vnet/sys/geom/geom_disk.c projects/vnet/sys/geom/geom_disk.h projects/vnet/sys/kern/sys_socket.c projects/vnet/sys/kern/vfs_aio.c projects/vnet/sys/net/if.c projects/vnet/sys/netinet6/in6.c projects/vnet/sys/sys/aio.h projects/vnet/sys/sys/param.h projects/vnet/sys/vm/vm_meter.c projects/vnet/sys/vm/vm_object.h projects/vnet/tests/sys/aio/aio_test.c projects/vnet/usr.bin/bsdcat/Makefile projects/vnet/usr.bin/cpio/Makefile projects/vnet/usr.bin/cpio/tests/Makefile projects/vnet/usr.bin/tar/Makefile projects/vnet/usr.bin/tar/tests/Makefile Directory Properties: projects/vnet/ (props changed) projects/vnet/contrib/libarchive/ (props changed) projects/vnet/contrib/libarchive/cpio/ (props changed) projects/vnet/contrib/libarchive/libarchive/ (props changed) projects/vnet/contrib/libarchive/libarchive_fe/ (props changed) projects/vnet/contrib/libarchive/tar/ (props changed) projects/vnet/contrib/one-true-awk/ (props changed) projects/vnet/sys/cddl/contrib/opensolaris/ (props changed) Modified: projects/vnet/Makefile ============================================================================== --- projects/vnet/Makefile Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/Makefile Wed Jun 22 12:12:13 2016 (r302085) @@ -103,7 +103,7 @@ # This is included so CC is set to ccache for -V, and COMPILER_TYPE/VERSION # can be cached for sub-makes. -.if ${MAKE_VERSION} >= 20140620 +.if ${MAKE_VERSION} >= 20140620 && defined(.PARSEDIR) .include .endif @@ -218,7 +218,9 @@ _CAN_USE_META_MODE?= yes .endfor .if !defined(_CAN_USE_META_MODE) _MAKE+= MK_META_MODE=no +.if defined(.PARSEDIR) .unexport META_MODE +.endif .elif defined(MK_META_MODE) && ${MK_META_MODE} == "yes" .if !exists(/dev/filemon) && !defined(NO_FILEMON) && !make(showconfig) # Require filemon be loaded to provide a working incremental build Modified: projects/vnet/contrib/libarchive/NEWS ============================================================================== --- projects/vnet/contrib/libarchive/NEWS Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/NEWS Wed Jun 22 12:12:13 2016 (r302085) @@ -1,3 +1,8 @@ +Jun 20, 2016: libarchive 3.2.1 released + This fixes a handful of security and other critical issues with 3.2.0 + +May 01, 2016: libarchive 3.2.0 released + Apr 09, 2016: libarchive 3.1.901a released Another test release in preparation for 3.2.0 Modified: projects/vnet/contrib/libarchive/cat/test/main.c ============================================================================== --- projects/vnet/contrib/libarchive/cat/test/main.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/cat/test/main.c Wed Jun 22 12:12:13 2016 (r302085) @@ -2534,18 +2534,36 @@ usage(const char *program) static char * get_refdir(const char *d) { - char tried[512] = { '\0' }; - char buff[128]; - char *pwd, *p; + size_t tried_size, buff_size; + char *buff, *tried, *pwd = NULL, *p = NULL; + +#ifdef PATH_MAX + buff_size = PATH_MAX; +#else + buff_size = 8192; +#endif + buff = calloc(buff_size, 1); + if (buff == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } + + /* Allocate a buffer to hold the various directories we checked. */ + tried_size = buff_size * 2; + tried = calloc(tried_size, 1); + if (tried == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } /* If a dir was specified, try that */ if (d != NULL) { pwd = NULL; - snprintf(buff, sizeof(buff), "%s", d); + snprintf(buff, buff_size, "%s", d); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); goto failure; } @@ -2559,48 +2577,48 @@ get_refdir(const char *d) pwd[strlen(pwd) - 1] = '\0'; /* Look for a known file. */ - snprintf(buff, sizeof(buff), "%s", pwd); + snprintf(buff, buff_size, "%s", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd); + snprintf(buff, buff_size, "%s/test", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(LIBRARY) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, LIBRARY); + snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY); #else - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM); #endif p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(PROGRAM_ALIAS) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM_ALIAS); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #endif if (memcmp(pwd, "/usr/obj", 8) == 0) { - snprintf(buff, sizeof(buff), "%s", pwd + 8); + snprintf(buff, buff_size, "%s", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd + 8); + snprintf(buff, buff_size, "%s/test", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); } failure: @@ -2615,7 +2633,12 @@ failure: success: free(p); free(pwd); - return strdup(buff); + free(tried); + + /* Copy result into a fresh buffer to reduce memory usage. */ + p = strdup(buff); + free(buff); + return p; } int Modified: projects/vnet/contrib/libarchive/cpio/cpio.c ============================================================================== --- projects/vnet/contrib/libarchive/cpio/cpio.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/cpio/cpio.c Wed Jun 22 12:12:13 2016 (r302085) @@ -498,7 +498,7 @@ long_help(void) static void version(void) { - fprintf(stdout,"bsdcpio %s -- %s\n", + fprintf(stdout,"bsdcpio %s - %s\n", BSDCPIO_VERSION_STRING, archive_version_details()); exit(0); Modified: projects/vnet/contrib/libarchive/cpio/test/main.c ============================================================================== --- projects/vnet/contrib/libarchive/cpio/test/main.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/cpio/test/main.c Wed Jun 22 12:12:13 2016 (r302085) @@ -2535,18 +2535,36 @@ usage(const char *program) static char * get_refdir(const char *d) { - char tried[512] = { '\0' }; - char buff[128]; - char *pwd, *p; + size_t tried_size, buff_size; + char *buff, *tried, *pwd = NULL, *p = NULL; + +#ifdef PATH_MAX + buff_size = PATH_MAX; +#else + buff_size = 8192; +#endif + buff = calloc(buff_size, 1); + if (buff == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } + + /* Allocate a buffer to hold the various directories we checked. */ + tried_size = buff_size * 2; + tried = calloc(tried_size, 1); + if (tried == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } /* If a dir was specified, try that */ if (d != NULL) { pwd = NULL; - snprintf(buff, sizeof(buff), "%s", d); + snprintf(buff, buff_size, "%s", d); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); goto failure; } @@ -2560,48 +2578,48 @@ get_refdir(const char *d) pwd[strlen(pwd) - 1] = '\0'; /* Look for a known file. */ - snprintf(buff, sizeof(buff), "%s", pwd); + snprintf(buff, buff_size, "%s", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd); + snprintf(buff, buff_size, "%s/test", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(LIBRARY) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, LIBRARY); + snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY); #else - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM); #endif p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(PROGRAM_ALIAS) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM_ALIAS); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #endif if (memcmp(pwd, "/usr/obj", 8) == 0) { - snprintf(buff, sizeof(buff), "%s", pwd + 8); + snprintf(buff, buff_size, "%s", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd + 8); + snprintf(buff, buff_size, "%s/test", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); } failure: @@ -2616,7 +2634,12 @@ failure: success: free(p); free(pwd); - return strdup(buff); + free(tried); + + /* Copy result into a fresh buffer to reduce memory usage. */ + p = strdup(buff); + free(buff); + return p; } int Copied: projects/vnet/contrib/libarchive/cpio/test/test_missing_file.c (from r302083, head/contrib/libarchive/cpio/test/test_missing_file.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/vnet/contrib/libarchive/cpio/test/test_missing_file.c Wed Jun 22 12:12:13 2016 (r302085, copy of r302083, head/contrib/libarchive/cpio/test/test_missing_file.c) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2016 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_missing_file) +{ + int r; + + assertMakeFile("file1", 0644, "file1"); + assertMakeFile("file2", 0644, "file2"); + + assertMakeFile("filelist1", 0644, "file1\nfile2\n"); + r = systemf("%s -o stdout1 2>stderr1", testprog); + assertEqualInt(r, 0); + assertTextFileContents("1 block\n", "stderr1"); + + assertMakeFile("filelist2", 0644, "file1\nfile2\nfile3\n"); + r = systemf("%s -o stdout2 2>stderr2", testprog); + assert(r != 0); + + assertMakeFile("filelist3", 0644, ""); + r = systemf("%s -o stdout3 2>stderr3", testprog); + assertEqualInt(r, 0); + assertTextFileContents("1 block\n", "stderr3"); + + assertMakeFile("filelist4", 0644, "file3\n"); + r = systemf("%s -o stdout4 2>stderr4", testprog); + assert(r != 0); +} Modified: projects/vnet/contrib/libarchive/cpio/test/test_option_version.c ============================================================================== --- projects/vnet/contrib/libarchive/cpio/test/test_option_version.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/cpio/test/test_option_version.c Wed Jun 22 12:12:13 2016 (r302085) @@ -59,8 +59,8 @@ verify(const char *p, size_t s) ++q; --s; /* Separator. */ failure("Version: %s", p); - assertEqualMem(q, "-- ", 3); - q += 3; s -= 3; + assertEqualMem(q, "- ", 2); + q += 2; s -= 2; /* libarchive name and version number */ assert(s > 11); failure("Version: %s", p); Modified: projects/vnet/contrib/libarchive/libarchive/archive.h ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive.h Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive.h Wed Jun 22 12:12:13 2016 (r302085) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3002000 +#define ARCHIVE_VERSION_NUMBER 3002001 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(vo /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.2.0" +#define ARCHIVE_VERSION_ONLY_STRING "3.2.1" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: projects/vnet/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_entry.h Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_entry.h Wed Jun 22 12:12:13 2016 (r302085) @@ -29,7 +29,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3002000 +#define ARCHIVE_VERSION_NUMBER 3002001 /* * Note: archive_entry.h is for use outside of libarchive; the Modified: projects/vnet/contrib/libarchive/libarchive/archive_entry_xattr.c ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_entry_xattr.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_entry_xattr.c Wed Jun 22 12:12:13 2016 (r302085) @@ -91,16 +91,11 @@ archive_entry_xattr_add_entry(struct arc { struct ae_xattr *xp; - for (xp = entry->xattr_head; xp != NULL; xp = xp->next) - ; - if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL) - /* XXX Error XXX */ - return; + __archive_errx(1, "Out of memory"); if ((xp->name = strdup(name)) == NULL) - /* XXX Error XXX */ - return; + __archive_errx(1, "Out of memory"); if ((xp->value = malloc(size)) != NULL) { memcpy(xp->value, value, size); Modified: projects/vnet/contrib/libarchive/libarchive/archive_ppmd7.c ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_ppmd7.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_ppmd7.c Wed Jun 22 12:12:13 2016 (r302085) @@ -126,6 +126,11 @@ static Bool Ppmd7_Alloc(CPpmd7 *p, UInt3 { if (p->Base == 0 || p->Size != size) { + /* RestartModel() below assumes that p->Size >= UNIT_SIZE + (see the calculation of m->MinContext). */ + if (size < UNIT_SIZE) { + return False; + } Ppmd7_Free(p, alloc); p->AlignOffset = #ifdef PPMD_32BIT Modified: projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_7zip.c ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_7zip.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_7zip.c Wed Jun 22 12:12:13 2016 (r302085) @@ -2153,6 +2153,9 @@ read_SubStreamsInfo(struct archive_read return (-1); if (UMAX_ENTRY < f[i].numUnpackStreams) return (-1); + if (unpack_streams > SIZE_MAX - UMAX_ENTRY) { + return (-1); + } unpack_streams += (size_t)f[i].numUnpackStreams; } if ((p = header_bytes(a, 1)) == NULL) Modified: projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Wed Jun 22 12:12:13 2016 (r302085) @@ -1091,7 +1091,7 @@ choose_volume(struct archive_read *a, st /* This condition is unlikely; by way of caution. */ vd = &(iso9660->joliet); - skipsize = LOGICAL_BLOCK_SIZE * vd->location; + skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location; skipsize = __archive_read_consume(a, skipsize); if (skipsize < 0) return ((int)skipsize); @@ -1129,7 +1129,7 @@ choose_volume(struct archive_read *a, st && iso9660->seenJoliet) { /* Switch reading data from primary to joliet. */ vd = &(iso9660->joliet); - skipsize = LOGICAL_BLOCK_SIZE * vd->location; + skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location; skipsize -= iso9660->current_position; skipsize = __archive_read_consume(a, skipsize); if (skipsize < 0) Modified: projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_lha.c ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_lha.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_lha.c Wed Jun 22 12:12:13 2016 (r302085) @@ -1712,6 +1712,7 @@ lha_crc16(uint16_t crc, const void *pp, for (;len >= 8; len -= 8) { /* This if statement expects compiler optimization will * remove the stament which will not be executed. */ +#undef bswap16 #if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */ # define bswap16(x) _byteswap_ushort(x) #elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8) \ Modified: projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Wed Jun 22 12:12:13 2016 (r302085) @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive "Missing number"); return ARCHIVE_WARN; } - numbers[argc++] = (unsigned long)mtree_atol(&p); - if (argc > MAX_PACK_ARGS) { + if (argc >= MAX_PACK_ARGS) { archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT, "Too many arguments"); return ARCHIVE_WARN; } + numbers[argc++] = (unsigned long)mtree_atol(&p); } if (argc < 2) { archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT, Modified: projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_rar.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_rar.c Wed Jun 22 12:12:13 2016 (r302085) @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a) rar->range_dec.Stream = &rar->bytein; __archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context); + if (rar->dictionary_size == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Invalid zero dictionary size"); + return (ARCHIVE_FATAL); + } + if (!__archive_ppmd7_functions.Ppmd7_Alloc(&rar->ppmd7_context, rar->dictionary_size, &g_szalloc)) { @@ -2884,11 +2890,10 @@ copy_from_lzss_window(struct archive_rea } windowoffs = lzss_offset_for_position(&rar->lzss, startpos); - if(windowoffs + length <= lzss_size(&rar->lzss)) + if(windowoffs + length <= lzss_size(&rar->lzss)) { memcpy(&rar->unp_buffer[rar->unp_offset], &rar->lzss.window[windowoffs], length); - else - { + } else if (length <= lzss_size(&rar->lzss)) { firstpart = lzss_size(&rar->lzss) - windowoffs; if (firstpart < 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, @@ -2900,9 +2905,14 @@ copy_from_lzss_window(struct archive_rea &rar->lzss.window[windowoffs], firstpart); memcpy(&rar->unp_buffer[rar->unp_offset + firstpart], &rar->lzss.window[0], length - firstpart); - } else + } else { memcpy(&rar->unp_buffer[rar->unp_offset], &rar->lzss.window[windowoffs], length); + } + } else { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Bad RAR file data"); + return (ARCHIVE_FATAL); } rar->unp_offset += length; if (rar->unp_offset >= rar->unp_buffer_size) Modified: projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_warc.c ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_warc.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_warc.c Wed Jun 22 12:12:13 2016 (r302085) @@ -535,7 +535,8 @@ xstrpisotime(const char *s, char **endpt /* as a courtesy to our callers, and since this is a non-standard * routine, we skip leading whitespace */ - for (; isspace(*s); s++); + while (isspace((unsigned char)*s)) + ++s; /* read year */ if ((tm.tm_year = strtoi_lim(s, &s, 1583, 4095)) < 0 || *s++ != '-') { @@ -639,7 +640,9 @@ _warc_rdtyp(const char *buf, size_t bsz) return WT_NONE; } /* overread whitespace */ - for (val += sizeof(_key) - 1U; val < eob && isspace(*val); val++); + val += sizeof(_key) - 1U; + while (val < eob && isspace((unsigned char)*val)) + ++val; if (val + 8U > eob) { ; @@ -676,7 +679,9 @@ _warc_rduri(const char *buf, size_t bsz) return res; } /* overread whitespace */ - for (val += sizeof(_key) - 1U; val < eob && isspace(*val); val++); + val += sizeof(_key) - 1U; + while (val < eob && isspace((unsigned char)*val)) + ++val; /* overread URL designators */ if ((uri = xmemmem(val, eob - val, "://", 3U)) == NULL) { @@ -692,7 +697,8 @@ _warc_rduri(const char *buf, size_t bsz) /* also massage eol to point to the first whitespace * after the last non-whitespace character before * the end of the line */ - for (; eol > uri && isspace(eol[-1]); eol--); + while (eol > uri && isspace((unsigned char)eol[-1])) + --eol; /* now then, inspect the URI */ if (memcmp(val, "file", 4U) == 0) { @@ -727,7 +733,7 @@ _warc_rdlen(const char *buf, size_t bsz) /* strtol kindly overreads whitespace for us, so use that */ val += sizeof(_key) - 1U; len = strtol(val, &on, 10); - if (on == NULL || !isspace(*on)) { + if (on == NULL || !isspace((unsigned char)*on)) { /* hm, can we trust that number? Best not. */ return -1; } @@ -750,7 +756,7 @@ _warc_rdrtm(const char *buf, size_t bsz) /* xstrpisotime() kindly overreads whitespace for us, so use that */ val += sizeof(_key) - 1U; res = xstrpisotime(val, &on); - if (on == NULL || !isspace(*on)) { + if (on == NULL || !isspace((unsigned char)*on)) { /* hm, can we trust that number? Best not. */ return (time_t)-1; } @@ -773,7 +779,7 @@ _warc_rdmtm(const char *buf, size_t bsz) /* xstrpisotime() kindly overreads whitespace for us, so use that */ val += sizeof(_key) - 1U; res = xstrpisotime(val, &on); - if (on == NULL || !isspace(*on)) { + if (on == NULL || !isspace((unsigned char)*on)) { /* hm, can we trust that number? Best not. */ return (time_t)-1; } Modified: projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_zip.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_read_support_format_zip.c Wed Jun 22 12:12:13 2016 (r302085) @@ -181,6 +181,14 @@ struct zip { char init_decryption; /* Decryption buffer. */ + /* + * The decrypted data starts at decrypted_ptr and + * extends for decrypted_bytes_remaining. Decryption + * adds new data to the end of this block, data is returned + * to clients from the beginning. When the block hits the + * end of decrypted_buffer, it has to be shuffled back to + * the beginning of the buffer. + */ unsigned char *decrypted_buffer; unsigned char *decrypted_ptr; size_t decrypted_buffer_size; @@ -1293,8 +1301,9 @@ zip_read_data_deflate(struct archive_rea if (zip->tctx_valid || zip->cctx_valid) { if (zip->decrypted_bytes_remaining < (size_t)bytes_avail) { - size_t buff_remaining = zip->decrypted_buffer_size - - (zip->decrypted_ptr - zip->decrypted_buffer); + size_t buff_remaining = + (zip->decrypted_buffer + zip->decrypted_buffer_size) + - (zip->decrypted_ptr + zip->decrypted_bytes_remaining); if (buff_remaining > (size_t)bytes_avail) buff_remaining = (size_t)bytes_avail; Modified: projects/vnet/contrib/libarchive/libarchive/archive_write_filter.3 ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_write_filter.3 Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_write_filter.3 Wed Jun 22 12:12:13 2016 (r302085) @@ -43,6 +43,7 @@ .Nm archive_write_add_filter_program , .Nm archive_write_add_filter_uuencode , .Nm archive_write_add_filter_xz +.Nd functions enabling output filters .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) .Sh SYNOPSIS Modified: projects/vnet/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c Wed Jun 22 12:12:13 2016 (r302085) @@ -467,7 +467,7 @@ archive_write_gnutar_header(struct archi } } if (gnutar->linkname_length > GNUTAR_linkname_size) { - size_t todo = gnutar->linkname_length; + size_t length = gnutar->linkname_length + 1; struct archive_entry *temp = archive_entry_new2(&a->archive); /* Uname/gname here don't really matter since no one reads them; @@ -476,7 +476,7 @@ archive_write_gnutar_header(struct archi archive_entry_set_gname(temp, "wheel"); archive_entry_set_pathname(temp, "././@LongLink"); - archive_entry_set_size(temp, gnutar->linkname_length + 1); + archive_entry_set_size(temp, length); ret = archive_format_gnutar_header(a, buff, temp, 'K'); if (ret < ARCHIVE_WARN) goto exit_write_header; @@ -484,11 +484,12 @@ archive_write_gnutar_header(struct archi if(ret < ARCHIVE_WARN) goto exit_write_header; archive_entry_free(temp); - /* Write as many 512 bytes blocks as needed to write full name. */ - ret = __archive_write_output(a, gnutar->linkname, todo); + /* Write name and trailing null byte. */ + ret = __archive_write_output(a, gnutar->linkname, length); if(ret < ARCHIVE_WARN) goto exit_write_header; - ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)todo)); + /* Pad to 512 bytes */ + ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)length)); if (ret < ARCHIVE_WARN) goto exit_write_header; } @@ -496,7 +497,7 @@ archive_write_gnutar_header(struct archi /* If pathname is longer than 100 chars we need to add an 'L' header. */ if (gnutar->pathname_length > GNUTAR_name_size) { const char *pathname = gnutar->pathname; - size_t todo = gnutar->pathname_length; + size_t length = gnutar->pathname_length + 1; struct archive_entry *temp = archive_entry_new2(&a->archive); /* Uname/gname here don't really matter since no one reads them; @@ -505,7 +506,7 @@ archive_write_gnutar_header(struct archi archive_entry_set_gname(temp, "wheel"); archive_entry_set_pathname(temp, "././@LongLink"); - archive_entry_set_size(temp, gnutar->pathname_length + 1); + archive_entry_set_size(temp, length); ret = archive_format_gnutar_header(a, buff, temp, 'L'); if (ret < ARCHIVE_WARN) goto exit_write_header; @@ -513,11 +514,12 @@ archive_write_gnutar_header(struct archi if(ret < ARCHIVE_WARN) goto exit_write_header; archive_entry_free(temp); - /* Write as many 512 bytes blocks as needed to write full name. */ - ret = __archive_write_output(a, pathname, todo); + /* Write pathname + trailing null byte. */ + ret = __archive_write_output(a, pathname, length); if(ret < ARCHIVE_WARN) goto exit_write_header; - ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)todo)); + /* Pad to multiple of 512 bytes. */ + ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)length)); if (ret < ARCHIVE_WARN) goto exit_write_header; } Modified: projects/vnet/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Wed Jun 22 12:12:13 2016 (r302085) @@ -6225,7 +6225,7 @@ isoent_gen_joliet_identifier(struct arch unsigned char *p; size_t l; int r; - int ffmax, parent_len; + size_t ffmax, parent_len; static const struct archive_rb_tree_ops rb_ops = { isoent_cmp_node_joliet, isoent_cmp_key_joliet }; @@ -6239,7 +6239,7 @@ isoent_gen_joliet_identifier(struct arch else ffmax = 128; - r = idr_start(a, idr, isoent->children.cnt, ffmax, 6, 2, &rb_ops); + r = idr_start(a, idr, isoent->children.cnt, (int)ffmax, 6, 2, &rb_ops); if (r < 0) return (r); @@ -6252,7 +6252,7 @@ isoent_gen_joliet_identifier(struct arch int ext_off, noff, weight; size_t lt; - if ((int)(l = np->file->basename_utf16.length) > ffmax) + if ((l = np->file->basename_utf16.length) > ffmax) l = ffmax; p = malloc((l+1)*2); @@ -6285,7 +6285,7 @@ isoent_gen_joliet_identifier(struct arch /* * Get a length of MBS of a full-pathname. */ - if ((int)np->file->basename_utf16.length > ffmax) { + if (np->file->basename_utf16.length > ffmax) { if (archive_strncpy_l(&iso9660->mbs, (const char *)np->identifier, l, iso9660->sconv_from_utf16be) != 0 && @@ -6302,7 +6302,9 @@ isoent_gen_joliet_identifier(struct arch /* If a length of full-pathname is longer than 240 bytes, * it violates Joliet extensions regulation. */ - if (parent_len + np->mb_len > 240) { + if (parent_len > 240 + || np->mb_len > 240 + || parent_len + np->mb_len > 240) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "The regulation of Joliet extensions;" " A length of a full-pathname of `%s' is " @@ -6314,11 +6316,11 @@ isoent_gen_joliet_identifier(struct arch /* Make an offset of the number which is used to be set * hexadecimal number to avoid duplicate identifier. */ - if ((int)l == ffmax) + if (l == ffmax) noff = ext_off - 6; - else if ((int)l == ffmax-2) + else if (l == ffmax-2) noff = ext_off - 4; - else if ((int)l == ffmax-4) + else if (l == ffmax-4) noff = ext_off - 2; else noff = ext_off; Modified: projects/vnet/contrib/libarchive/libarchive/archive_write_set_options.3 ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/archive_write_set_options.3 Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/archive_write_set_options.3 Wed Jun 22 12:12:13 2016 (r302085) @@ -32,7 +32,7 @@ .Nm archive_write_set_format_option , .Nm archive_write_set_option , .Nm archive_write_set_options -.Nd functions controlling options for reading archives +.Nd functions controlling options for writing archives .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) .Sh SYNOPSIS Modified: projects/vnet/contrib/libarchive/libarchive/libarchive-formats.5 ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/libarchive-formats.5 Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/libarchive-formats.5 Wed Jun 22 12:12:13 2016 (r302085) @@ -65,7 +65,6 @@ Later variants have extended this by eit areas of the header record, extending the header to multiple records, or by storing special entries that modify the interpretation of subsequent entries. -.Pp .Bl -tag -width indent .It Cm gnutar The Modified: projects/vnet/contrib/libarchive/libarchive/libarchive_changes.3 ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/libarchive_changes.3 Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/libarchive_changes.3 Wed Jun 22 12:12:13 2016 (r302085) @@ -28,7 +28,7 @@ .Dt LIBARCHIVE_CHANGES 3 .Os .Sh NAME -.Nm changes in libarchive interface +.Nd changes in libarchive interface .\" .Sh CHANGES IN LIBARCHIVE 3 This page describes user-visible changes in libarchive3, and lists Modified: projects/vnet/contrib/libarchive/libarchive/test/main.c ============================================================================== --- projects/vnet/contrib/libarchive/libarchive/test/main.c Wed Jun 22 12:05:08 2016 (r302084) +++ projects/vnet/contrib/libarchive/libarchive/test/main.c Wed Jun 22 12:12:13 2016 (r302085) @@ -2533,18 +2533,36 @@ usage(const char *program) static char * get_refdir(const char *d) { - char tried[512] = { '\0' }; - char buff[128]; - char *pwd, *p; + size_t tried_size, buff_size; + char *buff, *tried, *pwd = NULL, *p = NULL; + +#ifdef PATH_MAX + buff_size = PATH_MAX; +#else + buff_size = 8192; +#endif + buff = calloc(buff_size, 1); + if (buff == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } + + /* Allocate a buffer to hold the various directories we checked. */ + tried_size = buff_size * 2; + tried = calloc(tried_size, 1); + if (tried == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } /* If a dir was specified, try that */ if (d != NULL) { pwd = NULL; - snprintf(buff, sizeof(buff), "%s", d); + snprintf(buff, buff_size, "%s", d); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); goto failure; } @@ -2558,48 +2576,48 @@ get_refdir(const char *d) pwd[strlen(pwd) - 1] = '\0'; /* Look for a known file. */ - snprintf(buff, sizeof(buff), "%s", pwd); + snprintf(buff, buff_size, "%s", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd); + snprintf(buff, buff_size, "%s/test", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(LIBRARY) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, LIBRARY); + snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY); #else - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM); #endif p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(PROGRAM_ALIAS) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM_ALIAS); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #endif if (memcmp(pwd, "/usr/obj", 8) == 0) { - snprintf(buff, sizeof(buff), "%s", pwd + 8); + snprintf(buff, buff_size, "%s", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd + 8); + snprintf(buff, buff_size, "%s/test", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); } failure: @@ -2614,7 +2632,12 @@ failure: success: free(p); free(pwd); - return strdup(buff); + free(tried); + + /* Copy result into a fresh buffer to reduce memory usage. */ + p = strdup(buff); + free(buff); + return p; } int Copied: projects/vnet/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.c (from r302083, head/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/vnet/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.c Wed Jun 22 12:12:13 2016 (r302085, copy of r302083, head/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.c) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2003-2016 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_read_format_rar_invalid1) +{ + const char *refname = "test_read_format_rar_invalid1.rar"; + struct archive *a; + struct archive_entry *ae; + char *buff[100]; + + extract_reference_file(refname); + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 10240)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_FATAL, archive_read_data(a, buff, 99)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} Copied: projects/vnet/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.rar.uu (from r302083, head/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.rar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/vnet/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.rar.uu Wed Jun 22 12:12:13 2016 (r302085, copy of r302083, head/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.rar.uu) @@ -0,0 +1,5 @@ +begin 644 test_read_format_rar_invalid1.rar +M4F%R(1H'`,^0B$4= +2,P0`I($``'1E Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5AE5B736EF for ; Thu, 23 Jun 2016 06:22:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B96413CD; Thu, 23 Jun 2016 06:22:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N6MqCs001690; Thu, 23 Jun 2016 06:22:52 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N6Mnr1001655; Thu, 23 Jun 2016 06:22:49 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606230622.u5N6Mnr1001655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 06:22:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302121 - in projects/vnet: . lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/mips/sys lib/libc/powerpc/sys lib/libc/powerpc64/sys lib/libc/riscv/sys... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 06:22:53 -0000 Author: bz Date: Thu Jun 23 06:22:48 2016 New Revision: 302121 URL: https://svnweb.freebsd.org/changeset/base/302121 Log: MfH @r302119 Includes the pf CVE fix. Sponsored by: The FreeBSD Foundation Added: projects/vnet/lib/libc/sys/pipe.c - copied unchanged from r302119, head/lib/libc/sys/pipe.c Deleted: projects/vnet/lib/libc/aarch64/sys/pipe.S projects/vnet/lib/libc/amd64/sys/pipe.S projects/vnet/lib/libc/arm/sys/pipe.S projects/vnet/lib/libc/i386/sys/pipe.S projects/vnet/lib/libc/mips/sys/pipe.S projects/vnet/lib/libc/powerpc/sys/pipe.S projects/vnet/lib/libc/powerpc64/sys/pipe.S projects/vnet/lib/libc/riscv/sys/pipe.S projects/vnet/lib/libc/sparc64/sys/pipe.S Modified: projects/vnet/Makefile projects/vnet/lib/libc/aarch64/sys/Makefile.inc projects/vnet/lib/libc/amd64/sys/Makefile.inc projects/vnet/lib/libc/arm/sys/Makefile.inc projects/vnet/lib/libc/i386/sys/Makefile.inc projects/vnet/lib/libc/mips/sys/Makefile.inc projects/vnet/lib/libc/powerpc/sys/Makefile.inc projects/vnet/lib/libc/powerpc64/sys/Makefile.inc projects/vnet/lib/libc/riscv/sys/Makefile.inc projects/vnet/lib/libc/sparc64/sys/Makefile.inc projects/vnet/lib/libc/sys/Makefile.inc projects/vnet/lib/libc/sys/pipe.2 projects/vnet/share/mk/bsd.README projects/vnet/share/mk/bsd.sys.mk projects/vnet/sys/compat/freebsd32/freebsd32_misc.c projects/vnet/sys/compat/freebsd32/freebsd32_proto.h projects/vnet/sys/compat/freebsd32/freebsd32_syscall.h projects/vnet/sys/compat/freebsd32/freebsd32_syscalls.c projects/vnet/sys/compat/freebsd32/freebsd32_sysent.c projects/vnet/sys/compat/freebsd32/freebsd32_systrace_args.c projects/vnet/sys/compat/freebsd32/syscalls.master projects/vnet/sys/compat/svr4/svr4_filio.c projects/vnet/sys/compat/svr4/svr4_proto.h projects/vnet/sys/compat/svr4/svr4_syscall.h projects/vnet/sys/compat/svr4/svr4_syscallnames.c projects/vnet/sys/compat/svr4/svr4_sysent.c projects/vnet/sys/compat/svr4/syscalls.master projects/vnet/sys/dev/ath/if_athvar.h projects/vnet/sys/dev/bhnd/bcma/bcma.c projects/vnet/sys/dev/bhnd/bhnd_core.h projects/vnet/sys/dev/bhnd/bhndb/bhndb.c projects/vnet/sys/dev/cxgbe/adapter.h projects/vnet/sys/dev/cxgbe/t4_main.c projects/vnet/sys/dev/cxgbe/t4_netmap.c projects/vnet/sys/dev/cxgbe/t4_sge.c projects/vnet/sys/dev/iwm/if_iwm.c projects/vnet/sys/dev/iwm/if_iwm_mac_ctxt.c projects/vnet/sys/dev/iwm/if_iwm_phy_db.c projects/vnet/sys/dev/iwm/if_iwm_phy_db.h projects/vnet/sys/dev/iwm/if_iwm_scan.c projects/vnet/sys/dev/iwm/if_iwm_util.c projects/vnet/sys/geom/geom_subr.c projects/vnet/sys/geom/mirror/g_mirror.c projects/vnet/sys/kern/init_sysent.c projects/vnet/sys/kern/makesyscalls.sh projects/vnet/sys/kern/sys_pipe.c projects/vnet/sys/kern/syscalls.c projects/vnet/sys/kern/syscalls.master projects/vnet/sys/kern/systrace_args.c projects/vnet/sys/netpfil/pf/pf_ioctl.c projects/vnet/sys/sys/proc.h projects/vnet/sys/sys/syscall.h projects/vnet/sys/sys/syscall.mk projects/vnet/sys/sys/sysproto.h projects/vnet/sys/vm/vm_glue.c projects/vnet/sys/vm/vm_pageout.c Directory Properties: projects/vnet/ (props changed) Modified: projects/vnet/Makefile ============================================================================== --- projects/vnet/Makefile Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/Makefile Thu Jun 23 06:22:48 2016 (r302121) @@ -150,9 +150,9 @@ TGTS+= ${BITGTS} # the ones that benefit from it. META_TGT_WHITELIST+= \ _* build32 buildfiles buildincludes buildkernel buildsoft \ - buildworld everything kernel-toolchains kernel kernels libraries \ - native-xtools showconfig tinderbox toolchain toolchains universe \ - world worlds xdev xdev-build + buildworld everything kernel-toolchain kernel-toolchains kernel \ + kernels libraries native-xtools showconfig tinderbox toolchain \ + toolchains universe world worlds xdev xdev-build .ORDER: buildworld installworld .ORDER: buildworld distributeworld Modified: projects/vnet/lib/libc/aarch64/sys/Makefile.inc ============================================================================== --- projects/vnet/lib/libc/aarch64/sys/Makefile.inc Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/lib/libc/aarch64/sys/Makefile.inc Thu Jun 23 06:22:48 2016 (r302121) @@ -6,7 +6,6 @@ SRCS+= __vdso_gettc.c #MDASM= ptrace.S MDASM= cerror.S \ - pipe.S \ shmat.S \ sigreturn.S \ syscall.S \ Modified: projects/vnet/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- projects/vnet/lib/libc/amd64/sys/Makefile.inc Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/lib/libc/amd64/sys/Makefile.inc Thu Jun 23 06:22:48 2016 (r302121) @@ -4,7 +4,7 @@ SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \ amd64_set_gsbase.c __vdso_gettc.c -MDASM= vfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \ +MDASM= vfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ sbrk.S setlogin.S sigreturn.S # Don't generate default code for these syscalls: Modified: projects/vnet/lib/libc/arm/sys/Makefile.inc ============================================================================== --- projects/vnet/lib/libc/arm/sys/Makefile.inc Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/lib/libc/arm/sys/Makefile.inc Thu Jun 23 06:22:48 2016 (r302121) @@ -2,7 +2,7 @@ SRCS+= __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S +MDASM= Ovfork.S brk.S cerror.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o Modified: projects/vnet/lib/libc/i386/sys/Makefile.inc ============================================================================== --- projects/vnet/lib/libc/i386/sys/Makefile.inc Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/lib/libc/i386/sys/Makefile.inc Thu Jun 23 06:22:48 2016 (r302121) @@ -8,7 +8,7 @@ SRCS+= i386_get_fsbase.c i386_get_gsbase i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c \ __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \ +MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ sbrk.S setlogin.S sigreturn.S syscall.S # Don't generate default code for these syscalls: Modified: projects/vnet/lib/libc/mips/sys/Makefile.inc ============================================================================== --- projects/vnet/lib/libc/mips/sys/Makefile.inc Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/lib/libc/mips/sys/Makefile.inc Thu Jun 23 06:22:48 2016 (r302121) @@ -3,7 +3,7 @@ SRCS+= trivial-vdso_tc.c MDASM= Ovfork.S brk.S cerror.S exect.S \ - pipe.S ptrace.S sbrk.S syscall.S + ptrace.S sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o Modified: projects/vnet/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- projects/vnet/lib/libc/powerpc/sys/Makefile.inc Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/lib/libc/powerpc/sys/Makefile.inc Thu Jun 23 06:22:48 2016 (r302121) @@ -1,6 +1,6 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o Modified: projects/vnet/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- projects/vnet/lib/libc/powerpc64/sys/Makefile.inc Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/lib/libc/powerpc64/sys/Makefile.inc Thu Jun 23 06:22:48 2016 (r302121) @@ -1,6 +1,6 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o Modified: projects/vnet/lib/libc/riscv/sys/Makefile.inc ============================================================================== --- projects/vnet/lib/libc/riscv/sys/Makefile.inc Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/lib/libc/riscv/sys/Makefile.inc Thu Jun 23 06:22:48 2016 (r302121) @@ -4,7 +4,6 @@ SRCS+= trivial-vdso_tc.c #MDASM= ptrace.S MDASM= cerror.S \ - pipe.S \ shmat.S \ sigreturn.S \ syscall.S \ Modified: projects/vnet/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- projects/vnet/lib/libc/sparc64/sys/Makefile.inc Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/lib/libc/sparc64/sys/Makefile.inc Thu Jun 23 06:22:48 2016 (r302121) @@ -12,7 +12,7 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction1.S +MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S sigaction1.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o Modified: projects/vnet/lib/libc/sys/Makefile.inc ============================================================================== --- projects/vnet/lib/libc/sys/Makefile.inc Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/lib/libc/sys/Makefile.inc Thu Jun 23 06:22:48 2016 (r302121) @@ -28,6 +28,8 @@ SRCS+= futimens.c utimensat.c NOASM+= futimens.o utimensat.o PSEUDO+= _futimens.o _utimensat.o +SRCS+= pipe.c + INTERPOSED = \ accept \ accept4 \ Modified: projects/vnet/lib/libc/sys/pipe.2 ============================================================================== --- projects/vnet/lib/libc/sys/pipe.2 Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/lib/libc/sys/pipe.2 Thu Jun 23 06:22:48 2016 (r302121) @@ -28,7 +28,7 @@ .\" @(#)pipe.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 1, 2013 +.Dd June 22, 2016 .Dt PIPE 2 .Os .Sh NAME @@ -118,6 +118,9 @@ and .Fn pipe2 system calls will fail if: .Bl -tag -width Er +.It Bq Er EFAULT +.Ar fildes +argument points to an invalid memory location. .It Bq Er EMFILE Too many descriptors are active. .It Bq Er ENFILE Copied: projects/vnet/lib/libc/sys/pipe.c (from r302119, head/lib/libc/sys/pipe.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/vnet/lib/libc/sys/pipe.c Thu Jun 23 06:22:48 2016 (r302121, copy of r302119, head/lib/libc/sys/pipe.c) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2016 SRI International + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include + +__weak_reference(__sys_pipe, pipe); +__weak_reference(__sys_pipe, _pipe); + +extern int __sys_pipe2(int fildes[2], int flags); + +int +__sys_pipe(int fildes[2]) +{ + + return (__sys_pipe2(fildes, 0)); +} Modified: projects/vnet/share/mk/bsd.README ============================================================================== --- projects/vnet/share/mk/bsd.README Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/share/mk/bsd.README Thu Jun 23 06:22:48 2016 (r302121) @@ -120,6 +120,8 @@ object. The following variables are common: +AFLAGS.${SRC} + Flags dependent on source file name. ACFLAGS.${SRC} Flags dependent on source file name. CFLAGS.${SRC} @@ -255,6 +257,11 @@ It has seven targets: It sets/uses the following variables: +AFLAGS Flags to the assembler when assembling .s files. + +ACFLAGS Flags to the compiler when preprocessing and + assembling .S files. + BINGRP Binary group. BINOWN Binary owner. Modified: projects/vnet/share/mk/bsd.sys.mk ============================================================================== --- projects/vnet/share/mk/bsd.sys.mk Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/share/mk/bsd.sys.mk Thu Jun 23 06:22:48 2016 (r302121) @@ -174,6 +174,7 @@ CFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} +AFLAGS+= ${AFLAGS.${.IMPSRC:T}} ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} CFLAGS+= ${CFLAGS.${.IMPSRC:T}} CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} Modified: projects/vnet/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- projects/vnet/sys/compat/freebsd32/freebsd32_misc.c Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/freebsd32/freebsd32_misc.c Thu Jun 23 06:22:48 2016 (r302121) @@ -272,6 +272,15 @@ freebsd4_freebsd32_getfsstat(struct thre } #endif +#ifdef COMPAT_FREEBSD10 +int +freebsd10_freebsd32_pipe(struct thread *td, + struct freebsd10_freebsd32_pipe_args *uap) { + + return (freebsd10_pipe(td, (struct freebsd10_pipe_args*)uap)); +} +#endif + int freebsd32_sigaltstack(struct thread *td, struct freebsd32_sigaltstack_args *uap) Modified: projects/vnet/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- projects/vnet/sys/compat/freebsd32/freebsd32_proto.h Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/freebsd32/freebsd32_proto.h Thu Jun 23 06:22:48 2016 (r302121) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -61,6 +61,9 @@ struct freebsd32_recvfrom_args { char from_l_[PADL_(uint32_t)]; uint32_t from; char from_r_[PADR_(uint32_t)]; char fromlenaddr_l_[PADL_(uint32_t)]; uint32_t fromlenaddr; char fromlenaddr_r_[PADR_(uint32_t)]; }; +struct freebsd10_freebsd32_pipe_args { + register_t dummy; +}; struct ofreebsd32_sigpending_args { register_t dummy; }; @@ -1099,6 +1102,28 @@ int freebsd7_freebsd32_shmctl(struct thr #endif /* COMPAT_FREEBSD7 */ + +#ifdef COMPAT_FREEBSD10 + +#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#define PAD64_REQUIRED +#endif +#ifdef PAD64_REQUIRED +#else +#endif +#ifdef PAD64_REQUIRED +#else +#endif +#ifdef PAD64_REQUIRED +#else +#endif +#ifdef PAD64_REQUIRED +#else +#endif +int freebsd10_freebsd32_pipe(struct thread *, struct freebsd10_freebsd32_pipe_args *); + +#endif /* COMPAT_FREEBSD10 */ + #define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4 #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT #define FREEBSD32_SYS_AUE_ofreebsd32_lseek AUE_LSEEK @@ -1107,6 +1132,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_recvfrom AUE_RECVFROM #define FREEBSD32_SYS_AUE_ofreebsd32_stat AUE_STAT #define FREEBSD32_SYS_AUE_ofreebsd32_lstat AUE_LSTAT +#define FREEBSD32_SYS_AUE_freebsd10_freebsd32_pipe AUE_PIPE #define FREEBSD32_SYS_AUE_ofreebsd32_sigaction AUE_SIGACTION #define FREEBSD32_SYS_AUE_ofreebsd32_sigprocmask AUE_SIGPROCMASK #define FREEBSD32_SYS_AUE_ofreebsd32_sigpending AUE_SIGPENDING Modified: projects/vnet/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- projects/vnet/sys/compat/freebsd32/freebsd32_syscall.h Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/freebsd32/freebsd32_syscall.h Thu Jun 23 06:22:48 2016 (r302121) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks */ #define FREEBSD32_SYS_syscall 0 @@ -48,7 +48,7 @@ #define FREEBSD32_SYS_getppid 39 /* 40 is old freebsd32_lstat */ #define FREEBSD32_SYS_dup 41 -#define FREEBSD32_SYS_pipe 42 + /* 42 is freebsd10 freebsd32_pipe */ #define FREEBSD32_SYS_getegid 43 #define FREEBSD32_SYS_profil 44 #define FREEBSD32_SYS_ktrace 45 Modified: projects/vnet/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- projects/vnet/sys/compat/freebsd32/freebsd32_syscalls.c Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/freebsd32/freebsd32_syscalls.c Thu Jun 23 06:22:48 2016 (r302121) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks */ const char *freebsd32_syscallnames[] = { @@ -52,7 +52,7 @@ const char *freebsd32_syscallnames[] = { "getppid", /* 39 = getppid */ "compat.freebsd32_lstat", /* 40 = old freebsd32_lstat */ "dup", /* 41 = dup */ - "pipe", /* 42 = pipe */ + "compat10.freebsd32_pipe", /* 42 = freebsd10 freebsd32_pipe */ "getegid", /* 43 = getegid */ "profil", /* 44 = profil */ "ktrace", /* 45 = ktrace */ Modified: projects/vnet/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- projects/vnet/sys/compat/freebsd32/freebsd32_sysent.c Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/freebsd32/freebsd32_sysent.c Thu Jun 23 06:22:48 2016 (r302121) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks */ #include "opt_compat.h" @@ -42,6 +42,12 @@ #define compat7(n, name) 0, (sy_call_t *)nosys #endif +#ifdef COMPAT_FREEBSD10 +#define compat10(n, name) n, (sy_call_t *)__CONCAT(freebsd10_,name) +#else +#define compat10(n, name) 0, (sy_call_t *)nosys +#endif + /* The casts are bogus but will do for now. */ struct sysent freebsd32_sysent[] = { #if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) @@ -89,7 +95,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)sys_getppid, AUE_GETPPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 39 = getppid */ { compat(AS(ofreebsd32_lstat_args),freebsd32_lstat), AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 40 = old freebsd32_lstat */ { AS(dup_args), (sy_call_t *)sys_dup, AUE_DUP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 41 = dup */ - { 0, (sy_call_t *)sys_pipe, AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = pipe */ + { compat10(0,freebsd32_pipe), AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = freebsd10 freebsd32_pipe */ { 0, (sy_call_t *)sys_getegid, AUE_GETEGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 43 = getegid */ { AS(profil_args), (sy_call_t *)sys_profil, AUE_PROFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 44 = profil */ { AS(ktrace_args), (sy_call_t *)sys_ktrace, AUE_KTRACE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 45 = ktrace */ Modified: projects/vnet/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- projects/vnet/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Jun 23 06:22:48 2016 (r302121) @@ -293,11 +293,6 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } - /* pipe */ - case 42: { - *n_args = 0; - break; - } /* getegid */ case 43: { *n_args = 0; @@ -3768,9 +3763,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* pipe */ - case 42: - break; /* getegid */ case 43: break; @@ -9083,8 +9075,6 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* pipe */ - case 42: /* getegid */ case 43: /* profil */ Modified: projects/vnet/sys/compat/freebsd32/syscalls.master ============================================================================== --- projects/vnet/sys/compat/freebsd32/syscalls.master Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/freebsd32/syscalls.master Thu Jun 23 06:22:48 2016 (r302121) @@ -29,6 +29,7 @@ ; COMPAT4 included on COMPAT4 #ifdef (FreeBSD 4 compat) ; COMPAT6 included on COMPAT6 #ifdef (FreeBSD 6 compat) ; COMPAT7 included on COMPAT7 #ifdef (FreeBSD 7 compat) +; COMPAT10 included on COMPAT10 #ifdef (FreeBSD 10 compat) ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically @@ -124,7 +125,7 @@ 40 AUE_LSTAT COMPAT { int freebsd32_lstat(char *path, \ struct ostat *ub); } 41 AUE_DUP NOPROTO { int dup(u_int fd); } -42 AUE_PIPE NOPROTO { int pipe(void); } +42 AUE_PIPE COMPAT10 { int freebsd32_pipe(void); } 43 AUE_GETEGID NOPROTO { gid_t getegid(void); } 44 AUE_PROFILE NOPROTO { int profil(caddr_t samples, size_t size, \ size_t offset, u_int scale); } Modified: projects/vnet/sys/compat/svr4/svr4_filio.c ============================================================================== --- projects/vnet/sys/compat/svr4/svr4_filio.c Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/svr4/svr4_filio.c Thu Jun 23 06:22:48 2016 (r302121) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -250,3 +251,19 @@ svr4_fil_ioctl(fp, td, retval, fd, cmd, return 0; /* ENOSYS really */ } } + +int +svr4_pipe(struct thread *td, struct svr4_pipe_args *uap) { + int error; + int fildes[2]; + + error = kern_pipe(td, fildes, 0, NULL, NULL); + if (error) + return (error); + + td->td_retval[0] = fildes[0]; + td->td_retval[1] = fildes[1]; + + return (0); +} + Modified: projects/vnet/sys/compat/svr4/svr4_proto.h ============================================================================== --- projects/vnet/sys/compat/svr4/svr4_proto.h Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/svr4/svr4_proto.h Thu Jun 23 06:22:48 2016 (r302121) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/compat/svr4/syscalls.master 302096 2016-06-23 00:29:03Z brooks */ #ifndef _SVR4_SYSPROTO_H_ @@ -12,8 +12,10 @@ #include #include #include +#include #include #include +#include #include @@ -93,6 +95,9 @@ struct svr4_sys_pgrpsys_args { char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; char pgid_l_[PADL_(int)]; int pgid; char pgid_r_[PADR_(int)]; }; +struct svr4_pipe_args { + register_t dummy; +}; struct svr4_sys_times_args { char tp_l_[PADL_(struct tms *)]; struct tms * tp; char tp_r_[PADR_(struct tms *)]; }; @@ -422,6 +427,7 @@ int svr4_sys_access(struct thread *, str int svr4_sys_nice(struct thread *, struct svr4_sys_nice_args *); int svr4_sys_kill(struct thread *, struct svr4_sys_kill_args *); int svr4_sys_pgrpsys(struct thread *, struct svr4_sys_pgrpsys_args *); +int svr4_pipe(struct thread *, struct svr4_pipe_args *); int svr4_sys_times(struct thread *, struct svr4_sys_times_args *); int svr4_sys_signal(struct thread *, struct svr4_sys_signal_args *); int svr4_sys_msgsys(struct thread *, struct svr4_sys_msgsys_args *); @@ -509,6 +515,12 @@ int svr4_sys_sendto(struct thread *, str #endif /* COMPAT_FREEBSD7 */ + +#ifdef COMPAT_FREEBSD10 + + +#endif /* COMPAT_FREEBSD10 */ + #define SVR4_SYS_AUE_svr4_sys_open AUE_NULL #define SVR4_SYS_AUE_svr4_sys_wait AUE_NULL #define SVR4_SYS_AUE_svr4_sys_creat AUE_NULL @@ -525,6 +537,7 @@ int svr4_sys_sendto(struct thread *, str #define SVR4_SYS_AUE_svr4_sys_nice AUE_NULL #define SVR4_SYS_AUE_svr4_sys_kill AUE_NULL #define SVR4_SYS_AUE_svr4_sys_pgrpsys AUE_NULL +#define SVR4_SYS_AUE_svr4_pipe AUE_NULL #define SVR4_SYS_AUE_svr4_sys_times AUE_NULL #define SVR4_SYS_AUE_svr4_sys_signal AUE_NULL #define SVR4_SYS_AUE_svr4_sys_msgsys AUE_NULL Modified: projects/vnet/sys/compat/svr4/svr4_syscall.h ============================================================================== --- projects/vnet/sys/compat/svr4/svr4_syscall.h Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/svr4/svr4_syscall.h Thu Jun 23 06:22:48 2016 (r302121) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/compat/svr4/syscalls.master 302096 2016-06-23 00:29:03Z brooks */ #define SVR4_SYS_exit 1 @@ -38,7 +38,7 @@ #define SVR4_SYS_svr4_sys_kill 37 #define SVR4_SYS_svr4_sys_pgrpsys 39 #define SVR4_SYS_dup 41 -#define SVR4_SYS_pipe 42 +#define SVR4_SYS_svr4_pipe 42 #define SVR4_SYS_svr4_sys_times 43 #define SVR4_SYS_setgid 46 #define SVR4_SYS_getgid 47 Modified: projects/vnet/sys/compat/svr4/svr4_syscallnames.c ============================================================================== --- projects/vnet/sys/compat/svr4/svr4_syscallnames.c Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/svr4/svr4_syscallnames.c Thu Jun 23 06:22:48 2016 (r302121) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/compat/svr4/syscalls.master 302096 2016-06-23 00:29:03Z brooks */ const char *svr4_syscallnames[] = { @@ -49,7 +49,7 @@ const char *svr4_syscallnames[] = { "svr4_sys_pgrpsys", /* 39 = svr4_sys_pgrpsys */ "#40", /* 40 = xenix */ "dup", /* 41 = dup */ - "pipe", /* 42 = pipe */ + "svr4_pipe", /* 42 = svr4_pipe */ "svr4_sys_times", /* 43 = svr4_sys_times */ "#44", /* 44 = profil */ "#45", /* 45 = plock */ Modified: projects/vnet/sys/compat/svr4/svr4_sysent.c ============================================================================== --- projects/vnet/sys/compat/svr4/svr4_sysent.c Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/svr4/svr4_sysent.c Thu Jun 23 06:22:48 2016 (r302121) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/compat/svr4/syscalls.master 302096 2016-06-23 00:29:03Z brooks */ #include @@ -61,7 +61,7 @@ struct sysent svr4_sysent[] = { { AS(svr4_sys_pgrpsys_args), (sy_call_t *)svr4_sys_pgrpsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 39 = svr4_sys_pgrpsys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 40 = xenix */ { AS(dup_args), (sy_call_t *)sys_dup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 41 = dup */ - { 0, (sy_call_t *)sys_pipe, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = pipe */ + { 0, (sy_call_t *)svr4_pipe, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = svr4_pipe */ { AS(svr4_sys_times_args), (sy_call_t *)svr4_sys_times, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 43 = svr4_sys_times */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 44 = profil */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 45 = plock */ Modified: projects/vnet/sys/compat/svr4/syscalls.master ============================================================================== --- projects/vnet/sys/compat/svr4/syscalls.master Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/compat/svr4/syscalls.master Thu Jun 23 06:22:48 2016 (r302121) @@ -87,7 +87,7 @@ int pgid); } 40 AUE_NULL UNIMPL xenix 41 AUE_NULL NOPROTO { int dup(u_int fd); } -42 AUE_NULL NOPROTO { int pipe(void); } +42 AUE_NULL STD { int svr4_pipe(void); } 43 AUE_NULL STD { int svr4_sys_times(struct tms *tp); } 44 AUE_NULL UNIMPL profil 45 AUE_NULL UNIMPL plock Modified: projects/vnet/sys/dev/ath/if_athvar.h ============================================================================== --- projects/vnet/sys/dev/ath/if_athvar.h Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/dev/ath/if_athvar.h Thu Jun 23 06:22:48 2016 (r302121) @@ -370,9 +370,9 @@ struct ath_txq { */ struct { TAILQ_HEAD(axq_q_f_s, ath_buf) axq_q; - u_int axq_depth; + u_int axq_depth; /* how many frames (1 per legacy, 1 per A-MPDU list) are in the FIFO queue */ } fifo; - u_int axq_fifo_depth; /* depth of FIFO frames */ + u_int axq_fifo_depth; /* how many FIFO slots are active */ /* * XXX the holdingbf field is protected by the TXBUF lock Modified: projects/vnet/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- projects/vnet/sys/dev/bhnd/bcma/bcma.c Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/dev/bhnd/bcma/bcma.c Thu Jun 23 06:22:48 2016 (r302121) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "bcma_eromreg.h" #include "bcma_eromvar.h" +#include int bcma_probe(device_t dev) @@ -218,9 +219,33 @@ bcma_reset_core(device_t dev, device_t c if (dinfo->res_agent == NULL) return (ENODEV); - // TODO - perform reset + /* Start reset */ + bhnd_bus_write_4(dinfo->res_agent, BHND_RESET_CF, BHND_RESET_CF_ENABLE); + bhnd_bus_read_4(dinfo->res_agent, BHND_RESET_CF); + DELAY(10); + + /* Disable clock */ + bhnd_bus_write_4(dinfo->res_agent, BHND_CF, flags); + bhnd_bus_read_4(dinfo->res_agent, BHND_CF); + DELAY(10); + + /* Enable clocks & force clock gating */ + bhnd_bus_write_4(dinfo->res_agent, BHND_CF, BHND_CF_CLOCK_EN | + BHND_CF_FGC | flags); + bhnd_bus_read_4(dinfo->res_agent, BHND_CF); + DELAY(10); + + /* Complete reset */ + bhnd_bus_write_4(dinfo->res_agent, BHND_RESET_CF, 0); + bhnd_bus_read_4(dinfo->res_agent, BHND_RESET_CF); + DELAY(10); + + /* Release force clock gating */ + bhnd_bus_write_4(dinfo->res_agent, BHND_CF, BHND_CF_CLOCK_EN | flags); + bhnd_bus_read_4(dinfo->res_agent, BHND_CF); + DELAY(10); - return (ENXIO); + return (0); } static int Modified: projects/vnet/sys/dev/bhnd/bhnd_core.h ============================================================================== --- projects/vnet/sys/dev/bhnd/bhnd_core.h Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/dev/bhnd/bhnd_core.h Thu Jun 23 06:22:48 2016 (r302121) @@ -25,19 +25,27 @@ #define _BHND_BHND_CORE_H_ /* Common core control flags */ -#define BHND_CF_BIST_EN 0x8000 /**< ??? */ +#define BHND_CF 0x0408 +#define BHND_CF_BIST_EN 0x8000 /**< built-in self test */ #define BHND_CF_PME_EN 0x4000 /**< ??? */ #define BHND_CF_CORE_BITS 0x3ffc /**< core specific flag mask */ #define BHND_CF_FGC 0x0002 /**< force clock gating */ #define BHND_CF_CLOCK_EN 0x0001 /**< enable clock */ /* Common core status flags */ +#define BHND_SF 0x0500 #define BHND_SF_BIST_DONE 0x8000 /**< ??? */ #define BHND_SF_BIST_ERROR 0x4000 /**< ??? */ #define BHND_SF_GATED_CLK 0x2000 /**< clock gated */ #define BHND_SF_DMA64 0x1000 /**< supports 64-bit DMA */ #define BHND_SF_CORE_BITS 0x0fff /**< core-specific status mask */ +/*Reset core control flags */ +#define BHND_RESET_CF 0x0800 +#define BHND_RESET_CF_ENABLE 0x0001 + +#define BHND_RESET_SF 0x0804 + /* * A register that is common to all cores to * communicate w/PMU regarding clock control. Modified: projects/vnet/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- projects/vnet/sys/dev/bhnd/bhndb/bhndb.c Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/dev/bhnd/bhndb/bhndb.c Thu Jun 23 06:22:48 2016 (r302121) @@ -596,8 +596,10 @@ bhndb_generic_init_full_config(device_t hostb = NULL; /* Fetch the full set of bhnd-attached cores */ - if ((error = device_get_children(sc->bus_dev, &devs, &ndevs))) + if ((error = device_get_children(sc->bus_dev, &devs, &ndevs))) { + device_printf(sc->dev, "unable to get children\n"); return (error); + } /* Find our host bridge device */ hostb = BHNDB_FIND_HOSTB_DEVICE(dev, child); Modified: projects/vnet/sys/dev/cxgbe/adapter.h ============================================================================== --- projects/vnet/sys/dev/cxgbe/adapter.h Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/dev/cxgbe/adapter.h Thu Jun 23 06:22:48 2016 (r302121) @@ -208,7 +208,6 @@ enum { INTR_RXQ = (1 << 4), /* All NIC rxq's take interrupts */ INTR_OFLD_RXQ = (1 << 5), /* All TOE rxq's take interrupts */ INTR_ALL = (INTR_RXQ | INTR_OFLD_RXQ), - VI_NETMAP = (1 << 6), /* adapter debug_flags */ DF_DUMP_MBOX = (1 << 0), @@ -230,7 +229,7 @@ struct vi_info { unsigned long flags; int if_flags; - uint16_t *rss; + uint16_t *rss, *nm_rss; uint16_t viid; int16_t xact_addr_filt;/* index of exact MAC address filter */ uint16_t rss_size; /* size of VI's RSS table slice */ @@ -251,6 +250,10 @@ struct vi_info { int first_ofld_txq; /* index of first offload tx queue */ int nofldrxq; /* # of offload rx queues */ int first_ofld_rxq; /* index of first offload rx queue */ + int nnmtxq; + int first_nm_txq; + int nnmrxq; + int first_nm_rxq; int tmr_idx; int pktc_idx; int qsize_rxq; @@ -362,6 +365,11 @@ enum { IQS_DISABLED = 0, IQS_BUSY = 1, IQS_IDLE = 2, + + /* netmap related flags */ + NM_OFF = 0, + NM_ON = 1, + NM_BUSY = 2, }; /* @@ -765,8 +773,11 @@ struct adapter { struct irq { struct resource *res; int rid; + volatile int nm_state; /* NM_OFF, NM_ON, or NM_BUSY */ void *tag; - } *irq; + struct sge_rxq *rxq; + struct sge_nm_rxq *nm_rxq; + } __aligned(CACHE_LINE_SIZE) *irq; bus_dma_tag_t dmat; /* Parent DMA tag */ @@ -911,11 +922,11 @@ struct adapter { for (q = &vi->pi->adapter->sge.ofld_rxq[vi->first_ofld_rxq], iter = 0; \ iter < vi->nofldrxq; ++iter, ++q) #define for_each_nm_txq(vi, iter, q) \ - for (q = &vi->pi->adapter->sge.nm_txq[vi->first_txq], iter = 0; \ - iter < vi->ntxq; ++iter, ++q) + for (q = &vi->pi->adapter->sge.nm_txq[vi->first_nm_txq], iter = 0; \ + iter < vi->nnmtxq; ++iter, ++q) #define for_each_nm_rxq(vi, iter, q) \ - for (q = &vi->pi->adapter->sge.nm_rxq[vi->first_rxq], iter = 0; \ - iter < vi->nrxq; ++iter, ++q) + for (q = &vi->pi->adapter->sge.nm_rxq[vi->first_nm_rxq], iter = 0; \ + iter < vi->nnmrxq; ++iter, ++q) #define for_each_vi(_pi, _iter, _vi) \ for ((_vi) = (_pi)->vi, (_iter) = 0; (_iter) < (_pi)->nvi; \ ++(_iter), ++(_vi)) @@ -1087,8 +1098,8 @@ void vi_tick(void *); #ifdef DEV_NETMAP /* t4_netmap.c */ -int create_netmap_ifnet(struct port_info *); -int destroy_netmap_ifnet(struct port_info *); +void cxgbe_nm_attach(struct vi_info *); +void cxgbe_nm_detach(struct vi_info *); void t4_nm_intr(void *); #endif @@ -1109,6 +1120,7 @@ int t4_setup_vi_queues(struct vi_info *) int t4_teardown_vi_queues(struct vi_info *); void t4_intr_all(void *); void t4_intr(void *); +void t4_vi_intr(void *); void t4_intr_err(void *); void t4_intr_evt(void *); void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *); Modified: projects/vnet/sys/dev/cxgbe/t4_main.c ============================================================================== --- projects/vnet/sys/dev/cxgbe/t4_main.c Thu Jun 23 06:18:32 2016 (r302120) +++ projects/vnet/sys/dev/cxgbe/t4_main.c Thu Jun 23 06:22:48 2016 (r302121) @@ -230,6 +230,14 @@ TUNABLE_INT("hw.cxgbe.ntxq1g", &t4_ntxq1 static int t4_nrxq1g = -1; TUNABLE_INT("hw.cxgbe.nrxq1g", &t4_nrxq1g); +#define NTXQ_VI 1 +static int t4_ntxq_vi = -1; +TUNABLE_INT("hw.cxgbe.ntxq_vi", &t4_ntxq_vi); + +#define NRXQ_VI 1 +static int t4_nrxq_vi = -1; +TUNABLE_INT("hw.cxgbe.nrxq_vi", &t4_nrxq_vi); + static int t4_rsrv_noflowq = 0; TUNABLE_INT("hw.cxgbe.rsrv_noflowq", &t4_rsrv_noflowq); @@ -249,24 +257,24 @@ TUNABLE_INT("hw.cxgbe.nofldtxq1g", &t4_n #define NOFLDRXQ_1G 1 static int t4_nofldrxq1g = -1; TUNABLE_INT("hw.cxgbe.nofldrxq1g", &t4_nofldrxq1g); + +#define NOFLDTXQ_VI 1 +static int t4_nofldtxq_vi = -1; +TUNABLE_INT("hw.cxgbe.nofldtxq_vi", &t4_nofldtxq_vi); + +#define NOFLDRXQ_VI 1 +static int t4_nofldrxq_vi = -1; +TUNABLE_INT("hw.cxgbe.nofldrxq_vi", &t4_nofldrxq_vi); #endif #ifdef DEV_NETMAP -#define NNMTXQ_10G 2 -static int t4_nnmtxq10g = -1; -TUNABLE_INT("hw.cxgbe.nnmtxq10g", &t4_nnmtxq10g); - -#define NNMRXQ_10G 2 -static int t4_nnmrxq10g = -1; -TUNABLE_INT("hw.cxgbe.nnmrxq10g", &t4_nnmrxq10g); - -#define NNMTXQ_1G 1 -static int t4_nnmtxq1g = -1; -TUNABLE_INT("hw.cxgbe.nnmtxq1g", &t4_nnmtxq1g); - -#define NNMRXQ_1G 1 -static int t4_nnmrxq1g = -1; -TUNABLE_INT("hw.cxgbe.nnmrxq1g", &t4_nnmrxq1g); +#define NNMTXQ_VI 2 +static int t4_nnmtxq_vi = -1; +TUNABLE_INT("hw.cxgbe.nnmtxq_vi", &t4_nnmtxq_vi); + +#define NNMRXQ_VI 2 +static int t4_nnmrxq_vi = -1; +TUNABLE_INT("hw.cxgbe.nnmrxq_vi", &t4_nnmrxq_vi); #endif /* @@ -387,18 +395,18 @@ struct intrs_and_queues { uint16_t ntxq1g; /* # of NIC txq's for each 1G port */ uint16_t nrxq1g; /* # of NIC rxq's for each 1G port */ uint16_t rsrv_noflowq; /* Flag whether to reserve queue 0 */ -#ifdef TCP_OFFLOAD uint16_t nofldtxq10g; /* # of TOE txq's for each 10G port */ uint16_t nofldrxq10g; /* # of TOE rxq's for each 10G port */ uint16_t nofldtxq1g; /* # of TOE txq's for each 1G port */ uint16_t nofldrxq1g; /* # of TOE rxq's for each 1G port */ -#endif -#ifdef DEV_NETMAP - uint16_t nnmtxq10g; /* # of netmap txq's for each 10G port */ - uint16_t nnmrxq10g; /* # of netmap rxq's for each 10G port */ - uint16_t nnmtxq1g; /* # of netmap txq's for each 1G port */ - uint16_t nnmrxq1g; /* # of netmap rxq's for each 1G port */ -#endif + + /* The vcxgbe/vcxl interfaces use these and not the ones above. */ + uint16_t ntxq_vi; /* # of NIC txq's */ + uint16_t nrxq_vi; /* # of NIC rxq's */ + uint16_t nofldtxq_vi; /* # of TOE txq's */ + uint16_t nofldrxq_vi; /* # of TOE rxq's */ + uint16_t nnmtxq_vi; /* # of netmap txq's */ + uint16_t nnmrxq_vi; /* # of netmap rxq's */ }; struct filter_entry { @@ -802,10 +810,10 @@ t4_attach(device_t dev) goto done; /* error message displayed already */ /* - * Number of VIs to create per-port. The first VI is the - * "main" regular VI for the port. The second VI is used for - * netmap if present, and any remaining VIs are used for - * additional virtual interfaces. + * Number of VIs to create per-port. The first VI is the "main" regular + * VI for the port. The rest are additional virtual interfaces on the + * same physical port. Note that the main VI does not have native + * netmap support but the extra VIs do. * * Limit the number of VIs per port to the number of available * MAC addresses per port. @@ -814,9 +822,6 @@ t4_attach(device_t dev) num_vis = t4_num_vis; else num_vis = 1; -#ifdef DEV_NETMAP - num_vis++; -#endif if (num_vis > nitems(vi_mac_funcs)) { num_vis = nitems(vi_mac_funcs); device_printf(dev, "Number of VIs limited to %d\n", num_vis); @@ -831,7 +836,6 @@ t4_attach(device_t dev) n10g = n1g = 0; for_each_port(sc, i) { struct port_info *pi; - struct vi_info *vi; pi = malloc(sizeof(*pi), M_CXGBE, M_ZERO | M_WAITOK); sc->port[i] = pi; @@ -839,7 +843,10 @@ t4_attach(device_t dev) /* These must be set before t4_port_init */ pi->adapter = sc; pi->port_id = i; - pi->nvi = num_vis; + /* + * XXX: vi[0] is special so we can't delay this allocation until + * pi->nvi's final value is known. + */ pi->vi = malloc(sizeof(struct vi_info) * num_vis, M_CXGBE, M_ZERO | M_WAITOK); @@ -881,26 +888,12 @@ t4_attach(device_t dev) if (is_10G_port(pi) || is_40G_port(pi)) { n10g++; - for_each_vi(pi, j, vi) { - vi->tmr_idx = t4_tmr_idx_10g; - vi->pktc_idx = t4_pktc_idx_10g; - } } else { n1g++; - for_each_vi(pi, j, vi) { - vi->tmr_idx = t4_tmr_idx_1g; - vi->pktc_idx = t4_pktc_idx_1g; - } } pi->linkdnrc = -1; - for_each_vi(pi, j, vi) { - vi->qsize_rxq = t4_qsize_rxq; - vi->qsize_txq = t4_qsize_txq; - vi->pi = pi; - } - pi->dev = device_add_child(dev, is_t4(sc) ? "cxgbe" : "cxl", -1); if (pi->dev == NULL) { device_printf(dev, @@ -915,12 +908,11 @@ t4_attach(device_t dev) /* * Interrupt type, # of interrupts, # of rx/tx queues, etc. */ -#ifdef DEV_NETMAP - num_vis--; -#endif rc = cfg_itype_and_nqueues(sc, n10g, n1g, num_vis, &iaq); if (rc != 0) goto done; /* error message displayed already */ + if (iaq.nrxq_vi + iaq.nofldrxq_vi + iaq.nnmrxq_vi == 0) + num_vis = 1; sc->intr_type = iaq.intr_type; sc->intr_count = iaq.nirq; @@ -929,8 +921,8 @@ t4_attach(device_t dev) s->nrxq = n10g * iaq.nrxq10g + n1g * iaq.nrxq1g; s->ntxq = n10g * iaq.ntxq10g + n1g * iaq.ntxq1g; if (num_vis > 1) { - s->nrxq += (n10g + n1g) * (num_vis - 1); - s->ntxq += (n10g + n1g) * (num_vis - 1); + s->nrxq += (n10g + n1g) * (num_vis - 1) * iaq.nrxq_vi; + s->ntxq += (n10g + n1g) * (num_vis - 1) * iaq.ntxq_vi; } s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */ s->neq += sc->params.nports + 1;/* ctrl queues: 1 per port + 1 mgmt */ @@ -940,8 +932,10 @@ t4_attach(device_t dev) s->nofldrxq = n10g * iaq.nofldrxq10g + n1g * iaq.nofldrxq1g; s->nofldtxq = n10g * iaq.nofldtxq10g + n1g * iaq.nofldtxq1g; if (num_vis > 1) { - s->nofldrxq += (n10g + n1g) * (num_vis - 1); - s->nofldtxq += (n10g + n1g) * (num_vis - 1); + s->nofldrxq += (n10g + n1g) * (num_vis - 1) * + iaq.nofldrxq_vi; + s->nofldtxq += (n10g + n1g) * (num_vis - 1) * + iaq.nofldtxq_vi; } s->neq += s->nofldtxq + s->nofldrxq; s->niq += s->nofldrxq; @@ -953,8 +947,10 @@ t4_attach(device_t dev) } #endif #ifdef DEV_NETMAP - s->nnmrxq = n10g * iaq.nnmrxq10g + n1g * iaq.nnmrxq1g; - s->nnmtxq = n10g * iaq.nnmtxq10g + n1g * iaq.nnmtxq1g; + if (num_vis > 1) { + s->nnmrxq = (n10g + n1g) * (num_vis - 1) * iaq.nnmrxq_vi; + s->nnmtxq = (n10g + n1g) * (num_vis - 1) * iaq.nnmtxq_vi; + } s->neq += s->nnmtxq + s->nnmrxq; s->niq += s->nnmrxq; @@ -998,62 +994,64 @@ t4_attach(device_t dev) if (pi == NULL) continue; + pi->nvi = num_vis; for_each_vi(pi, j, vi) { -#ifdef DEV_NETMAP - if (j == 1) { - vi->flags |= VI_NETMAP | INTR_RXQ; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Thu Jun 23 16:34:56 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46A74B73628 for ; Thu, 23 Jun 2016 16:34:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 184E32B87; Thu, 23 Jun 2016 16:34:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NGYtu7037610; Thu, 23 Jun 2016 16:34:55 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NGYtdh037609; Thu, 23 Jun 2016 16:34:55 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606231634.u5NGYtdh037609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 16:34:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302142 - projects/vnet/sys/netpfil/pf X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 16:34:56 -0000 Author: bz Date: Thu Jun 23 16:34:55 2016 New Revision: 302142 URL: https://svnweb.freebsd.org/changeset/base/302142 Log: DO not attach before pf is attached as we borrow locks from there; do not detach before pf is detached as otherwise we might still be called for VNETs and thus reference freed memory. Sponsored by: The FreeBSD Foundation Modified: projects/vnet/sys/netpfil/pf/if_pflog.c Modified: projects/vnet/sys/netpfil/pf/if_pflog.c ============================================================================== --- projects/vnet/sys/netpfil/pf/if_pflog.c Thu Jun 23 15:02:57 2016 (r302141) +++ projects/vnet/sys/netpfil/pf/if_pflog.c Thu Jun 23 16:34:55 2016 (r302142) @@ -268,7 +268,7 @@ vnet_pflog_init(const void *unused __unu pflogattach(1); } -VNET_SYSINIT(vnet_pflog_init, SI_SUB_PSEUDO, SI_ORDER_ANY, +VNET_SYSINIT(vnet_pflog_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY, vnet_pflog_init, NULL); static void @@ -277,6 +277,10 @@ vnet_pflog_uninit(const void *unused __u if_clone_detach(V_pflog_cloner); } +/* + * Detach after pf is gone; otherwise we might touch pflog memory + * from within pf after freeing pflog. + */ VNET_SYSUNINIT(vnet_pflog_uninit, SI_SUB_INIT_IF, SI_ORDER_SECOND, vnet_pflog_uninit, NULL); @@ -308,6 +312,7 @@ static moduledata_t pflog_mod = { pflogn #define PFLOG_MODVER 1 -DECLARE_MODULE(pflog, pflog_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +/* Do not run before pf is initialized as we depend on its locks. */ +DECLARE_MODULE(pflog, pflog_mod, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY); MODULE_VERSION(pflog, PFLOG_MODVER); MODULE_DEPEND(pflog, pf, PF_MODVER, PF_MODVER, PF_MODVER); From owner-svn-src-projects@freebsd.org Thu Jun 23 16:35:48 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B10C0B736AD for ; Thu, 23 Jun 2016 16:35:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ECCF2F64; Thu, 23 Jun 2016 16:35:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NGZlqZ037693; Thu, 23 Jun 2016 16:35:47 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NGZlEV037692; Thu, 23 Jun 2016 16:35:47 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606231635.u5NGZlEV037692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 16:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302143 - projects/vnet/sys/netpfil/pf X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 16:35:48 -0000 Author: bz Date: Thu Jun 23 16:35:47 2016 New Revision: 302143 URL: https://svnweb.freebsd.org/changeset/base/302143 Log: PFSTATE_NOSYNC goes onto state_flags, not sync_state; This prevents: panic: pfsync_delete_state: unexpected sync state 8 Sponsored by: The FreeBSD Foundation Differential Revision: D6942 Modified: projects/vnet/sys/netpfil/pf/pf_ioctl.c Modified: projects/vnet/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- projects/vnet/sys/netpfil/pf/pf_ioctl.c Thu Jun 23 16:34:55 2016 (r302142) +++ projects/vnet/sys/netpfil/pf/pf_ioctl.c Thu Jun 23 16:35:47 2016 (r302143) @@ -3362,7 +3362,7 @@ relock: LIST_FOREACH(s, &ih->states, entry) { s->timeout = PFTM_PURGE; /* Don't send out individual delete messages. */ - s->sync_state = PFSTATE_NOSYNC; + s->state_flags |= PFSTATE_NOSYNC; pf_unlink_state(s, PF_ENTER_LOCKED); goto relock; } From owner-svn-src-projects@freebsd.org Thu Jun 23 16:37:44 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8E35B7370F for ; Thu, 23 Jun 2016 16:37:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A51AA1773; Thu, 23 Jun 2016 16:37:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NGbhwG037808; Thu, 23 Jun 2016 16:37:43 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NGbhPA037807; Thu, 23 Jun 2016 16:37:43 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606231637.u5NGbhPA037807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 16:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302144 - projects/vnet/sys/netpfil/pf X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 16:37:44 -0000 Author: bz Date: Thu Jun 23 16:37:43 2016 New Revision: 302144 URL: https://svnweb.freebsd.org/changeset/base/302144 Log: Make pfsync initialization and teardown VNET ready. I am still seeing solid hangs when I compile this into the kernel or load the module; however that is more likely a general code problem than a specific VNET problem. Sponsored by: The FreeBSD Foundation Modified: projects/vnet/sys/netpfil/pf/if_pfsync.c Modified: projects/vnet/sys/netpfil/pf/if_pfsync.c ============================================================================== --- projects/vnet/sys/netpfil/pf/if_pfsync.c Thu Jun 23 16:35:47 2016 (r302143) +++ projects/vnet/sys/netpfil/pf/if_pfsync.c Thu Jun 23 16:37:43 2016 (r302144) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -2315,71 +2316,67 @@ pfsync_pointers_uninit() PF_RULES_WUNLOCK(); } -static int -pfsync_init() +static void +vnet_pfsync_init(const void *unused __unused) { - VNET_ITERATOR_DECL(vnet_iter); - int error = 0; + int error; - VNET_LIST_RLOCK(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - V_pfsync_cloner = if_clone_simple(pfsyncname, - pfsync_clone_create, pfsync_clone_destroy, 1); - error = swi_add(NULL, pfsyncname, pfsyncintr, V_pfsyncif, - SWI_NET, INTR_MPSAFE, &V_pfsync_swi_cookie); - CURVNET_RESTORE(); - if (error) - goto fail_locked; + V_pfsync_cloner = if_clone_simple(pfsyncname, + pfsync_clone_create, pfsync_clone_destroy, 1); + error = swi_add(NULL, pfsyncname, pfsyncintr, V_pfsyncif, + SWI_NET, INTR_MPSAFE, &V_pfsync_swi_cookie); + if (error) { + if_clone_detach(V_pfsync_cloner); + log(LOG_INFO, "swi_add() failed in %s\n", __func__); } - VNET_LIST_RUNLOCK(); +} +VNET_SYSINIT(vnet_pfsync_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY, + vnet_pfsync_init, NULL); + +static void +vnet_pfsync_uninit(const void *unused __unused) +{ + + if_clone_detach(V_pfsync_cloner); + swi_remove(V_pfsync_swi_cookie); +} +/* + * Detach after pf is gone; otherwise we might touch pfsync memory + * from within pf after freeing pfsync. + */ +VNET_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_INIT_IF, SI_ORDER_SECOND, + vnet_pfsync_uninit, NULL); + +static int +pfsync_init() +{ #ifdef INET + int error; + error = pf_proto_register(PF_INET, &in_pfsync_protosw); if (error) - goto fail; + return (error); error = ipproto_register(IPPROTO_PFSYNC); if (error) { pf_proto_unregister(PF_INET, IPPROTO_PFSYNC, SOCK_RAW); - goto fail; + return (error); } #endif pfsync_pointers_init(); return (0); - -fail: - VNET_LIST_RLOCK(); -fail_locked: - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - if (V_pfsync_swi_cookie) { - swi_remove(V_pfsync_swi_cookie); - if_clone_detach(V_pfsync_cloner); - } - CURVNET_RESTORE(); - } - VNET_LIST_RUNLOCK(); - - return (error); } static void pfsync_uninit() { - VNET_ITERATOR_DECL(vnet_iter); pfsync_pointers_uninit(); +#ifdef INET ipproto_unregister(IPPROTO_PFSYNC); pf_proto_unregister(PF_INET, IPPROTO_PFSYNC, SOCK_RAW); - VNET_LIST_RLOCK(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - if_clone_detach(V_pfsync_cloner); - swi_remove(V_pfsync_swi_cookie); - CURVNET_RESTORE(); - } - VNET_LIST_RUNLOCK(); +#endif } static int @@ -2416,7 +2413,7 @@ static moduledata_t pfsync_mod = { #define PFSYNC_MODVER 1 -/* XXX-BZ recheck the r229853 comment once the shuffling is done. */ -DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); +/* Stay on FIREWALL as we depend on pf being initialized and on inetdomain. */ +DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY); MODULE_VERSION(pfsync, PFSYNC_MODVER); MODULE_DEPEND(pfsync, pf, PF_MODVER, PF_MODVER, PF_MODVER); From owner-svn-src-projects@freebsd.org Thu Jun 23 21:50:57 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E56BB745FB for ; Thu, 23 Jun 2016 21:50:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B14F32C29; Thu, 23 Jun 2016 21:50:56 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NLot3I062822; Thu, 23 Jun 2016 21:50:55 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NLoqgR060802; Thu, 23 Jun 2016 21:50:52 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606232150.u5NLoqgR060802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 21:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302158 - in projects/vnet: . cddl/lib/libavl cddl/lib/libctf cddl/lib/libnvpair cddl/lib/libumem cddl/lib/libuutil etc/defaults lib/libusb sys/cddl/contrib/opensolaris/uts/common/fs/zf... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 21:50:57 -0000 Author: bz Date: Thu Jun 23 21:50:52 2016 New Revision: 302158 URL: https://svnweb.freebsd.org/changeset/base/302158 Log: MfH @r302157 merged the initial pf/pflog/pfsync changes Sponsored by: The FreeBSD Foundation Modified: projects/vnet/UPDATING projects/vnet/cddl/lib/libavl/Makefile projects/vnet/cddl/lib/libctf/Makefile projects/vnet/cddl/lib/libnvpair/Makefile projects/vnet/cddl/lib/libumem/Makefile projects/vnet/cddl/lib/libuutil/Makefile projects/vnet/etc/defaults/rc.conf projects/vnet/lib/libusb/Makefile projects/vnet/lib/libusb/libusb.3 projects/vnet/lib/libusb/libusb.h projects/vnet/lib/libusb/libusb10.c projects/vnet/lib/libusb/libusb10.h projects/vnet/lib/libusb/libusb10_io.c projects/vnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c projects/vnet/sys/dev/mlx5/mlx5_core/mlx5_vport.c projects/vnet/sys/geom/geom_disk.c projects/vnet/sys/geom/geom_disk.h projects/vnet/sys/kern/uipc_shm.c projects/vnet/sys/net/if_var.h projects/vnet/sys/net/pfvar.h projects/vnet/sys/netinet/in_pcb.h projects/vnet/sys/netinet/sctp_usrreq.c projects/vnet/sys/netinet/sctputil.c projects/vnet/sys/netinet/tcp_subr.c projects/vnet/sys/netinet6/sctp6_usrreq.c projects/vnet/sys/netpfil/pf/pf.c projects/vnet/sys/netpfil/pf/pf_if.c projects/vnet/sys/sys/param.h projects/vnet/sys/sys/socketvar.h projects/vnet/sys/vm/vm_page.c projects/vnet/sys/vm/vm_page.h projects/vnet/sys/x86/acpica/acpi_wakeup.c projects/vnet/tools/tools/makeroot/makeroot.sh projects/vnet/usr.sbin/bsdinstall/partedit/partedit_x86.c Directory Properties: projects/vnet/ (props changed) projects/vnet/cddl/ (props changed) projects/vnet/sys/cddl/contrib/opensolaris/ (props changed) Modified: projects/vnet/UPDATING ============================================================================== --- projects/vnet/UPDATING Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/UPDATING Thu Jun 23 21:50:52 2016 (r302158) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160622: + The libc stub for the pipe(2) system call has been replaced with + a wrapper which calls the pipe2(2) system call and the pipe(2) is now + only implemented by the kernels which include "options + COMPAT_FREEBSD10" in their config file (this is the default). + Users should ensure that this option is enabled in their kernel + or upgrade userspace to r302092 before upgrading their kernel. + 20160527: CAM will now strip leading spaces from SCSI disks' serial numbers. This will effect users who create UFS filesystems on SCSI disks using Modified: projects/vnet/cddl/lib/libavl/Makefile ============================================================================== --- projects/vnet/cddl/lib/libavl/Makefile Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/cddl/lib/libavl/Makefile Thu Jun 23 21:50:52 2016 (r302158) @@ -4,7 +4,7 @@ LIB= avl SRCS= avl.c -WARNS?= 0 +WARNS?= 3 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common Modified: projects/vnet/cddl/lib/libctf/Makefile ============================================================================== --- projects/vnet/cddl/lib/libctf/Makefile Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/cddl/lib/libctf/Makefile Thu Jun 23 21:50:52 2016 (r302158) @@ -18,7 +18,7 @@ SRCS= ctf_create.c \ ctf_util.c MAN= ctf.5 -WARNS?= 0 +WARNS?= 2 CFLAGS+= -DCTF_OLD_VERSIONS CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ Modified: projects/vnet/cddl/lib/libnvpair/Makefile ============================================================================== --- projects/vnet/cddl/lib/libnvpair/Makefile Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/cddl/lib/libnvpair/Makefile Thu Jun 23 21:50:52 2016 (r302158) @@ -12,7 +12,7 @@ SRCS= libnvpair.c \ opensolaris_nvpair.c \ opensolaris_nvpair_alloc_fixed.c -WARNS?= 0 +WARNS?= 1 CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris Modified: projects/vnet/cddl/lib/libumem/Makefile ============================================================================== --- projects/vnet/cddl/lib/libumem/Makefile Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/cddl/lib/libumem/Makefile Thu Jun 23 21:50:52 2016 (r302158) @@ -4,7 +4,7 @@ LIB= umem SRCS= umem.c -WARNS?= 0 +WARNS?= 3 CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem .include Modified: projects/vnet/cddl/lib/libuutil/Makefile ============================================================================== --- projects/vnet/cddl/lib/libuutil/Makefile Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/cddl/lib/libuutil/Makefile Thu Jun 23 21:50:52 2016 (r302158) @@ -15,7 +15,7 @@ SRCS= avl.c \ uu_pname.c \ uu_strtoint.c -WARNS?= 0 +WARNS?= 1 CFLAGS+= -DNATIVE_BUILD CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris Modified: projects/vnet/etc/defaults/rc.conf ============================================================================== --- projects/vnet/etc/defaults/rc.conf Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/etc/defaults/rc.conf Thu Jun 23 21:50:52 2016 (r302158) @@ -741,3 +741,9 @@ if [ -z "${source_rc_confs_defined}" ]; done } fi + +# Allow vendors to override FreeBSD defaults in /etc/default/rc.conf +# without the need to carefully manage /etc/rc.conf. +if [ -r /etc/defaults/vendor.conf ]; then + . /etc/defaults/vendor.conf +fi Modified: projects/vnet/lib/libusb/Makefile ============================================================================== --- projects/vnet/lib/libusb/Makefile Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/lib/libusb/Makefile Thu Jun 23 21:50:52 2016 (r302158) @@ -120,8 +120,12 @@ MLINKS += libusb.3 libusb_get_ss_usb_dev MLINKS += libusb.3 libusb_free_ss_usb_device_capability_descriptor.3 MLINKS += libusb.3 libusb_get_container_id_descriptor.3 MLINKS += libusb.3 libusb_free_container_id_descriptor.3 +MLINKS += libusb.3 libusb_alloc_streams.3 +MLINKS += libusb.3 libusb_free_streams.3 MLINKS += libusb.3 libusb_alloc_transfer.3 MLINKS += libusb.3 libusb_free_transfer.3 +MLINKS += libusb.3 libusb_transfer_set_stream_id.3 +MLINKS += libusb.3 libusb_transfer_get_stream_id.3 MLINKS += libusb.3 libusb_submit_transfer.3 MLINKS += libusb.3 libusb_cancel_transfer.3 MLINKS += libusb.3 libusb_control_transfer.3 Modified: projects/vnet/lib/libusb/libusb.3 ============================================================================== --- projects/vnet/lib/libusb/libusb.3 Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/lib/libusb/libusb.3 Thu Jun 23 21:50:52 2016 (r302158) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 2016 +.Dd June 23, 2016 .Dt LIBUSB 3 .Os .Sh NAME @@ -521,6 +521,29 @@ if the transfer timed out, LIBUSB_ERROR_ supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on other failure. +.Sh USB STREAMS SUPPORT +.Ft int +.Fn libusb_alloc_streams "libusb_device_handle *dev" "uint32_t num_streams" "unsigned char *endpoints" "int num_endpoints" +This function verifies that the given number of streams using the +given number of endpoints is allowed and allocates the resources +needed to use so-called USB streams. +Currently only a single stream per endpoint is supported to simplify +the internals of LibUSB. +This function returns 0 on success or a LIBUSB_ERROR code on failure. +.Pp +.Ft int +.Fn libusb_free_streams "libusb_device_handle *dev" "unsigned char *endpoints" "int num_endpoints" +This function release resources needed for streams usage. +Returns 0 on success or a LIBUSB_ERROR code on failure. +.Pp +.Ft void +.Fn libusb_transfer_set_stream_id "struct libusb_transfer *transfer" "uint32_t stream_id" +This function sets the stream ID for the given USB transfer. +.Pp +.Ft uint32_t +.Fn libusb_transfer_get_stream_id "struct libusb_transfer *transfer" +This function returns the stream ID for the given USB transfer. +If no stream ID is used a value of zero is returned. .Sh USB EVENTS .Ft int .Fn libusb_try_lock_events "libusb_context *ctx" Modified: projects/vnet/lib/libusb/libusb.h ============================================================================== --- projects/vnet/lib/libusb/libusb.h Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/lib/libusb/libusb.h Thu Jun 23 21:50:52 2016 (r302158) @@ -561,6 +561,13 @@ typedef int (*libusb_hotplug_callback_fn int libusb_hotplug_register_callback(libusb_context *ctx, libusb_hotplug_event events, libusb_hotplug_flag flags, int vendor_id, int product_id, int dev_class, libusb_hotplug_callback_fn cb_fn, void *user_data, libusb_hotplug_callback_handle *handle); void libusb_hotplug_deregister_callback(libusb_context *ctx, libusb_hotplug_callback_handle handle); +/* Streams support */ + +int libusb_alloc_streams(libusb_device_handle *dev, uint32_t num_streams, unsigned char *endpoints, int num_endpoints); +int libusb_free_streams(libusb_device_handle *dev, unsigned char *endpoints, int num_endpoints); +void libusb_transfer_set_stream_id(struct libusb_transfer *transfer, uint32_t stream_id); +uint32_t libusb_transfer_get_stream_id(struct libusb_transfer *transfer); + #if 0 { /* indent fix */ #endif Modified: projects/vnet/lib/libusb/libusb10.c ============================================================================== --- projects/vnet/lib/libusb/libusb10.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/lib/libusb/libusb10.c Thu Jun 23 21:50:52 2016 (r302158) @@ -1403,7 +1403,8 @@ found: maxframe = libusb10_get_maxframe(pdev, uxfer); /* make sure the transfer is opened */ - err = libusb20_tr_open(pxfer0, buffsize, maxframe, endpoint); + err = libusb20_tr_open_stream(pxfer0, buffsize, maxframe, + endpoint, sxfer->stream_id); if (err && (err != LIBUSB20_ERROR_BUSY)) { goto failure; } Modified: projects/vnet/lib/libusb/libusb10.h ============================================================================== --- projects/vnet/lib/libusb/libusb10.h Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/lib/libusb/libusb10.h Thu Jun 23 21:50:52 2016 (r302158) @@ -69,6 +69,7 @@ struct libusb_super_transfer { uint8_t *curr_data; uint32_t rem_len; uint32_t last_len; + uint32_t stream_id; uint8_t state; #define LIBUSB_SUPER_XFER_ST_NONE 0 #define LIBUSB_SUPER_XFER_ST_PEND 1 Modified: projects/vnet/lib/libusb/libusb10_io.c ============================================================================== --- projects/vnet/lib/libusb/libusb10_io.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/lib/libusb/libusb10_io.c Thu Jun 23 21:50:52 2016 (r302158) @@ -767,3 +767,48 @@ libusb_fill_iso_transfer(struct libusb_t transfer->callback = callback; } +int +libusb_alloc_streams(libusb_device_handle *dev, uint32_t num_streams, + unsigned char *endpoints, int num_endpoints) +{ + if (num_streams > 1) + return (LIBUSB_ERROR_INVALID_PARAM); + return (0); +} + +int +libusb_free_streams(libusb_device_handle *dev, unsigned char *endpoints, int num_endpoints) +{ + + return (0); +} + +void +libusb_transfer_set_stream_id(struct libusb_transfer *transfer, uint32_t stream_id) +{ + struct libusb_super_transfer *sxfer; + + if (transfer == NULL) + return; + + sxfer = (struct libusb_super_transfer *)( + ((uint8_t *)transfer) - sizeof(*sxfer)); + + /* set stream ID */ + sxfer->stream_id = stream_id; +} + +uint32_t +libusb_transfer_get_stream_id(struct libusb_transfer *transfer) +{ + struct libusb_super_transfer *sxfer; + + if (transfer == NULL) + return (0); + + sxfer = (struct libusb_super_transfer *)( + ((uint8_t *)transfer) - sizeof(*sxfer)); + + /* get stream ID */ + return (sxfer->stream_id); +} Modified: projects/vnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- projects/vnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Jun 23 21:50:52 2016 (r302158) @@ -1430,6 +1430,7 @@ static int getzfsvfs(const char *dsname, zfsvfs_t **zfvp) { objset_t *os; + vfs_t *vfsp; int error; error = dmu_objset_hold(dsname, FTAG, &os); @@ -1443,19 +1444,21 @@ getzfsvfs(const char *dsname, zfsvfs_t * mutex_enter(&os->os_user_ptr_lock); *zfvp = dmu_objset_get_user(os); if (*zfvp) { -#ifdef illumos - VFS_HOLD((*zfvp)->z_vfs); -#else - if (vfs_busy((*zfvp)->z_vfs, 0) != 0) { - *zfvp = NULL; - error = SET_ERROR(ESRCH); - } -#endif + vfsp = (*zfvp)->z_vfs; + vfs_ref(vfsp); } else { error = SET_ERROR(ESRCH); } mutex_exit(&os->os_user_ptr_lock); dmu_objset_rele(os, FTAG); + if (error == 0) { + error = vfs_busy(vfsp, 0); + vfs_rel(vfsp); + if (error != 0) { + *zfvp = NULL; + error = SET_ERROR(ESRCH); + } + } return (error); } Modified: projects/vnet/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- projects/vnet/sys/dev/mlx5/mlx5_core/mlx5_vport.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/dev/mlx5/mlx5_core/mlx5_vport.c Thu Jun 23 21:50:52 2016 (r302158) @@ -71,7 +71,7 @@ static int mlx5_query_nic_vport_context( int mlx5_vport_alloc_q_counter(struct mlx5_core_dev *mdev, int *counter_set_id) { u32 in[MLX5_ST_SZ_DW(alloc_q_counter_in)]; - u32 out[MLX5_ST_SZ_DW(alloc_q_counter_in)]; + u32 out[MLX5_ST_SZ_DW(alloc_q_counter_out)]; int err; memset(in, 0, sizeof(in)); Modified: projects/vnet/sys/geom/geom_disk.c ============================================================================== --- projects/vnet/sys/geom/geom_disk.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/geom/geom_disk.c Thu Jun 23 21:50:52 2016 (r302158) @@ -670,7 +670,7 @@ g_disk_create(void *arg, int flag) g_topology_assert(); dp = arg; - mtx_lock(&dp->d_mtx); + mtx_pool_lock(mtxpool_sleep, dp); dp->d_init_level = DISK_INIT_START; /* @@ -678,12 +678,12 @@ g_disk_create(void *arg, int flag) * call the user's callback to tell him we've cleaned things up. */ if (dp->d_goneflag != 0) { - mtx_unlock(&dp->d_mtx); + mtx_pool_unlock(mtxpool_sleep, dp); if (dp->d_gone != NULL) dp->d_gone(dp); return; } - mtx_unlock(&dp->d_mtx); + mtx_pool_unlock(mtxpool_sleep, dp); sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); mtx_init(&sc->start_mtx, "g_disk_start", NULL, MTX_DEF); @@ -721,7 +721,7 @@ g_disk_create(void *arg, int flag) dp->d_geom = gp; g_error_provider(pp, 0); - mtx_lock(&dp->d_mtx); + mtx_pool_lock(mtxpool_sleep, dp); dp->d_init_level = DISK_INIT_DONE; /* @@ -729,11 +729,11 @@ g_disk_create(void *arg, int flag) * process for it. */ if (dp->d_goneflag != 0) { - mtx_unlock(&dp->d_mtx); + mtx_pool_unlock(mtxpool_sleep, dp); g_wither_provider(pp, ENXIO); return; } - mtx_unlock(&dp->d_mtx); + mtx_pool_unlock(mtxpool_sleep, dp); } @@ -786,8 +786,6 @@ g_disk_destroy(void *ptr, int flag) g_wither_geom(gp, ENXIO); } - mtx_destroy(&dp->d_mtx); - g_free(dp); } @@ -852,9 +850,6 @@ disk_create(struct disk *dp, int version DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); dp->d_geom = NULL; - snprintf(dp->d_mtx_name, sizeof(dp->d_mtx_name), "%s%ddlk", - dp->d_name, dp->d_unit); - mtx_init(&dp->d_mtx, dp->d_mtx_name, NULL, MTX_DEF); dp->d_init_level = DISK_INIT_NONE; g_disk_ident_adjust(dp->d_ident, sizeof(dp->d_ident)); @@ -878,7 +873,7 @@ disk_gone(struct disk *dp) struct g_geom *gp; struct g_provider *pp; - mtx_lock(&dp->d_mtx); + mtx_pool_lock(mtxpool_sleep, dp); dp->d_goneflag = 1; /* @@ -897,10 +892,10 @@ disk_gone(struct disk *dp) * has not been fully setup in any case. */ if (dp->d_init_level < DISK_INIT_DONE) { - mtx_unlock(&dp->d_mtx); + mtx_pool_unlock(mtxpool_sleep, dp); return; } - mtx_unlock(&dp->d_mtx); + mtx_pool_unlock(mtxpool_sleep, dp); gp = dp->d_geom; if (gp != NULL) { Modified: projects/vnet/sys/geom/geom_disk.h ============================================================================== --- projects/vnet/sys/geom/geom_disk.h Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/geom/geom_disk.h Thu Jun 23 21:50:52 2016 (r302158) @@ -72,8 +72,6 @@ struct disk { struct devstat *d_devstat; int d_goneflag; int d_destroyed; - struct mtx d_mtx; - char d_mtx_name[24]; disk_init_level d_init_level; /* Shared fields */ Modified: projects/vnet/sys/kern/uipc_shm.c ============================================================================== --- projects/vnet/sys/kern/uipc_shm.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/kern/uipc_shm.c Thu Jun 23 21:50:52 2016 (r302158) @@ -295,14 +295,14 @@ shm_read(struct file *fp, struct uio *ui int error; shmfd = fp->f_data; - foffset_lock_uio(fp, uio, flags); - rl_cookie = rangelock_rlock(&shmfd->shm_rl, uio->uio_offset, - uio->uio_offset + uio->uio_resid, &shmfd->shm_mtx); #ifdef MAC error = mac_posixshm_check_read(active_cred, fp->f_cred, shmfd); if (error) return (error); #endif + foffset_lock_uio(fp, uio, flags); + rl_cookie = rangelock_rlock(&shmfd->shm_rl, uio->uio_offset, + uio->uio_offset + uio->uio_resid, &shmfd->shm_mtx); error = uiomove_object(shmfd->shm_object, shmfd->shm_size, uio); rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); foffset_unlock_uio(fp, uio, flags); Modified: projects/vnet/sys/net/if_var.h ============================================================================== --- projects/vnet/sys/net/if_var.h Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/net/if_var.h Thu Jun 23 21:50:52 2016 (r302158) @@ -311,6 +311,8 @@ struct ifnet { * that structure can be enhanced without changing the kernel * binary interface. */ + void *if_pspare[4]; /* packet pacing / general use */ + int if_ispare[4]; /* packet pacing / general use */ }; /* for compatibility with other BSDs */ Modified: projects/vnet/sys/net/pfvar.h ============================================================================== --- projects/vnet/sys/net/pfvar.h Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/net/pfvar.h Thu Jun 23 21:50:52 2016 (r302158) @@ -835,7 +835,6 @@ typedef int pflog_packet_t(struct pfi_ki struct pf_ruleset *, struct pf_pdesc *, int); extern pflog_packet_t *pflog_packet_ptr; -#define V_pf_end_threads VNET(pf_end_threads) #endif /* _KERNEL */ #define PFSYNC_FLAG_SRCNODE 0x04 Modified: projects/vnet/sys/netinet/in_pcb.h ============================================================================== --- projects/vnet/sys/netinet/in_pcb.h Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/netinet/in_pcb.h Thu Jun 23 21:50:52 2016 (r302158) @@ -202,10 +202,10 @@ struct inpcb { u_char inp_ip_minttl; /* (i) minimum TTL or drop */ uint32_t inp_flowid; /* (x) flow id / queue id */ u_int inp_refcount; /* (i) refcount */ - void *inp_pspare[5]; /* (x) route caching / general use */ + void *inp_pspare[5]; /* (x) packet pacing / general use */ uint32_t inp_flowtype; /* (x) M_HASHTYPE value */ uint32_t inp_rss_listen_bucket; /* (x) overridden RSS listen bucket */ - u_int inp_ispare[4]; /* (x) route caching / user cookie / + u_int inp_ispare[4]; /* (x) packet pacing / user cookie / * general use */ /* Local and foreign ports, local and foreign addr. */ Modified: projects/vnet/sys/netinet/sctp_usrreq.c ============================================================================== --- projects/vnet/sys/netinet/sctp_usrreq.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/netinet/sctp_usrreq.c Thu Jun 23 21:50:52 2016 (r302158) @@ -291,8 +291,7 @@ sctp_ctlinput(int cmd, struct sockaddr * SCTP_DEFAULT_VRFID); if ((stcb != NULL) && (net != NULL) && - (inp != NULL) && - (inp->sctp_socket != NULL)) { + (inp != NULL)) { /* Check the verification tag */ if (ntohl(sh->v_tag) != 0) { /* Modified: projects/vnet/sys/netinet/sctputil.c ============================================================================== --- projects/vnet/sys/netinet/sctputil.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/netinet/sctputil.c Thu Jun 23 21:50:52 2016 (r302158) @@ -5274,8 +5274,14 @@ restart_nosblocks: } } } - if ((so->so_rcv.sb_cc <= held_length) && block_allowed) { - /* we need to wait for data */ + if (so->so_rcv.sb_cc <= held_length) { + if (so->so_error) { + error = so->so_error; + if ((in_flags & MSG_PEEK) == 0) { + so->so_error = 0; + } + goto out; + } if ((so->so_rcv.sb_cc == 0) && ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { @@ -5306,51 +5312,18 @@ restart_nosblocks: goto out; } } - error = sbwait(&so->so_rcv); - if (error) { - goto out; - } - held_length = 0; - goto restart_nosblocks; - } else if (so->so_rcv.sb_cc == 0) { - if (so->so_error) { - error = so->so_error; - if ((in_flags & MSG_PEEK) == 0) - so->so_error = 0; - } else { - if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || - (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - if ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0) { - /* - * For active open side clear flags - * for re-use passive open is - * blocked by connect. - */ - if (inp->sctp_flags & SCTP_PCB_FLAGS_WAS_ABORTED) { - /* - * You were aborted, passive - * side always hits here - */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET); - error = ECONNRESET; - } - so->so_state &= ~(SS_ISCONNECTING | - SS_ISDISCONNECTING | - SS_ISCONFIRMING | - SS_ISCONNECTED); - if (error == 0) { - if ((inp->sctp_flags & SCTP_PCB_FLAGS_WAS_CONNECTED) == 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOTCONN); - error = ENOTCONN; - } - } - goto out; - } + if (block_allowed) { + error = sbwait(&so->so_rcv); + if (error) { + goto out; } + held_length = 0; + goto restart_nosblocks; + } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EWOULDBLOCK); error = EWOULDBLOCK; + goto out; } - goto out; } if (hold_sblock == 1) { SOCKBUF_UNLOCK(&so->so_rcv); @@ -6965,8 +6938,7 @@ sctp_recv_icmp_tunneled_packet(int cmd, SCTP_DEFAULT_VRFID); if ((stcb != NULL) && (net != NULL) && - (inp != NULL) && - (inp->sctp_socket != NULL)) { + (inp != NULL)) { /* Check the UDP port numbers */ if ((udp->uh_dport != net->port) || (udp->uh_sport != htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)))) { @@ -7092,8 +7064,7 @@ sctp_recv_icmp6_tunneled_packet(int cmd, &inp, &net, 1, SCTP_DEFAULT_VRFID); if ((stcb != NULL) && (net != NULL) && - (inp != NULL) && - (inp->sctp_socket != NULL)) { + (inp != NULL)) { /* Check the UDP port numbers */ if ((udp.uh_dport != net->port) || (udp.uh_sport != htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)))) { Modified: projects/vnet/sys/netinet/tcp_subr.c ============================================================================== --- projects/vnet/sys/netinet/tcp_subr.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/netinet/tcp_subr.c Thu Jun 23 21:50:52 2016 (r302158) @@ -738,12 +738,14 @@ tcp_destroy(void *unused __unused) * up, which means, we should be past the tcp_discardcb() calls. * Sleep to let all tcpcb timers really disappear and cleanup. */ - do { - pause("tcpdes", hz/10); + for (;;) { INP_LIST_RLOCK(&V_tcbinfo); n = V_tcbinfo.ipi_count; INP_LIST_RUNLOCK(&V_tcbinfo); - } while (n != 0); + if (n == 0) + break; + pause("tcpdes", hz / 10); + } tcp_hc_destroy(); syncache_destroy(); tcp_tw_destroy(); Modified: projects/vnet/sys/netinet6/sctp6_usrreq.c ============================================================================== --- projects/vnet/sys/netinet6/sctp6_usrreq.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/netinet6/sctp6_usrreq.c Thu Jun 23 21:50:52 2016 (r302158) @@ -341,8 +341,7 @@ sctp6_ctlinput(int cmd, struct sockaddr &inp, &net, 1, SCTP_DEFAULT_VRFID); if ((stcb != NULL) && (net != NULL) && - (inp != NULL) && - (inp->sctp_socket != NULL)) { + (inp != NULL)) { /* Check the verification tag */ if (ntohl(sh.v_tag) != 0) { /* Modified: projects/vnet/sys/netpfil/pf/pf.c ============================================================================== --- projects/vnet/sys/netpfil/pf/pf.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/netpfil/pf/pf.c Thu Jun 23 21:50:52 2016 (r302158) @@ -1436,6 +1436,7 @@ pf_purge_thread(void *unused __unused) CURVNET_SET(vnet_iter); if (pf_end_threads) { + pf_end_threads++; wakeup(pf_purge_thread); kproc_exit(0); } Modified: projects/vnet/sys/netpfil/pf/pf_if.c ============================================================================== --- projects/vnet/sys/netpfil/pf/pf_if.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/netpfil/pf/pf_if.c Thu Jun 23 21:50:52 2016 (r302158) @@ -802,7 +802,7 @@ pfi_attach_ifnet_event(void *arg __unuse CURVNET_SET(ifp->if_vnet); if (V_pf_vnet_active == 0) { - /* Avoid teardown race in the least expensie way. */ + /* Avoid teardown race in the least expensive way. */ CURVNET_RESTORE(); return; } @@ -825,7 +825,7 @@ pfi_detach_ifnet_event(void *arg __unuse CURVNET_SET(ifp->if_vnet); if (V_pf_vnet_active == 0) { - /* Avoid teardown race in the least expensie way. */ + /* Avoid teardown race in the least expensive way. */ CURVNET_RESTORE(); return; } @@ -848,7 +848,7 @@ pfi_attach_group_event(void *arg , struc CURVNET_SET((struct vnet *)arg); if (V_pf_vnet_active == 0) { - /* Avoid teardown race in the least expensie way. */ + /* Avoid teardown race in the least expensive way. */ CURVNET_RESTORE(); return; } @@ -863,7 +863,7 @@ pfi_change_group_event(void *arg, char * CURVNET_SET((struct vnet *)arg); if (V_pf_vnet_active == 0) { - /* Avoid teardown race in the least expensie way. */ + /* Avoid teardown race in the least expensive way. */ CURVNET_RESTORE(); return; } @@ -887,7 +887,7 @@ pfi_detach_group_event(void *arg, struct CURVNET_SET((struct vnet *)arg); if (V_pf_vnet_active == 0) { - /* Avoid teardown race in the least expensie way. */ + /* Avoid teardown race in the least expensive way. */ CURVNET_RESTORE(); return; } @@ -908,7 +908,7 @@ pfi_ifaddr_event(void *arg __unused, str CURVNET_SET(ifp->if_vnet); if (V_pf_vnet_active == 0) { - /* Avoid teardown race in the least expensie way. */ + /* Avoid teardown race in the least expensive way. */ CURVNET_RESTORE(); return; } Modified: projects/vnet/sys/sys/param.h ============================================================================== --- projects/vnet/sys/sys/param.h Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/sys/param.h Thu Jun 23 21:50:52 2016 (r302158) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100118 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100120 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: projects/vnet/sys/sys/socketvar.h ============================================================================== --- projects/vnet/sys/sys/socketvar.h Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/sys/socketvar.h Thu Jun 23 21:50:52 2016 (r302158) @@ -126,6 +126,9 @@ struct socket { */ int so_fibnum; /* routing domain for this socket */ uint32_t so_user_cookie; + + void *so_pspare[2]; /* packet pacing / general use */ + int so_ispare[2]; /* packet pacing / general use */ }; /* Modified: projects/vnet/sys/vm/vm_page.c ============================================================================== --- projects/vnet/sys/vm/vm_page.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/vm/vm_page.c Thu Jun 23 21:50:52 2016 (r302158) @@ -760,17 +760,36 @@ vm_page_trysbusy(vm_page_t m) } static void +vm_page_xunbusy_locked(vm_page_t m) +{ + + vm_page_assert_xbusied(m); + vm_page_assert_locked(m); + + atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED); + /* There is a waiter, do wakeup() instead of vm_page_flash(). */ + wakeup(m); +} + +static void vm_page_xunbusy_maybelocked(vm_page_t m) { bool lockacq; vm_page_assert_xbusied(m); + /* + * Fast path for unbusy. If it succeeds, we know that there + * are no waiters, so we do not need a wakeup. + */ + if (atomic_cmpset_rel_int(&m->busy_lock, VPB_SINGLE_EXCLUSIVER, + VPB_UNBUSIED)) + return; + lockacq = !mtx_owned(vm_page_lockptr(m)); if (lockacq) vm_page_lock(m); - vm_page_flash(m); - atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED); + vm_page_xunbusy_locked(m); if (lockacq) vm_page_unlock(m); } @@ -788,8 +807,7 @@ vm_page_xunbusy_hard(vm_page_t m) vm_page_assert_xbusied(m); vm_page_lock(m); - atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED); - wakeup(m); + vm_page_xunbusy_locked(m); vm_page_unlock(m); } Modified: projects/vnet/sys/vm/vm_page.h ============================================================================== --- projects/vnet/sys/vm/vm_page.h Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/vm/vm_page.h Thu Jun 23 21:50:52 2016 (r302158) @@ -552,6 +552,7 @@ void vm_page_lock_assert_KBI(vm_page_t m (m)); \ } while (0) +/* Note: page m's lock must not be owned by the caller. */ #define vm_page_xunbusy(m) do { \ if (!atomic_cmpset_rel_int(&(m)->busy_lock, \ VPB_SINGLE_EXCLUSIVER, VPB_UNBUSIED)) \ Modified: projects/vnet/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- projects/vnet/sys/x86/acpica/acpi_wakeup.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/sys/x86/acpica/acpi_wakeup.c Thu Jun 23 21:50:52 2016 (r302158) @@ -322,7 +322,7 @@ acpi_alloc_wakeup_handler(void) * page-aligned. */ wakeaddr = contigmalloc((ACPI_PAGETABLES + 1) * PAGE_SIZE, M_DEVBUF, - M_WAITOK, 0x500, 0xa0000, PAGE_SIZE, 0ul); + M_NOWAIT, 0x500, 0xa0000, PAGE_SIZE, 0ul); if (wakeaddr == NULL) { printf("%s: can't alloc wake memory\n", __func__); return (NULL); Modified: projects/vnet/tools/tools/makeroot/makeroot.sh ============================================================================== --- projects/vnet/tools/tools/makeroot/makeroot.sh Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/tools/tools/makeroot/makeroot.sh Thu Jun 23 21:50:52 2016 (r302158) @@ -238,5 +238,9 @@ if [ -n "${SIZE}" ]; then SIZEFLAG="-s ${SIZE}" fi +# Zero out subsecond component of time= keywords as they are currently not +# supported by makefs +sed -i '' -E 's/(time=[0-9]*)\.[0-9]*/\1.0/' ${manifest} + cd ${BSDROOT}; makefs ${DUPFLAG} -N ${DBDIR} ${SIZEFLAG} ${BFLAG} \ -t ffs ${LABELFLAG} -f 256 ${IMGFILE} ${manifest} Modified: projects/vnet/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- projects/vnet/usr.sbin/bsdinstall/partedit/partedit_x86.c Thu Jun 23 21:42:43 2016 (r302157) +++ projects/vnet/usr.sbin/bsdinstall/partedit/partedit_x86.c Thu Jun 23 21:50:52 2016 (r302158) @@ -99,7 +99,7 @@ bootpart_size(const char *scheme) if (strcmp(x86_bootmethod(), "BIOS") == 0) return (512*1024); else - return (800*1024); + return (200*1024*1024); return (0); } From owner-svn-src-projects@freebsd.org Thu Jun 23 22:42:04 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD434B73297 for ; Thu, 23 Jun 2016 22:42:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 768C41661; Thu, 23 Jun 2016 22:42:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NMg3Wj082391; Thu, 23 Jun 2016 22:42:03 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NMg3gp082390; Thu, 23 Jun 2016 22:42:03 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606232242.u5NMg3gp082390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 22:42:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302161 - projects/vnet X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 22:42:04 -0000 Author: bz Date: Thu Jun 23 22:42:03 2016 New Revision: 302161 URL: https://svnweb.freebsd.org/changeset/base/302161 Log: MfH @r302160 Everything merged :) Special thanks to gjb for letting 2 commits slip into ^/head/ past the deadline (which I wasn't aware of). Sponsored by: The FreeBSD Foundation Modified: Directory Properties: projects/vnet/ (props changed) From owner-svn-src-projects@freebsd.org Fri Jun 24 11:45:57 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF766B80085 for ; Fri, 24 Jun 2016 11:45:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 919721FCB; Fri, 24 Jun 2016 11:45:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5OBjuPR071559; Fri, 24 Jun 2016 11:45:56 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5OBjuOl071558; Fri, 24 Jun 2016 11:45:56 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606241145.u5OBjuOl071558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 24 Jun 2016 11:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302172 - projects/vnet/sys/netpfil/pf X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 11:45:57 -0000 Author: bz Date: Fri Jun 24 11:45:56 2016 New Revision: 302172 URL: https://svnweb.freebsd.org/changeset/base/302172 Log: Fix builds on sparc64 and powerpc. Sponsored by: The FreeBSD Foundation Modified: projects/vnet/sys/netpfil/pf/pf_ioctl.c Modified: projects/vnet/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- projects/vnet/sys/netpfil/pf/pf_ioctl.c Fri Jun 24 10:55:14 2016 (r302171) +++ projects/vnet/sys/netpfil/pf/pf_ioctl.c Fri Jun 24 11:45:56 2016 (r302172) @@ -3740,7 +3740,7 @@ pf_load(void) } static void -pf_unload_vnet() +pf_unload_vnet(void) { int error; From owner-svn-src-projects@freebsd.org Sat Jun 25 14:14:57 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 919EEB82CCA for ; Sat, 25 Jun 2016 14:14:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CD031804; Sat, 25 Jun 2016 14:14:57 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5PEEu9g065657; Sat, 25 Jun 2016 14:14:56 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5PEEuDv065651; Sat, 25 Jun 2016 14:14:56 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606251414.u5PEEuDv065651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 25 Jun 2016 14:14:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302199 - projects/vnet/sys/contrib/ipfilter/netinet X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 14:14:57 -0000 Author: bz Date: Sat Jun 25 14:14:55 2016 New Revision: 302199 URL: https://svnweb.freebsd.org/changeset/base/302199 Log: A first cut of V_irtualising ipfilter. Untested. Sponsored by: The FreeBSD Foundation Modified: projects/vnet/sys/contrib/ipfilter/netinet/ip_fil.h projects/vnet/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c projects/vnet/sys/contrib/ipfilter/netinet/ip_nat.c projects/vnet/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c projects/vnet/sys/contrib/ipfilter/netinet/ip_rules.c projects/vnet/sys/contrib/ipfilter/netinet/mlfk_ipl.c Modified: projects/vnet/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- projects/vnet/sys/contrib/ipfilter/netinet/ip_fil.h Sat Jun 25 12:54:27 2016 (r302198) +++ projects/vnet/sys/contrib/ipfilter/netinet/ip_fil.h Sat Jun 25 14:14:55 2016 (r302199) @@ -1710,7 +1710,6 @@ typedef struct ipf_main_softc_s { #ifndef _KERNEL extern int ipf_check __P((void *, struct ip *, int, void *, int, mb_t **)); -extern int (*ipf_checkp) __P((ip_t *, int, void *, int, mb_t **)); extern struct ifnet *get_unit __P((char *, int)); extern char *get_ifname __P((struct ifnet *)); extern int ipfioctl __P((ipf_main_softc_t *, int, ioctlcmd_t, Modified: projects/vnet/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- projects/vnet/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Jun 25 12:54:27 2016 (r302198) +++ projects/vnet/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Jun 25 14:14:55 2016 (r302199) @@ -99,31 +99,29 @@ MALLOC_DEFINE(M_IPFILTER, "ipfilter", "I # endif -static int (*ipf_savep) __P((void *, ip_t *, int, void *, int, struct mbuf **)); static int ipf_send_ip __P((fr_info_t *, mb_t *)); static void ipf_timer_func __P((void *arg)); -int ipf_locks_done = 0; -ipf_main_softc_t ipfmain; +VNET_DEFINE(ipf_main_softc_t, ipfmain); +#define V_ipfmain VNET(ipfmain) # include # if defined(NETBSD_PF) # include # endif /* NETBSD_PF */ -/* - * We provide the ipf_checkp name just to minimize changes later. - */ -int (*ipf_checkp) __P((void *, ip_t *ip, int hlen, void *ifp, int out, mb_t **mp)); - static eventhandler_tag ipf_arrivetag, ipf_departtag, ipf_clonetag; -static void ipf_ifevent(void *arg); +static void ipf_ifevent(void *arg, struct ifnet *ifp); -static void ipf_ifevent(arg) +static void ipf_ifevent(arg, ifp) void *arg; + struct ifnet *ifp; { - ipf_sync(arg, NULL); + + CURVNET_SET(ifp->if_vnet); + ipf_sync(&V_ipfmain, NULL); + CURVNET_RESTORE(); } @@ -141,8 +139,10 @@ ipf_check_wrapper(void *arg, struct mbuf ip->ip_len = htons(ip->ip_len); ip->ip_off = htons(ip->ip_off); #endif - rv = ipf_check(&ipfmain, ip, ip->ip_hl << 2, ifp, (dir == PFIL_OUT), + CURVNET_SET(ifp->if_vnet); + rv = ipf_check(&V_ipfmain, ip, ip->ip_hl << 2, ifp, (dir == PFIL_OUT), mp); + CURVNET_RESTORE(); #if (__FreeBSD_version < 1000019) if ((rv == 0) && (*mp != NULL)) { ip = mtod(*mp, struct ip *); @@ -159,8 +159,13 @@ ipf_check_wrapper(void *arg, struct mbuf static int ipf_check_wrapper6(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir) { - return (ipf_check(&ipfmain, mtod(*mp, struct ip *), - sizeof(struct ip6_hdr), ifp, (dir == PFIL_OUT), mp)); + int error; + + CURVNET_SET(ifp->if_vnet); + error = ipf_check(&V_ipfmain, mtod(*mp, struct ip *), + sizeof(struct ip6_hdr), ifp, (dir == PFIL_OUT), mp); + CURVNET_RESTORE(); + return (error); } # endif #if defined(IPFILTER_LKM) @@ -221,12 +226,7 @@ ipfattach(softc) } - if (ipf_checkp != ipf_check) { - ipf_savep = ipf_checkp; - ipf_checkp = ipf_check; - } - - bzero((char *)ipfmain.ipf_selwait, sizeof(ipfmain.ipf_selwait)); + bzero((char *)V_ipfmain.ipf_selwait, sizeof(V_ipfmain.ipf_selwait)); softc->ipf_running = 1; if (softc->ipf_control_forwarding & 1) @@ -268,12 +268,6 @@ ipfdetach(softc) #endif callout_drain(&softc->ipf_slow_ch); -#ifndef NETBSD_PF - if (ipf_checkp != NULL) - ipf_checkp = ipf_savep; - ipf_savep = NULL; -#endif - ipf_fini_all(softc); softc->ipf_running = -2; @@ -304,27 +298,27 @@ ipfioctl(dev, cmd, data, mode #if (BSD >= 199306) if (securelevel_ge(p->p_cred, 3) && (mode & FWRITE)) { - ipfmain.ipf_interror = 130001; + V_ipfmain.ipf_interror = 130001; return EPERM; } #endif unit = GET_MINOR(dev); if ((IPL_LOGMAX < unit) || (unit < 0)) { - ipfmain.ipf_interror = 130002; + V_ipfmain.ipf_interror = 130002; return ENXIO; } - if (ipfmain.ipf_running <= 0) { + if (V_ipfmain.ipf_running <= 0) { if (unit != IPL_LOGIPF && cmd != SIOCIPFINTERROR) { - ipfmain.ipf_interror = 130003; + V_ipfmain.ipf_interror = 130003; return EIO; } if (cmd != SIOCIPFGETNEXT && cmd != SIOCIPFGET && cmd != SIOCIPFSET && cmd != SIOCFRENB && cmd != SIOCGETFS && cmd != SIOCGETFF && cmd != SIOCIPFINTERROR) { - ipfmain.ipf_interror = 130004; + V_ipfmain.ipf_interror = 130004; return EIO; } } @@ -332,7 +326,7 @@ ipfioctl(dev, cmd, data, mode SPL_NET(s); CURVNET_SET(TD_TO_VNET(p)); - error = ipf_ioctlswitch(&ipfmain, unit, data, cmd, mode, p->p_uid, p); + error = ipf_ioctlswitch(&V_ipfmain, unit, data, cmd, mode, p->p_uid, p); CURVNET_RESTORE(); if (error != -1) { SPL_X(s); @@ -580,7 +574,7 @@ ipf_send_icmp_err(type, fin, dst) } if (dst == 0) { - if (ipf_ifpaddr(&ipfmain, 4, FRI_NORMAL, ifp, + if (ipf_ifpaddr(&V_ipfmain, 4, FRI_NORMAL, ifp, &dst6, NULL) == -1) { FREE_MB_T(m); return -1; @@ -617,7 +611,7 @@ ipf_send_icmp_err(type, fin, dst) xtra = MIN(fin->fin_plen, avail - iclen - max_linkhdr); xtra = MIN(xtra, IPV6_MMTU - iclen); if (dst == 0) { - if (ipf_ifpaddr(&ipfmain, 6, FRI_NORMAL, ifp, + if (ipf_ifpaddr(&V_ipfmain, 6, FRI_NORMAL, ifp, &dst6, NULL) == -1) { FREE_MB_T(m); return -1; @@ -941,9 +935,9 @@ sendorfree: } done: if (!error) - ipfmain.ipf_frouteok[0]++; + V_ipfmain.ipf_frouteok[0]++; else - ipfmain.ipf_frouteok[1]++; + V_ipfmain.ipf_frouteok[1]++; if (has_nhop) fib4_free_nh_ext(fibnum, &nh4); @@ -1405,13 +1399,13 @@ void ipf_event_reg(void) { ipf_arrivetag = EVENTHANDLER_REGISTER(ifnet_arrival_event, \ - ipf_ifevent, &ipfmain, \ + ipf_ifevent, NULL, \ EVENTHANDLER_PRI_ANY); ipf_departtag = EVENTHANDLER_REGISTER(ifnet_departure_event, \ - ipf_ifevent, &ipfmain, \ + ipf_ifevent, NULL, \ EVENTHANDLER_PRI_ANY); ipf_clonetag = EVENTHANDLER_REGISTER(if_clone_event, ipf_ifevent, \ - &ipfmain, EVENTHANDLER_PRI_ANY); + NULL, EVENTHANDLER_PRI_ANY); } void Modified: projects/vnet/sys/contrib/ipfilter/netinet/ip_nat.c ============================================================================== --- projects/vnet/sys/contrib/ipfilter/netinet/ip_nat.c Sat Jun 25 12:54:27 2016 (r302198) +++ projects/vnet/sys/contrib/ipfilter/netinet/ip_nat.c Sat Jun 25 14:14:55 2016 (r302199) @@ -133,8 +133,6 @@ static const char rcsid[] = "@(#)$FreeBS #define NBUMPSIDEDF(y,x)do { softn->ipf_nat_stats.ns_side[y].x++; \ DT1(x, fr_info_t *, fin); } while (0) -frentry_t ipfnatblock; - static ipftuneable_t ipf_nat_tuneables[] = { /* nat */ { { (void *)offsetof(ipf_nat_softc_t, ipf_nat_lock) }, @@ -275,9 +273,6 @@ static void ipf_nat_tabmove __P((ipf_nat int ipf_nat_main_load() { - bzero((char *)&ipfnatblock, sizeof(ipfnatblock)); - ipfnatblock.fr_flags = FR_BLOCK|FR_QUICK; - ipfnatblock.fr_ref = 1; return 0; } Modified: projects/vnet/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c ============================================================================== --- projects/vnet/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c Sat Jun 25 12:54:27 2016 (r302198) +++ projects/vnet/sys/contrib/ipfilter/netinet/ip_rpcb_pxy.c Sat Jun 25 14:14:55 2016 (r302199) @@ -80,7 +80,9 @@ static void ipf_p_rpcb_fixlen __P((f */ static frentry_t rpcbfr; /* Skeleton rule for reference by entities this proxy creates. */ -static int rpcbcnt; /* Upper bound of allocated RPCB sessions. */ +static VNET_DEFINE(int, rpcbcnt); +#define V_rpcbcnt VNET(rpcbcnt) + /* Upper bound of allocated RPCB sessions. */ /* XXX rpcbcnt still requires locking. */ static int rpcb_proxy_init = 0; @@ -107,7 +109,7 @@ static int rpcb_proxy_init = 0; void ipf_p_rpcb_main_load() { - rpcbcnt = 0; + V_rpcbcnt = 0; bzero((char *)&rpcbfr, sizeof(rpcbfr)); rpcbfr.fr_ref = 1; @@ -581,7 +583,7 @@ ipf_p_rpcb_insert(rs, rx) return(0); } - if (rpcbcnt == RPCB_MAXREQS) + if (V_rpcbcnt == RPCB_MAXREQS) return(-1); KMALLOC(rxp, rpcb_xact_t *); @@ -599,7 +601,7 @@ ipf_p_rpcb_insert(rs, rx) rxp->rx_ref = 1; - ++rpcbcnt; + ++V_rpcbcnt; return(0); } @@ -1084,7 +1086,7 @@ ipf_p_rpcb_deref(rs, rx) KFREE(rx); - --rpcbcnt; + --V_rpcbcnt; } /* -------------------------------------------------------------------- */ Modified: projects/vnet/sys/contrib/ipfilter/netinet/ip_rules.c ============================================================================== --- projects/vnet/sys/contrib/ipfilter/netinet/ip_rules.c Sat Jun 25 12:54:27 2016 (r302198) +++ projects/vnet/sys/contrib/ipfilter/netinet/ip_rules.c Sat Jun 25 14:14:55 2016 (r302199) @@ -51,7 +51,8 @@ #ifdef IPFILTER_COMPILED -extern ipf_main_softc_t ipfmain; +VNET_DECLARE(ipf_main_softc_t, ipfmain); +#define V_ipfmain VNET(ipfmain) static u_long in_rule__0[] = { @@ -129,8 +130,8 @@ int ipfrule_add_out_() fp->fr_dsize = sizeof(ipf_rules_out_[0]); fp->fr_family = AF_INET; fp->fr_func = (ipfunc_t)ipfrule_match_out_; - err = frrequest(&ipfmain, IPL_LOGIPF, SIOCADDFR, (caddr_t)fp, - ipfmain.ipf_active, 0); + err = frrequest(&V_ipfmain, IPL_LOGIPF, SIOCADDFR, (caddr_t)fp, + V_ipfmain.ipf_active, 0); return err; } @@ -156,9 +157,9 @@ int ipfrule_remove_out_() } } if (err == 0) - err = frrequest(&ipfmain, IPL_LOGIPF, SIOCDELFR, + err = frrequest(&V_ipfmain, IPL_LOGIPF, SIOCDELFR, (caddr_t)&ipfrule_out_, - ipfmain.ipf_active, 0); + V_ipfmain.ipf_active, 0); if (err) return err; @@ -198,8 +199,8 @@ int ipfrule_add_in_() fp->fr_dsize = sizeof(ipf_rules_in_[0]); fp->fr_family = AF_INET; fp->fr_func = (ipfunc_t)ipfrule_match_in_; - err = frrequest(&ipfmain, IPL_LOGIPF, SIOCADDFR, (caddr_t)fp, - ipfmain.ipf_active, 0); + err = frrequest(&V_ipfmain, IPL_LOGIPF, SIOCADDFR, (caddr_t)fp, + V_ipfmain.ipf_active, 0); return err; } @@ -225,9 +226,9 @@ int ipfrule_remove_in_() } } if (err == 0) - err = frrequest(&ipfmain, IPL_LOGIPF, SIOCDELFR, + err = frrequest(&V_ipfmain, IPL_LOGIPF, SIOCDELFR, (caddr_t)&ipfrule_in_, - ipfmain.ipf_active, 0); + V_ipfmain.ipf_active, 0); if (err) return err; Modified: projects/vnet/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- projects/vnet/sys/contrib/ipfilter/netinet/mlfk_ipl.c Sat Jun 25 12:54:27 2016 (r302198) +++ projects/vnet/sys/contrib/ipfilter/netinet/mlfk_ipl.c Sat Jun 25 14:14:55 2016 (r302199) @@ -18,6 +18,7 @@ #include #if __FreeBSD_version >= 500000 # include +# include #endif #include #include @@ -33,7 +34,8 @@ #include "netinet/ip_frag.h" #include "netinet/ip_sync.h" -extern ipf_main_softc_t ipfmain; +VNET_DECLARE(ipf_main_softc_t, ipfmain); +#define V_ipfmain VNET(ipfmain) #if __FreeBSD_version >= 502116 static struct cdev *ipf_devs[IPL_LOGSIZE]; @@ -70,40 +72,41 @@ static int ipfwrite __P((dev_t, struct u SYSCTL_DECL(_net_inet); #define SYSCTL_IPF(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \ - ptr, val, sysctl_ipf_int, "I", descr); + SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|CTLFLAG_VNET|access, \ + ptr, val, sysctl_ipf_int, "I", descr) #define SYSCTL_DYN_IPF(parent, nbr, name, access,ptr, val, descr) \ - SYSCTL_ADD_OID(&ipf_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \ - CTLFLAG_DYN|CTLTYPE_INT|access, ptr, val, sysctl_ipf_int, "I", descr) -static struct sysctl_ctx_list ipf_clist; + SYSCTL_ADD_OID(&V_ipf_clist, SYSCTL_STATIC_CHILDREN(parent), nbr, name, \ + CTLFLAG_DYN|CTLTYPE_INT|CTLFLAG_VNET|access, ptr, val, sysctl_ipf_int, "I", descr) +static VNET_DEFINE(struct sysctl_ctx_list, ipf_clist); +#define V_ipf_clist VNET(ipf_clist) #define CTLFLAG_OFF 0x00800000 /* IPFilter must be disabled */ #define CTLFLAG_RWO (CTLFLAG_RW|CTLFLAG_OFF) SYSCTL_NODE(_net_inet, OID_AUTO, ipf, CTLFLAG_RW, 0, "IPF"); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_flags, CTLFLAG_RW, &ipfmain.ipf_flags, 0, "IPF flags"); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_pass, CTLFLAG_RW, &ipfmain.ipf_pass, 0, "default pass/block"); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_active, CTLFLAG_RD, &ipfmain.ipf_active, 0, "IPF is active"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_flags, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_flags), 0, "IPF flags"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, ipf_pass, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_pass), 0, "default pass/block"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_active, CTLFLAG_RD, &VNET_NAME(ipfmain.ipf_active), 0, "IPF is active"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcpidletimeout, CTLFLAG_RWO, - &ipfmain.ipf_tcpidletimeout, 0, "TCP idle timeout in seconds"); + &VNET_NAME(ipfmain.ipf_tcpidletimeout), 0, "TCP idle timeout in seconds"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcphalfclosed, CTLFLAG_RWO, - &ipfmain.ipf_tcphalfclosed, 0, "timeout for half closed TCP sessions"); + &VNET_NAME(ipfmain.ipf_tcphalfclosed), 0, "timeout for half closed TCP sessions"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcpclosewait, CTLFLAG_RWO, - &ipfmain.ipf_tcpclosewait, 0, "timeout for TCP sessions in closewait status"); + &VNET_NAME(ipfmain.ipf_tcpclosewait), 0, "timeout for TCP sessions in closewait status"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcplastack, CTLFLAG_RWO, - &ipfmain.ipf_tcplastack, 0, "timeout for TCP sessions in last ack status"); + &VNET_NAME(ipfmain.ipf_tcplastack), 0, "timeout for TCP sessions in last ack status"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcptimeout, CTLFLAG_RWO, - &ipfmain.ipf_tcptimeout, 0, ""); + &VNET_NAME(ipfmain.ipf_tcptimeout), 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_tcpclosed, CTLFLAG_RWO, - &ipfmain.ipf_tcpclosed, 0, ""); + &VNET_NAME(ipfmain.ipf_tcpclosed), 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_udptimeout, CTLFLAG_RWO, - &ipfmain.ipf_udptimeout, 0, "UDP timeout"); + &VNET_NAME(ipfmain.ipf_udptimeout), 0, "UDP timeout"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_udpacktimeout, CTLFLAG_RWO, - &ipfmain.ipf_udpacktimeout, 0, ""); + &VNET_NAME(ipfmain.ipf_udpacktimeout), 0, ""); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_icmptimeout, CTLFLAG_RWO, - &ipfmain.ipf_icmptimeout, 0, "ICMP timeout"); + &VNET_NAME(ipfmain.ipf_icmptimeout), 0, "ICMP timeout"); SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_running, CTLFLAG_RD, - &ipfmain.ipf_running, 0, "IPF is running"); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_chksrc, CTLFLAG_RW, &ipfmain.ipf_chksrc, 0, ""); -SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &ipfmain.ipf_minttl, 0, ""); + &VNET_NAME(ipfmain.ipf_running), 0, "IPF is running"); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_chksrc, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_chksrc), 0, ""); +SYSCTL_IPF(_net_inet_ipf, OID_AUTO, fr_minttl, CTLFLAG_RW, &VNET_NAME(ipfmain.ipf_minttl), 0, ""); #define CDEV_MAJOR 79 #include @@ -178,28 +181,63 @@ ipfilter_modevent(module_t mod, int type } +static void +vnet_ipf_init(void) +{ + char *defpass; + int error; + + if (ipf_create_all(&V_ipfmain) == NULL) + return; + + if (ipf_fbsd_sysctl_create(&V_ipfmain) != 0) { + ipf_destroy_all(&V_ipfmain); + return; + } + + error = ipfattach(&V_ipfmain); + if (error) { + (void)ipf_fbsd_sysctl_destroy(&V_ipfmain); + ipf_destroy_all(&V_ipfmain); + return; + } + + if (FR_ISPASS(V_ipfmain.ipf_pass)) + defpass = "pass"; + else if (FR_ISBLOCK(V_ipfmain.ipf_pass)) + defpass = "block"; + else + defpass = "no-match -> block"; + + if (IS_DEFAULT_VNET(curvnet)) + printf("%s initialized. Default = %s all, Logging = %s%s\n", + ipfilter_version, defpass, +#ifdef IPFILTER_LOG + "enabled", +#else + "disabled", +#endif +#ifdef IPFILTER_COMPILED + " (COMPILED)" +#else + "" +#endif + ); +} +VNET_SYSINIT(vnet_ipf_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, + vnet_ipf_init, NULL); + static int ipf_modload() { - char *defpass, *c, *str; + char *c, *str; int i, j, error; if (ipf_load_all() != 0) return EIO; - if (ipf_create_all(&ipfmain) == NULL) - return EIO; - - if (ipf_fbsd_sysctl_create(&ipfmain) != 0) - return EIO; - - error = ipfattach(&ipfmain); - if (error) - return error; - for (i = 0; i < IPL_LOGSIZE; i++) ipf_devs[i] = NULL; - for (i = 0; (str = ipf_devfiles[i]); i++) { c = NULL; for(j = strlen(str); j > 0; j--) @@ -217,63 +255,50 @@ ipf_modload() return error; ipf_event_reg(); - if (FR_ISPASS(ipfmain.ipf_pass)) - defpass = "pass"; - else if (FR_ISBLOCK(ipfmain.ipf_pass)) - defpass = "block"; - else - defpass = "no-match -> block"; - - printf("%s initialized. Default = %s all, Logging = %s%s\n", - ipfilter_version, defpass, -#ifdef IPFILTER_LOG - "enabled", -#else - "disabled", -#endif -#ifdef IPFILTER_COMPILED - " (COMPILED)" -#else - "" -#endif - ); return 0; } +static void +vnet_ipf_uninit(void) +{ + + if (V_ipfmain.ipf_refcnt) + return; + + if (ipf_fbsd_sysctl_destroy(&V_ipfmain) != 0) + return; + + if (V_ipfmain.ipf_running >= 0) { + if (ipfdetach(&V_ipfmain) != 0) + return; + + ipf_fbsd_sysctl_destroy(&V_ipfmain); + ipf_destroy_all(&V_ipfmain); + } + + V_ipfmain.ipf_running = -2; +} +VNET_SYSUNINIT(vnet_ipf_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, + vnet_ipf_uninit, NULL); static int ipf_modunload() { int error, i; - if (ipfmain.ipf_refcnt) - return EBUSY; - - if (ipf_fbsd_sysctl_destroy(&ipfmain) != 0) - return EIO; + ipf_event_dereg(); error = ipf_pfil_unhook(); if (error != 0) return error; - if (ipfmain.ipf_running >= 0) { - error = ipfdetach(&ipfmain); - if (error != 0) - return error; - - ipf_fbsd_sysctl_destroy(&ipfmain); - ipf_destroy_all(&ipfmain); - ipf_unload_all(); - } else - error = 0; - - ipfmain.ipf_running = -2; - for (i = 0; ipf_devfiles[i]; i++) { if (ipf_devs[i] != NULL) destroy_dev(ipf_devs[i]); } + ipf_unload_all(); + printf("%s unloaded\n", ipfilter_version); return error; @@ -287,7 +312,7 @@ static moduledata_t ipfiltermod = { }; -DECLARE_MODULE(ipfilter, ipfiltermod, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY); +DECLARE_MODULE(ipfilter, ipfiltermod, SI_SUB_PROTO_FIREWALL, SI_ORDER_SECOND); #ifdef MODULE_VERSION MODULE_VERSION(ipfilter, 1); #endif @@ -310,7 +335,7 @@ sysctl_ipf_int ( SYSCTL_HANDLER_ARGS ) if (!arg1) error = EPERM; else { - if ((oidp->oid_kind & CTLFLAG_OFF) && (ipfmain.ipf_running > 0)) + if ((oidp->oid_kind & CTLFLAG_OFF) && (V_ipfmain.ipf_running > 0)) error = EBUSY; else error = SYSCTL_IN(req, arg1, sizeof(int)); @@ -335,24 +360,25 @@ ipfpoll(dev_t dev, int events, struct pr revents = 0; + CURVNET_SET(TD_TO_VNET(td)); switch (unit) { case IPL_LOGIPF : case IPL_LOGNAT : case IPL_LOGSTATE : #ifdef IPFILTER_LOG - if ((events & (POLLIN | POLLRDNORM)) && ipf_log_canread(&ipfmain, unit)) + if ((events & (POLLIN | POLLRDNORM)) && ipf_log_canread(&V_ipfmain, unit)) revents |= events & (POLLIN | POLLRDNORM); #endif break; case IPL_LOGAUTH : - if ((events & (POLLIN | POLLRDNORM)) && ipf_auth_waiting(&ipfmain)) + if ((events & (POLLIN | POLLRDNORM)) && ipf_auth_waiting(&V_ipfmain)) revents |= events & (POLLIN | POLLRDNORM); break; case IPL_LOGSYNC : - if ((events & (POLLIN | POLLRDNORM)) && ipf_sync_canread(&ipfmain)) + if ((events & (POLLIN | POLLRDNORM)) && ipf_sync_canread(&V_ipfmain)) revents |= events & (POLLIN | POLLRDNORM); - if ((events & (POLLOUT | POLLWRNORM)) && ipf_sync_canwrite(&ipfmain)) + if ((events & (POLLOUT | POLLWRNORM)) && ipf_sync_canwrite(&V_ipfmain)) revents |= events & (POLLOUT | POLLWRNORM); break; case IPL_LOGSCAN : @@ -362,7 +388,8 @@ ipfpoll(dev_t dev, int events, struct pr } if ((revents == 0) && ((events & (POLLIN|POLLRDNORM)) != 0)) - selrecord(td, &ipfmain.ipf_selwait[unit]); + selrecord(td, &V_ipfmain.ipf_selwait[unit]); + CURVNET_RESTORE(); return revents; } @@ -465,22 +492,31 @@ static int ipfread(dev, uio) #endif struct uio *uio; { + int error; int unit = GET_MINOR(dev); if (unit < 0) return ENXIO; - if (ipfmain.ipf_running < 1) + CURVNET_SET(CRED_TO_VNET(dev->si_cred)); + if (V_ipfmain.ipf_running < 1) { + CURVNET_RESTORE(); return EIO; + } - if (unit == IPL_LOGSYNC) - return ipf_sync_read(&ipfmain, uio); + if (unit == IPL_LOGSYNC) { + error = ipf_sync_read(&V_ipfmain, uio); + CURVNET_RESTORE(); + return error; + } #ifdef IPFILTER_LOG - return ipf_log_read(&ipfmain, unit, uio); + error = ipf_log_read(&V_ipfmain, unit, uio); #else - return ENXIO; + error = ENXIO; #endif + CURVNET_RESTORE(); + return error; } @@ -503,12 +539,19 @@ static int ipfwrite(dev, uio) #endif struct uio *uio; { + int error; - if (ipfmain.ipf_running < 1) + CURVNET_SET(CRED_TO_VNET(dev->si_cred)); + if (V_ipfmain.ipf_running < 1) { + CURVNET_RESTORE(); return EIO; + } - if (GET_MINOR(dev) == IPL_LOGSYNC) - return ipf_sync_write(&ipfmain, uio); + if (GET_MINOR(dev) == IPL_LOGSYNC) { + error = ipf_sync_write(&V_ipfmain, uio); + CURVNET_RESTORE(); + return error; + } return ENXIO; } @@ -526,7 +569,7 @@ ipf_fbsd_sysctl_create(main_softc) auth_softc = main_softc->ipf_auth_soft; frag_softc = main_softc->ipf_frag_soft; - sysctl_ctx_init(&ipf_clist); + sysctl_ctx_init(&V_ipf_clist); SYSCTL_DYN_IPF(_net_inet_ipf, OID_AUTO, "fr_defnatage", CTLFLAG_RWO, &nat_softc->ipf_nat_defage, 0, ""); @@ -559,7 +602,7 @@ static int ipf_fbsd_sysctl_destroy(main_softc) ipf_main_softc_t *main_softc; { - if (sysctl_ctx_free(&ipf_clist)) { + if (sysctl_ctx_free(&V_ipf_clist)) { printf("sysctl_ctx_free failed"); return(ENOTEMPTY); } From owner-svn-src-projects@freebsd.org Sat Jun 25 14:20:38 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BD97B82E0E for ; Sat, 25 Jun 2016 14:20:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AB891BEB; Sat, 25 Jun 2016 14:20:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5PEKbFi065960; Sat, 25 Jun 2016 14:20:37 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5PEKYpE065931; Sat, 25 Jun 2016 14:20:34 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606251420.u5PEKYpE065931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 25 Jun 2016 14:20:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302200 - in projects/vnet: crypto/openssh etc lib/libthr/thread lib/libusb release/doc/en_US.ISO8859-1/relnotes release/tools sbin/sysctl secure/usr.sbin/sshd share/man/man5 share/man/... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 14:20:38 -0000 Author: bz Date: Sat Jun 25 14:20:34 2016 New Revision: 302200 URL: https://svnweb.freebsd.org/changeset/base/302200 Log: MfH @r302199 Sponsored by: The FreeBSD Foundation Deleted: projects/vnet/crypto/openssh/blacklist.c projects/vnet/crypto/openssh/blacklist_client.h projects/vnet/sys/mips/sentry5/files.sentry5 projects/vnet/sys/mips/sentry5/obio.c projects/vnet/sys/mips/sentry5/obiovar.h projects/vnet/sys/mips/sentry5/s5_machdep.c projects/vnet/sys/mips/sentry5/s5reg.h projects/vnet/sys/mips/sentry5/std.sentry5 projects/vnet/sys/mips/sentry5/uart_bus_sbusart.c projects/vnet/sys/mips/sentry5/uart_cpu_sbusart.c Modified: projects/vnet/crypto/openssh/auth-pam.c projects/vnet/crypto/openssh/auth.c projects/vnet/crypto/openssh/auth1.c projects/vnet/crypto/openssh/auth2.c projects/vnet/crypto/openssh/packet.c projects/vnet/crypto/openssh/sshd.c projects/vnet/etc/netstart projects/vnet/lib/libthr/thread/thr_mutex.c projects/vnet/lib/libusb/libusb.h projects/vnet/lib/libusb/libusb10.h projects/vnet/release/doc/en_US.ISO8859-1/relnotes/article.xml projects/vnet/release/tools/ec2.conf projects/vnet/sbin/sysctl/sysctl.c projects/vnet/secure/usr.sbin/sshd/Makefile projects/vnet/secure/usr.sbin/sshd/Makefile.depend projects/vnet/share/man/man5/src.conf.5 projects/vnet/share/man/man9/pci.9 projects/vnet/share/mk/bsd.prog.mk projects/vnet/share/mk/src.opts.mk projects/vnet/sys/cam/cam_iosched.c projects/vnet/sys/conf/newvers.sh projects/vnet/sys/conf/options projects/vnet/sys/dev/bhnd/bcma/bcma.c projects/vnet/sys/dev/bhnd/bcma/bcma_subr.c projects/vnet/sys/dev/bhnd/bcma/bcmavar.h projects/vnet/sys/dev/bhnd/bhnd.c projects/vnet/sys/dev/bhnd/bhnd_bus_if.m projects/vnet/sys/dev/bhnd/bhnd_subr.c projects/vnet/sys/dev/bhnd/bhndvar.h projects/vnet/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m projects/vnet/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c projects/vnet/sys/dev/bhnd/cores/chipc/chipc.c projects/vnet/sys/dev/bhnd/cores/chipc/chipc_cfi.c projects/vnet/sys/dev/bhnd/cores/chipc/chipc_private.h projects/vnet/sys/dev/bhnd/cores/chipc/chipc_slicer.c projects/vnet/sys/dev/bhnd/cores/chipc/chipc_slicer.h projects/vnet/sys/dev/bhnd/cores/chipc/chipc_spi.c projects/vnet/sys/dev/bhnd/cores/chipc/chipc_spi.h projects/vnet/sys/dev/bhnd/cores/chipc/chipc_subr.c projects/vnet/sys/dev/bhnd/cores/chipc/chipcreg.h projects/vnet/sys/dev/bhnd/cores/chipc/chipcvar.h projects/vnet/sys/dev/bhnd/siba/siba.c projects/vnet/sys/dev/bhnd/siba/siba_subr.c projects/vnet/sys/dev/bhnd/siba/sibavar.h projects/vnet/sys/dev/pci/pci.c projects/vnet/sys/dev/pci/pcivar.h projects/vnet/sys/dev/urtwn/if_urtwn.c projects/vnet/sys/fs/nfsclient/nfs_clnode.c projects/vnet/sys/kern/kern_thr.c projects/vnet/sys/mips/atheros/ar71xx_chip.c projects/vnet/sys/mips/atheros/ar71xx_machdep.c projects/vnet/sys/mips/atheros/ar724x_chip.c projects/vnet/sys/mips/atheros/ar91xx_chip.c projects/vnet/sys/mips/broadcom/bcm_machdep.c projects/vnet/sys/mips/broadcom/bcm_socinfo.c projects/vnet/sys/mips/broadcom/bcm_socinfo.h projects/vnet/sys/mips/broadcom/std.broadcom projects/vnet/sys/mips/broadcom/uart_bus_chipc.c projects/vnet/sys/mips/broadcom/uart_cpu_chipc.c projects/vnet/sys/mips/conf/BCM projects/vnet/sys/mips/conf/BCM.hints projects/vnet/sys/mips/conf/SENTRY5 projects/vnet/sys/mips/conf/SENTRY5.hints projects/vnet/sys/sys/bitstring.h projects/vnet/sys/sys/proc.h projects/vnet/sys/x86/x86/msi.c projects/vnet/tests/sys/sys/bitstring_test.c projects/vnet/usr.bin/gcore/elfcore.c projects/vnet/usr.bin/sockstat/sockstat.c projects/vnet/usr.sbin/gstat/gstat.c Directory Properties: projects/vnet/ (props changed) projects/vnet/crypto/openssh/ (props changed) projects/vnet/sys/contrib/ipfilter/ (props changed) Modified: projects/vnet/crypto/openssh/auth-pam.c ============================================================================== --- projects/vnet/crypto/openssh/auth-pam.c Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/crypto/openssh/auth-pam.c Sat Jun 25 14:20:34 2016 (r302200) @@ -98,9 +98,6 @@ #include "ssh-gss.h" #endif #include "monitor_wrap.h" -#ifdef USE_BLACKLIST -#include "blacklist_client.h" -#endif extern ServerOptions options; extern Buffer loginmsg; @@ -797,9 +794,6 @@ sshpam_query(void *ctx, char **name, cha free(msg); return (0); } -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif error("PAM: %s for %s%.100s from %.100s", msg, sshpam_authctxt->valid ? "" : "illegal user ", sshpam_authctxt->user, Modified: projects/vnet/crypto/openssh/auth.c ============================================================================== --- projects/vnet/crypto/openssh/auth.c Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/crypto/openssh/auth.c Sat Jun 25 14:20:34 2016 (r302200) @@ -75,9 +75,6 @@ __RCSID("$FreeBSD$"); #include "authfile.h" #include "ssherr.h" #include "compat.h" -#ifdef USE_BLACKLIST -#include "blacklist_client.h" -#endif /* import */ extern ServerOptions options; @@ -309,10 +306,6 @@ auth_log(Authctxt *authctxt, int authent compat20 ? "ssh2" : "ssh1", authctxt->info != NULL ? ": " : "", authctxt->info != NULL ? authctxt->info : ""); -#ifdef USE_BLACKLIST - if (!authctxt->postponed) - blacklist_notify(!authenticated); -#endif free(authctxt->info); authctxt->info = NULL; @@ -647,9 +640,6 @@ getpwnamallow(const char *user) } #endif if (pw == NULL) { -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif logit("Invalid user %.100s from %.100s", user, get_remote_ipaddr()); #ifdef CUSTOM_FAILED_LOGIN Modified: projects/vnet/crypto/openssh/auth1.c ============================================================================== --- projects/vnet/crypto/openssh/auth1.c Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/crypto/openssh/auth1.c Sat Jun 25 14:20:34 2016 (r302200) @@ -43,9 +43,6 @@ #endif #include "monitor_wrap.h" #include "buffer.h" -#ifdef USE_BLACKLIST -#include "blacklist_client.h" -#endif /* import */ extern ServerOptions options; @@ -340,9 +337,6 @@ do_authloop(Authctxt *authctxt) char *msg; size_t len; -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif error("Access denied for user %s by PAM account " "configuration", authctxt->user); len = buffer_len(&loginmsg); @@ -410,9 +404,6 @@ do_authentication(Authctxt *authctxt) else { debug("do_authentication: invalid user %s", user); authctxt->pw = fakepw(); -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif } /* Configuration may have changed as a result of Match */ Modified: projects/vnet/crypto/openssh/auth2.c ============================================================================== --- projects/vnet/crypto/openssh/auth2.c Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/crypto/openssh/auth2.c Sat Jun 25 14:20:34 2016 (r302200) @@ -52,9 +52,6 @@ __RCSID("$FreeBSD$"); #include "pathnames.h" #include "buffer.h" #include "canohost.h" -#ifdef USE_BLACKLIST -#include "blacklist_client.h" -#endif #ifdef GSSAPI #include "ssh-gss.h" @@ -251,9 +248,6 @@ input_userauth_request(int type, u_int32 } else { logit("input_userauth_request: invalid user %s", user); authctxt->pw = fakepw(); -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif #ifdef SSH_AUDIT_EVENTS PRIVSEP(audit_event(SSH_INVALID_USER)); #endif Modified: projects/vnet/crypto/openssh/packet.c ============================================================================== --- projects/vnet/crypto/openssh/packet.c Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/crypto/openssh/packet.c Sat Jun 25 14:20:34 2016 (r302200) @@ -86,9 +86,6 @@ __RCSID("$FreeBSD$"); #include "packet.h" #include "ssherr.h" #include "sshbuf.h" -#ifdef USE_BLACKLIST -#include "blacklist_client.h" -#endif #ifdef PACKET_DEBUG #define DBG(x) x @@ -2074,9 +2071,6 @@ sshpkt_fatal(struct ssh *ssh, const char case SSH_ERR_NO_KEX_ALG_MATCH: case SSH_ERR_NO_HOSTKEY_ALG_MATCH: if (ssh && ssh->kex && ssh->kex->failed_choice) { -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif fatal("Unable to negotiate with %.200s port %d: %s. " "Their offer: %s", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), ssh_err(r), Modified: projects/vnet/crypto/openssh/sshd.c ============================================================================== --- projects/vnet/crypto/openssh/sshd.c Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/crypto/openssh/sshd.c Sat Jun 25 14:20:34 2016 (r302200) @@ -135,9 +135,6 @@ __RCSID("$FreeBSD$"); #include "ssh-sandbox.h" #include "version.h" #include "ssherr.h" -#ifdef USE_BLACKLIST -#include "blacklist_client.h" -#endif #ifdef LIBWRAP #include @@ -391,9 +388,6 @@ grace_alarm_handler(int sig) kill(0, SIGTERM); } -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif /* Log error and exit. */ sigdie("Timeout before authentication for %s", get_remote_ipaddr()); } @@ -655,10 +649,6 @@ privsep_preauth_child(void) /* Demote the private keys to public keys. */ demote_sensitive_data(); -#ifdef USE_BLACKLIST - blacklist_init(); -#endif - /* Demote the child */ if (getuid() == 0 || geteuid() == 0) { /* Change our root directory */ @@ -1282,9 +1272,6 @@ server_accept_loop(int *sock_in, int *so for (i = 0; i < options.max_startups; i++) startup_pipes[i] = -1; -#ifdef USE_BLACKLIST - blacklist_init(); -#endif /* * Stay listening for connections until the system crashes or * the daemon is killed with a signal. Modified: projects/vnet/etc/netstart ============================================================================== --- projects/vnet/etc/netstart Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/etc/netstart Sat Jun 25 14:20:34 2016 (r302200) @@ -52,7 +52,6 @@ _start=quietstart /etc/rc.d/ppp ${_start} /etc/rc.d/ipfw ${_start} /etc/rc.d/routing ${_start} -/etc/rc.d/mroute6d ${_start} /etc/rc.d/route6d ${_start} /etc/rc.d/routed ${_start} /etc/rc.d/rtsold ${_start} Modified: projects/vnet/lib/libthr/thread/thr_mutex.c ============================================================================== --- projects/vnet/lib/libthr/thread/thr_mutex.c Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/lib/libthr/thread/thr_mutex.c Sat Jun 25 14:20:34 2016 (r302200) @@ -850,9 +850,12 @@ mutex_self_trylock(struct pthread_mutex switch (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: - case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_ADAPTIVE_NP: - ret = EBUSY; + ret = EDEADLK; + break; + + case PTHREAD_MUTEX_NORMAL: + ret = EBUSY; break; case PTHREAD_MUTEX_RECURSIVE: Modified: projects/vnet/lib/libusb/libusb.h ============================================================================== --- projects/vnet/lib/libusb/libusb.h Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/lib/libusb/libusb.h Sat Jun 25 14:20:34 2016 (r302200) @@ -254,7 +254,7 @@ struct libusb_context; struct libusb_device; struct libusb_transfer; struct libusb_device_handle; -struct libusb_hotplug_callback_handle; +struct libusb_hotplug_callback_handle_struct; struct libusb_pollfd { int fd; @@ -276,7 +276,7 @@ typedef struct libusb_device_handle libu typedef struct libusb_pollfd libusb_pollfd; typedef void (*libusb_pollfd_added_cb) (int fd, short events, void *user_data); typedef void (*libusb_pollfd_removed_cb) (int fd, void *user_data); -typedef struct libusb_hotplug_callback_handle *libusb_hotplug_callback_handle; +typedef struct libusb_hotplug_callback_handle_struct *libusb_hotplug_callback_handle; typedef struct libusb_device_descriptor { uint8_t bLength; Modified: projects/vnet/lib/libusb/libusb10.h ============================================================================== --- projects/vnet/lib/libusb/libusb10.h Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/lib/libusb/libusb10.h Sat Jun 25 14:20:34 2016 (r302200) @@ -75,8 +75,8 @@ struct libusb_super_transfer { #define LIBUSB_SUPER_XFER_ST_PEND 1 }; -struct libusb_hotplug_callback_handle { - TAILQ_ENTRY(libusb_hotplug_callback_handle) entry; +struct libusb_hotplug_callback_handle_struct { + TAILQ_ENTRY(libusb_hotplug_callback_handle_struct) entry; int events; int vendor; int product; @@ -101,7 +101,7 @@ struct libusb_context { TAILQ_HEAD(, libusb_super_pollfd) pollfds; TAILQ_HEAD(, libusb_super_transfer) tr_done; - TAILQ_HEAD(, libusb_hotplug_callback_handle) hotplug_cbh; + TAILQ_HEAD(, libusb_hotplug_callback_handle_struct) hotplug_cbh; TAILQ_HEAD(, libusb_device) hotplug_devs; struct libusb_super_pollfd ctx_poll; Modified: projects/vnet/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- projects/vnet/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/release/doc/en_US.ISO8859-1/relnotes/article.xml Sat Jun 25 14:20:34 2016 (r302200) @@ -621,9 +621,8 @@ A selection of system daemons, including: fingerd, ftpd, - rlogind, - rshd, and - sshd have been modified to support + rlogind, and + rshd have been modified to support sending notifications to the blacklistd daemon. Modified: projects/vnet/release/tools/ec2.conf ============================================================================== --- projects/vnet/release/tools/ec2.conf Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/release/tools/ec2.conf Sat Jun 25 14:20:34 2016 (r302200) @@ -77,6 +77,12 @@ vm_extra_pre_umount() { # by default for now. echo 'hw.xbd.xbd_enable_indirect="0"' >> ${DESTDIR}/boot/loader.conf + # Some EC2 instances run on a version of Xen which has a bug relating + # to the migration of MSI-X interrupts; this is visible as SR-IOV + # networking (aka. "EC2 Enhanced Networking") not being able to pass + # packets. Disable MSI-X interrupt migration to work around this bug. + echo 'machdep.disable_msix_migration="1"' >> ${DESTDIR}/boot/loader.conf + # The first time the AMI boots, the installed "first boot" scripts # should be allowed to run: # * ec2_configinit (download and process EC2 user-data) Modified: projects/vnet/sbin/sysctl/sysctl.c ============================================================================== --- projects/vnet/sbin/sysctl/sysctl.c Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/sbin/sysctl/sysctl.c Sat Jun 25 14:20:34 2016 (r302200) @@ -623,15 +623,15 @@ S_vmtotal(size_t l2, void *p) "%hd Sleep: %hd)\n", v->t_rq, v->t_dw, v->t_pw, v->t_sl); printf( - "Virtual Memory:\t\t(Total: %dK Active: %dK)\n", - v->t_vm * pageKilo, v->t_avm * pageKilo); - printf("Real Memory:\t\t(Total: %dK Active: %dK)\n", - v->t_rm * pageKilo, v->t_arm * pageKilo); - printf("Shared Virtual Memory:\t(Total: %dK Active: %dK)\n", - v->t_vmshr * pageKilo, v->t_avmshr * pageKilo); - printf("Shared Real Memory:\t(Total: %dK Active: %dK)\n", - v->t_rmshr * pageKilo, v->t_armshr * pageKilo); - printf("Free Memory:\t%dK", v->t_free * pageKilo); + "Virtual Memory:\t\t(Total: %jdK Active: %jdK)\n", + (intmax_t)v->t_vm * pageKilo, (intmax_t)v->t_avm * pageKilo); + printf("Real Memory:\t\t(Total: %jdK Active: %jdK)\n", + (intmax_t)v->t_rm * pageKilo, (intmax_t)v->t_arm * pageKilo); + printf("Shared Virtual Memory:\t(Total: %jdK Active: %jdK)\n", + (intmax_t)v->t_vmshr * pageKilo, (intmax_t)v->t_avmshr * pageKilo); + printf("Shared Real Memory:\t(Total: %jdK Active: %jdK)\n", + (intmax_t)v->t_rmshr * pageKilo, (intmax_t)v->t_armshr * pageKilo); + printf("Free Memory:\t%jdK", (intmax_t)v->t_free * pageKilo); return (0); } Modified: projects/vnet/secure/usr.sbin/sshd/Makefile ============================================================================== --- projects/vnet/secure/usr.sbin/sshd/Makefile Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/secure/usr.sbin/sshd/Makefile Sat Jun 25 14:20:34 2016 (r302200) @@ -40,13 +40,6 @@ CFLAGS+= -DUSE_BSM_AUDIT -DHAVE_GETAUDIT LIBADD+= bsm .endif -.if ${MK_BLACKLIST_SUPPORT} != "no" -CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blacklist/include -SRCS+= blacklist.c -LIBADD+= blacklist -LDFLAGS+=-L${LIBBLACKLISTDIR} -.endif - .if ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h Modified: projects/vnet/secure/usr.sbin/sshd/Makefile.depend ============================================================================== --- projects/vnet/secure/usr.sbin/sshd/Makefile.depend Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/secure/usr.sbin/sshd/Makefile.depend Sat Jun 25 14:20:34 2016 (r302200) @@ -17,7 +17,6 @@ DIRDEPS = \ kerberos5/lib/libroken \ kerberos5/lib/libwind \ lib/${CSU_DIR} \ - lib/libblacklist \ lib/libbsm \ lib/libc \ lib/libcom_err \ Modified: projects/vnet/share/man/man5/src.conf.5 ============================================================================== --- projects/vnet/share/man/man5/src.conf.5 Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/share/man/man5/src.conf.5 Sat Jun 25 14:20:34 2016 (r302200) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd June 14, 2016 +.Dd June 24, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -536,6 +536,10 @@ When set, it also enforces the following When set, the following options are also in effect: .Pp .Bl -inset -compact +.It Va WITHOUT_SYSTEM_COMPILER +(unless +.Va WITH_SYSTEM_COMPILER +is set explicitly) .It Va WITH_AUTO_OBJ (unless .Va WITHOUT_AUTO_OBJ @@ -1134,6 +1138,14 @@ to .Pp Currently this also enforces .Va WITHOUT_SYSTEM_COMPILER . +When set, the following options are also in effect: +.Pp +.Bl -inset -compact +.It Va WITHOUT_SYSTEM_COMPILER +(unless +.Va WITH_SYSTEM_COMPILER +is set explicitly) +.El .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , @@ -1434,12 +1446,12 @@ This must be set in the environment, mak .Pa /etc/src-env.conf , not .Pa /etc/src.conf . -.It Va WITH_SYSTEM_COMPILER -.\" from FreeBSD: head/tools/build/options/WITH_SYSTEM_COMPILER 300354 2016-05-21 01:32:23Z bdrewery -Set to opportunistically skip building a cross-compiler during the +.It Va WITHOUT_SYSTEM_COMPILER +.\" from FreeBSD: head/tools/build/options/WITHOUT_SYSTEM_COMPILER 300354 2016-05-21 01:32:23Z bdrewery +Set to not opportunistically skip building a cross-compiler during the bootstrap phase of the build. -If the currently installed compiler matches the planned bootstrap compiler -type and revision, then it will not be built. +Normally, if the currently installed compiler matches the planned bootstrap +compiler type and revision, then it will not be built. This does not prevent a compiler from being built for installation though, only for building one for the build itself. The Modified: projects/vnet/share/man/man9/pci.9 ============================================================================== --- projects/vnet/share/man/man9/pci.9 Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/share/man/man9/pci.9 Sat Jun 25 14:20:34 2016 (r302200) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2016 +.Dd June 24, 2016 .Dt PCI 9 .Os .Sh NAME @@ -44,6 +44,7 @@ .Nm pci_find_htcap , .Nm pci_find_pcie_root_port , .Nm pci_get_id , +.Nm pci_get_max_payload , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -100,6 +101,8 @@ .Ft int .Fn pci_get_id "device_t dev" "enum pci_id_type type" "uintptr_t *id" .Ft int +.Fn pci_get_max_payload "device_t dev" +.Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int .Fn pci_get_powerstate "device_t dev" @@ -461,6 +464,16 @@ or .Xr bus_activate_resource 9 . .Pp The +.Fn pci_get_max_payload +function returns the current maximum TLP payload size in bytes for a +PCI-express device. +If the +.Fa dev +device is not a PCI-express device, +.Fn pci_get_max_payload +returns zero. +.Pp +The .Fn pci_get_max_read_req function returns the current maximum read request size in bytes for a PCI-express device. Modified: projects/vnet/share/mk/bsd.prog.mk ============================================================================== --- projects/vnet/share/mk/bsd.prog.mk Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/share/mk/bsd.prog.mk Sat Jun 25 14:20:34 2016 (r302200) @@ -66,7 +66,8 @@ PROG_FULL=${PROG}.full ${BINDIR} == "/bin" ||\ ${BINDIR:C%/libexec(/.*)?%/libexec%} == "/libexec" ||\ ${BINDIR} == "/sbin" ||\ - ${BINDIR:C%/usr/(bin|bsdinstall|libexec|lpr|sendmail|sm.bin|sbin|tests)(/.*)?%/usr/bin%} == "/usr/bin"\ + ${BINDIR:C%/usr/(bin|bsdinstall|libexec|lpr|sendmail|sm.bin|sbin|tests)(/.*)?%/usr/bin%} == "/usr/bin" ||\ + ${BINDIR} == "/usr/lib" \ ) DEBUGFILEDIR= ${DEBUGDIR}${BINDIR} .else Modified: projects/vnet/share/mk/src.opts.mk ============================================================================== --- projects/vnet/share/mk/src.opts.mk Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/share/mk/src.opts.mk Sat Jun 25 14:20:34 2016 (r302200) @@ -158,6 +158,7 @@ __DEFAULT_YES_OPTIONS = \ SOURCELESS_UCODE \ SVNLITE \ SYSCONS \ + SYSTEM_COMPILER \ TALK \ TCP_WRAPPERS \ TCSH \ @@ -189,7 +190,6 @@ __DEFAULT_NO_OPTIONS = \ SHARED_TOOLCHAIN \ SORT_THREADS \ SVN \ - SYSTEM_COMPILER \ # Modified: projects/vnet/sys/cam/cam_iosched.c ============================================================================== --- projects/vnet/sys/cam/cam_iosched.c Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/sys/cam/cam_iosched.c Sat Jun 25 14:20:34 2016 (r302200) @@ -61,7 +61,7 @@ static MALLOC_DEFINE(M_CAMSCHED, "CAM I/ * for trims. */ -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC static int do_netflix_iosched = 1; TUNABLE_INT("kern.cam.do_netflix_iosched", &do_netflix_iosched); @@ -250,7 +250,7 @@ struct cam_iosched_softc /* scheduler flags < 16, user flags >= 16 */ uint32_t flags; int sort_io_queue; -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC int read_bias; /* Read bias setting */ int current_read_bias; /* Current read bias state */ int total_ticks; @@ -269,7 +269,7 @@ struct cam_iosched_softc #endif }; -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC /* * helper functions to call the limsw functions. */ @@ -624,7 +624,7 @@ cam_iosched_cl_maybe_steer(struct contro /* Periph drivers set these flags to indicate work */ #define CAM_IOSCHED_FLAG_WORK_FLAGS ((0xffffu) << 16) -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC static void cam_iosched_io_metric_update(struct cam_iosched_softc *isc, sbintime_t sim_latency, int cmd, size_t size); @@ -639,7 +639,7 @@ cam_iosched_has_flagged_work(struct cam_ static inline int cam_iosched_has_io(struct cam_iosched_softc *isc) { -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (do_netflix_iosched) { struct bio *rbp = bioq_first(&isc->bio_queue); struct bio *wbp = bioq_first(&isc->write_queue); @@ -672,7 +672,7 @@ cam_iosched_has_more_trim(struct cam_ios static inline int cam_iosched_has_work(struct cam_iosched_softc *isc) { -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (iosched_debug > 2) printf("has work: %d %d %d\n", cam_iosched_has_io(isc), cam_iosched_has_more_trim(isc), @@ -684,7 +684,7 @@ cam_iosched_has_work(struct cam_iosched_ cam_iosched_has_flagged_work(isc); } -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC static void cam_iosched_iop_stats_init(struct cam_iosched_softc *isc, struct iop_stats *ios) { @@ -946,14 +946,14 @@ cam_iosched_init(struct cam_iosched_soft *iscp = malloc(sizeof(**iscp), M_CAMSCHED, M_NOWAIT | M_ZERO); if (*iscp == NULL) return ENOMEM; -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (iosched_debug) printf("CAM IOSCHEDULER Allocating entry at %p\n", *iscp); #endif (*iscp)->sort_io_queue = -1; bioq_init(&(*iscp)->bio_queue); bioq_init(&(*iscp)->trim_queue); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (do_netflix_iosched) { bioq_init(&(*iscp)->write_queue); (*iscp)->read_bias = 100; @@ -984,7 +984,7 @@ cam_iosched_fini(struct cam_iosched_soft { if (isc) { cam_iosched_flush(isc, NULL, ENXIO); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC cam_iosched_iop_stats_fini(&isc->read_stats); cam_iosched_iop_stats_fini(&isc->write_stats); cam_iosched_iop_stats_fini(&isc->trim_stats); @@ -1009,7 +1009,7 @@ cam_iosched_fini(struct cam_iosched_soft void cam_iosched_sysctl_init(struct cam_iosched_softc *isc, struct sysctl_ctx_list *ctx, struct sysctl_oid *node) { -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC struct sysctl_oid_list *n; #endif @@ -1018,7 +1018,7 @@ void cam_iosched_sysctl_init(struct cam_ &isc->sort_io_queue, 0, "Sort IO queue to try and optimise disk access patterns"); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (!do_netflix_iosched) return; @@ -1060,13 +1060,13 @@ cam_iosched_flush(struct cam_iosched_sof { bioq_flush(&isc->bio_queue, stp, err); bioq_flush(&isc->trim_queue, stp, err); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (do_netflix_iosched) bioq_flush(&isc->write_queue, stp, err); #endif } -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC static struct bio * cam_iosched_get_write(struct cam_iosched_softc *isc) { @@ -1132,7 +1132,7 @@ void cam_iosched_put_back_trim(struct cam_iosched_softc *isc, struct bio *bp) { bioq_insert_head(&isc->trim_queue, bp); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC isc->trim_stats.queued++; isc->trim_stats.total--; /* since we put it back, don't double count */ isc->trim_stats.pending--; @@ -1155,7 +1155,7 @@ cam_iosched_next_trim(struct cam_iosched if (bp == NULL) return NULL; bioq_remove(&isc->trim_queue, bp); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC isc->trim_stats.queued--; isc->trim_stats.total++; isc->trim_stats.pending++; @@ -1201,7 +1201,7 @@ cam_iosched_next_bio(struct cam_iosched_ if ((bp = cam_iosched_get_trim(isc)) != NULL) return bp; -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC /* * See if we have any pending writes, and room in the queue for them, * and if so, those are next. @@ -1218,7 +1218,7 @@ cam_iosched_next_bio(struct cam_iosched_ if ((bp = bioq_first(&isc->bio_queue)) == NULL) return NULL; -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC /* * For the netflix scheduler, bio_queue is only for reads, so enforce * the limits here. Enforce only for reads. @@ -1230,7 +1230,7 @@ cam_iosched_next_bio(struct cam_iosched_ } #endif bioq_remove(&isc->bio_queue, bp); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (do_netflix_iosched) { if (bp->bio_cmd == BIO_READ) { isc->read_stats.queued--; @@ -1262,12 +1262,12 @@ cam_iosched_queue_work(struct cam_iosche */ if (bp->bio_cmd == BIO_DELETE) { bioq_disksort(&isc->trim_queue, bp); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC isc->trim_stats.in++; isc->trim_stats.queued++; #endif } -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC else if (do_netflix_iosched && (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { if (cam_iosched_sort_queue(isc)) @@ -1287,7 +1287,7 @@ cam_iosched_queue_work(struct cam_iosche bioq_disksort(&isc->bio_queue, bp); else bioq_insert_tail(&isc->bio_queue, bp); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (iosched_debug > 9) printf("Qr : %p %#x\n", bp, bp->bio_cmd); if (bp->bio_cmd == BIO_READ) { @@ -1331,7 +1331,7 @@ cam_iosched_bio_complete(struct cam_iosc union ccb *done_ccb) { int retval = 0; -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (!do_netflix_iosched) return retval; @@ -1399,7 +1399,7 @@ cam_iosched_clr_work_flags(struct cam_io isc->flags &= ~flags; } -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC /* * After the method presented in Jack Crenshaw's 1998 article "Integer * Suqare Roots," reprinted at @@ -1523,7 +1523,7 @@ cam_iosched_update(struct iop_stats *iop iop->sd = (int64_t)var < 0 ? 0 : isqrt64(var); } -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC static void cam_iosched_io_metric_update(struct cam_iosched_softc *isc, sbintime_t sim_latency, int cmd, size_t size) Modified: projects/vnet/sys/conf/newvers.sh ============================================================================== --- projects/vnet/sys/conf/newvers.sh Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/sys/conf/newvers.sh Sat Jun 25 14:20:34 2016 (r302200) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="11.0" -BRANCH="ALPHA4" +BRANCH="ALPHA5" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: projects/vnet/sys/conf/options ============================================================================== --- projects/vnet/sys/conf/options Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/sys/conf/options Sat Jun 25 14:20:34 2016 (r302200) @@ -330,7 +330,7 @@ CAM_DEBUG_TARGET opt_cam.h CAM_DEBUG_LUN opt_cam.h CAM_DEBUG_FLAGS opt_cam.h CAM_BOOT_DELAY opt_cam.h -CAM_NETFLIX_IOSCHED opt_cam.h +CAM_IOSCHED_DYNAMIC opt_cam.h SCSI_DELAY opt_scsi.h SCSI_NO_SENSE_STRINGS opt_scsi.h SCSI_NO_OP_STRINGS opt_scsi.h Modified: projects/vnet/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- projects/vnet/sys/dev/bhnd/bcma/bcma.c Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/sys/dev/bhnd/bcma/bcma.c Sat Jun 25 14:20:34 2016 (r302200) @@ -181,14 +181,6 @@ bcma_write_ivar(device_t dev, device_t c } } -static void -bcma_child_deleted(device_t dev, device_t child) -{ - struct bcma_devinfo *dinfo = device_get_ivars(child); - if (dinfo != NULL) - bcma_free_dinfo(dev, dinfo); -} - static struct resource_list * bcma_get_resource_list(device_t dev, device_t child) { @@ -415,6 +407,19 @@ bcma_get_region_addr(device_t dev, devic return (ENOENT); } +static struct bhnd_devinfo * +bcma_alloc_bhnd_dinfo(device_t dev) +{ + struct bcma_devinfo *dinfo = bcma_alloc_dinfo(dev); + return ((struct bhnd_devinfo *)dinfo); +} + +static void +bcma_free_bhnd_dinfo(device_t dev, struct bhnd_devinfo *dinfo) +{ + bcma_free_dinfo(dev, (struct bcma_devinfo *)dinfo); +} + /** * Scan a device enumeration ROM table, adding all valid discovered cores to * the bus. @@ -431,8 +436,7 @@ bcma_add_children(device_t bus, struct r struct bcma_devinfo *dinfo; device_t child; int error; - - dinfo = NULL; + corecfg = NULL; /* Initialize our reader */ @@ -450,26 +454,20 @@ bcma_add_children(device_t bus, struct r goto failed; } - /* Allocate per-device bus info */ - dinfo = bcma_alloc_dinfo(bus, corecfg); - if (dinfo == NULL) { - error = ENXIO; - goto failed; - } - - /* The dinfo instance now owns the corecfg value */ - corecfg = NULL; - /* Add the child device */ - child = device_add_child(bus, NULL, -1); + child = BUS_ADD_CHILD(bus, 0, NULL, -1); if (child == NULL) { error = ENXIO; goto failed; } - /* The child device now owns the dinfo pointer */ - device_set_ivars(child, dinfo); - dinfo = NULL; + /* Initialize device ivars */ + dinfo = device_get_ivars(child); + if ((error = bcma_init_dinfo(bus, dinfo, corecfg))) + goto failed; + + /* The dinfo instance now owns the corecfg value */ + corecfg = NULL; /* If pins are floating or the hardware is otherwise * unpopulated, the device shouldn't be used. */ @@ -482,9 +480,6 @@ bcma_add_children(device_t bus, struct r return (0); failed: - if (dinfo != NULL) - bcma_free_dinfo(bus, dinfo); - if (corecfg != NULL) bcma_free_corecfg(corecfg); @@ -499,13 +494,14 @@ static device_method_t bcma_methods[] = DEVMETHOD(device_detach, bcma_detach), /* Bus interface */ - DEVMETHOD(bus_child_deleted, bcma_child_deleted), DEVMETHOD(bus_read_ivar, bcma_read_ivar), DEVMETHOD(bus_write_ivar, bcma_write_ivar), DEVMETHOD(bus_get_resource_list, bcma_get_resource_list), /* BHND interface */ DEVMETHOD(bhnd_bus_find_hostb_device, bcma_find_hostb_device), + DEVMETHOD(bhnd_bus_alloc_devinfo, bcma_alloc_bhnd_dinfo), + DEVMETHOD(bhnd_bus_free_devinfo, bcma_free_bhnd_dinfo), DEVMETHOD(bhnd_bus_reset_core, bcma_reset_core), DEVMETHOD(bhnd_bus_suspend_core, bcma_suspend_core), DEVMETHOD(bhnd_bus_get_port_count, bcma_get_port_count), Modified: projects/vnet/sys/dev/bhnd/bcma/bcma_subr.c ============================================================================== --- projects/vnet/sys/dev/bhnd/bcma/bcma_subr.c Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/sys/dev/bhnd/bcma/bcma_subr.c Sat Jun 25 14:20:34 2016 (r302200) @@ -186,28 +186,54 @@ bcma_dinfo_init_resource_info(device_t b } } + /** - * Allocate and initialize new device info structure, assuming ownership - * of the provided core configuration. + * Allocate and return a new empty device info structure. * * @param bus The requesting bus device. - * @param corecfg Device core configuration. + * + * @retval NULL if allocation failed. */ struct bcma_devinfo * -bcma_alloc_dinfo(device_t bus, struct bcma_corecfg *corecfg) +bcma_alloc_dinfo(device_t bus) { struct bcma_devinfo *dinfo; - dinfo = malloc(sizeof(struct bcma_devinfo), M_BHND, M_NOWAIT); + dinfo = malloc(sizeof(struct bcma_devinfo), M_BHND, M_NOWAIT|M_ZERO); if (dinfo == NULL) - return NULL; + return (NULL); - dinfo->corecfg = corecfg; + dinfo->corecfg = NULL; dinfo->res_agent = NULL; dinfo->rid_agent = -1; resource_list_init(&dinfo->resources); + return (dinfo); +} + +/** + * Initialize a device info structure previously allocated via + * bcma_alloc_dinfo, assuming ownership of the provided core + * configuration. + * + * @param bus The requesting bus device. + * @param dinfo The device info instance. + * @param corecfg Device core configuration; ownership of this value + * will be assumed by @p dinfo. + * + * @retval 0 success + * @retval non-zero initialization failed. + */ +int +bcma_init_dinfo(device_t bus, struct bcma_devinfo *dinfo, + struct bcma_corecfg *corecfg) +{ + KASSERT(dinfo->corecfg == NULL, ("dinfo previously initialized")); + + /* Save core configuration value */ + dinfo->corecfg = corecfg; + /* The device ports must always be initialized first to ensure that * rid 0 maps to the first device port */ bcma_dinfo_init_resource_info(bus, dinfo, &corecfg->dev_ports); @@ -215,7 +241,7 @@ bcma_alloc_dinfo(device_t bus, struct bc bcma_dinfo_init_resource_info(bus, dinfo, &corecfg->bridge_ports); bcma_dinfo_init_resource_info(bus, dinfo, &corecfg->wrapper_ports); - return dinfo; + return (0); } /** @@ -227,9 +253,11 @@ bcma_alloc_dinfo(device_t bus, struct bc void bcma_free_dinfo(device_t bus, struct bcma_devinfo *dinfo) { - bcma_free_corecfg(dinfo->corecfg); resource_list_free(&dinfo->resources); + if (dinfo->corecfg != NULL) + bcma_free_corecfg(dinfo->corecfg); + /* Release agent resource, if any */ if (dinfo->res_agent != NULL) { bhnd_release_resource(bus, SYS_RES_MEMORY, dinfo->rid_agent, Modified: projects/vnet/sys/dev/bhnd/bcma/bcmavar.h ============================================================================== --- projects/vnet/sys/dev/bhnd/bcma/bcmavar.h Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/sys/dev/bhnd/bcma/bcmavar.h Sat Jun 25 14:20:34 2016 (r302200) @@ -69,7 +69,9 @@ int bcma_add_children(device_t bus, struct bcma_sport_list *bcma_corecfg_get_port_list(struct bcma_corecfg *cfg, bhnd_port_type type); -struct bcma_devinfo *bcma_alloc_dinfo(device_t bus, +struct bcma_devinfo *bcma_alloc_dinfo(device_t bus); +int bcma_init_dinfo(device_t bus, + struct bcma_devinfo *dinfo, struct bcma_corecfg *corecfg); void bcma_free_dinfo(device_t bus, struct bcma_devinfo *dinfo); @@ -132,7 +134,9 @@ struct bcma_corecfg { * BCMA per-device info */ struct bcma_devinfo { - struct resource_list resources; /**< Slave port memory regions. */ + struct bhnd_devinfo bhnd_dinfo; /**< superclass device info. */ + + struct resource_list resources; /**< Slave port memory regions. */ struct bcma_corecfg *corecfg; /**< IP core/block config */ struct bhnd_resource *res_agent; /**< Agent (wrapper) resource, or NULL. Not @@ -147,4 +151,4 @@ struct bcma_softc { device_t hostb_dev; /**< host bridge core, or NULL */ }; -#endif /* _BCMA_BCMAVAR_H_ */ \ No newline at end of file +#endif /* _BCMA_BCMAVAR_H_ */ Modified: projects/vnet/sys/dev/bhnd/bhnd.c ============================================================================== --- projects/vnet/sys/dev/bhnd/bhnd.c Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/sys/dev/bhnd/bhnd.c Sat Jun 25 14:20:34 2016 (r302200) @@ -493,6 +493,54 @@ bhnd_child_location_str(device_t dev, de } /** + * Default bhnd(4) bus driver implementation of BUS_ADD_CHILD(). + * + * This implementation manages internal bhnd(4) state, and must be called + * by subclassing drivers. + */ +device_t +bhnd_generic_add_child(device_t dev, u_int order, const char *name, int unit) +{ + struct bhnd_devinfo *dinfo; + device_t child; + + child = device_add_child_ordered(dev, order, name, unit); + if (child == NULL) + return (NULL); + + if ((dinfo = BHND_BUS_ALLOC_DEVINFO(dev)) == NULL) { + device_delete_child(dev, child); + return (NULL); + } + + device_set_ivars(child, dinfo); + + /* Inform concrete bus driver. */ + BHND_BUS_CHILD_ADDED(dev, child); + + return (child); +} + +/** + * Default bhnd(4) bus driver implementation of BUS_CHILD_DELETED(). + * + * This implementation manages internal bhnd(4) state, and must be called + * by subclassing drivers. + */ +void +bhnd_generic_child_deleted(device_t dev, device_t child) +{ + struct bhnd_softc *sc; + struct bhnd_devinfo *dinfo; + + sc = device_get_softc(dev); + + /* Free device info */ + if ((dinfo = device_get_ivars(child)) != NULL) + BHND_BUS_FREE_DEVINFO(dev, dinfo); +} + +/** * Helper function for implementing BUS_SUSPEND_CHILD(). * * TODO: Power management @@ -611,6 +659,8 @@ static device_method_t bhnd_methods[] = DEVMETHOD(device_resume, bhnd_generic_resume), /* Bus interface */ + DEVMETHOD(bus_add_child, bhnd_generic_add_child), + DEVMETHOD(bus_child_deleted, bhnd_generic_child_deleted), DEVMETHOD(bus_probe_nomatch, bhnd_generic_probe_nomatch), DEVMETHOD(bus_print_child, bhnd_generic_print_child), DEVMETHOD(bus_child_pnpinfo_str, bhnd_child_pnpinfo_str), Modified: projects/vnet/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- projects/vnet/sys/dev/bhnd/bhnd_bus_if.m Sat Jun 25 14:14:55 2016 (r302199) +++ projects/vnet/sys/dev/bhnd/bhnd_bus_if.m Sat Jun 25 14:20:34 2016 (r302200) @@ -41,6 +41,7 @@ HEADER { struct bhnd_board_info; struct bhnd_core_info; struct bhnd_chipid; + struct bhnd_devinfo; struct bhnd_resource; } @@ -55,12 +56,23 @@ CODE { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@freebsd.org Sat Jun 25 21:39:22 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE763B82CC6 for ; Sat, 25 Jun 2016 21:39:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DE0B1867; Sat, 25 Jun 2016 21:39:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5PLdLpH030183; Sat, 25 Jun 2016 21:39:21 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5PLdLNR030179; Sat, 25 Jun 2016 21:39:21 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606252139.u5PLdLNR030179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 25 Jun 2016 21:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302203 - projects/vnet/sys/contrib/ipfilter/netinet X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 21:39:22 -0000 Author: bz Date: Sat Jun 25 21:39:21 2016 New Revision: 302203 URL: https://svnweb.freebsd.org/changeset/base/302203 Log: Make ipfilter user space parts compile as well. Sponsored by: The FreeBSD Foundation Modified: projects/vnet/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c projects/vnet/sys/contrib/ipfilter/netinet/ip_proxy.c projects/vnet/sys/contrib/ipfilter/netinet/ip_rules.c projects/vnet/sys/contrib/ipfilter/netinet/mlfk_ipl.c Modified: projects/vnet/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- projects/vnet/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Jun 25 20:31:20 2016 (r302202) +++ projects/vnet/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Jun 25 21:39:21 2016 (r302203) @@ -62,6 +62,9 @@ static const char rcsid[] = "@(#)$Id$"; #else #define CURVNET_SET(arg) #define CURVNET_RESTORE() +#define VNET_DEFINE(_t, _v) _t _v +#define VNET_DECLARE(_t, _v) extern _t _v +#define VNET(arg) arg #endif #if defined(__osf__) # include Modified: projects/vnet/sys/contrib/ipfilter/netinet/ip_proxy.c ============================================================================== --- projects/vnet/sys/contrib/ipfilter/netinet/ip_proxy.c Sat Jun 25 20:31:20 2016 (r302202) +++ projects/vnet/sys/contrib/ipfilter/netinet/ip_proxy.c Sat Jun 25 21:39:21 2016 (r302203) @@ -64,6 +64,15 @@ struct file; # include #endif #include +#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) && defined(_KERNEL) +#include +#else +#define CURVNET_SET(arg) +#define CURVNET_RESTORE() +#define VNET_DEFINE(_t, _v) _t _v +#define VNET_DECLARE(_t, _v) extern _t _v +#define VNET(arg) arg +#endif #ifdef sun # include #endif Modified: projects/vnet/sys/contrib/ipfilter/netinet/ip_rules.c ============================================================================== --- projects/vnet/sys/contrib/ipfilter/netinet/ip_rules.c Sat Jun 25 20:31:20 2016 (r302202) +++ projects/vnet/sys/contrib/ipfilter/netinet/ip_rules.c Sat Jun 25 21:39:21 2016 (r302203) @@ -32,6 +32,15 @@ #endif #if defined(__FreeBSD__) && (__FreeBSD_version > 220000) # include +#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) && defined(_KERNEL) +#include +#else +#define CURVNET_SET(arg) +#define CURVNET_RESTORE() +#define VNET_DEFINE(_t, _v) _t _v +#define VNET_DECLARE(_t, _v) extern _t _v +#define VNET(arg) arg +#endif #else # include #endif /* FreeBSD */ Modified: projects/vnet/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- projects/vnet/sys/contrib/ipfilter/netinet/mlfk_ipl.c Sat Jun 25 20:31:20 2016 (r302202) +++ projects/vnet/sys/contrib/ipfilter/netinet/mlfk_ipl.c Sat Jun 25 21:39:21 2016 (r302203) @@ -7,6 +7,12 @@ * See the IPFILTER.LICENCE file for details on licencing. */ +#if defined(KERNEL) || defined(_KERNEL) +# undef KERNEL +# undef _KERNEL +# define KERNEL 1 +# define _KERNEL 1 +#endif #include #include @@ -20,6 +26,15 @@ # include # include #endif +#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800000) && defined(_KERNEL) +#include +#else +#define CURVNET_SET(arg) +#define CURVNET_RESTORE() +#define VNET_DEFINE(_t, _v) _t _v +#define VNET_DECLARE(_t, _v) extern _t _v +#define VNET(arg) arg +#endif #include #include #include From owner-svn-src-projects@freebsd.org Sat Jun 25 22:44:37 2016 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A14B8B80EFC for ; Sat, 25 Jun 2016 22:44:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 594F71197; Sat, 25 Jun 2016 22:44:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5PMiaGl056861; Sat, 25 Jun 2016 22:44:36 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5PMiaAg056859; Sat, 25 Jun 2016 22:44:36 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606252244.u5PMiaAg056859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 25 Jun 2016 22:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r302205 - projects/vnet/sys/contrib/ipfilter/netinet X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 22:44:37 -0000 Author: bz Date: Sat Jun 25 22:44:36 2016 New Revision: 302205 URL: https://svnweb.freebsd.org/changeset/base/302205 Log: Cover all of the ioctl handler with a set vnet; what was there from old days was not enough anymore. Also use curthread for read/write operations on the device, rather than the cache credentials; things can move around and the cached ones might not be the right ones. Sponsored by: The FreeBSD Foundation Modified: projects/vnet/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c projects/vnet/sys/contrib/ipfilter/netinet/mlfk_ipl.c Modified: projects/vnet/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c ============================================================================== --- projects/vnet/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Jun 25 22:24:16 2016 (r302204) +++ projects/vnet/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c Sat Jun 25 22:44:36 2016 (r302205) @@ -298,10 +298,12 @@ ipfioctl(dev, cmd, data, mode int error = 0, unit = 0; SPL_INT(s); + CURVNET_SET(TD_TO_VNET(p)); #if (BSD >= 199306) if (securelevel_ge(p->p_cred, 3) && (mode & FWRITE)) { V_ipfmain.ipf_interror = 130001; + CURVNET_RESTORE(); return EPERM; } #endif @@ -309,12 +311,14 @@ ipfioctl(dev, cmd, data, mode unit = GET_MINOR(dev); if ((IPL_LOGMAX < unit) || (unit < 0)) { V_ipfmain.ipf_interror = 130002; + CURVNET_RESTORE(); return ENXIO; } if (V_ipfmain.ipf_running <= 0) { if (unit != IPL_LOGIPF && cmd != SIOCIPFINTERROR) { V_ipfmain.ipf_interror = 130003; + CURVNET_RESTORE(); return EIO; } if (cmd != SIOCIPFGETNEXT && cmd != SIOCIPFGET && @@ -322,13 +326,13 @@ ipfioctl(dev, cmd, data, mode cmd != SIOCGETFS && cmd != SIOCGETFF && cmd != SIOCIPFINTERROR) { V_ipfmain.ipf_interror = 130004; + CURVNET_RESTORE(); return EIO; } } SPL_NET(s); - CURVNET_SET(TD_TO_VNET(p)); error = ipf_ioctlswitch(&V_ipfmain, unit, data, cmd, mode, p->p_uid, p); CURVNET_RESTORE(); if (error != -1) { Modified: projects/vnet/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- projects/vnet/sys/contrib/ipfilter/netinet/mlfk_ipl.c Sat Jun 25 22:24:16 2016 (r302204) +++ projects/vnet/sys/contrib/ipfilter/netinet/mlfk_ipl.c Sat Jun 25 22:44:36 2016 (r302205) @@ -513,7 +513,7 @@ static int ipfread(dev, uio) if (unit < 0) return ENXIO; - CURVNET_SET(CRED_TO_VNET(dev->si_cred)); + CURVNET_SET(TD_TO_VNET(curthread)); if (V_ipfmain.ipf_running < 1) { CURVNET_RESTORE(); return EIO; @@ -556,7 +556,7 @@ static int ipfwrite(dev, uio) { int error; - CURVNET_SET(CRED_TO_VNET(dev->si_cred)); + CURVNET_SET(TD_TO_VNET(curthread)); if (V_ipfmain.ipf_running < 1) { CURVNET_RESTORE(); return EIO;