From owner-svn-src-stable-12@freebsd.org Sun Nov 18 00:00:40 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81853110BB1F; Sun, 18 Nov 2018 00:00:40 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EEBB286CEF; Sun, 18 Nov 2018 00:00:39 +0000 (UTC) (envelope-from ae@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDE0B328E; Sun, 18 Nov 2018 00:00:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI00dcO072838; Sun, 18 Nov 2018 00:00:39 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI00diU072837; Sun, 18 Nov 2018 00:00:39 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180000.wAI00diU072837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340531 - stable/12/sys/netpfil/ipfw/nat64 X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw/nat64 X-SVN-Commit-Revision: 340531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EEBB286CEF X-Spamd-Result: default: False [0.06 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.062,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:00:40 -0000 Author: ae Date: Sun Nov 18 00:00:39 2018 New Revision: 340531 URL: https://svnweb.freebsd.org/changeset/base/340531 Log: MFC r339544: Call inet_ntop() only when its result is needed. Obtained from: Yandex LLC Sponsored by: Yandex LLC Modified: stable/12/sys/netpfil/ipfw/nat64/nat64lsn.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/nat64/nat64lsn.c ============================================================================== --- stable/12/sys/netpfil/ipfw/nat64/nat64lsn.c Sat Nov 17 23:58:55 2018 (r340530) +++ stable/12/sys/netpfil/ipfw/nat64/nat64lsn.c Sun Nov 18 00:00:39 2018 (r340531) @@ -643,7 +643,6 @@ static NAT64NOINLINE int nat64lsn_periodic_chkhost(struct nat64lsn_host *nh, struct nat64lsn_periodic_data *d) { - char a[INET6_ADDRSTRLEN]; struct nat64lsn_portgroup *pg; struct nat64lsn_job_item *ji; uint64_t delmask[NAT64LSN_PGPTRNMASK]; @@ -652,9 +651,13 @@ nat64lsn_periodic_chkhost(struct nat64lsn_host *nh, delcount = 0; memset(delmask, 0, sizeof(delmask)); - inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); - DPRINTF(DP_JQUEUE, "Checking %s host %s on cpu %d", - stale_nh(d->cfg, nh) ? "stale" : "non-stale", a, curcpu); + if (V_nat64_debug & DP_JQUEUE) { + char a[INET6_ADDRSTRLEN]; + + inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); + DPRINTF(DP_JQUEUE, "Checking %s host %s on cpu %d", + stale_nh(d->cfg, nh) ? "stale" : "non-stale", a, curcpu); + } if (!stale_nh(d->cfg, nh)) { /* Non-stale host. Inspect internals */ NAT64_LOCK(nh); @@ -1527,9 +1530,9 @@ nat64lsn_translate6(struct nat64lsn_cfg *cfg, struct i if (k++ > 1000) { DPRINTF(DP_ALL, "XXX: too long %d/%d %d/%d\n", sidx.idx, sidx.off, st->next.idx, st->next.off); - inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); DPRINTF(DP_GENERIC, "TR host %s %p on cpu %d", - a, nh, curcpu); + inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)), + nh, curcpu); k = 0; } sidx = st->next; @@ -1542,10 +1545,10 @@ nat64lsn_translate6(struct nat64lsn_cfg *cfg, struct i /* No free states. Request more if we can */ if (nh->pg_used >= cfg->max_chunks) { /* Limit reached */ - inet_ntop(AF_INET6, &nh->addr, a, sizeof(a)); DPRINTF(DP_DROPS, "PG limit reached " " for host %s (used %u, allocated %u, " - "limit %u)", a, + "limit %u)", inet_ntop(AF_INET6, + &nh->addr, a, sizeof(a)), nh->pg_used * NAT64_CHUNK_SIZE, nh->pg_allocated * NAT64_CHUNK_SIZE, cfg->max_chunks * NAT64_CHUNK_SIZE); From owner-svn-src-stable-12@freebsd.org Sun Nov 18 00:04:05 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E33AC110BEF4; Sun, 18 Nov 2018 00:04:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8901887116; Sun, 18 Nov 2018 00:04:04 +0000 (UTC) (envelope-from ae@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 677A33415; Sun, 18 Nov 2018 00:04:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI044VG077868; Sun, 18 Nov 2018 00:04:04 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI043uD077863; Sun, 18 Nov 2018 00:04:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180004.wAI043uD077863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340532 - in stable/12: share/man/man9 sys/net sys/netinet sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: share/man/man9 sys/net sys/netinet sys/netinet6 X-SVN-Commit-Revision: 340532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8901887116 X-Spamd-Result: default: False [0.06 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.060,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:04:05 -0000 Author: ae Date: Sun Nov 18 00:04:03 2018 New Revision: 340532 URL: https://svnweb.freebsd.org/changeset/base/340532 Log: MFC r339537: Add ifaddr_event_ext event. It is similar to ifaddr_event, but the handler receives the type of event IFADDR_EVENT_ADD/IFADDR_EVENT_DEL, and the pointer to ifaddr. Also ifaddr_event now is implemented using ifaddr_event_ext handler. Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17100 Modified: stable/12/share/man/man9/EVENTHANDLER.9 stable/12/sys/net/if.c stable/12/sys/net/if_var.h stable/12/sys/netinet/in.c stable/12/sys/netinet6/in6.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/EVENTHANDLER.9 ============================================================================== --- stable/12/share/man/man9/EVENTHANDLER.9 Sun Nov 18 00:00:39 2018 (r340531) +++ stable/12/share/man/man9/EVENTHANDLER.9 Sun Nov 18 00:04:03 2018 (r340532) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd September 6, 2018 +.Dd October 21, 2018 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -298,6 +298,8 @@ Callback invoked when an change has been made to an in Callback invoked when an interfance has been removed from an interface group. .It Vt ifaddr_event Callbacks invoked when an address is set up on a network interface. +.It Vt ifaddr_event_ext +Callback invoked when an address has been added or removed from an interface. .It Vt if_clone_event Callbacks invoked when an interface is cloned. .It Vt iflladdr_event Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Sun Nov 18 00:00:39 2018 (r340531) +++ stable/12/sys/net/if.c Sun Nov 18 00:04:03 2018 (r340532) @@ -328,6 +328,18 @@ static MALLOC_DEFINE(M_IFNET, "ifnet", "interface inte MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address"); MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address"); +/* + * Support for old ifaddr_event. + */ +static void +ifaddr_event_compat(void *arg __unused, struct ifnet *ifp, + struct ifaddr *ifa __unused, int event __unused) +{ + + EVENTHANDLER_INVOKE(ifaddr_event, ifp); +} +EVENTHANDLER_DEFINE(ifaddr_event_ext, ifaddr_event_compat, NULL, 0); + struct ifnet * ifnet_byindex_locked(u_short idx) { Modified: stable/12/sys/net/if_var.h ============================================================================== --- stable/12/sys/net/if_var.h Sun Nov 18 00:00:39 2018 (r340531) +++ stable/12/sys/net/if_var.h Sun Nov 18 00:04:03 2018 (r340532) @@ -432,6 +432,11 @@ EVENTHANDLER_DECLARE(iflladdr_event, iflladdr_event_ha /* interface address change event */ typedef void (*ifaddr_event_handler_t)(void *, struct ifnet *); EVENTHANDLER_DECLARE(ifaddr_event, ifaddr_event_handler_t); +typedef void (*ifaddr_event_ext_handler_t)(void *, struct ifnet *, + struct ifaddr *, int); +EVENTHANDLER_DECLARE(ifaddr_event_ext, ifaddr_event_ext_handler_t); +#define IFADDR_EVENT_ADD 0 +#define IFADDR_EVENT_DEL 1 /* new interface arrival event */ typedef void (*ifnet_arrival_event_handler_t)(void *, struct ifnet *); EVENTHANDLER_DECLARE(ifnet_arrival_event, ifnet_arrival_event_handler_t); Modified: stable/12/sys/netinet/in.c ============================================================================== --- stable/12/sys/netinet/in.c Sun Nov 18 00:00:39 2018 (r340531) +++ stable/12/sys/netinet/in.c Sun Nov 18 00:04:03 2018 (r340532) @@ -520,7 +520,12 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifne &ii->ii_allhosts); } - EVENTHANDLER_INVOKE(ifaddr_event, ifp); + /* + * Note: we don't need extra reference for ifa, since we called + * with sx lock held, and ifaddr can not be deleted in concurrent + * thread. + */ + EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, ifa, IFADDR_EVENT_ADD); return (error); @@ -643,7 +648,8 @@ in_difaddr_ioctl(u_long cmd, caddr_t data, struct ifne } IF_ADDR_WUNLOCK(ifp); - EVENTHANDLER_INVOKE(ifaddr_event, ifp); + EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, &ia->ia_ifa, + IFADDR_EVENT_DEL); ifa_free(&ia->ia_ifa); /* in_ifaddrhead */ return (0); Modified: stable/12/sys/netinet6/in6.c ============================================================================== --- stable/12/sys/netinet6/in6.c Sun Nov 18 00:00:39 2018 (r340531) +++ stable/12/sys/netinet6/in6.c Sun Nov 18 00:04:03 2018 (r340532) @@ -712,7 +712,8 @@ aifaddr_out: ND6_WUNLOCK(); nd6_prefix_del(pr); } - EVENTHANDLER_INVOKE(ifaddr_event, ifp); + EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, &ia->ia_ifa, + IFADDR_EVENT_DEL); break; } @@ -1456,7 +1457,10 @@ done: WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "Invoking IPv6 network device address event may sleep"); - EVENTHANDLER_INVOKE(ifaddr_event, ifp); + ifa_ref(&ia->ia_ifa); + EVENTHANDLER_INVOKE(ifaddr_event_ext, ifp, &ia->ia_ifa, + IFADDR_EVENT_ADD); + ifa_free(&ia->ia_ifa); return (error); } From owner-svn-src-stable-12@freebsd.org Sun Nov 18 00:09:35 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A95F110C127; Sun, 18 Nov 2018 00:09:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F181B87349; Sun, 18 Nov 2018 00:09:34 +0000 (UTC) (envelope-from ae@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC989341C; Sun, 18 Nov 2018 00:09:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI09Ygr078160; Sun, 18 Nov 2018 00:09:34 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI09YI8078157; Sun, 18 Nov 2018 00:09:34 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180009.wAI09YI8078157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340533 - in stable/12/sys: net netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12/sys: net netinet X-SVN-Commit-Revision: 340533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F181B87349 X-Spamd-Result: default: False [-0.12 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.12)[-0.119,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:09:35 -0000 Author: ae Date: Sun Nov 18 00:09:33 2018 New Revision: 340533 URL: https://svnweb.freebsd.org/changeset/base/340533 Log: MFC r339550,339556: Add KPI that can be used by tunneling interfaces to handle IP addresses appearing and disappearing on the host system. Such handling is need, because tunneling interfaces must use addresses, that are configured on the host as ingress addresses for tunnels. Otherwise the system can send spoofed packets with source address, that belongs to foreign host. The KPI uses ifaddr_event_ext event to implement addresses tracking. Tunneling interfaces register event handlers and then they are notified by the kernel, when an address disappears or appears. ifaddr_event_compat() handler from if.c replaced by srcaddr_change_event() in the ip_encap.c Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17134 Modified: stable/12/sys/net/if.c stable/12/sys/netinet/ip_encap.c stable/12/sys/netinet/ip_encap.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Sun Nov 18 00:04:03 2018 (r340532) +++ stable/12/sys/net/if.c Sun Nov 18 00:09:33 2018 (r340533) @@ -328,18 +328,6 @@ static MALLOC_DEFINE(M_IFNET, "ifnet", "interface inte MALLOC_DEFINE(M_IFADDR, "ifaddr", "interface address"); MALLOC_DEFINE(M_IFMADDR, "ether_multi", "link-level multicast address"); -/* - * Support for old ifaddr_event. - */ -static void -ifaddr_event_compat(void *arg __unused, struct ifnet *ifp, - struct ifaddr *ifa __unused, int event __unused) -{ - - EVENTHANDLER_INVOKE(ifaddr_event, ifp); -} -EVENTHANDLER_DEFINE(ifaddr_event_ext, ifaddr_event_compat, NULL, 0); - struct ifnet * ifnet_byindex_locked(u_short idx) { Modified: stable/12/sys/netinet/ip_encap.c ============================================================================== --- stable/12/sys/netinet/ip_encap.c Sun Nov 18 00:04:03 2018 (r340532) +++ stable/12/sys/netinet/ip_encap.c Sun Nov 18 00:09:33 2018 (r340533) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -100,22 +101,139 @@ struct encaptab { encap_input_t input; }; +struct srcaddrtab { + CK_LIST_ENTRY(srcaddrtab) chain; + + encap_srcaddr_t srcaddr; + void *arg; +}; + CK_LIST_HEAD(encaptab_head, encaptab); +CK_LIST_HEAD(srcaddrtab_head, srcaddrtab); #ifdef INET static struct encaptab_head ipv4_encaptab = CK_LIST_HEAD_INITIALIZER(); +static struct srcaddrtab_head ipv4_srcaddrtab = CK_LIST_HEAD_INITIALIZER(); #endif #ifdef INET6 static struct encaptab_head ipv6_encaptab = CK_LIST_HEAD_INITIALIZER(); +static struct srcaddrtab_head ipv6_srcaddrtab = CK_LIST_HEAD_INITIALIZER(); #endif -static struct mtx encapmtx; +static struct mtx encapmtx, srcaddrmtx; MTX_SYSINIT(encapmtx, &encapmtx, "encapmtx", MTX_DEF); +MTX_SYSINIT(srcaddrmtx, &srcaddrmtx, "srcaddrmtx", MTX_DEF); #define ENCAP_WLOCK() mtx_lock(&encapmtx) #define ENCAP_WUNLOCK() mtx_unlock(&encapmtx) -#define ENCAP_RLOCK() struct epoch_tracker encap_et; epoch_enter_preempt(net_epoch_preempt, &encap_et) -#define ENCAP_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &encap_et) +#define ENCAP_RLOCK_TRACKER struct epoch_tracker encap_et +#define ENCAP_RLOCK() \ + epoch_enter_preempt(net_epoch_preempt, &encap_et) +#define ENCAP_RUNLOCK() \ + epoch_exit_preempt(net_epoch_preempt, &encap_et) #define ENCAP_WAIT() epoch_wait_preempt(net_epoch_preempt) +#define SRCADDR_WLOCK() mtx_lock(&srcaddrmtx) +#define SRCADDR_WUNLOCK() mtx_unlock(&srcaddrmtx) +#define SRCADDR_RLOCK_TRACKER struct epoch_tracker srcaddr_et +#define SRCADDR_RLOCK() \ + epoch_enter_preempt(net_epoch_preempt, &srcaddr_et) +#define SRCADDR_RUNLOCK() \ + epoch_exit_preempt(net_epoch_preempt, &srcaddr_et) +#define SRCADDR_WAIT() epoch_wait_preempt(net_epoch_preempt) + +/* + * ifaddr_event_ext handler. + * + * Tunnelling interfaces may request the kernel to notify when + * some interface addresses appears or disappears. Usually tunnelling + * interface must use an address configured on the local machine as + * ingress address to be able receive datagramms and do not send + * spoofed packets. + */ +static void +srcaddr_change_event(void *arg __unused, struct ifnet *ifp, + struct ifaddr *ifa, int event) +{ + SRCADDR_RLOCK_TRACKER; + struct srcaddrtab_head *head; + struct srcaddrtab *p; + + /* Support for old ifaddr_event. */ + EVENTHANDLER_INVOKE(ifaddr_event, ifp); + + switch (ifa->ifa_addr->sa_family) { +#ifdef INET + case AF_INET: + head = &ipv4_srcaddrtab; + break; +#endif +#ifdef INET6 + case AF_INET6: + head = &ipv6_srcaddrtab; + break; +#endif + default: + /* ignore event */ + return; + } + + SRCADDR_RLOCK(); + CK_LIST_FOREACH(p, head, chain) { + (*p->srcaddr)(p->arg, ifa->ifa_addr, event); + } + SRCADDR_RUNLOCK(); +} +EVENTHANDLER_DEFINE(ifaddr_event_ext, srcaddr_change_event, NULL, 0); + +static struct srcaddrtab * +encap_register_srcaddr(struct srcaddrtab_head *head, encap_srcaddr_t func, + void *arg, int mflags) +{ + struct srcaddrtab *p, *tmp; + + if (func == NULL) + return (NULL); + p = malloc(sizeof(*p), M_NETADDR, mflags); + if (p == NULL) + return (NULL); + p->srcaddr = func; + p->arg = arg; + + SRCADDR_WLOCK(); + CK_LIST_FOREACH(tmp, head, chain) { + if (func == tmp->srcaddr && arg == tmp->arg) + break; + } + if (tmp == NULL) + CK_LIST_INSERT_HEAD(head, p, chain); + SRCADDR_WUNLOCK(); + + if (tmp != NULL) { + free(p, M_NETADDR); + p = tmp; + } + return (p); +} + +static int +encap_unregister_srcaddr(struct srcaddrtab_head *head, + const struct srcaddrtab *cookie) +{ + struct srcaddrtab *p; + + SRCADDR_WLOCK(); + CK_LIST_FOREACH(p, head, chain) { + if (p == cookie) { + CK_LIST_REMOVE(p, chain); + SRCADDR_WUNLOCK(); + SRCADDR_WAIT(); + free(p, M_NETADDR); + return (0); + } + } + SRCADDR_WUNLOCK(); + return (EINVAL); +} + static struct encaptab * encap_attach(struct encaptab_head *head, const struct encap_config *cfg, void *arg, int mflags) @@ -175,6 +293,7 @@ encap_detach(struct encaptab_head *head, const struct static int encap_input(struct encaptab_head *head, struct mbuf *m, int off, int proto) { + ENCAP_RLOCK_TRACKER; struct encaptab *ep, *match; void *arg; int matchprio, ret; @@ -220,6 +339,20 @@ encap_input(struct encaptab_head *head, struct mbuf *m } #ifdef INET +const struct srcaddrtab * +ip_encap_register_srcaddr(encap_srcaddr_t func, void *arg, int mflags) +{ + + return (encap_register_srcaddr(&ipv4_srcaddrtab, func, arg, mflags)); +} + +int +ip_encap_unregister_srcaddr(const struct srcaddrtab *cookie) +{ + + return (encap_unregister_srcaddr(&ipv4_srcaddrtab, cookie)); +} + const struct encaptab * ip_encap_attach(const struct encap_config *cfg, void *arg, int mflags) { @@ -245,6 +378,20 @@ encap4_input(struct mbuf **mp, int *offp, int proto) #endif /* INET */ #ifdef INET6 +const struct srcaddrtab * +ip6_encap_register_srcaddr(encap_srcaddr_t func, void *arg, int mflags) +{ + + return (encap_register_srcaddr(&ipv6_srcaddrtab, func, arg, mflags)); +} + +int +ip6_encap_unregister_srcaddr(const struct srcaddrtab *cookie) +{ + + return (encap_unregister_srcaddr(&ipv6_srcaddrtab, cookie)); +} + const struct encaptab * ip6_encap_attach(const struct encap_config *cfg, void *arg, int mflags) { Modified: stable/12/sys/netinet/ip_encap.h ============================================================================== --- stable/12/sys/netinet/ip_encap.h Sun Nov 18 00:04:03 2018 (r340532) +++ stable/12/sys/netinet/ip_encap.h Sun Nov 18 00:09:33 2018 (r340533) @@ -43,7 +43,8 @@ int encap6_input(struct mbuf **, int *, int); typedef int (*encap_lookup_t)(const struct mbuf *, int, int, void **); typedef int (*encap_check_t)(const struct mbuf *, int, int, void *); -typedef int (*encap_input_t)(struct mbuf *, int , int, void *); +typedef int (*encap_input_t)(struct mbuf *, int, int, void *); +typedef void (*encap_srcaddr_t)(void *, const struct sockaddr *, int); struct encap_config { int proto; /* protocol */ @@ -60,12 +61,20 @@ struct encap_config { }; struct encaptab; +struct srcaddrtab; const struct encaptab *ip_encap_attach(const struct encap_config *, void *arg, int mflags); const struct encaptab *ip6_encap_attach(const struct encap_config *, void *arg, int mflags); +const struct srcaddrtab *ip_encap_register_srcaddr(encap_srcaddr_t, + void *arg, int mflags); +const struct srcaddrtab *ip6_encap_register_srcaddr(encap_srcaddr_t, + void *arg, int mflags); + +int ip_encap_unregister_srcaddr(const struct srcaddrtab *); +int ip6_encap_unregister_srcaddr(const struct srcaddrtab *); int ip_encap_detach(const struct encaptab *); int ip6_encap_detach(const struct encaptab *); #endif From owner-svn-src-stable-12@freebsd.org Sun Nov 18 00:17:09 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 883B9110C608; Sun, 18 Nov 2018 00:17:09 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAB72884C2; Sun, 18 Nov 2018 00:17:08 +0000 (UTC) (envelope-from ae@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB90A3941; Sun, 18 Nov 2018 00:17:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0H8WF083048; Sun, 18 Nov 2018 00:17:08 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0H6cK083038; Sun, 18 Nov 2018 00:17:06 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180017.wAI0H6cK083038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340535 - in stable/12: share/man/man4 sys/net sys/netinet sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/net sys/netinet sys/netinet6 X-SVN-Commit-Revision: 340535 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DAB72884C2 X-Spamd-Result: default: False [-0.13 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.13)[-0.130,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:17:09 -0000 Author: ae Date: Sun Nov 18 00:17:06 2018 New Revision: 340535 URL: https://svnweb.freebsd.org/changeset/base/340535 Log: MFC r339551: Add handling for appearing/disappearing of ingress addresses to if_gif(4). * register handler for ingress address appearing/disappearing; * add new srcaddr hash table for fast softc lookup by srcaddr; * when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface, and set it otherwise; * remove the note about ingress address from BUGS section. Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17134 MFC r339552: Add handling for appearing/disappearing of ingress addresses to if_gre(4). * register handler for ingress address appearing/disappearing; * add new srcaddr hash table for fast softc lookup by srcaddr; * when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface, and set it otherwise; Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17214 MFC r339553: Add handling for appearing/disappearing of ingress addresses to if_me(4). * register handler for ingress address appearing/disappearing; * add new srcaddr hash table for fast softc lookup by srcaddr; * when srcaddr disappears, clear IFF_DRV_RUNNING flag from interface, and set it otherwise; Sponsored by: Yandex LLC MFC r339649: Add the check that current VNET is ready and access to srchash is allowed. This change is similar to r339646. The callback that checks for appearing and disappearing of tunnel ingress address can be called during VNET teardown. To prevent access to already freed memory, add check to the callback and epoch_wait() call to be sure that callback has finished its work. Modified: stable/12/share/man/man4/gif.4 stable/12/sys/net/if_gif.c stable/12/sys/net/if_gif.h stable/12/sys/net/if_gre.c stable/12/sys/net/if_gre.h stable/12/sys/net/if_me.c stable/12/sys/netinet/in_gif.c stable/12/sys/netinet/ip_gre.c stable/12/sys/netinet6/in6_gif.c stable/12/sys/netinet6/ip6_gre.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/gif.4 ============================================================================== --- stable/12/share/man/man4/gif.4 Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/share/man/man4/gif.4 Sun Nov 18 00:17:06 2018 (r340535) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 5, 2018 +.Dd October 21, 2018 .Dt GIF 4 .Os .Sh NAME @@ -206,15 +206,6 @@ and are picky about outer header fields. For example, you cannot usually use .Nm to talk with IPsec devices that use IPsec tunnel mode. -.Pp -The current code does not check if the ingress address -(outer source address) -configured in the -.Nm -interface makes sense. -Make sure to specify an address which belongs to your node. -Otherwise, your node will not be able to receive packets from the peer, -and it will generate packets with a spoofed source address. .Pp If the outer protocol is IPv4, .Nm Modified: stable/12/sys/net/if_gif.c ============================================================================== --- stable/12/sys/net/if_gif.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/net/if_gif.c Sun Nov 18 00:17:06 2018 (r340535) @@ -284,6 +284,7 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m) sc = ifp->if_softc; if ((ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->gif_family == 0 || (error = if_tunnel_check_nesting(ifp, m, MTAG_GIF, V_max_gif_nesting)) != 0) { @@ -674,7 +675,6 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) cmd == SIOCSIFPHYADDR_IN6 || #endif 0) { - ifp->if_drv_flags |= IFF_DRV_RUNNING; if_link_state_change(ifp, LINK_STATE_UP); } } @@ -689,6 +689,7 @@ gif_delete_tunnel(struct gif_softc *sc) sx_assert(&gif_ioctl_sx, SA_XLOCKED); if (sc->gif_family != 0) { + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); /* Wait until it become safe to free gif_hdr */ GIF_WAIT(); Modified: stable/12/sys/net/if_gif.h ============================================================================== --- stable/12/sys/net/if_gif.h Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/net/if_gif.h Sun Nov 18 00:17:06 2018 (r340535) @@ -63,6 +63,7 @@ struct gif_softc { } gif_uhdr; CK_LIST_ENTRY(gif_softc) chain; + CK_LIST_ENTRY(gif_softc) srchash; }; CK_LIST_HEAD(gif_list, gif_softc); MALLOC_DECLARE(M_GIF); Modified: stable/12/sys/net/if_gre.c ============================================================================== --- stable/12/sys/net/if_gre.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/net/if_gre.c Sun Nov 18 00:17:06 2018 (r340535) @@ -326,7 +326,6 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) cmd == SIOCSIFPHYADDR_IN6 || #endif 0) { - ifp->if_drv_flags |= IFF_DRV_RUNNING; if_link_state_change(ifp, LINK_STATE_UP); } } @@ -342,6 +341,7 @@ gre_delete_tunnel(struct gre_softc *sc) sx_assert(&gre_ioctl_sx, SA_XLOCKED); if (sc->gre_family != 0) { CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); free(sc->gre_hdr, M_GRE); sc->gre_family = 0; @@ -543,6 +543,7 @@ gre_setseqn(struct grehdr *gh, uint32_t seq) static int gre_transmit(struct ifnet *ifp, struct mbuf *m) { + GRE_RLOCK_TRACKER; struct gre_softc *sc; struct grehdr *gh; uint32_t af; @@ -562,6 +563,7 @@ gre_transmit(struct ifnet *ifp, struct mbuf *m) sc = ifp->if_softc; if ((ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->gre_family == 0 || (error = if_tunnel_check_nesting(ifp, m, MTAG_GRE, V_max_gre_nesting)) != 0) { Modified: stable/12/sys/net/if_gre.h ============================================================================== --- stable/12/sys/net/if_gre.h Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/net/if_gre.h Sun Nov 18 00:17:06 2018 (r340535) @@ -82,6 +82,7 @@ struct gre_softc { } gre_uhdr; CK_LIST_ENTRY(gre_softc) chain; + CK_LIST_ENTRY(gre_softc) srchash; }; CK_LIST_HEAD(gre_list, gre_softc); MALLOC_DECLARE(M_GRE); @@ -91,7 +92,8 @@ MALLOC_DECLARE(M_GRE); #endif #define GRE2IFP(sc) ((sc)->gre_ifp) -#define GRE_RLOCK() struct epoch_tracker gre_et; epoch_enter_preempt(net_epoch_preempt, &gre_et) +#define GRE_RLOCK_TRACKER struct epoch_tracker gre_et +#define GRE_RLOCK() epoch_enter_preempt(net_epoch_preempt, &gre_et) #define GRE_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &gre_et) #define GRE_WAIT() epoch_wait_preempt(net_epoch_preempt) Modified: stable/12/sys/net/if_me.c ============================================================================== --- stable/12/sys/net/if_me.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/net/if_me.c Sun Nov 18 00:17:06 2018 (r340535) @@ -83,11 +83,13 @@ struct me_softc { struct in_addr me_dst; CK_LIST_ENTRY(me_softc) chain; + CK_LIST_ENTRY(me_softc) srchash; }; CK_LIST_HEAD(me_list, me_softc); #define ME2IFP(sc) ((sc)->me_ifp) #define ME_READY(sc) ((sc)->me_src.s_addr != 0) -#define ME_RLOCK() struct epoch_tracker me_et; epoch_enter_preempt(net_epoch_preempt, &me_et) +#define ME_RLOCK_TRACKER struct epoch_tracker me_et +#define ME_RLOCK() epoch_enter_preempt(net_epoch_preempt, &me_et) #define ME_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &me_et) #define ME_WAIT() epoch_wait_preempt(net_epoch_preempt) @@ -95,9 +97,13 @@ CK_LIST_HEAD(me_list, me_softc); #define ME_HASH_SIZE (1 << 4) #endif VNET_DEFINE_STATIC(struct me_list *, me_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct me_list *, me_srchashtbl) = NULL; #define V_me_hashtbl VNET(me_hashtbl) +#define V_me_srchashtbl VNET(me_srchashtbl) #define ME_HASH(src, dst) (V_me_hashtbl[\ me_hashval((src), (dst)) & (ME_HASH_SIZE - 1)]) +#define ME_SRCHASH(src) (V_me_srchashtbl[\ + fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (ME_HASH_SIZE - 1)]) static struct sx me_ioctl_sx; SX_SYSINIT(me_ioctl_sx, &me_ioctl_sx, "me_ioctl"); @@ -155,6 +161,7 @@ me_hashinit(void) static void vnet_me_init(const void *unused __unused) { + V_me_cloner = if_clone_simple(mename, me_clone_create, me_clone_destroy, 0); } @@ -165,8 +172,12 @@ static void vnet_me_uninit(const void *unused __unused) { - if (V_me_hashtbl != NULL) + if (V_me_hashtbl != NULL) { free(V_me_hashtbl, M_IFME); + V_me_hashtbl = NULL; + ME_WAIT(); + free(V_me_srchashtbl, M_IFME); + } if_clone_detach(V_me_cloner); } VNET_SYSUNINIT(vnet_me_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, @@ -330,6 +341,44 @@ me_lookup(const struct mbuf *m, int off, int proto, vo return (0); } +/* + * Check that ingress address belongs to local host. + */ +static void +me_set_running(struct me_softc *sc) +{ + + if (in_localip(sc->me_src)) + ME2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + ME2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +me_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + const struct sockaddr_in *sin; + struct me_softc *sc; + + /* Check that VNET is ready */ + if (V_me_hashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in *)sa; + CK_LIST_FOREACH(sc, &ME_SRCHASH(sin->sin_addr.s_addr), srchash) { + if (sc->me_src.s_addr != sin->sin_addr.s_addr) + continue; + me_set_running(sc); + } +} + static int me_set_tunnel(struct me_softc *sc, in_addr_t src, in_addr_t dst) { @@ -337,8 +386,10 @@ me_set_tunnel(struct me_softc *sc, in_addr_t src, in_a sx_assert(&me_ioctl_sx, SA_XLOCKED); - if (V_me_hashtbl == NULL) + if (V_me_hashtbl == NULL) { V_me_hashtbl = me_hashinit(); + V_me_srchashtbl = me_hashinit(); + } if (sc->me_src.s_addr == src && sc->me_dst.s_addr == dst) return (0); @@ -355,8 +406,9 @@ me_set_tunnel(struct me_softc *sc, in_addr_t src, in_a sc->me_dst.s_addr = dst; sc->me_src.s_addr = src; CK_LIST_INSERT_HEAD(&ME_HASH(src, dst), sc, chain); + CK_LIST_INSERT_HEAD(&ME_SRCHASH(src), sc, srchash); - ME2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + me_set_running(sc); if_link_state_change(ME2IFP(sc), LINK_STATE_UP); return (0); } @@ -368,6 +420,7 @@ me_delete_tunnel(struct me_softc *sc) sx_assert(&me_ioctl_sx, SA_XLOCKED); if (ME_READY(sc)) { CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); ME_WAIT(); sc->me_src.s_addr = 0; @@ -473,6 +526,7 @@ me_output(struct ifnet *ifp, struct mbuf *m, const str static int me_transmit(struct ifnet *ifp, struct mbuf *m) { + ME_RLOCK_TRACKER; struct mobhdr mh; struct me_softc *sc; struct ip *ip; @@ -490,6 +544,7 @@ me_transmit(struct ifnet *ifp, struct mbuf *m) if (sc == NULL || !ME_READY(sc) || (ifp->if_flags & IFF_MONITOR) != 0 || (ifp->if_flags & IFF_UP) == 0 || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (error = if_tunnel_check_nesting(ifp, m, MTAG_ME, V_max_me_nesting)) != 0) { m_freem(m); @@ -567,6 +622,7 @@ me_qflush(struct ifnet *ifp __unused) } +static const struct srcaddrtab *me_srcaddrtab = NULL; static const struct encaptab *ecookie = NULL; static const struct encap_config me_encap_cfg = { .proto = IPPROTO_MOBILE, @@ -583,10 +639,13 @@ memodevent(module_t mod, int type, void *data) switch (type) { case MOD_LOAD: + me_srcaddrtab = ip_encap_register_srcaddr(me_srcaddr, + NULL, M_WAITOK); ecookie = ip_encap_attach(&me_encap_cfg, NULL, M_WAITOK); break; case MOD_UNLOAD: ip_encap_detach(ecookie); + ip_encap_unregister_srcaddr(me_srcaddrtab); break; default: return (EOPNOTSUPP); Modified: stable/12/sys/netinet/in_gif.c ============================================================================== --- stable/12/sys/netinet/in_gif.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/netinet/in_gif.c Sun Nov 18 00:17:06 2018 (r340535) @@ -82,12 +82,16 @@ SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLA * Interfaces with GIF_IGNORE_SOURCE flag are linked into plain list. */ VNET_DEFINE_STATIC(struct gif_list *, ipv4_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gif_list *, ipv4_srchashtbl) = NULL; VNET_DEFINE_STATIC(struct gif_list, ipv4_list) = CK_LIST_HEAD_INITIALIZER(); #define V_ipv4_hashtbl VNET(ipv4_hashtbl) +#define V_ipv4_srchashtbl VNET(ipv4_srchashtbl) #define V_ipv4_list VNET(ipv4_list) #define GIF_HASH(src, dst) (V_ipv4_hashtbl[\ in_gif_hashval((src), (dst)) & (GIF_HASH_SIZE - 1)]) +#define GIF_SRCHASH(src) (V_ipv4_srchashtbl[\ + fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (GIF_HASH_SIZE - 1)]) #define GIF_HASH_SC(sc) GIF_HASH((sc)->gif_iphdr->ip_src.s_addr,\ (sc)->gif_iphdr->ip_dst.s_addr) static uint32_t @@ -119,7 +123,45 @@ in_gif_checkdup(const struct gif_softc *sc, in_addr_t return (0); } +/* + * Check that ingress address belongs to local host. + */ static void +in_gif_set_running(struct gif_softc *sc) +{ + + if (in_localip(sc->gif_iphdr->ip_src)) + GIF2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + GIF2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +in_gif_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + const struct sockaddr_in *sin; + struct gif_softc *sc; + + /* Check that VNET is ready */ + if (V_ipv4_hashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in *)sa; + CK_LIST_FOREACH(sc, &GIF_SRCHASH(sin->sin_addr.s_addr), srchash) { + if (sc->gif_iphdr->ip_src.s_addr != sin->sin_addr.s_addr) + continue; + in_gif_set_running(sc); + } +} + +static void in_gif_attach(struct gif_softc *sc) { @@ -127,6 +169,9 @@ in_gif_attach(struct gif_softc *sc) CK_LIST_INSERT_HEAD(&V_ipv4_list, sc, chain); else CK_LIST_INSERT_HEAD(&GIF_HASH_SC(sc), sc, chain); + + CK_LIST_INSERT_HEAD(&GIF_SRCHASH(sc->gif_iphdr->ip_src.s_addr), + sc, srchash); } int @@ -139,6 +184,7 @@ in_gif_setopts(struct gif_softc *sc, u_int options) if ((options & GIF_IGNORE_SOURCE) != (sc->gif_options & GIF_IGNORE_SOURCE)) { + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); sc->gif_options = options; in_gif_attach(sc); @@ -172,8 +218,10 @@ in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t error = EADDRNOTAVAIL; break; } - if (V_ipv4_hashtbl == NULL) + if (V_ipv4_hashtbl == NULL) { V_ipv4_hashtbl = gif_hashinit(); + V_ipv4_srchashtbl = gif_hashinit(); + } error = in_gif_checkdup(sc, src->sin_addr.s_addr, dst->sin_addr.s_addr); if (error == EADDRNOTAVAIL) @@ -188,6 +236,7 @@ in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t ip->ip_dst.s_addr = dst->sin_addr.s_addr; if (sc->gif_family != 0) { /* Detach existing tunnel first */ + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); GIF_WAIT(); free(sc->gif_hdr, M_GIF); @@ -196,6 +245,7 @@ in_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_t sc->gif_family = AF_INET; sc->gif_iphdr = ip; in_gif_attach(sc); + in_gif_set_running(sc); break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: @@ -342,6 +392,7 @@ done: return (ret); } +static const struct srcaddrtab *ipv4_srcaddrtab; static struct { const struct encap_config encap; const struct encaptab *cookie; @@ -387,6 +438,9 @@ in_gif_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + + ipv4_srcaddrtab = ip_encap_register_srcaddr(in_gif_srcaddr, + NULL, M_WAITOK); for (i = 0; i < nitems(ipv4_encap_cfg); i++) ipv4_encap_cfg[i].cookie = ip_encap_attach( &ipv4_encap_cfg[i].encap, NULL, M_WAITOK); @@ -400,8 +454,13 @@ in_gif_uninit(void) if (IS_DEFAULT_VNET(curvnet)) { for (i = 0; i < nitems(ipv4_encap_cfg); i++) ip_encap_detach(ipv4_encap_cfg[i].cookie); + ip_encap_unregister_srcaddr(ipv4_srcaddrtab); } - if (V_ipv4_hashtbl != NULL) + if (V_ipv4_hashtbl != NULL) { gif_hashdestroy(V_ipv4_hashtbl); + V_ipv4_hashtbl = NULL; + GIF_WAIT(); + gif_hashdestroy(V_ipv4_srchashtbl); + } } Modified: stable/12/sys/netinet/ip_gre.c ============================================================================== --- stable/12/sys/netinet/ip_gre.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/netinet/ip_gre.c Sun Nov 18 00:17:06 2018 (r340535) @@ -75,9 +75,13 @@ SYSCTL_INT(_net_inet_ip, OID_AUTO, grettl, CTLFLAG_VNE &VNET_NAME(ip_gre_ttl), 0, "Default TTL value for encapsulated packets"); VNET_DEFINE_STATIC(struct gre_list *, ipv4_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gre_list *, ipv4_srchashtbl) = NULL; #define V_ipv4_hashtbl VNET(ipv4_hashtbl) +#define V_ipv4_srchashtbl VNET(ipv4_srchashtbl) #define GRE_HASH(src, dst) (V_ipv4_hashtbl[\ in_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)]) +#define GRE_SRCHASH(src) (V_ipv4_srchashtbl[\ + fnv_32_buf(&(src), sizeof(src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) #define GRE_HASH_SC(sc) GRE_HASH((sc)->gre_oip.ip_src.s_addr,\ (sc)->gre_oip.ip_dst.s_addr) @@ -138,7 +142,45 @@ in_gre_lookup(const struct mbuf *m, int off, int proto return (0); } +/* + * Check that ingress address belongs to local host. + */ static void +in_gre_set_running(struct gre_softc *sc) +{ + + if (in_localip(sc->gre_oip.ip_src)) + GRE2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + GRE2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +in_gre_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + const struct sockaddr_in *sin; + struct gre_softc *sc; + + /* Check that VNET is ready */ + if (V_ipv4_hashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in *)sa; + CK_LIST_FOREACH(sc, &GRE_SRCHASH(sin->sin_addr.s_addr), srchash) { + if (sc->gre_oip.ip_src.s_addr != sin->sin_addr.s_addr) + continue; + in_gre_set_running(sc); + } +} + +static void in_gre_attach(struct gre_softc *sc) { @@ -148,6 +190,8 @@ in_gre_attach(struct gre_softc *sc) sc->gre_oip.ip_p = IPPROTO_GRE; gre_updatehdr(sc, &sc->gre_gihdr->gi_gre); CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain); + CK_LIST_INSERT_HEAD(&GRE_SRCHASH(sc->gre_oip.ip_src.s_addr), + sc, srchash); } void @@ -159,6 +203,7 @@ in_gre_setopts(struct gre_softc *sc, u_long cmd, uint3 /* NOTE: we are protected with gre_ioctl_sx lock */ MPASS(sc->gre_family == AF_INET); CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); if (cmd == GRESKEY) sc->gre_key = value; @@ -193,8 +238,10 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t error = EADDRNOTAVAIL; break; } - if (V_ipv4_hashtbl == NULL) + if (V_ipv4_hashtbl == NULL) { V_ipv4_hashtbl = gre_hashinit(); + V_ipv4_srchashtbl = gre_hashinit(); + } error = in_gre_checkdup(sc, src->sin_addr.s_addr, dst->sin_addr.s_addr); if (error == EADDRNOTAVAIL) @@ -211,6 +258,7 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t if (sc->gre_family != 0) { /* Detach existing tunnel first */ CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); free(sc->gre_hdr, M_GRE); /* XXX: should we notify about link state change? */ @@ -220,6 +268,7 @@ in_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_t sc->gre_oseq = 0; sc->gre_iseq = UINT32_MAX; in_gre_attach(sc); + in_gre_set_running(sc); break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: @@ -271,6 +320,7 @@ in_gre_output(struct mbuf *m, int af, int hlen) return (ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL)); } +static const struct srcaddrtab *ipv4_srcaddrtab = NULL; static const struct encaptab *ecookie = NULL; static const struct encap_config ipv4_encap_cfg = { .proto = IPPROTO_GRE, @@ -286,6 +336,8 @@ in_gre_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + ipv4_srcaddrtab = ip_encap_register_srcaddr(in_gre_srcaddr, + NULL, M_WAITOK); ecookie = ip_encap_attach(&ipv4_encap_cfg, NULL, M_WAITOK); } @@ -293,8 +345,14 @@ void in_gre_uninit(void) { - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { ip_encap_detach(ecookie); - if (V_ipv4_hashtbl != NULL) + ip_encap_unregister_srcaddr(ipv4_srcaddrtab); + } + if (V_ipv4_hashtbl != NULL) { gre_hashdestroy(V_ipv4_hashtbl); + V_ipv4_hashtbl = NULL; + GRE_WAIT(); + gre_hashdestroy(V_ipv4_srchashtbl); + } } Modified: stable/12/sys/netinet6/in6_gif.c ============================================================================== --- stable/12/sys/netinet6/in6_gif.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/netinet6/in6_gif.c Sun Nov 18 00:17:06 2018 (r340535) @@ -87,12 +87,16 @@ SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM, gifhlim, * Interfaces with GIF_IGNORE_SOURCE flag are linked into plain list. */ VNET_DEFINE_STATIC(struct gif_list *, ipv6_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gif_list *, ipv6_srchashtbl) = NULL; VNET_DEFINE_STATIC(struct gif_list, ipv6_list) = CK_LIST_HEAD_INITIALIZER(); #define V_ipv6_hashtbl VNET(ipv6_hashtbl) +#define V_ipv6_srchashtbl VNET(ipv6_srchashtbl) #define V_ipv6_list VNET(ipv6_list) #define GIF_HASH(src, dst) (V_ipv6_hashtbl[\ in6_gif_hashval((src), (dst)) & (GIF_HASH_SIZE - 1)]) +#define GIF_SRCHASH(src) (V_ipv6_srchashtbl[\ + fnv_32_buf((src), sizeof(*src), FNV1_32_INIT) & (GIF_HASH_SIZE - 1)]) #define GIF_HASH_SC(sc) GIF_HASH(&(sc)->gif_ip6hdr->ip6_src,\ &(sc)->gif_ip6hdr->ip6_dst) static uint32_t @@ -125,7 +129,45 @@ in6_gif_checkdup(const struct gif_softc *sc, const str return (0); } +/* + * Check that ingress address belongs to local host. + */ static void +in6_gif_set_running(struct gif_softc *sc) +{ + + if (in6_localip(&sc->gif_ip6hdr->ip6_src)) + GIF2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + GIF2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +in6_gif_srcaddr(void *arg __unused, const struct sockaddr *sa, int event) +{ + const struct sockaddr_in6 *sin; + struct gif_softc *sc; + + /* Check that VNET is ready */ + if (V_ipv6_hashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in6 *)sa; + CK_LIST_FOREACH(sc, &GIF_SRCHASH(&sin->sin6_addr), srchash) { + if (IN6_ARE_ADDR_EQUAL(&sc->gif_ip6hdr->ip6_src, + &sin->sin6_addr) == 0) + continue; + in6_gif_set_running(sc); + } +} + +static void in6_gif_attach(struct gif_softc *sc) { @@ -133,6 +175,9 @@ in6_gif_attach(struct gif_softc *sc) CK_LIST_INSERT_HEAD(&V_ipv6_list, sc, chain); else CK_LIST_INSERT_HEAD(&GIF_HASH_SC(sc), sc, chain); + + CK_LIST_INSERT_HEAD(&GIF_SRCHASH(&sc->gif_ip6hdr->ip6_src), + sc, srchash); } int @@ -145,6 +190,7 @@ in6_gif_setopts(struct gif_softc *sc, u_int options) if ((options & GIF_IGNORE_SOURCE) != (sc->gif_options & GIF_IGNORE_SOURCE)) { + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); sc->gif_options = options; in6_gif_attach(sc); @@ -187,8 +233,10 @@ in6_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_ (error = sa6_embedscope(dst, 0)) != 0) break; - if (V_ipv6_hashtbl == NULL) + if (V_ipv6_hashtbl == NULL) { V_ipv6_hashtbl = gif_hashinit(); + V_ipv6_srchashtbl = gif_hashinit(); + } error = in6_gif_checkdup(sc, &src->sin6_addr, &dst->sin6_addr); if (error == EADDRNOTAVAIL) @@ -204,6 +252,7 @@ in6_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_ ip6->ip6_vfc = IPV6_VERSION; if (sc->gif_family != 0) { /* Detach existing tunnel first */ + CK_LIST_REMOVE(sc, srchash); CK_LIST_REMOVE(sc, chain); GIF_WAIT(); free(sc->gif_hdr, M_GIF); @@ -212,6 +261,7 @@ in6_gif_ioctl(struct gif_softc *sc, u_long cmd, caddr_ sc->gif_family = AF_INET6; sc->gif_ip6hdr = ip6; in6_gif_attach(sc); + in6_gif_set_running(sc); break; case SIOCGIFPSRCADDR_IN6: case SIOCGIFPDSTADDR_IN6: @@ -365,6 +415,7 @@ done: return (ret); } +static const struct srcaddrtab *ipv6_srcaddrtab; static struct { const struct encap_config encap; const struct encaptab *cookie; @@ -410,6 +461,9 @@ in6_gif_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + + ipv6_srcaddrtab = ip6_encap_register_srcaddr(in6_gif_srcaddr, + NULL, M_WAITOK); for (i = 0; i < nitems(ipv6_encap_cfg); i++) ipv6_encap_cfg[i].cookie = ip6_encap_attach( &ipv6_encap_cfg[i].encap, NULL, M_WAITOK); @@ -423,7 +477,12 @@ in6_gif_uninit(void) if (IS_DEFAULT_VNET(curvnet)) { for (i = 0; i < nitems(ipv6_encap_cfg); i++) ip6_encap_detach(ipv6_encap_cfg[i].cookie); + ip6_encap_unregister_srcaddr(ipv6_srcaddrtab); } - if (V_ipv6_hashtbl != NULL) + if (V_ipv6_hashtbl != NULL) { gif_hashdestroy(V_ipv6_hashtbl); + V_ipv6_hashtbl = NULL; + GIF_WAIT(); + gif_hashdestroy(V_ipv6_srchashtbl); + } } Modified: stable/12/sys/netinet6/ip6_gre.c ============================================================================== --- stable/12/sys/netinet6/ip6_gre.c Sun Nov 18 00:11:19 2018 (r340534) +++ stable/12/sys/netinet6/ip6_gre.c Sun Nov 18 00:17:06 2018 (r340535) @@ -66,9 +66,13 @@ SYSCTL_INT(_net_inet6_ip6, OID_AUTO, grehlim, CTLFLAG_ &VNET_NAME(ip6_gre_hlim), 0, "Default hop limit for encapsulated packets"); VNET_DEFINE_STATIC(struct gre_list *, ipv6_hashtbl) = NULL; +VNET_DEFINE_STATIC(struct gre_list *, ipv6_srchashtbl) = NULL; #define V_ipv6_hashtbl VNET(ipv6_hashtbl) +#define V_ipv6_srchashtbl VNET(ipv6_srchashtbl) #define GRE_HASH(src, dst) (V_ipv6_hashtbl[\ in6_gre_hashval((src), (dst)) & (GRE_HASH_SIZE - 1)]) +#define GRE_SRCHASH(src) (V_ipv6_srchashtbl[\ + fnv_32_buf((src), sizeof(*src), FNV1_32_INIT) & (GRE_HASH_SIZE - 1)]) #define GRE_HASH_SC(sc) GRE_HASH(&(sc)->gre_oip6.ip6_src,\ &(sc)->gre_oip6.ip6_dst) @@ -131,7 +135,46 @@ in6_gre_lookup(const struct mbuf *m, int off, int prot return (0); } +/* + * Check that ingress address belongs to local host. + */ static void +in6_gre_set_running(struct gre_softc *sc) +{ + + if (in6_localip(&sc->gre_oip6.ip6_src)) + GRE2IFP(sc)->if_drv_flags |= IFF_DRV_RUNNING; + else + GRE2IFP(sc)->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +in6_gre_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + const struct sockaddr_in6 *sin; + struct gre_softc *sc; + + /* Check that VNET is ready */ + if (V_ipv6_hashtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + sin = (const struct sockaddr_in6 *)sa; + CK_LIST_FOREACH(sc, &GRE_SRCHASH(&sin->sin6_addr), srchash) { + if (IN6_ARE_ADDR_EQUAL(&sc->gre_oip6.ip6_src, + &sin->sin6_addr) == 0) + continue; + in6_gre_set_running(sc); + } +} + +static void in6_gre_attach(struct gre_softc *sc) { @@ -140,6 +183,7 @@ in6_gre_attach(struct gre_softc *sc) sc->gre_oip6.ip6_nxt = IPPROTO_GRE; gre_updatehdr(sc, &sc->gre_gi6hdr->gi6_gre); CK_LIST_INSERT_HEAD(&GRE_HASH_SC(sc), sc, chain); + CK_LIST_INSERT_HEAD(&GRE_SRCHASH(&sc->gre_oip6.ip6_src), sc, srchash); } void @@ -151,6 +195,7 @@ in6_gre_setopts(struct gre_softc *sc, u_long cmd, uint /* NOTE: we are protected with gre_ioctl_sx lock */ MPASS(sc->gre_family == AF_INET6); CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); if (cmd == GRESKEY) sc->gre_key = value; @@ -194,8 +239,10 @@ in6_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_ (error = sa6_embedscope(dst, 0)) != 0) break; - if (V_ipv6_hashtbl == NULL) + if (V_ipv6_hashtbl == NULL) { V_ipv6_hashtbl = gre_hashinit(); + V_ipv6_srchashtbl = gre_hashinit(); + } error = in6_gre_checkdup(sc, &src->sin6_addr, &dst->sin6_addr); if (error == EADDRNOTAVAIL) @@ -212,6 +259,7 @@ in6_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_ if (sc->gre_family != 0) { /* Detach existing tunnel first */ CK_LIST_REMOVE(sc, chain); + CK_LIST_REMOVE(sc, srchash); GRE_WAIT(); free(sc->gre_hdr, M_GRE); /* XXX: should we notify about link state change? */ @@ -221,6 +269,7 @@ in6_gre_ioctl(struct gre_softc *sc, u_long cmd, caddr_ sc->gre_oseq = 0; sc->gre_iseq = UINT32_MAX; in6_gre_attach(sc); + in6_gre_set_running(sc); break; case SIOCGIFPSRCADDR_IN6: case SIOCGIFPDSTADDR_IN6: @@ -254,6 +303,7 @@ in6_gre_output(struct mbuf *m, int af __unused, int hl return (ip6_output(m, NULL, NULL, IPV6_MINMTU, NULL, NULL, NULL)); } +static const struct srcaddrtab *ipv6_srcaddrtab = NULL; static const struct encaptab *ecookie = NULL; static const struct encap_config ipv6_encap_cfg = { .proto = IPPROTO_GRE, @@ -274,6 +324,8 @@ in6_gre_init(void) if (!IS_DEFAULT_VNET(curvnet)) return; + ipv6_srcaddrtab = ip6_encap_register_srcaddr(in6_gre_srcaddr, + NULL, M_WAITOK); ecookie = ip6_encap_attach(&ipv6_encap_cfg, NULL, M_WAITOK); } @@ -281,8 +333,14 @@ void in6_gre_uninit(void) { - if (IS_DEFAULT_VNET(curvnet)) + if (IS_DEFAULT_VNET(curvnet)) { ip6_encap_detach(ecookie); - if (V_ipv6_hashtbl != NULL) + ip6_encap_unregister_srcaddr(ipv6_srcaddrtab); + } + if (V_ipv6_hashtbl != NULL) { gre_hashdestroy(V_ipv6_hashtbl); + V_ipv6_hashtbl = NULL; + GRE_WAIT(); + gre_hashdestroy(V_ipv6_srchashtbl); + } } From owner-svn-src-stable-12@freebsd.org Sun Nov 18 00:22:02 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1176110CB4F; Sun, 18 Nov 2018 00:22:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96DDF88913; Sun, 18 Nov 2018 00:22:01 +0000 (UTC) (envelope-from ae@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 783BC3B31; Sun, 18 Nov 2018 00:22:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI0M1lC087766; Sun, 18 Nov 2018 00:22:01 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI0M10B087765; Sun, 18 Nov 2018 00:22:01 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201811180022.wAI0M10B087765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2018 00:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340536 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 340536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96DDF88913 X-Spamd-Result: default: False [-0.12 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.12)[-0.124,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 00:22:02 -0000 Author: ae Date: Sun Nov 18 00:22:01 2018 New Revision: 340536 URL: https://svnweb.freebsd.org/changeset/base/340536 Log: MFC r339554: Rework if_ipsec(4) to use epoch(9) instead of rmlock. * use CK_LIST and FNV hash to keep chains of softc; * read access to softc is protected by epoch(); * write access is protected by ipsec_ioctl_sx. Changing of softc fields is allowed only when softc is unlinked from CK_LIST chains. * linking/unlinking of softc is allowed only when ipsec_ioctl_sx is exclusive locked. * the plain LIST of all softc is replaced by hash table that uses ingress address of tunnels as a key. * added support for appearing/disappearing of ingress address handling. Now it is allowed configure non-local ingress IP address, and thus the problem with if_ipsec(4) configuration that happens on boot, when ingress address is not yet configured, is solved. Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D17190 MFC r339555: Follow the fix in r339532 (by glebius): Fix exiting an epoch(9) we never entered. May happen only with MAC. MFC r339642: Remove softc from idhash when interface is destroyed. MFC r339646: Add the check that current VNET is ready and access to srchash is allowed. ipsec_srcaddr() callback can be called during VNET teardown, since ingress address checking subsystem isn't VNET specific. And thus callback can make access to already freed memory. To prevent this, use V_ipsec_idhtbl pointer as indicator of VNET readiness. And make epoch_wait() after resetting it to NULL in vnet_ipsec_uninit() to be sure that ipsec_srcaddr() is finished its work. Reported by: kp Modified: stable/12/sys/net/if_ipsec.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_ipsec.c ============================================================================== --- stable/12/sys/net/if_ipsec.c Sun Nov 18 00:17:06 2018 (r340535) +++ stable/12/sys/net/if_ipsec.c Sun Nov 18 00:22:01 2018 (r340536) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2016 Yandex LLC - * Copyright (c) 2016 Andrey V. Elsukov + * Copyright (c) 2016-2018 Yandex LLC + * Copyright (c) 2016-2018 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -61,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -87,58 +87,72 @@ static const char ipsecname[] = "ipsec"; struct ipsec_softc { struct ifnet *ifp; - - struct rmlock lock; struct secpolicy *sp[IPSEC_SPCOUNT]; - uint32_t reqid; u_int family; u_int fibnum; - LIST_ENTRY(ipsec_softc) chain; - LIST_ENTRY(ipsec_softc) hash; + + CK_LIST_ENTRY(ipsec_softc) idhash; + CK_LIST_ENTRY(ipsec_softc) srchash; }; -#define IPSEC_LOCK_INIT(sc) rm_init(&(sc)->lock, "if_ipsec softc") -#define IPSEC_LOCK_DESTROY(sc) rm_destroy(&(sc)->lock) -#define IPSEC_RLOCK_TRACKER struct rm_priotracker ipsec_tracker -#define IPSEC_RLOCK(sc) rm_rlock(&(sc)->lock, &ipsec_tracker) -#define IPSEC_RUNLOCK(sc) rm_runlock(&(sc)->lock, &ipsec_tracker) -#define IPSEC_RLOCK_ASSERT(sc) rm_assert(&(sc)->lock, RA_RLOCKED) -#define IPSEC_WLOCK(sc) rm_wlock(&(sc)->lock) -#define IPSEC_WUNLOCK(sc) rm_wunlock(&(sc)->lock) -#define IPSEC_WLOCK_ASSERT(sc) rm_assert(&(sc)->lock, RA_WLOCKED) +#define IPSEC_RLOCK_TRACKER struct epoch_tracker ipsec_et +#define IPSEC_RLOCK() epoch_enter_preempt(net_epoch_preempt, &ipsec_et) +#define IPSEC_RUNLOCK() epoch_exit_preempt(net_epoch_preempt, &ipsec_et) +#define IPSEC_WAIT() epoch_wait_preempt(net_epoch_preempt) -static struct rmlock ipsec_sc_lock; -RM_SYSINIT(ipsec_sc_lock, &ipsec_sc_lock, "if_ipsec softc list"); +#ifndef IPSEC_HASH_SIZE +#define IPSEC_HASH_SIZE (1 << 5) +#endif -#define IPSEC_SC_RLOCK_TRACKER struct rm_priotracker ipsec_sc_tracker -#define IPSEC_SC_RLOCK() rm_rlock(&ipsec_sc_lock, &ipsec_sc_tracker) -#define IPSEC_SC_RUNLOCK() rm_runlock(&ipsec_sc_lock, &ipsec_sc_tracker) -#define IPSEC_SC_RLOCK_ASSERT() rm_assert(&ipsec_sc_lock, RA_RLOCKED) -#define IPSEC_SC_WLOCK() rm_wlock(&ipsec_sc_lock) -#define IPSEC_SC_WUNLOCK() rm_wunlock(&ipsec_sc_lock) -#define IPSEC_SC_WLOCK_ASSERT() rm_assert(&ipsec_sc_lock, RA_WLOCKED) +CK_LIST_HEAD(ipsec_iflist, ipsec_softc); +VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec_idhtbl) = NULL; +#define V_ipsec_idhtbl VNET(ipsec_idhtbl) -LIST_HEAD(ipsec_iflist, ipsec_softc); -VNET_DEFINE_STATIC(struct ipsec_iflist, ipsec_sc_list); -VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec_sc_htbl); -VNET_DEFINE_STATIC(u_long, ipsec_sc_hmask); -#define V_ipsec_sc_list VNET(ipsec_sc_list) -#define V_ipsec_sc_htbl VNET(ipsec_sc_htbl) -#define V_ipsec_sc_hmask VNET(ipsec_sc_hmask) +#ifdef INET +VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec4_srchtbl) = NULL; +#define V_ipsec4_srchtbl VNET(ipsec4_srchtbl) +static const struct srcaddrtab *ipsec4_srctab = NULL; +#endif -static uint32_t -ipsec_hash(uint32_t id) +#ifdef INET6 +VNET_DEFINE_STATIC(struct ipsec_iflist *, ipsec6_srchtbl) = NULL; +#define V_ipsec6_srchtbl VNET(ipsec6_srchtbl) +static const struct srcaddrtab *ipsec6_srctab = NULL; +#endif + +static struct ipsec_iflist * +ipsec_idhash(uint32_t id) { - return (fnv_32_buf(&id, sizeof(id), FNV1_32_INIT)); + return (&V_ipsec_idhtbl[fnv_32_buf(&id, sizeof(id), + FNV1_32_INIT) & (IPSEC_HASH_SIZE - 1)]); } -#define SCHASH_NHASH_LOG2 5 -#define SCHASH_NHASH (1 << SCHASH_NHASH_LOG2) -#define SCHASH_HASHVAL(id) (ipsec_hash((id)) & V_ipsec_sc_hmask) -#define SCHASH_HASH(id) &V_ipsec_sc_htbl[SCHASH_HASHVAL(id)] +static struct ipsec_iflist * +ipsec_srchash(const struct sockaddr *sa) +{ + uint32_t hval; + switch (sa->sa_family) { +#ifdef INET + case AF_INET: + hval = fnv_32_buf( + &((const struct sockaddr_in *)sa)->sin_addr.s_addr, + sizeof(in_addr_t), FNV1_32_INIT); + return (&V_ipsec4_srchtbl[hval & (IPSEC_HASH_SIZE - 1)]); +#endif +#ifdef INET6 + case AF_INET6: + hval = fnv_32_buf( + &((const struct sockaddr_in6 *)sa)->sin6_addr, + sizeof(struct in6_addr), FNV1_32_INIT); + return (&V_ipsec6_srchtbl[hval & (IPSEC_HASH_SIZE - 1)]); +#endif + } + return (NULL); +} + /* * ipsec_ioctl_sx protects from concurrent ioctls. */ @@ -148,12 +162,14 @@ SX_SYSINIT(ipsec_ioctl_sx, &ipsec_ioctl_sx, "ipsec_ioc static int ipsec_init_reqid(struct ipsec_softc *); static int ipsec_set_tunnel(struct ipsec_softc *, struct sockaddr *, struct sockaddr *, uint32_t); -static void ipsec_delete_tunnel(struct ifnet *, int); +static void ipsec_delete_tunnel(struct ipsec_softc *); static int ipsec_set_addresses(struct ifnet *, struct sockaddr *, struct sockaddr *); -static int ipsec_set_reqid(struct ifnet *, uint32_t); +static int ipsec_set_reqid(struct ipsec_softc *, uint32_t); +static void ipsec_set_running(struct ipsec_softc *); +static void ipsec_srcaddr(void *, const struct sockaddr *, int); static int ipsec_ioctl(struct ifnet *, u_long, caddr_t); static int ipsec_transmit(struct ifnet *, struct mbuf *); static int ipsec_output(struct ifnet *, struct mbuf *, @@ -174,7 +190,6 @@ ipsec_clone_create(struct if_clone *ifc, int unit, cad sc = malloc(sizeof(*sc), M_IPSEC, M_WAITOK | M_ZERO); sc->fibnum = curthread->td_proc->p_fibnum; sc->ifp = ifp = if_alloc(IFT_TUNNEL); - IPSEC_LOCK_INIT(sc); ifp->if_softc = sc; if_initname(ifp, ipsecname, unit); @@ -188,9 +203,6 @@ ipsec_clone_create(struct if_clone *ifc, int unit, cad if_attach(ifp); bpfattach(ifp, DLT_NULL, sizeof(uint32_t)); - IPSEC_SC_WLOCK(); - LIST_INSERT_HEAD(&V_ipsec_sc_list, sc, chain); - IPSEC_SC_WUNLOCK(); return (0); } @@ -201,28 +213,54 @@ ipsec_clone_destroy(struct ifnet *ifp) sx_xlock(&ipsec_ioctl_sx); sc = ifp->if_softc; - - IPSEC_SC_WLOCK(); - ipsec_delete_tunnel(ifp, 1); - LIST_REMOVE(sc, chain); - IPSEC_SC_WUNLOCK(); - + ipsec_delete_tunnel(sc); + /* + * Delete softc from idhash on interface destroy, since + * ipsec_delete_tunnel() keeps reqid unchanged. + */ + if (sc->reqid != 0) + CK_LIST_REMOVE(sc, idhash); bpfdetach(ifp); if_detach(ifp); ifp->if_softc = NULL; sx_xunlock(&ipsec_ioctl_sx); + IPSEC_WAIT(); if_free(ifp); - IPSEC_LOCK_DESTROY(sc); free(sc, M_IPSEC); } +static struct ipsec_iflist * +ipsec_hashinit(void) +{ + struct ipsec_iflist *hash; + int i; + + hash = malloc(sizeof(struct ipsec_iflist) * IPSEC_HASH_SIZE, + M_IPSEC, M_WAITOK); + for (i = 0; i < IPSEC_HASH_SIZE; i++) + CK_LIST_INIT(&hash[i]); + + return (hash); +} + static void vnet_ipsec_init(const void *unused __unused) { - LIST_INIT(&V_ipsec_sc_list); - V_ipsec_sc_htbl = hashinit(SCHASH_NHASH, M_IPSEC, &V_ipsec_sc_hmask); + V_ipsec_idhtbl = ipsec_hashinit(); +#ifdef INET + V_ipsec4_srchtbl = ipsec_hashinit(); + if (IS_DEFAULT_VNET(curvnet)) + ipsec4_srctab = ip_encap_register_srcaddr(ipsec_srcaddr, + NULL, M_WAITOK); +#endif +#ifdef INET6 + V_ipsec6_srchtbl = ipsec_hashinit(); + if (IS_DEFAULT_VNET(curvnet)) + ipsec6_srctab = ip6_encap_register_srcaddr(ipsec_srcaddr, + NULL, M_WAITOK); +#endif V_ipsec_cloner = if_clone_simple(ipsecname, ipsec_clone_create, ipsec_clone_destroy, 0); } @@ -234,7 +272,24 @@ vnet_ipsec_uninit(const void *unused __unused) { if_clone_detach(V_ipsec_cloner); - hashdestroy(V_ipsec_sc_htbl, M_IPSEC, V_ipsec_sc_hmask); + free(V_ipsec_idhtbl, M_IPSEC); + /* + * Use V_ipsec_idhtbl pointer as indicator that VNET is going to be + * destroyed, it is used by ipsec_srcaddr() callback. + */ + V_ipsec_idhtbl = NULL; + IPSEC_WAIT(); + +#ifdef INET + if (IS_DEFAULT_VNET(curvnet)) + ip_encap_unregister_srcaddr(ipsec4_srctab); + free(V_ipsec4_srchtbl, M_IPSEC); +#endif +#ifdef INET6 + if (IS_DEFAULT_VNET(curvnet)) + ip6_encap_unregister_srcaddr(ipsec6_srctab); + free(V_ipsec6_srchtbl, M_IPSEC); +#endif } VNET_SYSUNINIT(vnet_ipsec_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, vnet_ipsec_uninit, NULL); @@ -281,6 +336,7 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) uint32_t af; int error; + IPSEC_RLOCK(); #ifdef MAC error = mac_ifnet_check_transmit(ifp, m); if (error) { @@ -292,7 +348,7 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) sc = ifp->if_softc; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (ifp->if_flags & IFF_MONITOR) != 0 || - (ifp->if_flags & IFF_UP) == 0) { + (ifp->if_flags & IFF_UP) == 0 || sc->family == 0) { m_freem(m); goto err; } @@ -327,16 +383,9 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) goto err; } - IPSEC_RLOCK(sc); - if (sc->family == 0) { - IPSEC_RUNLOCK(sc); - m_freem(m); - goto err; - } sp = ipsec_getpolicy(sc, IPSEC_DIR_OUTBOUND, af); key_addref(sp); M_SETFIB(m, sc->fibnum); - IPSEC_RUNLOCK(sc); BPF_MTAP2(ifp, &af, sizeof(af), m); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); @@ -359,6 +408,7 @@ ipsec_transmit(struct ifnet *ifp, struct mbuf *m) err: if (error != 0) if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + IPSEC_RUNLOCK(); return (error); } @@ -379,7 +429,7 @@ ipsec_output(struct ifnet *ifp, struct mbuf *m, const int ipsec_if_input(struct mbuf *m, struct secasvar *sav, uint32_t af) { - IPSEC_SC_RLOCK_TRACKER; + IPSEC_RLOCK_TRACKER; struct secasindex *saidx; struct ipsec_softc *sc; struct ifnet *ifp; @@ -394,13 +444,10 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u sav->sah->saidx.proto != IPPROTO_ESP) return (0); - IPSEC_SC_RLOCK(); - /* - * We only acquire SC_RLOCK() while we are doing search in - * ipsec_sc_htbl. It is safe, because removing softc or changing - * of reqid/addresses requires removing from hash table. - */ - LIST_FOREACH(sc, SCHASH_HASH(sav->sah->saidx.reqid), hash) { + IPSEC_RLOCK(); + CK_LIST_FOREACH(sc, ipsec_idhash(sav->sah->saidx.reqid), idhash) { + if (sc->family == 0) + continue; saidx = ipsec_getsaidx(sc, IPSEC_DIR_INBOUND, sav->sah->saidx.src.sa.sa_family); /* SA's reqid should match reqid in SP */ @@ -416,14 +463,14 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u break; } if (sc == NULL) { - IPSEC_SC_RUNLOCK(); + IPSEC_RUNLOCK(); /* Tunnel was not found. Nothing to do. */ return (0); } ifp = sc->ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || (ifp->if_flags & IFF_UP) == 0) { - IPSEC_SC_RUNLOCK(); + IPSEC_RUNLOCK(); m_freem(m); return (ENETDOWN); } @@ -432,7 +479,6 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u * Set its ifnet as receiving interface. */ m->m_pkthdr.rcvif = ifp; - IPSEC_SC_RUNLOCK(); m_clrprotoflags(m); M_SETFIB(m, ifp->if_fib); @@ -440,17 +486,17 @@ ipsec_if_input(struct mbuf *m, struct secasvar *sav, u if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); if ((ifp->if_flags & IFF_MONITOR) != 0) { + IPSEC_RUNLOCK(); m_freem(m); return (ENETDOWN); } + IPSEC_RUNLOCK(); return (0); } -/* XXX how should we handle IPv6 scope on SIOC[GS]IFPHYADDR? */ -int +static int ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - IPSEC_RLOCK_TRACKER; struct ifreq *ifr = (struct ifreq*)data; struct sockaddr *dst, *src; struct ipsec_softc *sc; @@ -564,9 +610,10 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat #endif #ifdef INET6 case AF_INET6: - if (IN6_IS_ADDR_UNSPECIFIED(&satosin6(src)->sin6_addr) - || - IN6_IS_ADDR_UNSPECIFIED(&satosin6(dst)->sin6_addr)) + if (IN6_IS_ADDR_UNSPECIFIED( + &satosin6(src)->sin6_addr) || + IN6_IS_ADDR_UNSPECIFIED( + &satosin6(dst)->sin6_addr)) goto bad; /* * Check validity of the scope zone ID of the @@ -584,7 +631,7 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat error = ipsec_set_addresses(ifp, src, dst); break; case SIOCDIFPHYADDR: - ipsec_delete_tunnel(ifp, 0); + ipsec_delete_tunnel(sc); break; case SIOCGIFPSRCADDR: case SIOCGIFPDSTADDR: @@ -592,9 +639,7 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat case SIOCGIFPSRCADDR_IN6: case SIOCGIFPDSTADDR_IN6: #endif - IPSEC_RLOCK(sc); if (sc->family == 0) { - IPSEC_RUNLOCK(sc); error = EADDRNOTAVAIL; break; } @@ -650,7 +695,6 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat #endif } } - IPSEC_RUNLOCK(sc); if (error != 0) break; switch (cmd) { @@ -696,7 +740,7 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat error = copyin(ifr_data_get_ptr(ifr), &reqid, sizeof(reqid)); if (error != 0) break; - error = ipsec_set_reqid(ifp, reqid); + error = ipsec_set_reqid(sc, reqid); break; default: error = EINVAL; @@ -708,6 +752,63 @@ bad: } /* + * Check that ingress address belongs to local host. + */ +static void +ipsec_set_running(struct ipsec_softc *sc) +{ + struct secasindex *saidx; + int localip; + + saidx = ipsec_getsaidx(sc, IPSEC_DIR_OUTBOUND, sc->family); + localip = 0; + switch (sc->family) { +#ifdef INET + case AF_INET: + localip = in_localip(saidx->src.sin.sin_addr); + break; +#endif +#ifdef INET6 + case AF_INET6: + localip = in6_localip(&saidx->src.sin6.sin6_addr); + break; +#endif + } + if (localip != 0) + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; + else + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; +} + +/* + * ifaddr_event handler. + * Clear IFF_DRV_RUNNING flag when ingress address disappears to prevent + * source address spoofing. + */ +static void +ipsec_srcaddr(void *arg __unused, const struct sockaddr *sa, + int event __unused) +{ + struct ipsec_softc *sc; + struct secasindex *saidx; + + /* Check that VNET is ready */ + if (V_ipsec_idhtbl == NULL) + return; + + MPASS(in_epoch(net_epoch_preempt)); + CK_LIST_FOREACH(sc, ipsec_srchash(sa), srchash) { + if (sc->family == 0) + continue; + saidx = ipsec_getsaidx(sc, IPSEC_DIR_OUTBOUND, sa->sa_family); + if (saidx == NULL || + key_sockaddrcmp(&saidx->src.sa, sa, 0) != 0) + continue; + ipsec_set_running(sc); + } +} + +/* * Allocate new private security policies for tunneling interface. * Each tunneling interface has following security policies for * both AF: @@ -779,8 +880,8 @@ ipsec_check_reqid(uint32_t reqid) { struct ipsec_softc *sc; - IPSEC_SC_RLOCK_ASSERT(); - LIST_FOREACH(sc, &V_ipsec_sc_list, chain) { + sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); + CK_LIST_FOREACH(sc, ipsec_idhash(reqid), idhash) { if (sc->reqid == reqid) return (EEXIST); } @@ -800,8 +901,7 @@ ipsec_init_reqid(struct ipsec_softc *sc) uint32_t reqid; int trycount; - IPSEC_SC_RLOCK_ASSERT(); - + sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); if (sc->reqid != 0) /* already initialized */ return (0); @@ -814,6 +914,7 @@ ipsec_init_reqid(struct ipsec_softc *sc) if (trycount == 0) return (EEXIST); sc->reqid = reqid; + CK_LIST_INSERT_HEAD(ipsec_idhash(reqid), sc, idhash); return (0); } @@ -824,34 +925,30 @@ ipsec_init_reqid(struct ipsec_softc *sc) * Also softc would not disappear while we hold ioctl_sx lock. */ static int -ipsec_set_reqid(struct ifnet *ifp, uint32_t reqid) +ipsec_set_reqid(struct ipsec_softc *sc, uint32_t reqid) { - IPSEC_SC_RLOCK_TRACKER; - struct ipsec_softc *sc; struct secasindex *saidx; sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); - sc = ifp->if_softc; if (sc->reqid == reqid && reqid != 0) return (0); - IPSEC_SC_RLOCK(); if (reqid != 0) { /* Check that specified reqid doesn't exist */ - if (ipsec_check_reqid(reqid) != 0) { - IPSEC_SC_RUNLOCK(); + if (ipsec_check_reqid(reqid) != 0) return (EEXIST); + if (sc->reqid != 0) { + CK_LIST_REMOVE(sc, idhash); + IPSEC_WAIT(); } sc->reqid = reqid; + CK_LIST_INSERT_HEAD(ipsec_idhash(reqid), sc, idhash); } else { /* Generate new reqid */ - if (ipsec_init_reqid(sc) != 0) { - IPSEC_SC_RUNLOCK(); + if (ipsec_init_reqid(sc) != 0) return (EEXIST); - } } - IPSEC_SC_RUNLOCK(); /* Tunnel isn't fully configured, just return. */ if (sc->family == 0) @@ -871,7 +968,6 @@ static int ipsec_set_addresses(struct ifnet *ifp, struct sockaddr *src, struct sockaddr *dst) { - IPSEC_SC_RLOCK_TRACKER; struct ipsec_softc *sc, *tsc; struct secasindex *saidx; @@ -887,43 +983,21 @@ ipsec_set_addresses(struct ifnet *ifp, struct sockaddr return (0); /* Nothing has been changed. */ } - /* - * We cannot service IPsec tunnel when source address is - * not our own. - */ -#ifdef INET - if (src->sa_family == AF_INET && - in_localip(satosin(src)->sin_addr) == 0) - return (EADDRNOTAVAIL); -#endif -#ifdef INET6 - /* - * NOTE: IPv6 addresses are in kernel internal form with - * embedded scope zone id. - */ - if (src->sa_family == AF_INET6 && - in6_localip(&satosin6(src)->sin6_addr) == 0) - return (EADDRNOTAVAIL); -#endif /* Check that given addresses aren't already configured */ - IPSEC_SC_RLOCK(); - LIST_FOREACH(tsc, &V_ipsec_sc_list, chain) { - if (tsc == sc || tsc->family != src->sa_family) + CK_LIST_FOREACH(tsc, ipsec_srchash(src), srchash) { + if (tsc == sc) continue; + MPASS(tsc->family == src->sa_family); saidx = ipsec_getsaidx(tsc, IPSEC_DIR_OUTBOUND, tsc->family); if (key_sockaddrcmp(&saidx->src.sa, src, 0) == 0 && key_sockaddrcmp(&saidx->dst.sa, dst, 0) == 0) { /* We already have tunnel with such addresses */ - IPSEC_SC_RUNLOCK(); return (EADDRNOTAVAIL); } } /* If reqid is not set, generate new one. */ - if (ipsec_init_reqid(sc) != 0) { - IPSEC_SC_RUNLOCK(); + if (ipsec_init_reqid(sc) != 0) return (EEXIST); - } - IPSEC_SC_RUNLOCK(); return (ipsec_set_tunnel(sc, src, dst, sc->reqid)); } @@ -932,8 +1006,7 @@ ipsec_set_tunnel(struct ipsec_softc *sc, struct sockad struct sockaddr *dst, uint32_t reqid) { struct secpolicy *sp[IPSEC_SPCOUNT]; - struct secpolicy *oldsp[IPSEC_SPCOUNT]; - int i, f; + int i; sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); @@ -945,58 +1018,39 @@ ipsec_set_tunnel(struct ipsec_softc *sc, struct sockad key_freesp(&sp[i]); return (EAGAIN); } - IPSEC_SC_WLOCK(); - if ((f = sc->family) != 0) - LIST_REMOVE(sc, hash); - IPSEC_WLOCK(sc); - for (i = 0; i < IPSEC_SPCOUNT; i++) { - oldsp[i] = sc->sp[i]; + if (sc->family != 0) + ipsec_delete_tunnel(sc); + for (i = 0; i < IPSEC_SPCOUNT; i++) sc->sp[i] = sp[i]; - } sc->family = src->sa_family; - IPSEC_WUNLOCK(sc); - LIST_INSERT_HEAD(SCHASH_HASH(sc->reqid), sc, hash); - IPSEC_SC_WUNLOCK(); + CK_LIST_INSERT_HEAD(ipsec_srchash(src), sc, srchash); } else { sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; return (ENOMEM); } - - sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; - if (f != 0) { - key_unregister_ifnet(oldsp, IPSEC_SPCOUNT); - for (i = 0; i < IPSEC_SPCOUNT; i++) - key_freesp(&oldsp[i]); - } + ipsec_set_running(sc); return (0); } static void -ipsec_delete_tunnel(struct ifnet *ifp, int locked) +ipsec_delete_tunnel(struct ipsec_softc *sc) { - struct ipsec_softc *sc = ifp->if_softc; - struct secpolicy *oldsp[IPSEC_SPCOUNT]; int i; sx_assert(&ipsec_ioctl_sx, SA_XLOCKED); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + sc->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; if (sc->family != 0) { - if (!locked) - IPSEC_SC_WLOCK(); - /* Remove from hash table */ - LIST_REMOVE(sc, hash); - IPSEC_WLOCK(sc); - for (i = 0; i < IPSEC_SPCOUNT; i++) { - oldsp[i] = sc->sp[i]; - sc->sp[i] = NULL; - } + CK_LIST_REMOVE(sc, srchash); sc->family = 0; - IPSEC_WUNLOCK(sc); - if (!locked) - IPSEC_SC_WUNLOCK(); - key_unregister_ifnet(oldsp, IPSEC_SPCOUNT); + /* + * Make sure that ipsec_if_input() will not do access + * to softc's policies. + */ + IPSEC_WAIT(); + + key_unregister_ifnet(sc->sp, IPSEC_SPCOUNT); for (i = 0; i < IPSEC_SPCOUNT; i++) - key_freesp(&oldsp[i]); + key_freesp(&sc->sp[i]); } } From owner-svn-src-stable-12@freebsd.org Sun Nov 18 02:53:15 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA27A11243DD; Sun, 18 Nov 2018 02:53:15 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 196398E4EB; Sun, 18 Nov 2018 02:53:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAI2rCHI054182; Sat, 17 Nov 2018 18:53:12 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAI2rCR5054181; Sat, 17 Nov 2018 18:53:12 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811180253.wAI2rCR5054181@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340511 - stable/12/sys/kern In-Reply-To: <20181117235144.GA2799@raichu> To: Mark Johnston Date: Sat, 17 Nov 2018 18:53:12 -0800 (PST) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 196398E4EB X-Spamd-Result: default: False [1.37 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.50)[0.500,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.10)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 02:53:16 -0000 > On Sat, Nov 17, 2018 at 03:47:16PM -0800, Rodney W. Grimes wrote: > > > Author: markj > > > Date: Sat Nov 17 20:01:35 2018 > > > New Revision: 340511 > > > URL: https://svnweb.freebsd.org/changeset/base/340511 > > > > > > Log: > > > MFC r339731: > > > Add FALLTHROUGH comments to appease Coverity. > > > > > > Modified: > > > stable/12/sys/kern/kern_environment.c > > > stable/12/sys/kern/vfs_mount.c > > > Directory Properties: > > > stable/12/ (props changed) > > > > > > Modified: stable/12/sys/kern/kern_environment.c > > > ============================================================================== > > > --- stable/12/sys/kern/kern_environment.c Sat Nov 17 20:00:10 2018 (r340510) > > > +++ stable/12/sys/kern/kern_environment.c Sat Nov 17 20:01:35 2018 (r340511) > > > @@ -839,10 +839,13 @@ getenv_quad(const char *name, quad_t *data) > > > switch (vtp[0]) { > > > case 't': case 'T': > > > iv *= 1024; > > > + /* FALLTHROUGH */ > > > case 'g': case 'G': > > > iv *= 1024; > > > + /* FALLTHROUGH */ > > > case 'm': case 'M': > > > iv *= 1024; > > > + /* FALLTHROUGH */ > > > case 'k': case 'K': > > > iv *= 1024; > > Missing /* FALLTHROUGH */ ?? > > The statement following "case '\0':" is a break. > > > > > > case '\0': > > > > And a refactor: > > > > case 't': case 'T': > > case 'g': case 'G': > > case 'm': case 'M': > > case 'k': case 'K': > > iv *= 1024; > > /* FALLTHROUGH */ > > case '\0': > > > > Isnt that the same functionality? > > No, it isn't. Gag, for some reason I was reading iv *=1024 as *iv = 1024, I need more sleep :-( -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable-12@freebsd.org Sun Nov 18 09:55:58 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DFFC1132D34; Sun, 18 Nov 2018 09:55:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 22FEE74CD7; Sun, 18 Nov 2018 09:55:58 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 041DF11C16; Sun, 18 Nov 2018 09:55:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9tvAr081049; Sun, 18 Nov 2018 09:55:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9tv21081048; Sun, 18 Nov 2018 09:55:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811180955.wAI9tv21081048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Nov 2018 09:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340554 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 340554 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 22FEE74CD7 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:55:58 -0000 Author: kib Date: Sun Nov 18 09:55:57 2018 New Revision: 340554 URL: https://svnweb.freebsd.org/changeset/base/340554 Log: MFC r339893: Style. Modified: stable/12/sys/amd64/amd64/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Sun Nov 18 09:54:03 2018 (r340553) +++ stable/12/sys/amd64/amd64/machdep.c Sun Nov 18 09:55:57 2018 (r340554) @@ -2694,25 +2694,31 @@ DEFINE_IFUNC(, void *, memset, (void *, int, size_t), { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? - memset_erms : memset_std); + memset_erms : memset_std); } -void *memmove_std(void * _Nonnull dst, const void * _Nonnull src, size_t len); -void *memmove_erms(void * _Nonnull dst, const void * _Nonnull src, size_t len); -DEFINE_IFUNC(, void *, memmove, (void * _Nonnull, const void * _Nonnull, size_t), static) +void *memmove_std(void * _Nonnull dst, const void * _Nonnull src, + size_t len); +void *memmove_erms(void * _Nonnull dst, const void * _Nonnull src, + size_t len); +DEFINE_IFUNC(, void *, memmove, (void * _Nonnull, const void * _Nonnull, + size_t), static) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? - memmove_erms : memmove_std); + memmove_erms : memmove_std); } -void *memcpy_std(void * _Nonnull dst, const void * _Nonnull src, size_t len); -void *memcpy_erms(void * _Nonnull dst, const void * _Nonnull src, size_t len); -DEFINE_IFUNC(, void *, memcpy, (void * _Nonnull, const void * _Nonnull, size_t), static) +void *memcpy_std(void * _Nonnull dst, const void * _Nonnull src, + size_t len); +void *memcpy_erms(void * _Nonnull dst, const void * _Nonnull src, + size_t len); +DEFINE_IFUNC(, void *, memcpy, (void * _Nonnull, const void * _Nonnull,size_t), + static) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? - memcpy_erms : memcpy_std); + memcpy_erms : memcpy_std); } void pagezero_std(void *addr); @@ -2721,5 +2727,5 @@ DEFINE_IFUNC(, void , pagezero, (void *), static) { return ((cpu_stdext_feature & CPUID_STDEXT_ERMS) != 0 ? - pagezero_erms : pagezero_std); + pagezero_erms : pagezero_std); } From owner-svn-src-stable-12@freebsd.org Sun Nov 18 09:47:31 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 960EC113274B; Sun, 18 Nov 2018 09:47:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37EF774241; Sun, 18 Nov 2018 09:47:31 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1377F11A77; Sun, 18 Nov 2018 09:47:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9lUt4075805; Sun, 18 Nov 2018 09:47:30 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9lUWN075804; Sun, 18 Nov 2018 09:47:30 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811180947.wAI9lUWN075804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 09:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340549 - stable/12/sbin/pfctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sbin/pfctl X-SVN-Commit-Revision: 340549 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 37EF774241 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:47:31 -0000 Author: kp Date: Sun Nov 18 09:47:30 2018 New Revision: 340549 URL: https://svnweb.freebsd.org/changeset/base/340549 Log: MFC r339464: pfctl: Dup strings When we set the ifname we have to copy the string, rather than just keep the pointer. PR: 231323 Modified: stable/12/sbin/pfctl/parse.y Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/pfctl/parse.y ============================================================================== --- stable/12/sbin/pfctl/parse.y Sun Nov 18 09:45:52 2018 (r340548) +++ stable/12/sbin/pfctl/parse.y Sun Nov 18 09:47:30 2018 (r340549) @@ -4408,7 +4408,7 @@ route_host : STRING { $$ = calloc(1, sizeof(struct node_host)); if ($$ == NULL) err(1, "route_host: calloc"); - $$->ifname = $1; + $$->ifname = strdup($1); set_ipmask($$, 128); $$->next = NULL; $$->tail = $$; @@ -4418,7 +4418,7 @@ route_host : STRING { $$ = $3; for (n = $3; n != NULL; n = n->next) - n->ifname = $2; + n->ifname = strdup($2); } ; From owner-svn-src-stable-12@freebsd.org Sun Nov 18 09:48:53 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5469113278E; Sun, 18 Nov 2018 09:48:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7610774428; Sun, 18 Nov 2018 09:48:52 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C91B11A7E; Sun, 18 Nov 2018 09:48:52 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9mqoC076005; Sun, 18 Nov 2018 09:48:52 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9mpHM076002; Sun, 18 Nov 2018 09:48:51 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811180948.wAI9mpHM076002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 09:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340551 - in stable/12/sbin/pfctl/tests: . files X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/12/sbin/pfctl/tests: . files X-SVN-Commit-Revision: 340551 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7610774428 X-Spamd-Result: default: False [-0.05 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.049,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:48:53 -0000 Author: kp Date: Sun Nov 18 09:48:51 2018 New Revision: 340551 URL: https://svnweb.freebsd.org/changeset/base/340551 Log: MFC r339466: pfctl tests: Basic test case for PR 231323 PR: 231323 Added: stable/12/sbin/pfctl/tests/files/pf1005.in - copied unchanged from r339466, head/sbin/pfctl/tests/files/pf1005.in stable/12/sbin/pfctl/tests/files/pf1005.ok - copied unchanged from r339466, head/sbin/pfctl/tests/files/pf1005.ok Modified: stable/12/sbin/pfctl/tests/files/pfctl_test_descr.sh stable/12/sbin/pfctl/tests/pfctl_test.sh Directory Properties: stable/12/ (props changed) Copied: stable/12/sbin/pfctl/tests/files/pf1005.in (from r339466, head/sbin/pfctl/tests/files/pf1005.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sbin/pfctl/tests/files/pf1005.in Sun Nov 18 09:48:51 2018 (r340551, copy of r339466, head/sbin/pfctl/tests/files/pf1005.in) @@ -0,0 +1,3 @@ +rdr on em0 proto tcp from any to any -> 1.1.1.1 port 2121 +pass out log quick on lo0 route-to lo0 from any to any +pass in log quick on lo0 route-to (lo0 localhost) from any to any Copied: stable/12/sbin/pfctl/tests/files/pf1005.ok (from r339466, head/sbin/pfctl/tests/files/pf1005.ok) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sbin/pfctl/tests/files/pf1005.ok Sun Nov 18 09:48:51 2018 (r340551, copy of r339466, head/sbin/pfctl/tests/files/pf1005.ok) @@ -0,0 +1,2 @@ +pass out log quick on lo0 route-to (lo0 ?) all flags S/SA keep state +pass in log quick on lo0 route-to (lo0 ::1) inet6 all flags S/SA keep state Modified: stable/12/sbin/pfctl/tests/files/pfctl_test_descr.sh ============================================================================== --- stable/12/sbin/pfctl/tests/files/pfctl_test_descr.sh Sun Nov 18 09:47:39 2018 (r340550) +++ stable/12/sbin/pfctl/tests/files/pfctl_test_descr.sh Sun Nov 18 09:48:51 2018 (r340551) @@ -79,3 +79,4 @@ pf1001_descr () { echo "Binat" ; } pf1002_descr () { echo "Set timeout interval" ; } pf1003_descr () { echo "ALTQ" ; } pf1004_descr () { echo "ALTQ with Codel" ; } +pf1005_descr () { echo "PR 231323" ; } Modified: stable/12/sbin/pfctl/tests/pfctl_test.sh ============================================================================== --- stable/12/sbin/pfctl/tests/pfctl_test.sh Sun Nov 18 09:47:39 2018 (r340550) +++ stable/12/sbin/pfctl/tests/pfctl_test.sh Sun Nov 18 09:48:51 2018 (r340551) @@ -22,7 +22,7 @@ pftests="0001 0002 0003 0004 0005 0006 0007 0008 0009 0032 0034 0035 0038 0039 0040 0041 0047 0048 0049 0050 0052 0053 0055 0056 0057 0060 0061 0065 0067 0069 0070 0071 0072 0074 0075 0077 0078 0079 0081 0082 0084 0085 0087 0088 0089 0090 0091 0092 0094 0095 0096 -0097 0098 0100 0101 0102 0104 1001 1002 1003 1004" +0097 0098 0100 0101 0102 0104 1001 1002 1003 1004 1005" . $(atf_get_srcdir)/files/pfctl_test_descr.sh From owner-svn-src-stable-12@freebsd.org Sun Nov 18 09:57:13 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 238331132D5E; Sun, 18 Nov 2018 09:57:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B849074DC3; Sun, 18 Nov 2018 09:57:12 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 951CE11C17; Sun, 18 Nov 2018 09:57:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9vCeW081156; Sun, 18 Nov 2018 09:57:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9vCdE081155; Sun, 18 Nov 2018 09:57:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811180957.wAI9vCdE081155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Nov 2018 09:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340555 - stable/12/sys/arm/include X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/arm/include X-SVN-Commit-Revision: 340555 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B849074DC3 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:57:13 -0000 Author: kib Date: Sun Nov 18 09:57:12 2018 New Revision: 340555 URL: https://svnweb.freebsd.org/changeset/base/340555 Log: MFC r340136: Move the fixed base for PIE loading on arm. Modified: stable/12/sys/arm/include/elf.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/include/elf.h ============================================================================== --- stable/12/sys/arm/include/elf.h Sun Nov 18 09:55:57 2018 (r340554) +++ stable/12/sys/arm/include/elf.h Sun Nov 18 09:57:12 2018 (r340555) @@ -116,7 +116,7 @@ __ElfType(Auxinfo); */ #define MAGIC_TRAMP_NUMBER 0x5c000003 -#define ET_DYN_LOAD_ADDR 0x12000 +#define ET_DYN_LOAD_ADDR 0x500000 /* Flags passed in AT_HWCAP. */ #define HWCAP_SWP 0x00000001 /* Unsupported, never set. */ From owner-svn-src-stable-12@freebsd.org Sun Nov 18 09:45:53 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8FBD11326FD; Sun, 18 Nov 2018 09:45:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DA927413E; Sun, 18 Nov 2018 09:45:53 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E9C011A73; Sun, 18 Nov 2018 09:45:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9jrjQ075673; Sun, 18 Nov 2018 09:45:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9jrYZ075672; Sun, 18 Nov 2018 09:45:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811180945.wAI9jrYZ075672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Nov 2018 09:45:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340548 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4DA927413E X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:45:53 -0000 Author: kib Date: Sun Nov 18 09:45:52 2018 New Revision: 340548 URL: https://svnweb.freebsd.org/changeset/base/340548 Log: MFC r340344: Remove single-use variable, cleanup warnings. Modified: stable/12/sys/kern/sysv_shm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sysv_shm.c ============================================================================== --- stable/12/sys/kern/sysv_shm.c Sun Nov 18 01:58:48 2018 (r340547) +++ stable/12/sys/kern/sysv_shm.c Sun Nov 18 09:45:52 2018 (r340548) @@ -332,9 +332,6 @@ kern_shmdt_locked(struct thread *td, const void *shmad { struct proc *p = td->td_proc; struct shmmap_state *shmmap_s; -#if defined(AUDIT) || defined(MAC) - struct shmid_kernel *shmsegptr; -#endif #ifdef MAC int error; #endif @@ -355,11 +352,9 @@ kern_shmdt_locked(struct thread *td, const void *shmad } if (i == shminfo.shmseg) return (EINVAL); -#if (defined(AUDIT) && defined(KDTRACE_HOOKS)) || defined(MAC) - shmsegptr = &shmsegs[IPCID_TO_IX(shmmap_s->shmid)]; -#endif #ifdef MAC - error = mac_sysvshm_check_shmdt(td->td_ucred, shmsegptr); + error = mac_sysvshm_check_shmdt(td->td_ucred, + &shmsegs[IPCID_TO_IX(shmmap_s->shmid)]); if (error != 0) return (error); #endif From owner-svn-src-stable-12@freebsd.org Sun Nov 18 10:54:51 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D92D71135013; Sun, 18 Nov 2018 10:54:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A6D7576FE8; Sun, 18 Nov 2018 10:54:50 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3DE6125DE; Sun, 18 Nov 2018 10:54:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIAslGR011796; Sun, 18 Nov 2018 10:54:47 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIAslpq011795; Sun, 18 Nov 2018 10:54:47 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181054.wAIAslpq011795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 10:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340561 - stable/12/sbin/pfctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sbin/pfctl X-SVN-Commit-Revision: 340561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A6D7576FE8 X-Spamd-Result: default: False [-0.05 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 10:54:52 -0000 Author: kp Date: Sun Nov 18 10:54:47 2018 New Revision: 340561 URL: https://svnweb.freebsd.org/changeset/base/340561 Log: MFC r339578: pfctl: Fix line numbers when \ is used inside "" PR: 201520 Obtained from: OpenBSD Modified: stable/12/sbin/pfctl/parse.y Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/pfctl/parse.y ============================================================================== --- stable/12/sbin/pfctl/parse.y Sun Nov 18 10:54:38 2018 (r340560) +++ stable/12/sbin/pfctl/parse.y Sun Nov 18 10:54:47 2018 (r340561) @@ -5765,8 +5765,10 @@ top: return (0); if (next == quotec || c == ' ' || c == '\t') c = next; - else if (next == '\n') + else if (next == '\n') { + file->lineno++; continue; + } else lungetc(next); } else if (c == quotec) { From owner-svn-src-stable-12@freebsd.org Sun Nov 18 10:47:37 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB5741134D1C; Sun, 18 Nov 2018 10:47:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6644976A56; Sun, 18 Nov 2018 10:47:37 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 428A412449; Sun, 18 Nov 2018 10:47:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIAlb0C006660; Sun, 18 Nov 2018 10:47:37 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIAlbx9006659; Sun, 18 Nov 2018 10:47:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181047.wAIAlbx9006659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 10:47:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340558 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 340558 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6644976A56 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 10:47:38 -0000 Author: kp Date: Sun Nov 18 10:47:36 2018 New Revision: 340558 URL: https://svnweb.freebsd.org/changeset/base/340558 Log: MFC r339470: pf synproxy will do the 3WHS on behalf of the target machine, and once the 3WHS is completed, establish the backend connection. The trigger for "3WHS completed" is the reception of the first ACK. However, we should not proceed if that ACK also has RST or FIN set. PR: 197484 Obtained from: OpenBSD Modified: stable/12/sys/netpfil/pf/pf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/pf.c ============================================================================== --- stable/12/sys/netpfil/pf/pf.c Sun Nov 18 10:22:42 2018 (r340557) +++ stable/12/sys/netpfil/pf/pf.c Sun Nov 18 10:47:36 2018 (r340558) @@ -4401,7 +4401,7 @@ pf_test_state_tcp(struct pf_state **state, int directi TH_SYN|TH_ACK, 0, (*state)->src.mss, 0, 1, 0, NULL); REASON_SET(reason, PFRES_SYNPROXY); return (PF_SYNPROXY_DROP); - } else if (!(th->th_flags & TH_ACK) || + } else if ((th->th_flags & (TH_ACK|TH_RST|TH_FIN)) != TH_ACK || (ntohl(th->th_ack) != (*state)->src.seqhi + 1) || (ntohl(th->th_seq) != (*state)->src.seqlo + 1)) { REASON_SET(reason, PFRES_SYNPROXY); From owner-svn-src-stable-12@freebsd.org Sun Nov 18 10:57:32 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3409A11350B9; Sun, 18 Nov 2018 10:57:32 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB52477141; Sun, 18 Nov 2018 10:57:31 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC51A125E6; Sun, 18 Nov 2018 10:57:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIAvVpn012014; Sun, 18 Nov 2018 10:57:31 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIAvVvE012013; Sun, 18 Nov 2018 10:57:31 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181057.wAIAvVvE012013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 10:57:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340562 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 340562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CB52477141 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 10:57:32 -0000 Author: kp Date: Sun Nov 18 10:57:31 2018 New Revision: 340562 URL: https://svnweb.freebsd.org/changeset/base/340562 Log: MFC r339676: pf: Fix copy/paste error in IPv6 address rewriting We checked the destination address, but replaced the source address. This was fixed in OpenBSD as part of their NAT rework, which we don't want to import right now. CID: 1009561 Modified: stable/12/sys/netpfil/pf/pf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/pf.c ============================================================================== --- stable/12/sys/netpfil/pf/pf.c Sun Nov 18 10:54:47 2018 (r340561) +++ stable/12/sys/netpfil/pf/pf.c Sun Nov 18 10:57:31 2018 (r340562) @@ -3429,7 +3429,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm if (PF_ANEQ(daddr, &nk->addr[pd->didx], AF_INET6)) - PF_ACPY(saddr, &nk->addr[pd->didx], af); + PF_ACPY(daddr, &nk->addr[pd->didx], af); break; #endif /* INET */ } From owner-svn-src-stable-12@freebsd.org Sun Nov 18 09:49:26 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5112011327C6; Sun, 18 Nov 2018 09:49:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EA34E74519; Sun, 18 Nov 2018 09:49:25 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB32111A80; Sun, 18 Nov 2018 09:49:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9nPUL076104; Sun, 18 Nov 2018 09:49:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9nOpa076097; Sun, 18 Nov 2018 09:49:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811180949.wAI9nOpa076097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Nov 2018 09:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340552 - in stable/12/sys: amd64/amd64 amd64/ia32 amd64/include dev/cpuctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 amd64/ia32 amd64/include dev/cpuctl X-SVN-Commit-Revision: 340552 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA34E74519 X-Spamd-Result: default: False [-0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.049,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:49:26 -0000 Author: kib Date: Sun Nov 18 09:49:24 2018 New Revision: 340552 URL: https://svnweb.freebsd.org/changeset/base/340552 Log: MFC r339507: amd64: flush L1 data cache on syscall return with an error. Modified: stable/12/sys/amd64/amd64/initcpu.c stable/12/sys/amd64/amd64/machdep.c stable/12/sys/amd64/amd64/support.S stable/12/sys/amd64/amd64/trap.c stable/12/sys/amd64/ia32/ia32_syscall.c stable/12/sys/amd64/include/md_var.h stable/12/sys/dev/cpuctl/cpuctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/12/sys/amd64/amd64/initcpu.c Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/amd64/amd64/initcpu.c Sun Nov 18 09:49:24 2018 (r340552) @@ -253,6 +253,7 @@ initializecpu(void) } hw_ibrs_recalculate(); hw_ssb_recalculate(false); + amd64_syscall_ret_flush_l1d_recalc(); switch (cpu_vendor_id) { case CPU_VENDOR_AMD: init_amd(); Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/amd64/amd64/machdep.c Sun Nov 18 09:49:24 2018 (r340552) @@ -1728,6 +1728,11 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) != NULL) vty_set_preferred(VTY_VT); + TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable); + TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable); + TUNABLE_INT_FETCH("machdep.syscall_ret_l1d_flush", + &syscall_ret_l1d_flush_mode); + finishidentcpu(); /* Final stage of CPU initialization */ initializecpu(); /* Initialize CPU registers */ @@ -1875,9 +1880,6 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) x86_init_fdt(); #endif thread0.td_critnest = 0; - - TUNABLE_INT_FETCH("hw.ibrs_disable", &hw_ibrs_disable); - TUNABLE_INT_FETCH("hw.spec_store_bypass_disable", &hw_ssb_disable); TSEXIT(); Modified: stable/12/sys/amd64/amd64/support.S ============================================================================== --- stable/12/sys/amd64/amd64/support.S Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/amd64/amd64/support.S Sun Nov 18 09:49:24 2018 (r340552) @@ -1556,3 +1556,10 @@ ENTRY(flush_l1d_sw) ret #undef L1D_FLUSH_SIZE END(flush_l1d_sw) + +ENTRY(flush_l1d_sw_abi) + pushq %rbx + call flush_l1d_sw + popq %rbx + ret +END(flush_l1d_sw_abi) Modified: stable/12/sys/amd64/amd64/trap.c ============================================================================== --- stable/12/sys/amd64/amd64/trap.c Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/amd64/amd64/trap.c Sun Nov 18 09:49:24 2018 (r340552) @@ -1056,6 +1056,84 @@ cpu_fetch_syscall_args(struct thread *td) #include "../../kern/subr_syscall.c" +static void (*syscall_ret_l1d_flush)(void); +int syscall_ret_l1d_flush_mode; + +static void +flush_l1d_hw(void) +{ + + wrmsr(MSR_IA32_FLUSH_CMD, IA32_FLUSH_CMD_L1D); +} + +static void __inline +amd64_syscall_ret_flush_l1d_inline(int error) +{ + void (*p)(void); + + if (error != 0 && error != EEXIST && error != EAGAIN && + error != EXDEV && error != ENOENT && error != ENOTCONN && + error != EINPROGRESS) { + p = syscall_ret_l1d_flush; + if (p != NULL) + p(); + } +} + +void +amd64_syscall_ret_flush_l1d(int error) +{ + + amd64_syscall_ret_flush_l1d_inline(error); +} + +void +amd64_syscall_ret_flush_l1d_recalc(void) +{ + bool l1d_hw; + + l1d_hw = (cpu_stdext_feature3 & CPUID_STDEXT3_L1D_FLUSH) != 0; +again: + switch (syscall_ret_l1d_flush_mode) { + case 0: + syscall_ret_l1d_flush = NULL; + break; + case 1: + syscall_ret_l1d_flush = l1d_hw ? flush_l1d_hw : + flush_l1d_sw_abi; + break; + case 2: + syscall_ret_l1d_flush = l1d_hw ? flush_l1d_hw : NULL; + break; + case 3: + syscall_ret_l1d_flush = flush_l1d_sw_abi; + break; + default: + syscall_ret_l1d_flush_mode = 1; + goto again; + } +} + +static int +machdep_syscall_ret_flush_l1d(SYSCTL_HANDLER_ARGS) +{ + int error, val; + + val = syscall_ret_l1d_flush_mode; + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + syscall_ret_l1d_flush_mode = val; + amd64_syscall_ret_flush_l1d_recalc(); + return (0); +} +SYSCTL_PROC(_machdep, OID_AUTO, syscall_ret_flush_l1d, CTLTYPE_INT | + CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, NULL, 0, + machdep_syscall_ret_flush_l1d, "I", + "Flush L1D on syscall return with error (0 - off, 1 - on, " + "2 - use hw only, 3 - use sw only"); + + /* * System call handler for native binaries. The trap frame is already * set up by the assembler trampoline and a pointer to it is saved in @@ -1110,4 +1188,6 @@ amd64_syscall(struct thread *td, int traced) */ if (__predict_false(td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS)) set_pcb_flags(td->td_pcb, PCB_FULL_IRET); + + amd64_syscall_ret_flush_l1d_inline(error); } Modified: stable/12/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- stable/12/sys/amd64/ia32/ia32_syscall.c Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/amd64/ia32/ia32_syscall.c Sun Nov 18 09:49:24 2018 (r340552) @@ -231,6 +231,7 @@ ia32_syscall(struct trapframe *frame) } syscallret(td, error); + amd64_syscall_ret_flush_l1d(error); } static void Modified: stable/12/sys/amd64/include/md_var.h ============================================================================== --- stable/12/sys/amd64/include/md_var.h Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/amd64/include/md_var.h Sun Nov 18 09:49:24 2018 (r340552) @@ -41,6 +41,7 @@ extern int hw_lower_amd64_sharedpage; extern int hw_ibrs_disable; extern int hw_ssb_disable; extern int nmi_flush_l1d_sw; +extern int syscall_ret_l1d_flush_mode; extern vm_paddr_t intel_graphics_stolen_base; extern vm_paddr_t intel_graphics_stolen_size; @@ -58,8 +59,11 @@ void amd64_conf_fast_syscall(void); void amd64_db_resume_dbreg(void); void amd64_lower_shared_page(struct sysentvec *); void amd64_syscall(struct thread *td, int traced); +void amd64_syscall_ret_flush_l1d(int error); +void amd64_syscall_ret_flush_l1d_recalc(void); void doreti_iret(void) __asm(__STRING(doreti_iret)); void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); +void flush_l1d_sw_abi(void); void ld_ds(void) __asm(__STRING(ld_ds)); void ld_es(void) __asm(__STRING(ld_es)); void ld_fs(void) __asm(__STRING(ld_fs)); Modified: stable/12/sys/dev/cpuctl/cpuctl.c ============================================================================== --- stable/12/sys/dev/cpuctl/cpuctl.c Sun Nov 18 09:48:51 2018 (r340551) +++ stable/12/sys/dev/cpuctl/cpuctl.c Sun Nov 18 09:49:24 2018 (r340552) @@ -521,6 +521,9 @@ cpuctl_do_eval_cpu_features(int cpu, struct thread *td hw_ibrs_recalculate(); restore_cpu(oldcpu, is_bound, td); hw_ssb_recalculate(true); +#ifdef __amd64__ + amd64_syscall_ret_flush_l1d_recalc(); +#endif printcpuinfo(); return (0); } From owner-svn-src-stable-12@freebsd.org Sun Nov 18 09:54:04 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35BB61132C77; Sun, 18 Nov 2018 09:54:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8C8674B7C; Sun, 18 Nov 2018 09:54:03 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9BDC11C10; Sun, 18 Nov 2018 09:54:03 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAI9s3JO080893; Sun, 18 Nov 2018 09:54:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAI9s3gr080892; Sun, 18 Nov 2018 09:54:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811180954.wAI9s3gr080892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 18 Nov 2018 09:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340553 - stable/12/libexec/rtld-elf/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf/amd64 X-SVN-Commit-Revision: 340553 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C8C8674B7C X-Spamd-Result: default: False [-0.05 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.05)[-0.052,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 09:54:04 -0000 Author: kib Date: Sun Nov 18 09:54:03 2018 New Revision: 340553 URL: https://svnweb.freebsd.org/changeset/base/340553 Log: MFC r339897: Remove rtld use of libc amd64_set_fsbase(). Modified: stable/12/libexec/rtld-elf/amd64/reloc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/amd64/reloc.c ============================================================================== --- stable/12/libexec/rtld-elf/amd64/reloc.c Sun Nov 18 09:49:24 2018 (r340552) +++ stable/12/libexec/rtld-elf/amd64/reloc.c Sun Nov 18 09:54:03 2018 (r340553) @@ -35,8 +35,9 @@ #include #include -#include #include +#include +#include #include #include @@ -492,17 +493,26 @@ pre_init(void) } +int __getosreldate(void); + void allocate_initial_tls(Obj_Entry *objs) { - /* - * Fix the size of the static TLS block by using the maximum - * offset allocated so far and adding a bit for dynamic modules to - * use. - */ - tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; - amd64_set_fsbase(allocate_tls(objs, 0, - 3*sizeof(Elf_Addr), sizeof(Elf_Addr))); + void *addr; + + /* + * Fix the size of the static TLS block by using the maximum + * offset allocated so far and adding a bit for dynamic + * modules to use. + */ + tls_static_space = tls_last_offset + RTLD_STATIC_TLS_EXTRA; + + addr = allocate_tls(objs, 0, 3 * sizeof(Elf_Addr), sizeof(Elf_Addr)); + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + wrfsbase((uintptr_t)addr); + else + sysarch(AMD64_SET_FSBASE, &addr); } void *__tls_get_addr(tls_index *ti) From owner-svn-src-stable-12@freebsd.org Sun Nov 18 11:55:58 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 328941137394; Sun, 18 Nov 2018 11:55:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7F4979854; Sun, 18 Nov 2018 11:55:57 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8E8313009; Sun, 18 Nov 2018 11:55:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIBtvnZ042954; Sun, 18 Nov 2018 11:55:57 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIBtuZU042946; Sun, 18 Nov 2018 11:55:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181155.wAIBtuZU042946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 11:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340565 - in stable/12/sys: net netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/12/sys: net netpfil/pf X-SVN-Commit-Revision: 340565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C7F4979854 X-Spamd-Result: default: False [0.06 / 15.00]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.064,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 11:55:58 -0000 Author: kp Date: Sun Nov 18 11:55:56 2018 New Revision: 340565 URL: https://svnweb.freebsd.org/changeset/base/340565 Log: MFC r340065: pfsync: Make pfsync callbacks per-vnet The callbacks are installed and removed depending on the state of the pfsync device, which is per-vnet. The callbacks must also be per-vnet. Sponsored by: Orange Business Services Modified: stable/12/sys/net/pfvar.h stable/12/sys/netpfil/pf/if_pfsync.c stable/12/sys/netpfil/pf/pf.c stable/12/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/pfvar.h ============================================================================== --- stable/12/sys/net/pfvar.h Sun Nov 18 11:11:27 2018 (r340564) +++ stable/12/sys/net/pfvar.h Sun Nov 18 11:55:56 2018 (r340565) @@ -825,12 +825,18 @@ typedef void pfsync_delete_state_t(struct pf_state *) typedef void pfsync_clear_states_t(u_int32_t, const char *); typedef int pfsync_defer_t(struct pf_state *, struct mbuf *); -extern pfsync_state_import_t *pfsync_state_import_ptr; -extern pfsync_insert_state_t *pfsync_insert_state_ptr; -extern pfsync_update_state_t *pfsync_update_state_ptr; -extern pfsync_delete_state_t *pfsync_delete_state_ptr; -extern pfsync_clear_states_t *pfsync_clear_states_ptr; -extern pfsync_defer_t *pfsync_defer_ptr; +VNET_DECLARE(pfsync_state_import_t *, pfsync_state_import_ptr); +#define V_pfsync_state_import_ptr VNET(pfsync_state_import_ptr) +VNET_DECLARE(pfsync_insert_state_t *, pfsync_insert_state_ptr); +#define V_pfsync_insert_state_ptr VNET(pfsync_insert_state_ptr) +VNET_DECLARE(pfsync_update_state_t *, pfsync_update_state_ptr); +#define V_pfsync_update_state_ptr VNET(pfsync_update_state_ptr) +VNET_DECLARE(pfsync_delete_state_t *, pfsync_delete_state_ptr); +#define V_pfsync_delete_state_ptr VNET(pfsync_delete_state_ptr) +VNET_DECLARE(pfsync_clear_states_t *, pfsync_clear_states_ptr); +#define V_pfsync_clear_states_ptr VNET(pfsync_clear_states_ptr) +VNET_DECLARE(pfsync_defer_t *, pfsync_defer_ptr); +#define V_pfsync_defer_ptr VNET(pfsync_defer_ptr) void pfsync_state_export(struct pfsync_state *, struct pf_state *); Modified: stable/12/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 11:11:27 2018 (r340564) +++ stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 11:55:56 2018 (r340565) @@ -1362,10 +1362,10 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat sc->sc_maxupdates = pfsyncr.pfsyncr_maxupdates; if (pfsyncr.pfsyncr_defer) { sc->sc_flags |= PFSYNCF_DEFER; - pfsync_defer_ptr = pfsync_defer; + V_pfsync_defer_ptr = pfsync_defer; } else { sc->sc_flags &= ~PFSYNCF_DEFER; - pfsync_defer_ptr = NULL; + V_pfsync_defer_ptr = NULL; } if (sifp == NULL) { @@ -2311,12 +2311,12 @@ pfsync_pointers_init() { PF_RULES_WLOCK(); - pfsync_state_import_ptr = pfsync_state_import; - pfsync_insert_state_ptr = pfsync_insert_state; - pfsync_update_state_ptr = pfsync_update_state; - pfsync_delete_state_ptr = pfsync_delete_state; - pfsync_clear_states_ptr = pfsync_clear_states; - pfsync_defer_ptr = pfsync_defer; + V_pfsync_state_import_ptr = pfsync_state_import; + V_pfsync_insert_state_ptr = pfsync_insert_state; + V_pfsync_update_state_ptr = pfsync_update_state; + V_pfsync_delete_state_ptr = pfsync_delete_state; + V_pfsync_clear_states_ptr = pfsync_clear_states; + V_pfsync_defer_ptr = pfsync_defer; PF_RULES_WUNLOCK(); } @@ -2325,12 +2325,12 @@ pfsync_pointers_uninit() { PF_RULES_WLOCK(); - pfsync_state_import_ptr = NULL; - pfsync_insert_state_ptr = NULL; - pfsync_update_state_ptr = NULL; - pfsync_delete_state_ptr = NULL; - pfsync_clear_states_ptr = NULL; - pfsync_defer_ptr = NULL; + V_pfsync_state_import_ptr = NULL; + V_pfsync_insert_state_ptr = NULL; + V_pfsync_update_state_ptr = NULL; + V_pfsync_delete_state_ptr = NULL; + V_pfsync_clear_states_ptr = NULL; + V_pfsync_defer_ptr = NULL; PF_RULES_WUNLOCK(); } @@ -2347,6 +2347,8 @@ vnet_pfsync_init(const void *unused __unused) if_clone_detach(V_pfsync_cloner); log(LOG_INFO, "swi_add() failed in %s\n", __func__); } + + pfsync_pointers_init(); } VNET_SYSINIT(vnet_pfsync_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY, vnet_pfsync_init, NULL); @@ -2355,6 +2357,8 @@ static void vnet_pfsync_uninit(const void *unused __unused) { + pfsync_pointers_uninit(); + if_clone_detach(V_pfsync_cloner); swi_remove(V_pfsync_swi_cookie); } @@ -2380,7 +2384,6 @@ pfsync_init() return (error); } #endif - pfsync_pointers_init(); return (0); } @@ -2388,8 +2391,6 @@ pfsync_init() static void pfsync_uninit() { - - pfsync_pointers_uninit(); #ifdef INET ipproto_unregister(IPPROTO_PFSYNC); Modified: stable/12/sys/netpfil/pf/pf.c ============================================================================== --- stable/12/sys/netpfil/pf/pf.c Sun Nov 18 11:11:27 2018 (r340564) +++ stable/12/sys/netpfil/pf/pf.c Sun Nov 18 11:55:56 2018 (r340565) @@ -1268,8 +1268,8 @@ pf_state_insert(struct pfi_kif *kif, struct pf_state_k refcount_init(&s->refs, 2); counter_u64_add(V_pf_status.fcounters[FCNT_STATE_INSERT], 1); - if (pfsync_insert_state_ptr != NULL) - pfsync_insert_state_ptr(s); + if (V_pfsync_insert_state_ptr != NULL) + V_pfsync_insert_state_ptr(s); /* Returns locked. */ return (0); @@ -1672,8 +1672,8 @@ pf_unlink_state(struct pf_state *s, u_int flags) LIST_REMOVE(s, entry); pf_src_tree_remove_state(s); - if (pfsync_delete_state_ptr != NULL) - pfsync_delete_state_ptr(s); + if (V_pfsync_delete_state_ptr != NULL) + V_pfsync_delete_state_ptr(s); STATE_DEC_COUNTERS(s); @@ -3582,7 +3582,7 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm if (*sm != NULL && !((*sm)->state_flags & PFSTATE_NOSYNC) && direction == PF_OUT && - pfsync_defer_ptr != NULL && pfsync_defer_ptr(*sm, m)) + V_pfsync_defer_ptr != NULL && V_pfsync_defer_ptr(*sm, m)) /* * We want the state created, but we dont * want to send this in case a partner @@ -5996,8 +5996,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct action = pf_test_state_tcp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6025,8 +6025,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct } action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6048,8 +6048,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct action = pf_test_state_icmp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6071,8 +6071,8 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct default: action = pf_test_state_other(&s, dir, kif, m, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6435,8 +6435,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc action = pf_test_state_tcp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6464,8 +6464,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc } action = pf_test_state_udp(&s, dir, kif, m, off, h, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6494,8 +6494,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc action = pf_test_state_icmp(&s, dir, kif, m, off, h, &pd, &reason); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; @@ -6508,8 +6508,8 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struc default: action = pf_test_state_other(&s, dir, kif, m, &pd); if (action == PF_PASS) { - if (pfsync_update_state_ptr != NULL) - pfsync_update_state_ptr(s); + if (V_pfsync_update_state_ptr != NULL) + V_pfsync_update_state_ptr(s); r = s->rule.ptr; a = s->anchor.ptr; log = s->log; Modified: stable/12/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/12/sys/netpfil/pf/pf_ioctl.c Sun Nov 18 11:11:27 2018 (r340564) +++ stable/12/sys/netpfil/pf/pf_ioctl.c Sun Nov 18 11:55:56 2018 (r340565) @@ -212,12 +212,13 @@ struct sx pf_ioctl_lock; struct sx pf_end_lock; /* pfsync */ -pfsync_state_import_t *pfsync_state_import_ptr = NULL; -pfsync_insert_state_t *pfsync_insert_state_ptr = NULL; -pfsync_update_state_t *pfsync_update_state_ptr = NULL; -pfsync_delete_state_t *pfsync_delete_state_ptr = NULL; -pfsync_clear_states_t *pfsync_clear_states_ptr = NULL; -pfsync_defer_t *pfsync_defer_ptr = NULL; +VNET_DEFINE(pfsync_state_import_t *, pfsync_state_import_ptr); +VNET_DEFINE(pfsync_insert_state_t *, pfsync_insert_state_ptr); +VNET_DEFINE(pfsync_update_state_t *, pfsync_update_state_ptr); +VNET_DEFINE(pfsync_delete_state_t *, pfsync_delete_state_ptr); +VNET_DEFINE(pfsync_clear_states_t *, pfsync_clear_states_ptr); +VNET_DEFINE(pfsync_defer_t *, pfsync_defer_ptr); + /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; @@ -1873,8 +1874,8 @@ relock_DIOCCLRSTATES: PF_HASHROW_UNLOCK(ih); } psk->psk_killed = killed; - if (pfsync_clear_states_ptr != NULL) - pfsync_clear_states_ptr(V_pf_status.hostid, psk->psk_ifname); + if (V_pfsync_clear_states_ptr != NULL) + V_pfsync_clear_states_ptr(V_pf_status.hostid, psk->psk_ifname); break; } @@ -1961,9 +1962,9 @@ relock_DIOCKILLSTATES: error = EINVAL; break; } - if (pfsync_state_import_ptr != NULL) { + if (V_pfsync_state_import_ptr != NULL) { PF_RULES_RLOCK(); - error = pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL); + error = V_pfsync_state_import_ptr(sp, PFSYNC_SI_IOCTL); PF_RULES_RUNLOCK(); } else error = EOPNOTSUPP; From owner-svn-src-stable-12@freebsd.org Sun Nov 18 12:09:27 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EC4A1137D56; Sun, 18 Nov 2018 12:09:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 225BD7A4B3; Sun, 18 Nov 2018 12:09:27 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F41D3131AB; Sun, 18 Nov 2018 12:09:26 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIC9QON048421; Sun, 18 Nov 2018 12:09:26 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIC9QI0048420; Sun, 18 Nov 2018 12:09:26 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181209.wAIC9QI0048420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:09:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340570 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 340570 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 225BD7A4B3 X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.05)[0.051,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:09:27 -0000 Author: kp Date: Sun Nov 18 12:09:26 2018 New Revision: 340570 URL: https://svnweb.freebsd.org/changeset/base/340570 Log: MFC r340067: pfsync: Ensure uninit is done before pf pfsync touches pf memory (for pf_state and the pfsync callback pointers), not the other way around. We need to ensure that pfsync is torn down before pf. Sponsored by: Orange Business Services Modified: stable/12/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:04:25 2018 (r340569) +++ stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:09:26 2018 (r340570) @@ -2362,11 +2362,8 @@ 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_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_FOURTH, vnet_pfsync_uninit, NULL); static int From owner-svn-src-stable-12@freebsd.org Sun Nov 18 12:31:42 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43E3E1138A3C; Sun, 18 Nov 2018 12:31:42 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD9F17B8EC; Sun, 18 Nov 2018 12:31:41 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD85F13583; Sun, 18 Nov 2018 12:31:41 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAICVfLE061968; Sun, 18 Nov 2018 12:31:41 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAICVfXc061965; Sun, 18 Nov 2018 12:31:41 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181231.wAICVfXc061965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:31:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340575 - stable/12/tests/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/tests/sys/netpfil/pf X-SVN-Commit-Revision: 340575 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD9F17B8EC X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.058,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:31:42 -0000 Author: kp Date: Sun Nov 18 12:31:40 2018 New Revision: 340575 URL: https://svnweb.freebsd.org/changeset/base/340575 Log: MFC r340069: pf tests: Basic pfsync test Set up two jails, configure pfsync between them and create state in one of them, verify that this state is copied to the other jail. Sponsored by: Orange Business Services Added: stable/12/tests/sys/netpfil/pf/pfsync.sh - copied unchanged from r340069, head/tests/sys/netpfil/pf/pfsync.sh Modified: stable/12/tests/sys/netpfil/pf/Makefile stable/12/tests/sys/netpfil/pf/utils.subr Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/netpfil/pf/Makefile ============================================================================== --- stable/12/tests/sys/netpfil/pf/Makefile Sun Nov 18 12:30:18 2018 (r340574) +++ stable/12/tests/sys/netpfil/pf/Makefile Sun Nov 18 12:31:40 2018 (r340575) @@ -11,7 +11,8 @@ ATF_TESTS_SH+= pass_block \ set_tos \ route_to \ synproxy \ - set_skip + set_skip \ + pfsync ${PACKAGE}FILES+= utils.subr \ echo_inetd.conf \ Copied: stable/12/tests/sys/netpfil/pf/pfsync.sh (from r340069, head/tests/sys/netpfil/pf/pfsync.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/netpfil/pf/pfsync.sh Sun Nov 18 12:31:40 2018 (r340575, copy of r340069, head/tests/sys/netpfil/pf/pfsync.sh) @@ -0,0 +1,70 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "basic" "cleanup" +basic_head() +{ + atf_set descr 'Basic pfsync test' + atf_set require.user root + + atf_set require.progs scapy +} + +basic_body() +{ + pfsynct_init + + epair_sync=$(pft_mkepair) + epair_one=$(pft_mkepair) + epair_two=$(pft_mkepair) + + pft_mkjail one ${epair_one}a ${epair_sync}a + pft_mkjail two ${epair_two}a ${epair_sync}b + + # pfsync interface + jexec one ifconfig ${epair_sync}a 192.0.2.1/24 up + jexec one ifconfig ${epair_one}a 198.51.100.1/24 up + jexec one ifconfig pfsync0 \ + syncdev ${epair_sync}a \ + maxupd 1 \ + up + jexec two ifconfig ${epair_two}a 198.51.100.2/24 up + jexec two ifconfig ${epair_sync}b 192.0.2.2/24 up + jexec two ifconfig pfsync0 \ + syncdev ${epair_sync}b \ + maxupd 1 \ + up + + # Enable pf! + jexec one pfctl -e + pft_set_rules one \ + "set skip on ${epair_sync}a" \ + "pass keep state" + jexec two pfctl -e + pft_set_rules two \ + "set skip on ${epair_sync}b" \ + "pass keep state" + + ifconfig ${epair_one}b 198.51.100.254/24 up + + ping -c 1 -S 198.51.100.254 198.51.100.1 + + # Give pfsync time to do its thing + sleep 2 + + if ! jexec two pfctl -s states | grep icmp | grep 198.51.100.1 | \ + grep 198.51.100.2 ; then + atf_fail "state not found on synced host" + fi +} + +basic_cleanup() +{ + pfsynct_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "basic" +} Modified: stable/12/tests/sys/netpfil/pf/utils.subr ============================================================================== --- stable/12/tests/sys/netpfil/pf/utils.subr Sun Nov 18 12:30:18 2018 (r340574) +++ stable/12/tests/sys/netpfil/pf/utils.subr Sun Nov 18 12:31:40 2018 (r340575) @@ -13,6 +13,15 @@ pft_init() fi } +pfsynct_init() +{ + pft_init + + if ! kldstat -q -m pfsync; then + atf_skip "This test requires pfsync" + fi +} + pft_mkepair() { ifname=$(ifconfig epair create) @@ -66,4 +75,9 @@ pft_cleanup() done rm created_interfaces.lst fi +} + +pfsynct_cleanup() +{ + pft_cleanup } From owner-svn-src-stable-12@freebsd.org Sun Nov 18 12:04:25 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A53651137AA7; Sun, 18 Nov 2018 12:04:25 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4391079FE9; Sun, 18 Nov 2018 12:04:25 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CBB5131A4; Sun, 18 Nov 2018 12:04:25 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIC4OMN048106; Sun, 18 Nov 2018 12:04:24 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIC4OQV048105; Sun, 18 Nov 2018 12:04:24 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181204.wAIC4OQV048105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340568 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 340568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4391079FE9 X-Spamd-Result: default: False [0.05 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.05)[0.051,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:04:25 -0000 Author: kp Date: Sun Nov 18 12:04:24 2018 New Revision: 340568 URL: https://svnweb.freebsd.org/changeset/base/340568 Log: MFC r340066: Notify that the ifnet will go away, even on vnet shutdown pf subscribes to ifnet_departure_event events, so it can clean up the ifg_pf_kif and if_pf_kif pointers in the ifnet. During vnet shutdown interfaces could go away without sending the event, so pf ends up cleaning these up as part of its shutdown sequence, which happens after the ifnet has already been freed. Send the ifnet_departure_event during vnet shutdown, allowing pf to clean up correctly. Sponsored by: Orange Business Services Modified: stable/12/sys/net/if.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Sun Nov 18 12:03:12 2018 (r340567) +++ stable/12/sys/net/if.c Sun Nov 18 12:04:24 2018 (r340568) @@ -1122,6 +1122,9 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc * the work top-down for us. */ if (shutdown) { + /* Give interface users the chance to clean up. */ + EVENTHANDLER_INVOKE(ifnet_departure_event, ifp); + /* * In case of a vmove we are done here without error. * If we would signal an error it would lead to the same From owner-svn-src-stable-12@freebsd.org Sun Nov 18 12:30:18 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9F6811388A6; Sun, 18 Nov 2018 12:30:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DC917B4AA; Sun, 18 Nov 2018 12:30:17 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EB4E13519; Sun, 18 Nov 2018 12:30:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAICUHT9058882; Sun, 18 Nov 2018 12:30:17 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAICUGW6058878; Sun, 18 Nov 2018 12:30:16 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181230.wAICUGW6058878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:30:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340573 - in stable/12/sys: net netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in stable/12/sys: net netpfil/pf X-SVN-Commit-Revision: 340573 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DC917B4AA X-Spamd-Result: default: False [0.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.06)[0.058,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:30:18 -0000 Author: kp Date: Sun Nov 18 12:30:16 2018 New Revision: 340573 URL: https://svnweb.freebsd.org/changeset/base/340573 Log: MFC r340068: pfsync: Handle syncdev going away If the syncdev is removed we no longer need to clean up the multicast entry we've got set up for that device. Pass the ifnet detach event through pf to pfsync, and remove our multicast handle, and mark us as no longer having a syncdev. Note that this callback is always installed, even if the pfsync interface is disabled (and thus it's not a per-vnet callback pointer). Sponsored by: Orange Business Services Modified: stable/12/sys/net/pfvar.h stable/12/sys/netpfil/pf/if_pfsync.c stable/12/sys/netpfil/pf/pf_if.c stable/12/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/pfvar.h ============================================================================== --- stable/12/sys/net/pfvar.h Sun Nov 18 12:23:03 2018 (r340572) +++ stable/12/sys/net/pfvar.h Sun Nov 18 12:30:16 2018 (r340573) @@ -824,6 +824,7 @@ typedef void pfsync_update_state_t(struct pf_state *) typedef void pfsync_delete_state_t(struct pf_state *); typedef void pfsync_clear_states_t(u_int32_t, const char *); typedef int pfsync_defer_t(struct pf_state *, struct mbuf *); +typedef void pfsync_detach_ifnet_t(struct ifnet *); VNET_DECLARE(pfsync_state_import_t *, pfsync_state_import_ptr); #define V_pfsync_state_import_ptr VNET(pfsync_state_import_ptr) @@ -837,6 +838,7 @@ VNET_DECLARE(pfsync_clear_states_t *, pfsync_clear_sta #define V_pfsync_clear_states_ptr VNET(pfsync_clear_states_ptr) VNET_DECLARE(pfsync_defer_t *, pfsync_defer_ptr); #define V_pfsync_defer_ptr VNET(pfsync_defer_ptr) +extern pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; void pfsync_state_export(struct pfsync_state *, struct pf_state *); Modified: stable/12/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:23:03 2018 (r340572) +++ stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:30:16 2018 (r340573) @@ -281,6 +281,7 @@ static void pfsync_bulk_status(u_int8_t); static void pfsync_bulk_update(void *); static void pfsync_bulk_fail(void *); +static void pfsync_detach_ifnet(struct ifnet *); #ifdef IPSEC static void pfsync_update_net_tdb(struct pfsync_tdb *); #endif @@ -2292,6 +2293,29 @@ pfsync_multicast_cleanup(struct pfsync_softc *sc) imo->imo_multicast_ifp = NULL; } +void +pfsync_detach_ifnet(struct ifnet *ifp) +{ + struct pfsync_softc *sc = V_pfsyncif; + + if (sc == NULL) + return; + + PFSYNC_LOCK(sc); + + if (sc->sc_sync_if == ifp) { + /* We don't need mutlicast cleanup here, because the interface + * is going away. We do need to ensure we don't try to do + * cleanup later. + */ + sc->sc_imo.imo_membership = NULL; + sc->sc_imo.imo_multicast_ifp = NULL; + sc->sc_sync_if = NULL; + } + + PFSYNC_UNLOCK(sc); +} + #ifdef INET extern struct domain inetdomain; static struct protosw in_pfsync_protosw = { @@ -2372,6 +2396,8 @@ pfsync_init() #ifdef INET int error; + pfsync_detach_ifnet_ptr = pfsync_detach_ifnet; + error = pf_proto_register(PF_INET, &in_pfsync_protosw); if (error) return (error); @@ -2388,6 +2414,7 @@ pfsync_init() static void pfsync_uninit() { + pfsync_detach_ifnet_ptr = NULL; #ifdef INET ipproto_unregister(IPPROTO_PFSYNC); Modified: stable/12/sys/netpfil/pf/pf_if.c ============================================================================== --- stable/12/sys/netpfil/pf/pf_if.c Sun Nov 18 12:23:03 2018 (r340572) +++ stable/12/sys/netpfil/pf/pf_if.c Sun Nov 18 12:30:16 2018 (r340573) @@ -833,6 +833,9 @@ pfi_detach_ifnet_event(void *arg __unused, struct ifne { struct pfi_kif *kif = (struct pfi_kif *)ifp->if_pf_kif; + if (pfsync_detach_ifnet_ptr) + pfsync_detach_ifnet_ptr(ifp); + if (kif == NULL) return; @@ -840,6 +843,7 @@ pfi_detach_ifnet_event(void *arg __unused, struct ifne /* Avoid teardown race in the least expensive way. */ return; } + PF_RULES_WLOCK(); V_pfi_update++; pfi_kif_update(kif); Modified: stable/12/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/12/sys/netpfil/pf/pf_ioctl.c Sun Nov 18 12:23:03 2018 (r340572) +++ stable/12/sys/netpfil/pf/pf_ioctl.c Sun Nov 18 12:30:16 2018 (r340573) @@ -218,6 +218,7 @@ VNET_DEFINE(pfsync_update_state_t *, pfsync_update_sta VNET_DEFINE(pfsync_delete_state_t *, pfsync_delete_state_ptr); VNET_DEFINE(pfsync_clear_states_t *, pfsync_clear_states_ptr); VNET_DEFINE(pfsync_defer_t *, pfsync_defer_ptr); +pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; From owner-svn-src-stable-12@freebsd.org Sun Nov 18 12:59:10 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C10F1100F51; Sun, 18 Nov 2018 12:59:10 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1D5C7C9BE; Sun, 18 Nov 2018 12:59:09 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8AB96139FA; Sun, 18 Nov 2018 12:59:09 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAICx9vQ074376; Sun, 18 Nov 2018 12:59:09 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAICx9xa074374; Sun, 18 Nov 2018 12:59:09 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181259.wAICx9xa074374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 12:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340576 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 340576 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1D5C7C9BE X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.263,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 12:59:10 -0000 Author: kp Date: Sun Nov 18 12:59:09 2018 New Revision: 340576 URL: https://svnweb.freebsd.org/changeset/base/340576 Log: MFC r340070: pfsync: Allow module to be unloaded Sponsored by: Orange Business Services Modified: stable/12/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:31:40 2018 (r340575) +++ stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 12:59:09 2018 (r340576) @@ -2431,12 +2431,6 @@ pfsync_modevent(module_t mod, int type, void *data) case MOD_LOAD: error = pfsync_init(); break; - case MOD_QUIESCE: - /* - * Module should not be unloaded due to race conditions. - */ - error = EBUSY; - break; case MOD_UNLOAD: pfsync_uninit(); break; From owner-svn-src-stable-12@freebsd.org Sun Nov 18 13:03:50 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7742B11012C9; Sun, 18 Nov 2018 13:03:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18C317CEC1; Sun, 18 Nov 2018 13:03:50 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC13113BA0; Sun, 18 Nov 2018 13:03:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAID3n9s079457; Sun, 18 Nov 2018 13:03:49 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAID3ns5079456; Sun, 18 Nov 2018 13:03:49 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811181303.wAID3ns5079456@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 18 Nov 2018 13:03:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340579 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 340579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 18C317CEC1 X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.26)[0.263,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 13:03:50 -0000 Author: kp Date: Sun Nov 18 13:03:49 2018 New Revision: 340579 URL: https://svnweb.freebsd.org/changeset/base/340579 Log: MFC r340072: pfsync: Add missing unlock If we fail to set up the multicast entry for pfsync and return an error we must release the pfsync lock first. Sponsored by: Orange Business Services Modified: stable/12/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/if_pfsync.c ============================================================================== --- stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 13:03:48 2018 (r340578) +++ stable/12/sys/netpfil/pf/if_pfsync.c Sun Nov 18 13:03:49 2018 (r340579) @@ -1394,6 +1394,7 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat if (error) { if_rele(sifp); free(mship, M_PFSYNC); + PFSYNC_UNLOCK(sc); return (error); } } From owner-svn-src-stable-12@freebsd.org Sun Nov 18 14:52:18 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0DC311041F8; Sun, 18 Nov 2018 14:52:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FB3280B98; Sun, 18 Nov 2018 14:52:17 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60C5914C45; Sun, 18 Nov 2018 14:52:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIEqHwp035339; Sun, 18 Nov 2018 14:52:17 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIEqHMT035338; Sun, 18 Nov 2018 14:52:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811181452.wAIEqHMT035338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 18 Nov 2018 14:52:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340580 - stable/12/share/man/man7 X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/man/man7 X-SVN-Commit-Revision: 340580 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7FB3280B98 X-Spamd-Result: default: False [0.20 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.195,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 14:52:18 -0000 Author: emaste Date: Sun Nov 18 14:52:16 2018 New Revision: 340580 URL: https://svnweb.freebsd.org/changeset/base/340580 Log: MFC r340329: build(7): clarify buildenv target can be used for non-cross builds make buildenv can be used for building for the same architecture as the host (perhaps this is a degenerate case of cross-building). TARGET and TARGET_ARCH do not need to be set in this case. Sponsored by: The FreeBSD Foundation Modified: stable/12/share/man/man7/build.7 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man7/build.7 ============================================================================== --- stable/12/share/man/man7/build.7 Sun Nov 18 13:03:49 2018 (r340579) +++ stable/12/share/man/man7/build.7 Sun Nov 18 14:52:16 2018 (r340580) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 16, 2018 +.Dd November 10, 2018 .Dt BUILD 7 .Os .Sh NAME @@ -168,16 +168,16 @@ are: .Bl -tag -width ".Cm distributeworld" .It Cm buildenv Spawn an interactive shell with environment variables set up for -cross-building the system. -The target architecture needs to be specified with +building the system or individual components. +For cross-building the target architecture needs to be specified with .Xr make 1 variables .Va TARGET_ARCH and .Va TARGET . .Pp -This target is only useful after a complete cross-toolchain including -the compiler, linker, assembler, headers and libraries has been +This target is only useful after a complete toolchain (including +the compiler, linker, assembler, headers and libraries) has been built; see the .Cm toolchain target below. From owner-svn-src-stable-12@freebsd.org Sun Nov 18 14:54:46 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C08D1104445; Sun, 18 Nov 2018 14:54:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEF6080FA7; Sun, 18 Nov 2018 14:54:45 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FE7C14D6D; Sun, 18 Nov 2018 14:54:45 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIEsjoc035933; Sun, 18 Nov 2018 14:54:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIEsj5i035932; Sun, 18 Nov 2018 14:54:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811181454.wAIEsj5i035932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 18 Nov 2018 14:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340582 - stable/12/contrib/nvi/vi X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/contrib/nvi/vi X-SVN-Commit-Revision: 340582 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BEF6080FA7 X-Spamd-Result: default: False [0.20 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.195,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 14:54:46 -0000 Author: emaste Date: Sun Nov 18 14:54:45 2018 New Revision: 340582 URL: https://svnweb.freebsd.org/changeset/base/340582 Log: MFC r340288: nvi: remove superfluous space before ^\ This fixes alignment in vi's 'viusage' command and has been fixed upstream and in OpenBSD. Submitted by: Raf Czlonka (github:rjc) Modified: stable/12/contrib/nvi/vi/v_cmd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/nvi/vi/v_cmd.c ============================================================================== --- stable/12/contrib/nvi/vi/v_cmd.c Sun Nov 18 14:53:29 2018 (r340581) +++ stable/12/contrib/nvi/vi/v_cmd.c Sun Nov 18 14:54:45 2018 (r340582) @@ -130,7 +130,7 @@ VIKEYS const vikeys [MAXVIKEY + 1] = { /* 034 ^\ */ {v_exmode, 0, "^\\", - " ^\\ switch to ex mode"}, + "^\\ switch to ex mode"}, /* 035 ^] */ {v_tagpush, V_ABS|V_KEYW|VM_RCM_SET, "^]", From owner-svn-src-stable-12@freebsd.org Sun Nov 18 14:56:09 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9334811045D4; Sun, 18 Nov 2018 14:56:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1A2688132A; Sun, 18 Nov 2018 14:56:09 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE8F614D70; Sun, 18 Nov 2018 14:56:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIEu8YV036132; Sun, 18 Nov 2018 14:56:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIEu8us036131; Sun, 18 Nov 2018 14:56:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811181456.wAIEu8us036131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 18 Nov 2018 14:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340584 - stable/12/sys/contrib/octeon-sdk X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/contrib/octeon-sdk X-SVN-Commit-Revision: 340584 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A2688132A X-Spamd-Result: default: False [0.20 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.20)[0.195,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 14:56:09 -0000 Author: emaste Date: Sun Nov 18 14:56:08 2018 New Revision: 340584 URL: https://svnweb.freebsd.org/changeset/base/340584 Log: MFC r340299: Octeon SDK: avoid use of uninitialized variable Reported by: Clang Modified: stable/12/sys/contrib/octeon-sdk/cvmx-pip.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/octeon-sdk/cvmx-pip.h ============================================================================== --- stable/12/sys/contrib/octeon-sdk/cvmx-pip.h Sun Nov 18 14:55:04 2018 (r340583) +++ stable/12/sys/contrib/octeon-sdk/cvmx-pip.h Sun Nov 18 14:56:08 2018 (r340584) @@ -684,6 +684,7 @@ static inline int cvmx_pip_get_bsel_table_index(cvmx_w bsel_cfg.u64 = cvmx_read_csr(CVMX_PIP_BSEL_EXT_CFGX(bit)); bsel_pos.u64 = cvmx_read_csr(CVMX_PIP_BSEL_EXT_POSX(bit)); + index = 0; for (y = 0; y < 8; y++) { char *ptr = (char *)cvmx_phys_to_ptr(work->packet_ptr.s.addr); From owner-svn-src-stable-12@freebsd.org Sun Nov 18 14:58:02 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBA0C11047C4; Sun, 18 Nov 2018 14:58:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6BB8B81648; Sun, 18 Nov 2018 14:58:02 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CA4B14D76; Sun, 18 Nov 2018 14:58:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAIEw2o9036311; Sun, 18 Nov 2018 14:58:02 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAIEw2ig036310; Sun, 18 Nov 2018 14:58:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811181458.wAIEw2ig036310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 18 Nov 2018 14:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340586 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 340586 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6BB8B81648 X-Spamd-Result: default: False [0.20 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.20)[0.195,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2018 14:58:03 -0000 Author: emaste Date: Sun Nov 18 14:58:01 2018 New Revision: 340586 URL: https://svnweb.freebsd.org/changeset/base/340586 Log: MFC r340171: capability.h: add comment about planned removal timeline PR: 228878 Modified: stable/12/sys/sys/capability.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/capability.h ============================================================================== --- stable/12/sys/sys/capability.h Sun Nov 18 14:56:26 2018 (r340585) +++ stable/12/sys/sys/capability.h Sun Nov 18 14:58:01 2018 (r340586) @@ -35,7 +35,8 @@ * Historically, the key userspace and kernel Capsicum definitions were found * in this file. However, it conflicted with POSIX.1e's capability.h, so has * been renamed capsicum.h. The file remains for backwards compatibility - * reasons as a nested include. + * reasons as a nested include. It is expected to be removed before + * FreeBSD 13. */ #ifndef _SYS_CAPABILITY_H_ #define _SYS_CAPABILITY_H_ From owner-svn-src-stable-12@freebsd.org Mon Nov 19 00:49:09 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BD2B112D406; Mon, 19 Nov 2018 00:49:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B08A978E01; Mon, 19 Nov 2018 00:49:08 +0000 (UTC) (envelope-from rmacklem@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E7B31ADBD; Mon, 19 Nov 2018 00:49:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ0n8wk045260; Mon, 19 Nov 2018 00:49:08 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ0n8TG045259; Mon, 19 Nov 2018 00:49:08 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201811190049.wAJ0n8TG045259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Mon, 19 Nov 2018 00:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340590 - stable/12/sys/fs/nfsclient X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/sys/fs/nfsclient X-SVN-Commit-Revision: 340590 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B08A978E01 X-Spamd-Result: default: False [0.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.24)[0.236,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 00:49:09 -0000 Author: rmacklem Date: Mon Nov 19 00:49:08 2018 New Revision: 340590 URL: https://svnweb.freebsd.org/changeset/base/340590 Log: MFC: r339999 Fix NFS client vnode locking to avoid a crash during forced dismount. A crash was reported where the crash occurred in nfs_advlock() when the NFS_ISV4(vp) macro was being executed. This was caused by the vnode being VI_DOOMED due to a forced dismount in progress. This patch fixes the problem by locking the vnode before executing the NFS_ISV4() macro. PR: 232673 Modified: stable/12/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clvnops.c Sun Nov 18 23:48:15 2018 (r340589) +++ stable/12/sys/fs/nfsclient/nfs_clvnops.c Mon Nov 19 00:49:08 2018 (r340590) @@ -3008,14 +3008,19 @@ nfs_advlock(struct vop_advlock_args *ap) int ret, error = EOPNOTSUPP; u_quad_t size; + ret = NFSVOPLOCK(vp, LK_SHARED); + if (ret != 0) + return (EBADF); if (NFS_ISV4(vp) && (ap->a_flags & (F_POSIX | F_FLOCK)) != 0) { - if (vp->v_type != VREG) + if (vp->v_type != VREG) { + NFSVOPUNLOCK(vp, 0); return (EINVAL); + } if ((ap->a_flags & F_POSIX) != 0) cred = p->p_ucred; else cred = td->td_ucred; - NFSVOPLOCK(vp, LK_EXCLUSIVE | LK_RETRY); + NFSVOPLOCK(vp, LK_UPGRADE | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { NFSVOPUNLOCK(vp, 0); return (EBADF); @@ -3094,9 +3099,6 @@ nfs_advlock(struct vop_advlock_args *ap) NFSVOPUNLOCK(vp, 0); return (0); } else if (!NFS_ISV4(vp)) { - error = NFSVOPLOCK(vp, LK_SHARED); - if (error) - return (error); if ((VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOLOCKD) != 0) { size = VTONFS(vp)->n_size; NFSVOPUNLOCK(vp, 0); @@ -3119,7 +3121,8 @@ nfs_advlock(struct vop_advlock_args *ap) NFSVOPUNLOCK(vp, 0); } } - } + } else + NFSVOPUNLOCK(vp, 0); return (error); } From owner-svn-src-stable-12@freebsd.org Mon Nov 19 05:40:38 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B68351134FA4; Mon, 19 Nov 2018 05:40:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AE318337D; Mon, 19 Nov 2018 05:40:38 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AF1B1DE97; Mon, 19 Nov 2018 05:40:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ5ecY3096464; Mon, 19 Nov 2018 05:40:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ5ecsH096463; Mon, 19 Nov 2018 05:40:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190540.wAJ5ecsH096463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 05:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340603 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5AE318337D X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.522,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 05:40:38 -0000 Author: kib Date: Mon Nov 19 05:40:37 2018 New Revision: 340603 URL: https://svnweb.freebsd.org/changeset/base/340603 Log: MFC r340364: Allow set ether/vlan PCP operation from the VNET jails. Modified: stable/12/sys/kern/kern_jail.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_jail.c ============================================================================== --- stable/12/sys/kern/kern_jail.c Mon Nov 19 03:52:56 2018 (r340602) +++ stable/12/sys/kern/kern_jail.c Mon Nov 19 05:40:37 2018 (r340603) @@ -3062,6 +3062,7 @@ prison_priv_check(struct ucred *cred, int priv) case PRIV_NET_SETIFMETRIC: case PRIV_NET_SETIFPHYS: case PRIV_NET_SETIFMAC: + case PRIV_NET_SETLANPCP: case PRIV_NET_ADDMULTI: case PRIV_NET_DELMULTI: case PRIV_NET_HWIOCTL: From owner-svn-src-stable-12@freebsd.org Mon Nov 19 05:42:01 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4C1B11351C2; Mon, 19 Nov 2018 05:42:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 693BF836E1; Mon, 19 Nov 2018 05:42:01 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4BB841DEFA; Mon, 19 Nov 2018 05:42:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ5g1LH098441; Mon, 19 Nov 2018 05:42:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ5g0ca098439; Mon, 19 Nov 2018 05:42:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190542.wAJ5g0ca098439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 05:42:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340604 - in stable/12/sys: amd64/amd64 x86/include x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 x86/include x86/x86 X-SVN-Commit-Revision: 340604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 693BF836E1 X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.522,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 05:42:02 -0000 Author: kib Date: Mon Nov 19 05:42:00 2018 New Revision: 340604 URL: https://svnweb.freebsd.org/changeset/base/340604 Log: MFC r340384: Apply fix to un-cripple max cpu id on BSP earlier. Modified: stable/12/sys/amd64/amd64/machdep.c stable/12/sys/x86/include/x86_var.h stable/12/sys/x86/x86/identcpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Mon Nov 19 05:40:37 2018 (r340603) +++ stable/12/sys/amd64/amd64/machdep.c Mon Nov 19 05:42:00 2018 (r340604) @@ -1581,6 +1581,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) identify_cpu1(); identify_hypervisor(); + identify_cpu_fixup_bsp(); identify_cpu2(); initializecpucache(); Modified: stable/12/sys/x86/include/x86_var.h ============================================================================== --- stable/12/sys/x86/include/x86_var.h Mon Nov 19 05:40:37 2018 (r340603) +++ stable/12/sys/x86/include/x86_var.h Mon Nov 19 05:42:00 2018 (r340604) @@ -129,6 +129,7 @@ void dump_drop_page(vm_paddr_t); void finishidentcpu(void); void identify_cpu1(void); void identify_cpu2(void); +void identify_cpu_fixup_bsp(void); void identify_hypervisor(void); void initializecpu(void); void initializecpucache(void); Modified: stable/12/sys/x86/x86/identcpu.c ============================================================================== --- stable/12/sys/x86/x86/identcpu.c Mon Nov 19 05:40:37 2018 (r340603) +++ stable/12/sys/x86/x86/identcpu.c Mon Nov 19 05:42:00 2018 (r340604) @@ -1467,6 +1467,19 @@ identify_cpu2(void) } } +void +identify_cpu_fixup_bsp(void) +{ + u_int regs[4]; + + cpu_vendor_id = find_cpu_vendor_id(); + + if (fix_cpuid()) { + do_cpuid(0, regs); + cpu_high = regs[0]; + } +} + /* * Final stage of CPU identification. */ @@ -1478,12 +1491,7 @@ finishidentcpu(void) u_char ccr3; #endif - cpu_vendor_id = find_cpu_vendor_id(); - - if (fix_cpuid()) { - do_cpuid(0, regs); - cpu_high = regs[0]; - } + identify_cpu_fixup_bsp(); if (cpu_high >= 5 && (cpu_feature2 & CPUID2_MON) != 0) { do_cpuid(5, regs); From owner-svn-src-stable-12@freebsd.org Mon Nov 19 05:43:43 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83AB7113528D; Mon, 19 Nov 2018 05:43:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 276CF83918; Mon, 19 Nov 2018 05:43:43 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0856D1DF2C; Mon, 19 Nov 2018 05:43:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ5hgHs000881; Mon, 19 Nov 2018 05:43:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ5hgMj000876; Mon, 19 Nov 2018 05:43:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190543.wAJ5hgMj000876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 05:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340605 - in stable/12/sys: amd64/vmm/intel x86/include x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: amd64/vmm/intel x86/include x86/x86 X-SVN-Commit-Revision: 340605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 276CF83918 X-Spamd-Result: default: False [0.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.534,0]; NEURAL_SPAM_MEDIUM(0.12)[0.123,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 05:43:43 -0000 Author: kib Date: Mon Nov 19 05:43:41 2018 New Revision: 340605 URL: https://svnweb.freebsd.org/changeset/base/340605 Log: MFC r340487: Align IA32_ARCH_CAP MSR definitions and use with SDM rev. 068. Modified: stable/12/sys/amd64/vmm/intel/vmx.c stable/12/sys/x86/include/specialreg.h stable/12/sys/x86/x86/cpu_machdep.c stable/12/sys/x86/x86/identcpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx.c Mon Nov 19 05:42:00 2018 (r340604) +++ stable/12/sys/amd64/vmm/intel/vmx.c Mon Nov 19 05:43:41 2018 (r340605) @@ -814,7 +814,8 @@ vmx_init(int ipinum) return (error); } - guest_l1d_flush = (cpu_ia32_arch_caps & IA32_ARCH_CAP_RDCL_NO) == 0; + guest_l1d_flush = (cpu_ia32_arch_caps & + IA32_ARCH_CAP_SKIP_L1DFL_VMENTRY) == 0; TUNABLE_INT_FETCH("hw.vmm.l1d_flush", &guest_l1d_flush); /* Modified: stable/12/sys/x86/include/specialreg.h ============================================================================== --- stable/12/sys/x86/include/specialreg.h Mon Nov 19 05:42:00 2018 (r340604) +++ stable/12/sys/x86/include/specialreg.h Mon Nov 19 05:43:41 2018 (r340605) @@ -434,7 +434,9 @@ /* MSR IA32_ARCH_CAP(ABILITIES) bits */ #define IA32_ARCH_CAP_RDCL_NO 0x00000001 #define IA32_ARCH_CAP_IBRS_ALL 0x00000002 -#define IA32_ARCH_CAP_SSBD_NO 0x00000004 +#define IA32_ARCH_CAP_RSBA 0x00000004 +#define IA32_ARCH_CAP_SKIP_L1DFL_VMENTRY 0x00000008 +#define IA32_ARCH_CAP_SSB_NO 0x00000010 /* * CPUID manufacturers identifiers Modified: stable/12/sys/x86/x86/cpu_machdep.c ============================================================================== --- stable/12/sys/x86/x86/cpu_machdep.c Mon Nov 19 05:42:00 2018 (r340604) +++ stable/12/sys/x86/x86/cpu_machdep.c Mon Nov 19 05:43:41 2018 (r340605) @@ -891,7 +891,7 @@ hw_ssb_recalculate(bool all_cpus) hw_ssb_set(true, all_cpus); break; case 2: /* auto */ - hw_ssb_set((cpu_ia32_arch_caps & IA32_ARCH_CAP_SSBD_NO) != 0 ? + hw_ssb_set((cpu_ia32_arch_caps & IA32_ARCH_CAP_SSB_NO) != 0 ? false : true, all_cpus); break; } Modified: stable/12/sys/x86/x86/identcpu.c ============================================================================== --- stable/12/sys/x86/x86/identcpu.c Mon Nov 19 05:42:00 2018 (r340604) +++ stable/12/sys/x86/x86/identcpu.c Mon Nov 19 05:43:41 2018 (r340605) @@ -1014,6 +1014,9 @@ printcpuinfo(void) "\020" "\001RDCL_NO" "\002IBRS_ALL" + "\003RSBA" + "\004SKIP_L1DFL_VME" + "\005SSB_NO" ); } From owner-svn-src-stable-12@freebsd.org Mon Nov 19 05:45:48 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3495E11353B8; Mon, 19 Nov 2018 05:45:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C546D83AED; Mon, 19 Nov 2018 05:45:47 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A546D1DF2F; Mon, 19 Nov 2018 05:45:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ5jlsR001048; Mon, 19 Nov 2018 05:45:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ5jlfj001047; Mon, 19 Nov 2018 05:45:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190545.wAJ5jlfj001047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 05:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340606 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 340606 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C546D83AED X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.52)[0.522,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 05:45:48 -0000 Author: kib Date: Mon Nov 19 05:45:47 2018 New Revision: 340606 URL: https://svnweb.freebsd.org/changeset/base/340606 Log: MFC r339895: amd64: Use ifuncs to select suitable implementation of set_pcb_flags(). Modified: stable/12/sys/amd64/amd64/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/machdep.c ============================================================================== --- stable/12/sys/amd64/amd64/machdep.c Mon Nov 19 05:43:41 2018 (r340605) +++ stable/12/sys/amd64/amd64/machdep.c Mon Nov 19 05:45:47 2018 (r340606) @@ -2628,15 +2628,14 @@ set_pcb_flags_raw(struct pcb *pcb, const u_int flags) * the PCB_FULL_IRET flag is set. We disable interrupts to sync with * context switches. */ -void -set_pcb_flags(struct pcb *pcb, const u_int flags) +static void +set_pcb_flags_fsgsbase(struct pcb *pcb, const u_int flags) { register_t r; if (curpcb == pcb && (flags & PCB_FULL_IRET) != 0 && - (pcb->pcb_flags & PCB_FULL_IRET) == 0 && - (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) { + (pcb->pcb_flags & PCB_FULL_IRET) == 0) { r = intr_disable(); if ((pcb->pcb_flags & PCB_FULL_IRET) == 0) { if (rfs() == _ufssel) @@ -2649,6 +2648,13 @@ set_pcb_flags(struct pcb *pcb, const u_int flags) } else { set_pcb_flags_raw(pcb, flags); } +} + +DEFINE_IFUNC(, void, set_pcb_flags, (struct pcb *, const u_int), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0 ? + set_pcb_flags_fsgsbase : set_pcb_flags_raw); } void From owner-svn-src-stable-12@freebsd.org Mon Nov 19 05:47:33 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6A331135487; Mon, 19 Nov 2018 05:47:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8555E83C4A; Mon, 19 Nov 2018 05:47:32 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 616EC1DF31; Mon, 19 Nov 2018 05:47:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ5lWQZ001180; Mon, 19 Nov 2018 05:47:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ5lWT5001179; Mon, 19 Nov 2018 05:47:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190547.wAJ5lWT5001179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 05:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340607 - stable/12/lib/libc X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libc X-SVN-Commit-Revision: 340607 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8555E83C4A X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.52)[0.522,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 05:47:33 -0000 Author: kib Date: Mon Nov 19 05:47:31 2018 New Revision: 340607 URL: https://svnweb.freebsd.org/changeset/base/340607 Log: MFC r340383: Create namespace for the symbols added during 13-CURRENT cycle. Modified: stable/12/lib/libc/Versions.def Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/Versions.def ============================================================================== --- stable/12/lib/libc/Versions.def Mon Nov 19 05:45:47 2018 (r340606) +++ stable/12/lib/libc/Versions.def Mon Nov 19 05:47:31 2018 (r340607) @@ -31,6 +31,9 @@ FBSD_1.4 { FBSD_1.5 { } FBSD_1.4; +# This version was first added to 13.0-current. +FBSD_1.6 { +} FBSD_1.5; # This is our private namespace. Any global interfaces that are # strictly for use only by other FreeBSD applications and libraries @@ -39,4 +42,4 @@ FBSD_1.5 { # # Please do NOT increment the version of this namespace. FBSDprivate_1.0 { -} FBSD_1.5; +} FBSD_1.6; From owner-svn-src-stable-12@freebsd.org Mon Nov 19 05:56:49 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B21F4113576D; Mon, 19 Nov 2018 05:56:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4EDA584058; Mon, 19 Nov 2018 05:56:48 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11B6B1E0D8; Mon, 19 Nov 2018 05:56:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ5ulI4006051; Mon, 19 Nov 2018 05:56:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ5ul0Z006046; Mon, 19 Nov 2018 05:56:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811190556.wAJ5ul0Z006046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 19 Nov 2018 05:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340608 - stable/12/lib/libc/amd64/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libc/amd64/sys X-SVN-Commit-Revision: 340608 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4EDA584058 X-Spamd-Result: default: False [0.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.534,0]; NEURAL_SPAM_MEDIUM(0.12)[0.123,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 05:56:49 -0000 Author: kib Date: Mon Nov 19 05:56:46 2018 New Revision: 340608 URL: https://svnweb.freebsd.org/changeset/base/340608 Log: MFC r339898: Convert amd64_get/set_fs/gsbase to ifunc. Deleted: stable/12/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.c stable/12/lib/libc/amd64/sys/amd64_detect_rdfsgsbase.h Modified: stable/12/lib/libc/amd64/sys/Makefile.inc stable/12/lib/libc/amd64/sys/amd64_get_fsbase.c stable/12/lib/libc/amd64/sys/amd64_get_gsbase.c stable/12/lib/libc/amd64/sys/amd64_set_fsbase.c stable/12/lib/libc/amd64/sys/amd64_set_gsbase.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- stable/12/lib/libc/amd64/sys/Makefile.inc Mon Nov 19 05:47:31 2018 (r340607) +++ stable/12/lib/libc/amd64/sys/Makefile.inc Mon Nov 19 05:56:46 2018 (r340608) @@ -2,7 +2,6 @@ # $FreeBSD$ SRCS+= \ - amd64_detect_rdfsgsbase.c \ amd64_get_fsbase.c \ amd64_get_gsbase.c \ amd64_set_fsbase.c \ Modified: stable/12/lib/libc/amd64/sys/amd64_get_fsbase.c ============================================================================== --- stable/12/lib/libc/amd64/sys/amd64_get_fsbase.c Mon Nov 19 05:47:31 2018 (r340607) +++ stable/12/lib/libc/amd64/sys/amd64_get_fsbase.c Mon Nov 19 05:56:46 2018 (r340608) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2017 The FreeBSD Foundation + * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -33,18 +33,35 @@ #include __FBSDID("$FreeBSD$"); -#include +#define IN_RTLD 1 +#include +#undef IN_RTLD #include +#include #include -#include "amd64_detect_rdfsgsbase.h" +#include +#include "libc_private.h" -int -amd64_get_fsbase(void **addr) +static int +amd64_get_fsbase_cpu(void **addr) { - if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { - *addr = (void *)rdfsbase(); - return (0); - } + *addr = (void *)rdfsbase(); + return (0); +} + +static int +amd64_get_fsbase_syscall(void **addr) +{ + return (sysarch(AMD64_GET_FSBASE, addr)); +} + +DEFINE_UIFUNC(, int, amd64_get_fsbase, (void **), static) +{ + + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + return (amd64_get_fsbase_cpu); + return (amd64_get_fsbase_syscall); } Modified: stable/12/lib/libc/amd64/sys/amd64_get_gsbase.c ============================================================================== --- stable/12/lib/libc/amd64/sys/amd64_get_gsbase.c Mon Nov 19 05:47:31 2018 (r340607) +++ stable/12/lib/libc/amd64/sys/amd64_get_gsbase.c Mon Nov 19 05:56:46 2018 (r340608) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2017 The FreeBSD Foundation + * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -33,18 +33,35 @@ #include __FBSDID("$FreeBSD$"); -#include +#define IN_RTLD 1 +#include +#undef IN_RTLD #include +#include #include -#include "amd64_detect_rdfsgsbase.h" +#include +#include "libc_private.h" -int -amd64_get_gsbase(void **addr) +static int +amd64_get_gsbase_cpu(void **addr) { - if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { - *addr = (void *)rdgsbase(); - return (0); - } + *addr = (void *)rdgsbase(); + return (0); +} + +static int +amd64_get_gsbase_syscall(void **addr) +{ + return (sysarch(AMD64_GET_GSBASE, addr)); +} + +DEFINE_UIFUNC(, int, amd64_get_gsbase, (void **), static) +{ + + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + return (amd64_get_gsbase_cpu); + return (amd64_get_gsbase_syscall); } Modified: stable/12/lib/libc/amd64/sys/amd64_set_fsbase.c ============================================================================== --- stable/12/lib/libc/amd64/sys/amd64_set_fsbase.c Mon Nov 19 05:47:31 2018 (r340607) +++ stable/12/lib/libc/amd64/sys/amd64_set_fsbase.c Mon Nov 19 05:56:46 2018 (r340608) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2017 The FreeBSD Foundation + * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -33,18 +33,35 @@ #include __FBSDID("$FreeBSD$"); -#include +#define IN_RTLD 1 +#include +#undef IN_RTLD #include +#include #include -#include "amd64_detect_rdfsgsbase.h" +#include +#include "libc_private.h" -int -amd64_set_fsbase(void *addr) +static int +amd64_set_fsbase_cpu(void *addr) { - if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { - wrfsbase((uintptr_t)addr); - return (0); - } + wrfsbase((uintptr_t)addr); + return (0); +} + +static int +amd64_set_fsbase_syscall(void *addr) +{ + return (sysarch(AMD64_SET_FSBASE, &addr)); +} + +DEFINE_UIFUNC(, int, amd64_set_fsbase, (void *), static) +{ + + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + return (amd64_set_fsbase_cpu); + return (amd64_set_fsbase_syscall); } Modified: stable/12/lib/libc/amd64/sys/amd64_set_gsbase.c ============================================================================== --- stable/12/lib/libc/amd64/sys/amd64_set_gsbase.c Mon Nov 19 05:47:31 2018 (r340607) +++ stable/12/lib/libc/amd64/sys/amd64_set_gsbase.c Mon Nov 19 05:56:46 2018 (r340608) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2003 Peter Wemm - * Copyright (c) 2017 The FreeBSD Foundation + * Copyright (c) 2017, 2018 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Konstantin Belousov @@ -33,18 +33,35 @@ #include __FBSDID("$FreeBSD$"); -#include +#define IN_RTLD 1 +#include +#undef IN_RTLD #include +#include #include -#include "amd64_detect_rdfsgsbase.h" +#include +#include "libc_private.h" -int -amd64_set_gsbase(void *addr) +static int +amd64_set_gsbase_cpu(void *addr) { - if (amd64_detect_rdfsgsbase() == RDFSGS_SUPPORTED) { - wrgsbase((uintptr_t)addr); - return (0); - } + wrgsbase((uintptr_t)addr); + return (0); +} + +static int +amd64_set_gsbase_syscall(void *addr) +{ + return (sysarch(AMD64_SET_GSBASE, &addr)); +} + +DEFINE_UIFUNC(, int, amd64_set_gsbase, (void *), static) +{ + + if (__getosreldate() >= P_OSREL_WRFSBASE && + (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) != 0) + return (amd64_set_gsbase_cpu); + return (amd64_set_gsbase_syscall); } From owner-svn-src-stable-12@freebsd.org Mon Nov 19 06:33:39 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22279113616A; Mon, 19 Nov 2018 06:33:39 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADD31850EA; Mon, 19 Nov 2018 06:33:38 +0000 (UTC) (envelope-from eugen@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76B801E744; Mon, 19 Nov 2018 06:33:38 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ6XcUO026195; Mon, 19 Nov 2018 06:33:38 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ6XcVq026194; Mon, 19 Nov 2018 06:33:38 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811190633.wAJ6XcVq026194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 19 Nov 2018 06:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340610 - stable/12/libexec/rc X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/libexec/rc X-SVN-Commit-Revision: 340610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADD31850EA X-Spamd-Result: default: False [0.66 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.123,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.534,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 06:33:39 -0000 Author: eugen Date: Mon Nov 19 06:33:38 2018 New Revision: 340610 URL: https://svnweb.freebsd.org/changeset/base/340610 Log: MFC r339465: rc.initdiskless: add support for auxiliary NVRAM. Currently, rc.inidiskless assumes that local system configuration changes are kept in some mountable file system. For example, nanobsd uses dedicated partition mounted as /cfg for this. However, small embedded devices like MIPS routers may have no enough flash space to keep full-blown file system but have only one or couple small flash blocks to keep persistent local configuration overrides. This change extends rc.initdiskless and introduces ability to run auxiliary command /conf/T/M/extract that is supposed to extract configuration overrides from such local storage. For example, the command /conf/default/etc/extract may contain something like: cd "$1" && bsdcpio --quiet -idu < /dev/map/cfg bsdcpio command extracts compressed archive from the storage to /etc assuming the storage is exposed by the kernel as /dev/map/cfg to userland. PR: 204215 Modified: stable/12/libexec/rc/rc.initdiskless Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.initdiskless ============================================================================== --- stable/12/libexec/rc/rc.initdiskless Mon Nov 19 06:07:17 2018 (r340609) +++ stable/12/libexec/rc/rc.initdiskless Mon Nov 19 06:33:38 2018 (r340610) @@ -111,6 +111,15 @@ # created for /SUBDIR if necessary). The presence of this file # prevents the copy from /conf/T/SUBDIR/ # +# /conf/T/M/extract +# This is alternative to SUBDIR.cpio.gz and remount. +# Similar to remount case, a memory filesystem is created +# for /M and initialized from a template but no mounting +# performed. Instead, this file is run passing /M as singe +# argument. It is expected to extract template override to /M +# using auxiliary storage found in some embedded systems +# having NVRAM too small to hold mountable file system. +# # /conf/T/SUBDIR.remove # The list of paths contained in the file are rm -rf'd # relative to /SUBDIR. @@ -343,8 +352,8 @@ done # - Create all required MFS filesystems and populate them from # our templates. Support both a direct template and a dir.cpio.gz -# archive. Support dir.remove files containing a list of relative -# paths to remove. +# archive. Support for auxiliary NVRAM. Support dir.remove files containing +# a list of relative paths to remove. # # The dir.cpio.gz form is there to make the copy process more efficient, # so if the cpio archive is present, it prevents the files from dir/ @@ -365,6 +374,15 @@ for i in ${templates} ; do create_md $subdir echo "Loading /$subdir from cpio archive $j" (cd / ; /rescue/tar -xpf $j) + fi + done + for j in /conf/$i/*/extract ; do + if [ -x $j ]; then + subdir=${j%*/extract} + subdir=${subdir##*/} + create_md $subdir + echo "Loading /$subdir using auxiliary command $j" + $j /$subdir fi done for j in /conf/$i/*.remove ; do From owner-svn-src-stable-12@freebsd.org Mon Nov 19 06:49:31 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FBAE113671F; Mon, 19 Nov 2018 06:49:31 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2434685C74; Mon, 19 Nov 2018 06:49:31 +0000 (UTC) (envelope-from eugen@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04BA41E8F8; Mon, 19 Nov 2018 06:49:31 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ6nUsC032033; Mon, 19 Nov 2018 06:49:30 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ6nUm9032032; Mon, 19 Nov 2018 06:49:30 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811190649.wAJ6nUm9032032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 19 Nov 2018 06:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340614 - stable/12/libexec/rc X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/libexec/rc X-SVN-Commit-Revision: 340614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2434685C74 X-Spamd-Result: default: False [0.64 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.52)[0.522,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 06:49:31 -0000 Author: eugen Date: Mon Nov 19 06:49:30 2018 New Revision: 340614 URL: https://svnweb.freebsd.org/changeset/base/340614 Log: MFC r339472: rc.initdiskless: fix commentary grammar after r339465 Modified: stable/12/libexec/rc/rc.initdiskless Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.initdiskless ============================================================================== --- stable/12/libexec/rc/rc.initdiskless Mon Nov 19 06:48:48 2018 (r340613) +++ stable/12/libexec/rc/rc.initdiskless Mon Nov 19 06:49:30 2018 (r340614) @@ -115,7 +115,7 @@ # This is alternative to SUBDIR.cpio.gz and remount. # Similar to remount case, a memory filesystem is created # for /M and initialized from a template but no mounting -# performed. Instead, this file is run passing /M as singe +# performed. Instead, this file is run passing /M as single # argument. It is expected to extract template override to /M # using auxiliary storage found in some embedded systems # having NVRAM too small to hold mountable file system. From owner-svn-src-stable-12@freebsd.org Mon Nov 19 08:53:54 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1315113951A; Mon, 19 Nov 2018 08:53:54 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FF0C6C0F9; Mon, 19 Nov 2018 08:53:54 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 364011FE00; Mon, 19 Nov 2018 08:53:54 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ8rsTh097672; Mon, 19 Nov 2018 08:53:54 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ8rqgB097664; Mon, 19 Nov 2018 08:53:52 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201811190853.wAJ8rqgB097664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 19 Nov 2018 08:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340618 - in stable/12: share/man/man4 tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in stable/12: share/man/man4 tools/tools/netmap X-SVN-Commit-Revision: 340618 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FF0C6C0F9 X-Spamd-Result: default: False [0.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.15)[0.148,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.29)[0.290,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 08:53:55 -0000 Author: vmaffione Date: Mon Nov 19 08:53:52 2018 New Revision: 340618 URL: https://svnweb.freebsd.org/changeset/base/340618 Log: MFC r340279 netmap: add load balancer program Add the lb program, which is able to load-balance input traffic received from a netmap port over M groups, with N netmap pipes in each group. Each received packet is forwarded to one of the pipes chosen from each group (using an L3/L4 connection-consistent hash function). This also adds a man page for lb and some cross-references in related man pages. Differential Revision: https://reviews.freebsd.org/D17735 Added: stable/12/tools/tools/netmap/lb.8 - copied unchanged from r340279, head/tools/tools/netmap/lb.8 stable/12/tools/tools/netmap/lb.c - copied unchanged from r340279, head/tools/tools/netmap/lb.c stable/12/tools/tools/netmap/pkt_hash.c - copied unchanged from r340279, head/tools/tools/netmap/pkt_hash.c stable/12/tools/tools/netmap/pkt_hash.h - copied unchanged from r340279, head/tools/tools/netmap/pkt_hash.h Modified: stable/12/share/man/man4/netmap.4 stable/12/tools/tools/netmap/Makefile stable/12/tools/tools/netmap/README stable/12/tools/tools/netmap/bridge.8 stable/12/tools/tools/netmap/ctrs.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/netmap.4 ============================================================================== --- stable/12/share/man/man4/netmap.4 Mon Nov 19 07:27:50 2018 (r340617) +++ stable/12/share/man/man4/netmap.4 Mon Nov 19 08:53:52 2018 (r340618) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 23, 2018 +.Dd October 28, 2018 .Dt NETMAP 4 .Os .Sh NAME @@ -1073,8 +1073,11 @@ Other clients attached to the same switch can now communicate with the network card or the host. .Sh SEE ALSO -.Xr pkt-gen 8 , -.Xr bridge 8 +.Xr vale 4 , +.Xr vale-ctl 4 , +.Xr bridge 8 , +.Xr lb 8 , +.Xr pkt-gen 8 .Pp .Pa http://info.iet.unipi.it/~luigi/netmap/ .Pp Modified: stable/12/tools/tools/netmap/Makefile ============================================================================== --- stable/12/tools/tools/netmap/Makefile Mon Nov 19 07:27:50 2018 (r340617) +++ stable/12/tools/tools/netmap/Makefile Mon Nov 19 08:53:52 2018 (r340618) @@ -3,7 +3,7 @@ # # For multiple programs using a single source file each, # we can just define 'progs' and create custom targets. -PROGS = pkt-gen nmreplay bridge vale-ctl +PROGS = pkt-gen nmreplay bridge vale-ctl lb CLEANFILES = $(PROGS) *.o MAN= @@ -34,3 +34,6 @@ nmreplay: nmreplay.o vale-ctl: vale-ctl.o $(CC) $(CFLAGS) -o vale-ctl vale-ctl.o + +lb: lb.o pkt_hash.o + $(CC) $(CFLAGS) -o lb lb.o pkt_hash.o $(LDFLAGS) Modified: stable/12/tools/tools/netmap/README ============================================================================== --- stable/12/tools/tools/netmap/README Mon Nov 19 07:27:50 2018 (r340617) +++ stable/12/tools/tools/netmap/README Mon Nov 19 08:53:52 2018 (r340618) @@ -1,9 +1,13 @@ $FreeBSD$ -This directory contains examples that use netmap +This directory contains applications that use the netmap API - pkt-gen a packet sink/source using the netmap API + pkt-gen a multi-function packet generator and traffic sink - bridge a two-port jumper wire, also using the native API + bridge a two-port jumper wire, also using the netmap API - vale-ctl the program to control VALE bridges + vale-ctl the program to control and inspect VALE switches + + lb an L3/L4 load balancer + + nmreplay a tool to playback a pcap file to a netmap port Modified: stable/12/tools/tools/netmap/bridge.8 ============================================================================== --- stable/12/tools/tools/netmap/bridge.8 Mon Nov 19 07:27:50 2018 (r340617) +++ stable/12/tools/tools/netmap/bridge.8 Mon Nov 19 08:53:52 2018 (r340618) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 23, 2018 +.Dd October 28, 2018 .Dt BRIDGE 8 .Os .Sh NAME @@ -71,7 +71,8 @@ Disable zero-copy mode. .El .Sh SEE ALSO .Xr netmap 4 , -.Xr pkt-gen 8 +.Xr pkt-gen 8 , +.Xr lb 8 .Sh AUTHORS .An -nosplit .Nm Modified: stable/12/tools/tools/netmap/ctrs.h ============================================================================== --- stable/12/tools/tools/netmap/ctrs.h Mon Nov 19 07:27:50 2018 (r340617) +++ stable/12/tools/tools/netmap/ctrs.h Mon Nov 19 08:53:52 2018 (r340618) @@ -7,30 +7,37 @@ /* counters to accumulate statistics */ struct my_ctrs { - uint64_t pkts, bytes, events, drop; + uint64_t pkts, bytes, events; + uint64_t drop, drop_bytes; uint64_t min_space; struct timeval t; + uint32_t oq_n; /* number of elements in overflow queue (used in lb) */ }; /* very crude code to print a number in normalized form. * Caller has to make sure that the buffer is large enough. */ static const char * -norm2(char *buf, double val, char *fmt) +norm2(char *buf, double val, char *fmt, int normalize) { char *units[] = { "", "K", "M", "G", "T" }; u_int i; - - for (i = 0; val >=1000 && i < sizeof(units)/sizeof(char *) - 1; i++) - val /= 1000; + if (normalize) + for (i = 0; val >=1000 && i < sizeof(units)/sizeof(char *) - 1; i++) + val /= 1000; + else + i=0; sprintf(buf, fmt, val, units[i]); return buf; } static __inline const char * -norm(char *buf, double val) +norm(char *buf, double val, int normalize) { - return norm2(buf, val, "%.3f %s"); + if (normalize) + return norm2(buf, val, "%.3f %s", normalize); + else + return norm2(buf, val, "%.0f %s", normalize); } static __inline int @@ -89,7 +96,7 @@ timespec_sub(struct timespec a, struct timespec b) return ret; } -static uint64_t +static __inline uint64_t wait_for_next_report(struct timeval *prev, struct timeval *cur, int report_interval) { @@ -106,3 +113,4 @@ wait_for_next_report(struct timeval *prev, struct time return delta.tv_sec* 1000000 + delta.tv_usec; } #endif /* CTRS_H_ */ + Copied: stable/12/tools/tools/netmap/lb.8 (from r340279, head/tools/tools/netmap/lb.8) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/tools/netmap/lb.8 Mon Nov 19 08:53:52 2018 (r340618, copy of r340279, head/tools/tools/netmap/lb.8) @@ -0,0 +1,130 @@ +.\" Copyright (c) 2017 Corelight, Inc. and Universita` di Pisa +.\" 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 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$ +.\" +.Dd October 28, 2018 +.Dt LB 8 +.Os +.Sh NAME +.Nm lb +.Nd netmap-based load balancer +.Sh SYNOPSIS +.Bk -words +.Bl -tag -width "lb" +.It Nm +.Op Fl i Ar port +.Op Fl p Ar pipe-group +.Op Fl B Ar extra-buffers +.Op Fl b Ar batch-size +.Op Fl w Ar wait-link +.El +.Ek +.Sh DESCRIPTION +.Nm +reads packets from an input netmap port and sends them to a number of netmap pipes, +trying to balance the packets received by each pipe. +Packets belonging to the +same connection will always be sent to the same pipe. +.Pp +Command line options are listed below. +.Bl -tag -width Ds +.It Fl i Ar port +Name of a netmap port. +It must be supplied exactly once to identify +the input port. +Any netmap port type (e.g., physical interface, VALE switch, pipe, +monitor port) can be used. +.It Fl p Ar name Ns Cm \&: Ns Ar number | number +Add a new pipe group of the given number of pipes. +The pipe group will receive all the packets read from the input port, balanced +among the available pipes. +The receiving ends of the pipes +will be called +.Dq Ar name Ns Em }0 +to +.Dq Ar name No Ns Em } Ns Aq Ar number No - 1 . +The name is optional and defaults to +the name of the input port (stripped down of any netmap operator). +If the name is omitted, also the colon can be omitted. +.Pp +This option can be supplied multiple times to define a sequence of pipe groups, +each group receiving all the packets in turn. +.Pp +If no +.Fl p +option is given, a single group of two pipes with default name is assumed. +.Pp +It is allowed to use the same name for several groups. +The pipe numbering in each +group will start from were the previous identically-named group had left. +.It Fl B Ar extra-buffers +Try to reserve the given number of extra buffers. +Extra buffers are shared among +all pipes in all groups and work as an extension of the pipe rings. +If a pipe ring is full for whatever reason, +.Nm +tries to use extra buffers before dropping any packets directed to that pipe. +.Pp +If all extra buffers are busy, some are stolen from the pipe with the longest +backlog. +This gives preference to newer packets over old ones, and prevents a +stalled pipe to deplete the pool of extra buffers. +.It Fl b Ar batch-size +Maximum number of packets processed between two read operations from the input port. +Higher values of batch-size improve performance by amortizing read operations, +but increase the risk of filling up the port internal queues. +.It Fl w Ar wait-link +indicates the number of seconds to wait before transmitting. +It defaults to 2, and may be useful when talking to physical +ports to let link negotiation complete before starting transmission. +.El +.Sh LIMITATIONS +The group chaining assumes that the applications on the receiving end of the +pipes are read-only: they must not modify the buffers or the pipe ring slots +in any way. +.Pp +The group naming is currently implemented by creating a persistent VALE port +with the given name. +If +.Nm +does not exit cleanly the ports will not be removed. +Please use +.Xr vale-ctl 4 +to remove any stale persistent VALE port. +.Sh SEE ALSO +.Xr netmap 4 , +.Xr bridge 8 , +.Xr pkt-gen 8 +.Pp +.Pa http://info.iet.unipi.it/~luigi/netmap/ +.Sh AUTHORS +.An -nosplit +.Nm +has been written by +.An Seth Hall +at Corelight, USA. +The facilities related to extra buffers and pipe groups have been added by +.An Giuseppe Lettieri +at University of Pisa, Italy, under contract by Corelight, USA. Copied: stable/12/tools/tools/netmap/lb.c (from r340279, head/tools/tools/netmap/lb.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/tools/netmap/lb.c Mon Nov 19 08:53:52 2018 (r340618, copy of r340279, head/tools/tools/netmap/lb.c) @@ -0,0 +1,1027 @@ +/* + * Copyright (C) 2017 Corelight, Inc. and Universita` di Pisa. 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 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 +#include +#include +#include +#include + +#define NETMAP_WITH_LIBS +#include +#include + +#include /* htonl */ + +#include + +#include "pkt_hash.h" +#include "ctrs.h" + + +/* + * use our version of header structs, rather than bringing in a ton + * of platform specific ones + */ +#ifndef ETH_ALEN +#define ETH_ALEN 6 +#endif + +struct compact_eth_hdr { + unsigned char h_dest[ETH_ALEN]; + unsigned char h_source[ETH_ALEN]; + u_int16_t h_proto; +}; + +struct compact_ip_hdr { + u_int8_t ihl:4, version:4; + u_int8_t tos; + u_int16_t tot_len; + u_int16_t id; + u_int16_t frag_off; + u_int8_t ttl; + u_int8_t protocol; + u_int16_t check; + u_int32_t saddr; + u_int32_t daddr; +}; + +struct compact_ipv6_hdr { + u_int8_t priority:4, version:4; + u_int8_t flow_lbl[3]; + u_int16_t payload_len; + u_int8_t nexthdr; + u_int8_t hop_limit; + struct in6_addr saddr; + struct in6_addr daddr; +}; + +#define MAX_IFNAMELEN 64 +#define MAX_PORTNAMELEN (MAX_IFNAMELEN + 40) +#define DEF_OUT_PIPES 2 +#define DEF_EXTRA_BUFS 0 +#define DEF_BATCH 2048 +#define DEF_WAIT_LINK 2 +#define DEF_STATS_INT 600 +#define BUF_REVOKE 100 +#define STAT_MSG_MAXSIZE 1024 + +struct { + char ifname[MAX_IFNAMELEN]; + char base_name[MAX_IFNAMELEN]; + int netmap_fd; + uint16_t output_rings; + uint16_t num_groups; + uint32_t extra_bufs; + uint16_t batch; + int stdout_interval; + int syslog_interval; + int wait_link; + bool busy_wait; +} glob_arg; + +/* + * the overflow queue is a circular queue of buffers + */ +struct overflow_queue { + char name[MAX_IFNAMELEN + 16]; + struct netmap_slot *slots; + uint32_t head; + uint32_t tail; + uint32_t n; + uint32_t size; +}; + +struct overflow_queue *freeq; + +static inline int +oq_full(struct overflow_queue *q) +{ + return q->n >= q->size; +} + +static inline int +oq_empty(struct overflow_queue *q) +{ + return q->n <= 0; +} + +static inline void +oq_enq(struct overflow_queue *q, const struct netmap_slot *s) +{ + if (unlikely(oq_full(q))) { + D("%s: queue full!", q->name); + abort(); + } + q->slots[q->tail] = *s; + q->n++; + q->tail++; + if (q->tail >= q->size) + q->tail = 0; +} + +static inline struct netmap_slot +oq_deq(struct overflow_queue *q) +{ + struct netmap_slot s = q->slots[q->head]; + if (unlikely(oq_empty(q))) { + D("%s: queue empty!", q->name); + abort(); + } + q->n--; + q->head++; + if (q->head >= q->size) + q->head = 0; + return s; +} + +static volatile int do_abort = 0; + +uint64_t dropped = 0; +uint64_t forwarded = 0; +uint64_t received_bytes = 0; +uint64_t received_pkts = 0; +uint64_t non_ip = 0; +uint32_t freeq_n = 0; + +struct port_des { + char interface[MAX_PORTNAMELEN]; + struct my_ctrs ctr; + unsigned int last_sync; + uint32_t last_tail; + struct overflow_queue *oq; + struct nm_desc *nmd; + struct netmap_ring *ring; + struct group_des *group; +}; + +struct port_des *ports; + +/* each group of pipes receives all the packets */ +struct group_des { + char pipename[MAX_IFNAMELEN]; + struct port_des *ports; + int first_id; + int nports; + int last; + int custom_port; +}; + +struct group_des *groups; + +/* statistcs */ +struct counters { + struct timeval ts; + struct my_ctrs *ctrs; + uint64_t received_pkts; + uint64_t received_bytes; + uint64_t non_ip; + uint32_t freeq_n; + int status __attribute__((aligned(64))); +#define COUNTERS_EMPTY 0 +#define COUNTERS_FULL 1 +}; + +struct counters counters_buf; + +static void * +print_stats(void *arg) +{ + int npipes = glob_arg.output_rings; + int sys_int = 0; + (void)arg; + struct my_ctrs cur, prev; + struct my_ctrs *pipe_prev; + + pipe_prev = calloc(npipes, sizeof(struct my_ctrs)); + if (pipe_prev == NULL) { + D("out of memory"); + exit(1); + } + + char stat_msg[STAT_MSG_MAXSIZE] = ""; + + memset(&prev, 0, sizeof(prev)); + while (!do_abort) { + int j, dosyslog = 0, dostdout = 0, newdata; + uint64_t pps = 0, dps = 0, bps = 0, dbps = 0, usec = 0; + struct my_ctrs x; + + counters_buf.status = COUNTERS_EMPTY; + newdata = 0; + memset(&cur, 0, sizeof(cur)); + sleep(1); + if (counters_buf.status == COUNTERS_FULL) { + __sync_synchronize(); + newdata = 1; + cur.t = counters_buf.ts; + if (prev.t.tv_sec || prev.t.tv_usec) { + usec = (cur.t.tv_sec - prev.t.tv_sec) * 1000000 + + cur.t.tv_usec - prev.t.tv_usec; + } + } + + ++sys_int; + if (glob_arg.stdout_interval && sys_int % glob_arg.stdout_interval == 0) + dostdout = 1; + if (glob_arg.syslog_interval && sys_int % glob_arg.syslog_interval == 0) + dosyslog = 1; + + for (j = 0; j < npipes; ++j) { + struct my_ctrs *c = &counters_buf.ctrs[j]; + cur.pkts += c->pkts; + cur.drop += c->drop; + cur.drop_bytes += c->drop_bytes; + cur.bytes += c->bytes; + + if (usec) { + x.pkts = c->pkts - pipe_prev[j].pkts; + x.drop = c->drop - pipe_prev[j].drop; + x.bytes = c->bytes - pipe_prev[j].bytes; + x.drop_bytes = c->drop_bytes - pipe_prev[j].drop_bytes; + pps = (x.pkts*1000000 + usec/2) / usec; + dps = (x.drop*1000000 + usec/2) / usec; + bps = ((x.bytes*1000000 + usec/2) / usec) * 8; + dbps = ((x.drop_bytes*1000000 + usec/2) / usec) * 8; + } + pipe_prev[j] = *c; + + if ( (dosyslog || dostdout) && newdata ) + snprintf(stat_msg, STAT_MSG_MAXSIZE, + "{" + "\"ts\":%.6f," + "\"interface\":\"%s\"," + "\"output_ring\":%" PRIu16 "," + "\"packets_forwarded\":%" PRIu64 "," + "\"packets_dropped\":%" PRIu64 "," + "\"data_forward_rate_Mbps\":%.4f," + "\"data_drop_rate_Mbps\":%.4f," + "\"packet_forward_rate_kpps\":%.4f," + "\"packet_drop_rate_kpps\":%.4f," + "\"overflow_queue_size\":%" PRIu32 + "}", cur.t.tv_sec + (cur.t.tv_usec / 1000000.0), + ports[j].interface, + j, + c->pkts, + c->drop, + (double)bps / 1024 / 1024, + (double)dbps / 1024 / 1024, + (double)pps / 1000, + (double)dps / 1000, + c->oq_n); + + if (dosyslog && stat_msg[0]) + syslog(LOG_INFO, "%s", stat_msg); + if (dostdout && stat_msg[0]) + printf("%s\n", stat_msg); + } + if (usec) { + x.pkts = cur.pkts - prev.pkts; + x.drop = cur.drop - prev.drop; + x.bytes = cur.bytes - prev.bytes; + x.drop_bytes = cur.drop_bytes - prev.drop_bytes; + pps = (x.pkts*1000000 + usec/2) / usec; + dps = (x.drop*1000000 + usec/2) / usec; + bps = ((x.bytes*1000000 + usec/2) / usec) * 8; + dbps = ((x.drop_bytes*1000000 + usec/2) / usec) * 8; + } + + if ( (dosyslog || dostdout) && newdata ) + snprintf(stat_msg, STAT_MSG_MAXSIZE, + "{" + "\"ts\":%.6f," + "\"interface\":\"%s\"," + "\"output_ring\":null," + "\"packets_received\":%" PRIu64 "," + "\"packets_forwarded\":%" PRIu64 "," + "\"packets_dropped\":%" PRIu64 "," + "\"non_ip_packets\":%" PRIu64 "," + "\"data_forward_rate_Mbps\":%.4f," + "\"data_drop_rate_Mbps\":%.4f," + "\"packet_forward_rate_kpps\":%.4f," + "\"packet_drop_rate_kpps\":%.4f," + "\"free_buffer_slots\":%" PRIu32 + "}", cur.t.tv_sec + (cur.t.tv_usec / 1000000.0), + glob_arg.ifname, + received_pkts, + cur.pkts, + cur.drop, + counters_buf.non_ip, + (double)bps / 1024 / 1024, + (double)dbps / 1024 / 1024, + (double)pps / 1000, + (double)dps / 1000, + counters_buf.freeq_n); + + if (dosyslog && stat_msg[0]) + syslog(LOG_INFO, "%s", stat_msg); + if (dostdout && stat_msg[0]) + printf("%s\n", stat_msg); + + prev = cur; + } + + free(pipe_prev); + + return NULL; +} + +static void +free_buffers(void) +{ + int i, tot = 0; + struct port_des *rxport = &ports[glob_arg.output_rings]; + + /* build a netmap free list with the buffers in all the overflow queues */ + for (i = 0; i < glob_arg.output_rings + 1; i++) { + struct port_des *cp = &ports[i]; + struct overflow_queue *q = cp->oq; + + if (!q) + continue; + + while (q->n) { + struct netmap_slot s = oq_deq(q); + uint32_t *b = (uint32_t *)NETMAP_BUF(cp->ring, s.buf_idx); + + *b = rxport->nmd->nifp->ni_bufs_head; + rxport->nmd->nifp->ni_bufs_head = s.buf_idx; + tot++; + } + } + D("added %d buffers to netmap free list", tot); + + for (i = 0; i < glob_arg.output_rings + 1; ++i) { + nm_close(ports[i].nmd); + } +} + + +static void sigint_h(int sig) +{ + (void)sig; /* UNUSED */ + do_abort = 1; + signal(SIGINT, SIG_DFL); +} + +void usage() +{ + printf("usage: lb [options]\n"); + printf("where options are:\n"); + printf(" -h view help text\n"); + printf(" -i iface interface name (required)\n"); + printf(" -p [prefix:]npipes add a new group of output pipes\n"); + printf(" -B nbufs number of extra buffers (default: %d)\n", DEF_EXTRA_BUFS); + printf(" -b batch batch size (default: %d)\n", DEF_BATCH); + printf(" -w seconds wait for link up (default: %d)\n", DEF_WAIT_LINK); + printf(" -W enable busy waiting. this will run your CPU at 100%%\n"); + printf(" -s seconds seconds between syslog stats messages (default: 0)\n"); + printf(" -o seconds seconds between stdout stats messages (default: 0)\n"); + exit(0); +} + +static int +parse_pipes(char *spec) +{ + char *end = index(spec, ':'); + static int max_groups = 0; + struct group_des *g; + + ND("spec %s num_groups %d", spec, glob_arg.num_groups); + if (max_groups < glob_arg.num_groups + 1) { + size_t size = sizeof(*g) * (glob_arg.num_groups + 1); + groups = realloc(groups, size); + if (groups == NULL) { + D("out of memory"); + return 1; + } + } + g = &groups[glob_arg.num_groups]; + memset(g, 0, sizeof(*g)); + + if (end != NULL) { + if (end - spec > MAX_IFNAMELEN - 8) { + D("name '%s' too long", spec); + return 1; + } + if (end == spec) { + D("missing prefix before ':' in '%s'", spec); + return 1; + } + strncpy(g->pipename, spec, end - spec); + g->custom_port = 1; + end++; + } else { + /* no prefix, this group will use the + * name of the input port. + * This will be set in init_groups(), + * since here the input port may still + * be uninitialized + */ + end = spec; + } + if (*end == '\0') { + g->nports = DEF_OUT_PIPES; + } else { + g->nports = atoi(end); + if (g->nports < 1) { + D("invalid number of pipes '%s' (must be at least 1)", end); + return 1; + } + } + glob_arg.output_rings += g->nports; + glob_arg.num_groups++; + return 0; +} + +/* complete the initialization of the groups data structure */ +void init_groups(void) +{ + int i, j, t = 0; + struct group_des *g = NULL; + for (i = 0; i < glob_arg.num_groups; i++) { + g = &groups[i]; + g->ports = &ports[t]; + for (j = 0; j < g->nports; j++) + g->ports[j].group = g; + t += g->nports; + if (!g->custom_port) + strcpy(g->pipename, glob_arg.base_name); + for (j = 0; j < i; j++) { + struct group_des *h = &groups[j]; + if (!strcmp(h->pipename, g->pipename)) + g->first_id += h->nports; + } + } + g->last = 1; +} + +/* push the packet described by slot rs to the group g. + * This may cause other buffers to be pushed down the + * chain headed by g. + * Return a free buffer. + */ +uint32_t forward_packet(struct group_des *g, struct netmap_slot *rs) +{ + uint32_t hash = rs->ptr; + uint32_t output_port = hash % g->nports; + struct port_des *port = &g->ports[output_port]; + struct netmap_ring *ring = port->ring; + struct overflow_queue *q = port->oq; + + /* Move the packet to the output pipe, unless there is + * either no space left on the ring, or there is some + * packet still in the overflow queue (since those must + * take precedence over the new one) + */ + if (ring->head != ring->tail && (q == NULL || oq_empty(q))) { + struct netmap_slot *ts = &ring->slot[ring->head]; + struct netmap_slot old_slot = *ts; + + ts->buf_idx = rs->buf_idx; + ts->len = rs->len; + ts->flags |= NS_BUF_CHANGED; + ts->ptr = rs->ptr; + ring->head = nm_ring_next(ring, ring->head); + port->ctr.bytes += rs->len; + port->ctr.pkts++; + forwarded++; + return old_slot.buf_idx; + } + + /* use the overflow queue, if available */ + if (q == NULL || oq_full(q)) { + /* no space left on the ring and no overflow queue + * available: we are forced to drop the packet + */ + dropped++; + port->ctr.drop++; + port->ctr.drop_bytes += rs->len; + return rs->buf_idx; + } + + oq_enq(q, rs); + + /* + * we cannot continue down the chain and we need to + * return a free buffer now. We take it from the free queue. + */ + if (oq_empty(freeq)) { + /* the free queue is empty. Revoke some buffers + * from the longest overflow queue + */ + uint32_t j; + struct port_des *lp = &ports[0]; + uint32_t max = lp->oq->n; + + /* let lp point to the port with the longest queue */ + for (j = 1; j < glob_arg.output_rings; j++) { + struct port_des *cp = &ports[j]; + if (cp->oq->n > max) { + lp = cp; + max = cp->oq->n; + } + } + + /* move the oldest BUF_REVOKE buffers from the + * lp queue to the free queue + */ + // XXX optimize this cycle + for (j = 0; lp->oq->n && j < BUF_REVOKE; j++) { + struct netmap_slot tmp = oq_deq(lp->oq); + + dropped++; + lp->ctr.drop++; + lp->ctr.drop_bytes += tmp.len; + + oq_enq(freeq, &tmp); + } + + ND(1, "revoked %d buffers from %s", j, lq->name); + } + + return oq_deq(freeq).buf_idx; +} + +int main(int argc, char **argv) +{ + int ch; + uint32_t i; + int rv; + unsigned int iter = 0; + int poll_timeout = 10; /* default */ + + glob_arg.ifname[0] = '\0'; + glob_arg.output_rings = 0; + glob_arg.batch = DEF_BATCH; + glob_arg.wait_link = DEF_WAIT_LINK; + glob_arg.busy_wait = false; + glob_arg.syslog_interval = 0; + glob_arg.stdout_interval = 0; + + while ( (ch = getopt(argc, argv, "hi:p:b:B:s:o:w:W")) != -1) { + switch (ch) { + case 'i': + D("interface is %s", optarg); + if (strlen(optarg) > MAX_IFNAMELEN - 8) { + D("ifname too long %s", optarg); + return 1; + } + if (strncmp(optarg, "netmap:", 7) && strncmp(optarg, "vale", 4)) { + sprintf(glob_arg.ifname, "netmap:%s", optarg); + } else { + strcpy(glob_arg.ifname, optarg); + } + break; + + case 'p': + if (parse_pipes(optarg)) { + usage(); + return 1; + } + break; + + case 'B': + glob_arg.extra_bufs = atoi(optarg); + D("requested %d extra buffers", glob_arg.extra_bufs); + break; + + case 'b': + glob_arg.batch = atoi(optarg); + D("batch is %d", glob_arg.batch); + break; + + case 'w': + glob_arg.wait_link = atoi(optarg); + D("link wait for up time is %d", glob_arg.wait_link); + break; + + case 'W': + glob_arg.busy_wait = true; + break; + + case 'o': + glob_arg.stdout_interval = atoi(optarg); + break; + + case 's': + glob_arg.syslog_interval = atoi(optarg); + break; + + case 'h': + usage(); + return 0; + break; + + default: + D("bad option %c %s", ch, optarg); + usage(); + return 1; + } + } + + if (glob_arg.ifname[0] == '\0') { + D("missing interface name"); + usage(); + return 1; + } + + /* extract the base name */ + char *nscan = strncmp(glob_arg.ifname, "netmap:", 7) ? + glob_arg.ifname : glob_arg.ifname + 7; + strncpy(glob_arg.base_name, nscan, MAX_IFNAMELEN-1); + for (nscan = glob_arg.base_name; *nscan && !index("-*^{}/@", *nscan); nscan++) + ; + *nscan = '\0'; + + if (glob_arg.num_groups == 0) + parse_pipes(""); + + if (glob_arg.syslog_interval) { + setlogmask(LOG_UPTO(LOG_INFO)); + openlog("lb", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1); + } + + uint32_t npipes = glob_arg.output_rings; + + + pthread_t stat_thread; + + ports = calloc(npipes + 1, sizeof(struct port_des)); + if (!ports) { + D("failed to allocate the stats array"); + return 1; + } + struct port_des *rxport = &ports[npipes]; + init_groups(); + + memset(&counters_buf, 0, sizeof(counters_buf)); + counters_buf.ctrs = calloc(npipes, sizeof(struct my_ctrs)); + if (!counters_buf.ctrs) { + D("failed to allocate the counters snapshot buffer"); + return 1; + } + + /* we need base_req to specify pipes and extra bufs */ + struct nmreq base_req; + memset(&base_req, 0, sizeof(base_req)); + + base_req.nr_arg1 = npipes; + base_req.nr_arg3 = glob_arg.extra_bufs; + + rxport->nmd = nm_open(glob_arg.ifname, &base_req, 0, NULL); + + if (rxport->nmd == NULL) { + D("cannot open %s", glob_arg.ifname); + return (1); + } else { + D("successfully opened %s (tx rings: %u)", glob_arg.ifname, + rxport->nmd->req.nr_tx_slots); + } + + uint32_t extra_bufs = rxport->nmd->req.nr_arg3; + struct overflow_queue *oq = NULL; + /* reference ring to access the buffers */ + rxport->ring = NETMAP_RXRING(rxport->nmd->nifp, 0); + + if (!glob_arg.extra_bufs) + goto run; + + D("obtained %d extra buffers", extra_bufs); + if (!extra_bufs) + goto run; + + /* one overflow queue for each output pipe, plus one for the + * free extra buffers + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-12@freebsd.org Mon Nov 19 08:55:27 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F6F51139650; Mon, 19 Nov 2018 08:55:27 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F09636C2B0; Mon, 19 Nov 2018 08:55:26 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8B0B1FE03; Mon, 19 Nov 2018 08:55:26 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ8tQIV097818; Mon, 19 Nov 2018 08:55:26 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ8tQMG097816; Mon, 19 Nov 2018 08:55:26 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201811190855.wAJ8tQMG097816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 19 Nov 2018 08:55:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340619 - stable/12/tools/tools/netmap X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/tools/tools/netmap X-SVN-Commit-Revision: 340619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F09636C2B0 X-Spamd-Result: default: False [0.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.15)[0.148,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.29)[0.290,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 08:55:27 -0000 Author: vmaffione Date: Mon Nov 19 08:55:26 2018 New Revision: 340619 URL: https://svnweb.freebsd.org/changeset/base/340619 Log: MFC r340325 netmap: pkt-gen: several updates from upstream Various improvements to the netmap pkt-gen program: - indentation fixes - support for IPV6 - fixes to checksum computation - support for NS_MOREFRAG - rate limiting in ping mode Differential Revision: https://reviews.freebsd.org/D17698 Modified: stable/12/tools/tools/netmap/pkt-gen.8 stable/12/tools/tools/netmap/pkt-gen.c Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/tools/netmap/pkt-gen.8 ============================================================================== --- stable/12/tools/tools/netmap/pkt-gen.8 Mon Nov 19 08:53:52 2018 (r340618) +++ stable/12/tools/tools/netmap/pkt-gen.8 Mon Nov 19 08:55:26 2018 (r340619) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 23, 2018 +.Dd October 31, 2018 .Dt PKT-GEN 8 .Os .Sh NAME @@ -36,96 +36,215 @@ .Bl -item -compact .It .Nm +.Op Fl h46XzZNIWvrAB .Op Fl i Ar interface .Op Fl f Ar function .Op Fl n Ar count -.Op Fl t Ar pkts_to_send -.Op Fl r Ar pkts_to_receive .Op Fl l Ar pkt_size +.Op Fl b Ar burst_size .Op Fl d Ar dst_ip[:port[-dst_ip:port]] .Op Fl s Ar src_ip[:port[-src_ip:port]] -.Op Fl D Ar dst-mac -.Op Fl S Ar src-mac +.Op Fl D Ar dst_mac +.Op Fl S Ar src_mac .Op Fl a Ar cpu_id -.Op Fl b Ar burst size -.Op Fl c Ar cores +.Op Fl c Ar cpus .Op Fl p Ar threads .Op Fl T Ar report_ms -.Op Fl P +.Op Fl P Ar file .Op Fl w Ar wait_for_link_time .Op Fl R Ar rate -.Op Fl X .Op Fl H Ar len -.Op Fl P Ar xfile -.Op Fl z -.Op Fl Z +.Op Fl F Ar num_frags +.Op Fl M Ar frag_size +.Op Fl C Ar port_config +.El .Sh DESCRIPTION .Nm -generates and receives raw network packets using -.Xr netmap 4 . +leverages +.Xr netmap 4 +to generate and receive raw network packets in batches. The arguments are as follows: -.Pp .Bl -tag -width Ds +.It Fl h +Show program usage and exit. .It Fl i Ar interface -Network interface name. -.It Fl f Ar function tx rx ping pong -Set the function to transmit, receive of ping/pong. -.It Fl n count -Number of iterations (can be 0). -.It Fl t pkts_to_send -Number of packets to send. Also forces transmit mode. -.It Fl r Ar pkts_to_receive -Number of packets to receive. Also forces rx mode. +Name of the network interface that +.Nm +operates on. +It can be a system network interface (e.g., em0), +the name of a +.Xr vale 4 +port (e.g., valeSSS:PPP), the name of a netmap pipe or monitor, +or any valid netmap port name accepted by the +.Ar nm_open +library function, as documented in +.Xr netmap 4 +(NIOCREGIF section). +.It Fl f Ar function +The function to be executed by +.Nm . +Specify +.Cm tx +for transmission, +.Cm rx +for reception, +.Cm ping +for client-side ping-pong operation, and +.Cm pong +for server-side ping-pong operation. +.It Fl n Ar count +Number of iterations of the +.Nm +function, with 0 meaning infinite). +In case of +.Cm tx +or +.Cm rx , +.Ar count +is the number of packets to receive or transmit. +In case of +.Cm ping +or +.Cm pong , +.Ar count +is the number of ping-pong transactions. .It Fl l Ar pkt_size Packet size in bytes excluding CRC. +If passed a second time, use random sizes larger or equal than the +second one and lower than the first one. +.It Fl b Ar burst_size +Transmit or receive up to +.Ar burst_size +packets at a time. +.It Fl 4 +Use IPv4 addresses. +.It Fl 6 +Use IPv6 addresses. .It Fl d Ar dst_ip[:port[-dst_ip:port]] -Destination IPv4 address and port, single or range. +Destination IPv4/IPv6 address and port, single or range. .It Fl s Ar src_ip[:port[-src_ip:port]] -Source IPv4 address and port, single or range. -.It Fl D Ar dst-mac -Destination MAC address in colon notation. -.It Fl S Ar src-mac +Source IPv4/IPv6 address and port, single or range. +.It Fl D Ar dst_mac +Destination MAC address in colon notation (e.g., aa:bb:cc:dd:ee:00). +.It Fl S Ar src_mac Source MAC address in colon notation. .It Fl a Ar cpu_id -Tie +Pin the first thread of .Nm -to a particular CPU core using -.Xr setaffinity 2. -.It Fl b Ar burst size -Set the size of a burst of packets. -.It Fl c Ar cores -Number of cores to use. +to a particular CPU using +.Xr pthread_setaffinity_np 3 . +If more threads are used, they are pinned to the subsequent CPUs, +one per thread. +.It Fl c Ar cpus +Maximum number of CPUs to use (0 means to use all the available ones). .It Fl p Ar threads Number of threads to use. +By default, only a single thread is used +to handle all the netmap rings. +If +.Ar threads +is larger than one, each thread handles a single TX ring (in +.Cm tx +mode), a single RX ring (in +.Cm rx +mode), or a TX/RX ring couple. +The number of +.Ar threads +must be less or equal than the number of TX (or RX) ring available +in the device specified by +.Ar interface . .It Fl T Ar report_ms Number of milliseconds between reports. -.It Fl P -Use libpcap instead of netmap for reading or writing. .It Fl w Ar wait_for_link_time -Number of seconds to wait to make sure that the network link is up. A -network device driver may take some time to create a new -transmit/receive ring pair when +Number of seconds to wait before starting the +.Nm +function, useuful to make sure that the network link is up. +A network device driver may take some time to enter netmap mode, or +to create a new transmit/receive ring pair when .Xr netmap 4 requests one. .It Fl R Ar rate -Packet transmission rate. Not setting the packet transmission rate tells +Packet transmission rate. +Not setting the packet transmission rate tells .Nm -to transmit packets as quickly as possible. On servers from 2010 on-wards +to transmit packets as quickly as possible. +On servers from 2010 on-wards .Xr netmap 4 is able to completely use all of the bandwidth of a 10 or 40Gbps link, so this option should be used unless your intention is to saturate the link. .It Fl X -Dump payload transmitted or received. +Dump payload of each packet transmitted or received. .It Fl H Ar len -Add empty virtio-net-header with size 'len'. This option is only use -with Virtual Machine technologies that use virtio as a network interface. +Add empty virtio-net-header with size +.Ar len . +Valid sizes are 0, 10 and 12. +This option is only used with Virtual Machine technologies that use virtio +as a network interface. .It Fl P Ar file -Load the packet from a pcap file rather than constructing it inside of -.Nm +Load the packet to be transmitted from a pcap file rather than constructing +it within +.Nm . .It Fl z -Use random IPv4 src address/port +Use random IPv4/IPv6 src address/port. .It Fl Z -Use random IPv4 dst address/port +Use random IPv4/IPv6 dst address/port. +.It Fl N +Do not normalize units (i.e., use bps, pps instead of Mbps, Kpps, etc.). +.It Fl F Ar num_frags +Send multi-slot packets, each one with +.Ar num_frags +fragments. +A multi-slot packet is represented by two or more consecutive netmap slots +with the +.Ar NS_MOREFRAG +flag set (except for the last slot). +This is useful to transmit or receive packets larger than the netmap +buffer size. +.It Fl M Ar frag_size +In multi-slot mode, +.Ar frag_size +specifies the size of each fragment, if smaller than the packet length +divided by +.Ar num_frags . +.It Fl I +Use indirect buffers. +It is only valid for transmitting on VALE ports, +and it is implemented by setting the +.Ar NS_INDIRECT +flag in the netmap slots. +.It Fl W +Exit immediately if all the RX rings are empty the first time they are +examined. +.It Fl v +Increase the verbosity level. +.It Fl r +In +.Cm tx +mode, do not initialize packets, but send whatever the content of +the uninitialized netmap buffers is (rubbish mode). +.It Fl A +Compute mean and standard deviation (over a sliding window) for the +transmit or receive rate. +.It Fl B +Take Ethernet framing and CRC into account when computing the average bps. +This adds 4 bytes of CRC and 20 bytes of framing to each packet. +.It Fl C Ar tx_slots Ns Oo Cm \&, Ns Ar rx_slots Ns Oo Cm \&, Ns Ar tx_rings Ns Oo Cm \&, Ns Ar rx_rings Oc Oc Oc +Configuration in terms of number of rings and slots to be used when +opening the netmap port. +Such configuration has effect on software ports +created on the fly, such as VALE ports and netmap pipes. +The configuration may consist of 1 to 4 numbers separated by commas: +.Dq tx_slots,rx_slots,tx_rings,rx_rings . +Missing numbers or zeroes stand for default values. +As an additional convenience, if exactly one number is specified, +then this is assigned to both +.Ar tx_slots +and +.Ar rx_slots . +If there is no fourth number, then the third one is assigned to both +.Ar tx_rings +and +.Ar rx_rings . .El .Pp .Nm @@ -133,7 +252,7 @@ is a raw packet generator that can utilize either .Xr netmap 4 or .Xr bpf 4 -but which is most often uses with +but which is most often used with .Xr netmap 4 . The .Ar interface name @@ -146,7 +265,8 @@ system to balance traffic across the interface. .Nm can peel off one or more of the transmit or receive rings for its own use without interfering with packets that might otherwise be destined -for the host. For example on a system with a Chelsio Network +for the host. +For example on a system with a Chelsio Network Interface Card (NIC) the interface specification of .Ar -i netmap:ncxl0 gives @@ -156,20 +276,20 @@ the more commonly known cxl0 interface, which is used system's TCP/IP stack. .Sh EXAMPLES Capture and count all packets arriving on the operating system's cxl0 -interface. Using this will block packets from reaching the operating +interface. +Using this will block packets from reaching the operating system's network stack. -.Dl +.Bd -literal -offset indent +pkt-gen -i cxl0 -f rx +.Ed .Pp -.Nm --i cxl0 -f rx -.Pp Send a stream of fake DNS packets between two hosts with a packet -length of 128 bytes. You must set the destination MAC address for +length of 128 bytes. +You must set the destination MAC address for packets to be received by the target host. -.Pp -.Dl -.Nm --i netmap:ncxl0 -f tx -s 172.16.0.1:53 -d 172.16.1.3:53 -D 00:07:43:29:2a:e0 +.Bd -literal -offset intent +pkt-gen -i netmap:ncxl0 -f tx -s 172.16.0.1:53 -d 172.16.1.3:53 -D 00:07:43:29:2a:e0 +.Ed .Sh SEE ALSO .Xr netmap 4 , .Xr bridge 8 Modified: stable/12/tools/tools/netmap/pkt-gen.c ============================================================================== --- stable/12/tools/tools/netmap/pkt-gen.c Mon Nov 19 08:53:52 2018 (r340618) +++ stable/12/tools/tools/netmap/pkt-gen.c Mon Nov 19 08:55:26 2018 (r340619) @@ -55,6 +55,11 @@ #include #include #include +#include +#ifdef linux +#define IPV6_VERSION 0x60 +#define IPV6_DEFHLIM 64 +#endif #include #include @@ -66,16 +71,18 @@ #include "ctrs.h" +static void usage(int); + #ifdef _WIN32 #define cpuset_t DWORD_PTR //uint64_t static inline void CPU_ZERO(cpuset_t *p) { - *p = 0; + *p = 0; } static inline void CPU_SET(uint32_t i, cpuset_t *p) { - *p |= 1<< (i & 0x3f); + *p |= 1<< (i & 0x3f); } #define pthread_setaffinity_np(a, b, c) !SetThreadAffinityMask(a, *c) //((void)a, 0) @@ -155,12 +162,12 @@ ether_ntoa(const struct ether_addr *n) #define cpuset_t uint64_t // XXX static inline void CPU_ZERO(cpuset_t *p) { - *p = 0; + *p = 0; } static inline void CPU_SET(uint32_t i, cpuset_t *p) { - *p |= 1<< (i & 0x3f); + *p |= 1<< (i & 0x3f); } #define pthread_setaffinity_np(a, b, c) ((void)a, 0) @@ -169,7 +176,7 @@ static inline void CPU_SET(uint32_t i, cpuset_t *p) #define IFF_PPROMISC IFF_PROMISC #include /* LLADDR */ #define clock_gettime(a,b) \ - do {struct timespec t0 = {0,0}; *(b) = t0; } while (0) + do {struct timespec t0 = {0,0}; *(b) = t0; } while (0) #endif /* __APPLE__ */ const char *default_payload="netmap pkt-gen DIRECT payload\n" @@ -179,10 +186,8 @@ const char *indirect_payload="netmap pkt-gen indirect "http://info.iet.unipi.it/~luigi/netmap/ "; int verbose = 0; +int normalize = 1; -#define SKIP_PAYLOAD 1 /* do not check payload. XXX unused */ - - #define VIRT_HDR_1 10 /* length of a base vnet-hdr */ #define VIRT_HDR_2 12 /* length of the extenede vnet-hdr */ #define VIRT_HDR_MAX VIRT_HDR_2 @@ -195,14 +200,34 @@ struct virt_header { struct pkt { struct virt_header vh; struct ether_header eh; - struct ip ip; - struct udphdr udp; - uint8_t body[MAX_BODYSIZE]; // XXX hardwired + union { + struct { + struct ip ip; + struct udphdr udp; + uint8_t body[MAX_BODYSIZE]; /* hardwired */ + } ipv4; + struct { + struct ip6_hdr ip; + struct udphdr udp; + uint8_t body[MAX_BODYSIZE]; /* hardwired */ + } ipv6; + }; } __attribute__((__packed__)); +#define PKT(p, f, af) \ + ((af) == AF_INET ? (p)->ipv4.f: (p)->ipv6.f) + struct ip_range { char *name; - uint32_t start, end; /* same as struct in_addr */ + union { + struct { + uint32_t start, end; /* same as struct in_addr */ + } ipv4; + struct { + struct in6_addr start, end; + uint8_t sgroup, egroup; + } ipv6; + }; uint16_t port0, port1; }; @@ -227,15 +252,18 @@ struct tstamp { */ struct glob_arg { + int af; /* address family AF_INET/AF_INET6 */ struct ip_range src_ip; struct ip_range dst_ip; struct mac_range dst_mac; struct mac_range src_mac; int pkt_size; + int pkt_min_size; int burst; int forever; uint64_t npackets; /* total packets to send */ - int frags; /* fragments per packet */ + int frags; /* fragments per packet */ + u_int mtu; /* size of each fragment */ int nthreads; int cpus; /* cpus used for running */ int system_cpus; /* cpus on the system */ @@ -271,12 +299,12 @@ struct glob_arg { char *nmr_config; int dummy_send; int virt_header; /* send also the virt_header */ - int extra_bufs; /* goes in nr_arg3 */ - int extra_pipes; /* goes in nr_arg1 */ char *packet_file; /* -P option */ #define STATS_WIN 15 int win_idx; int64_t win[STATS_WIN]; + int wait_link; + int framing; /* #bits of framing (for bw output) */ }; enum dev_type { DEV_NONE, DEV_NETMAP, DEV_PCAP, DEV_TAP }; @@ -304,79 +332,166 @@ struct targ { struct pkt pkt; void *frame; + uint16_t seed[3]; + u_int frags; + u_int frag_size; }; +static __inline uint16_t +cksum_add(uint16_t sum, uint16_t a) +{ + uint16_t res; + res = sum + a; + return (res + (res < a)); +} + +static void +extract_ipv4_addr(char *name, uint32_t *addr, uint16_t *port) +{ + struct in_addr a; + char *pp; + + pp = strchr(name, ':'); + if (pp != NULL) { /* do we have ports ? */ + *pp++ = '\0'; + *port = (uint16_t)strtol(pp, NULL, 0); + } + + inet_pton(AF_INET, name, &a); + *addr = ntohl(a.s_addr); +} + +static void +extract_ipv6_addr(char *name, struct in6_addr *addr, uint16_t *port, + uint8_t *group) +{ + char *pp; + + /* + * We accept IPv6 address in the following form: + * group@[2001:DB8::1001]:port (w/ brackets and port) + * group@[2001:DB8::1] (w/ brackets and w/o port) + * group@2001:DB8::1234 (w/o brackets and w/o port) + */ + pp = strchr(name, '@'); + if (pp != NULL) { + *pp++ = '\0'; + *group = (uint8_t)strtol(name, NULL, 0); + if (*group > 7) + *group = 7; + name = pp; + } + if (name[0] == '[') + name++; + pp = strchr(name, ']'); + if (pp != NULL) + *pp++ = '\0'; + if (pp != NULL && *pp != ':') + pp = NULL; + if (pp != NULL) { /* do we have ports ? */ + *pp++ = '\0'; + *port = (uint16_t)strtol(pp, NULL, 0); + } + inet_pton(AF_INET6, name, addr); +} /* * extract the extremes from a range of ipv4 addresses. * addr_lo[-addr_hi][:port_lo[-port_hi]] */ -static void -extract_ip_range(struct ip_range *r) +static int +extract_ip_range(struct ip_range *r, int af) { - char *ap, *pp; + char *name, *ap, start[INET6_ADDRSTRLEN]; + char end[INET6_ADDRSTRLEN]; struct in_addr a; + uint32_t tmp; if (verbose) D("extract IP range from %s", r->name); - r->port0 = r->port1 = 0; - r->start = r->end = 0; + name = strdup(r->name); + if (name == NULL) { + D("strdup failed"); + usage(-1); + } /* the first - splits start/end of range */ - ap = index(r->name, '-'); /* do we have ports ? */ - if (ap) { + ap = strchr(name, '-'); + if (ap != NULL) *ap++ = '\0'; - } - /* grab the initial values (mandatory) */ - pp = index(r->name, ':'); - if (pp) { - *pp++ = '\0'; - r->port0 = r->port1 = strtol(pp, NULL, 0); - }; - inet_aton(r->name, &a); - r->start = r->end = ntohl(a.s_addr); - if (ap) { - pp = index(ap, ':'); - if (pp) { - *pp++ = '\0'; - if (*pp) - r->port1 = strtol(pp, NULL, 0); + r->port0 = 1234; /* default port */ + if (af == AF_INET6) { + r->ipv6.sgroup = 7; /* default group */ + extract_ipv6_addr(name, &r->ipv6.start, &r->port0, + &r->ipv6.sgroup); + } else + extract_ipv4_addr(name, &r->ipv4.start, &r->port0); + + r->port1 = r->port0; + if (af == AF_INET6) { + if (ap != NULL) { + r->ipv6.egroup = r->ipv6.sgroup; + extract_ipv6_addr(ap, &r->ipv6.end, &r->port1, + &r->ipv6.egroup); + } else { + r->ipv6.end = r->ipv6.start; + r->ipv6.egroup = r->ipv6.sgroup; } - if (*ap) { - inet_aton(ap, &a); - r->end = ntohl(a.s_addr); - } + } else { + if (ap != NULL) { + extract_ipv4_addr(ap, &r->ipv4.end, &r->port1); + if (r->ipv4.start > r->ipv4.end) { + tmp = r->ipv4.end; + r->ipv4.end = r->ipv4.start; + r->ipv4.start = tmp; + } + } else + r->ipv4.end = r->ipv4.start; } + if (r->port0 > r->port1) { - uint16_t tmp = r->port0; + tmp = r->port0; r->port0 = r->port1; r->port1 = tmp; } - if (r->start > r->end) { - uint32_t tmp = r->start; - r->start = r->end; - r->end = tmp; + if (af == AF_INET) { + a.s_addr = htonl(r->ipv4.start); + inet_ntop(af, &a, start, sizeof(start)); + a.s_addr = htonl(r->ipv4.end); + inet_ntop(af, &a, end, sizeof(end)); + } else { + inet_ntop(af, &r->ipv6.start, start, sizeof(start)); + inet_ntop(af, &r->ipv6.end, end, sizeof(end)); } - { - struct in_addr a; - char buf1[16]; // one ip address + if (af == AF_INET) + D("range is %s:%d to %s:%d", start, r->port0, end, r->port1); + else + D("range is %d@[%s]:%d to %d@[%s]:%d", r->ipv6.sgroup, + start, r->port0, r->ipv6.egroup, end, r->port1); - a.s_addr = htonl(r->end); - strncpy(buf1, inet_ntoa(a), sizeof(buf1)); - a.s_addr = htonl(r->start); - if (1) - D("range is %s:%d to %s:%d", - inet_ntoa(a), r->port0, buf1, r->port1); - } + free(name); + if (r->port0 != r->port1 || + (af == AF_INET && r->ipv4.start != r->ipv4.end) || + (af == AF_INET6 && + !IN6_ARE_ADDR_EQUAL(&r->ipv6.start, &r->ipv6.end))) + return (OPT_COPY); + return (0); } -static void +static int extract_mac_range(struct mac_range *r) { + struct ether_addr *e; if (verbose) D("extract MAC range from %s", r->name); - bcopy(ether_aton(r->name), &r->start, 6); - bcopy(ether_aton(r->name), &r->end, 6); + + e = ether_aton(r->name); + if (e == NULL) { + D("invalid MAC address '%s'", r->name); + return 1; + } + bcopy(e, &r->start, 6); + bcopy(e, &r->end, 6); #if 0 bcopy(targ->src_mac, eh->ether_shost, 6); p = index(targ->g->src_mac, '-'); @@ -391,6 +506,7 @@ extract_mac_range(struct mac_range *r) #endif if (verbose) D("%s starts at %s", r->name, ether_ntoa(&r->start)); + return 0; } static struct targ *targs; @@ -456,7 +572,7 @@ system_ncpus(void) /* * parse the vale configuration in conf and put it in nmr. * Return the flag set if necessary. - * The configuration may consist of 0 to 4 numbers separated + * The configuration may consist of 1 to 4 numbers separated * by commas: #tx-slots,#rx-slots,#tx-rings,#rx-rings. * Missing numbers or zeroes stand for default values. * As an additional convenience, if exactly one number @@ -500,7 +616,7 @@ parse_nmr_config(const char* conf, struct nmreq *nmr) nmr->nr_rx_rings, nmr->nr_rx_slots); free(w); return (nmr->nr_tx_rings || nmr->nr_tx_slots || - nmr->nr_rx_rings || nmr->nr_rx_slots) ? + nmr->nr_rx_rings || nmr->nr_rx_slots) ? NM_OPEN_RING_CFG : 0; } @@ -513,7 +629,6 @@ static int source_hwaddr(const char *ifname, char *buf) { struct ifaddrs *ifaphead, *ifap; - int l = sizeof(ifap->ifa_name); if (getifaddrs(&ifaphead) != 0) { D("getifaddrs %s failed", ifname); @@ -527,7 +642,7 @@ source_hwaddr(const char *ifname, char *buf) if (!sdl || sdl->sdl_family != AF_LINK) continue; - if (strncmp(ifap->ifa_name, ifname, l) != 0) + if (strncmp(ifap->ifa_name, ifname, IFNAMSIZ) != 0) continue; mac = (uint8_t *)LLADDR(sdl); sprintf(buf, "%02x:%02x:%02x:%02x:%02x:%02x", @@ -562,19 +677,20 @@ setaffinity(pthread_t me, int i) return 0; } + /* Compute the checksum of the given ip header. */ -static uint16_t +static uint32_t checksum(const void *data, uint16_t len, uint32_t sum) { - const uint8_t *addr = data; + const uint8_t *addr = data; uint32_t i; - /* Checksum all the pairs of bytes first... */ - for (i = 0; i < (len & ~1U); i += 2) { - sum += (u_int16_t)ntohs(*((u_int16_t *)(addr + i))); - if (sum > 0xFFFF) - sum -= 0xFFFF; - } + /* Checksum all the pairs of bytes first... */ + for (i = 0; i < (len & ~1U); i += 2) { + sum += (u_int16_t)ntohs(*((u_int16_t *)(addr + i))); + if (sum > 0xFFFF) + sum -= 0xFFFF; + } /* * If there's a single byte left over, checksum it, too. * Network byte order is big-endian, so the remaining byte is @@ -588,8 +704,8 @@ checksum(const void *data, uint16_t len, uint32_t sum) return sum; } -static u_int16_t -wrapsum(u_int32_t sum) +static uint16_t +wrapsum(uint32_t sum) { sum = ~sum & 0xFFFF; return (htons(sum)); @@ -637,64 +753,198 @@ dump_payload(const char *_p, int len, struct netmap_ri #define uh_sum check #endif /* linux */ -/* - * increment the addressed in the packet, - * starting from the least significant field. - * DST_IP DST_PORT SRC_IP SRC_PORT - */ static void -update_addresses(struct pkt *pkt, struct glob_arg *g) +update_ip(struct pkt *pkt, struct targ *t) { - uint32_t a; - uint16_t p; - struct ip *ip = &pkt->ip; - struct udphdr *udp = &pkt->udp; + struct glob_arg *g = t->g; + struct ip ip; + struct udphdr udp; + uint32_t oaddr, naddr; + uint16_t oport, nport; + uint16_t ip_sum, udp_sum; - do { - /* XXX for now it doesn't handle non-random src, random dst */ - if (g->options & OPT_RANDOM_SRC) { - udp->uh_sport = random(); - ip->ip_src.s_addr = random(); - } else { - p = ntohs(udp->uh_sport); - if (p < g->src_ip.port1) { /* just inc, no wrap */ - udp->uh_sport = htons(p + 1); + memcpy(&ip, &pkt->ipv4.ip, sizeof(ip)); + memcpy(&udp, &pkt->ipv4.udp, sizeof(udp)); + do { + ip_sum = udp_sum = 0; + naddr = oaddr = ntohl(ip.ip_src.s_addr); + nport = oport = ntohs(udp.uh_sport); + if (g->options & OPT_RANDOM_SRC) { + ip.ip_src.s_addr = nrand48(t->seed); + udp.uh_sport = nrand48(t->seed); + naddr = ntohl(ip.ip_src.s_addr); + nport = ntohs(udp.uh_sport); break; } - udp->uh_sport = htons(g->src_ip.port0); - - a = ntohl(ip->ip_src.s_addr); - if (a < g->src_ip.end) { /* just inc, no wrap */ - ip->ip_src.s_addr = htonl(a + 1); + if (oport < g->src_ip.port1) { + nport = oport + 1; + udp.uh_sport = htons(nport); break; } - ip->ip_src.s_addr = htonl(g->src_ip.start); - - udp->uh_sport = htons(g->src_ip.port0); + nport = g->src_ip.port0; + udp.uh_sport = htons(nport); + if (oaddr < g->src_ip.ipv4.end) { + naddr = oaddr + 1; + ip.ip_src.s_addr = htonl(naddr); + break; + } + naddr = g->src_ip.ipv4.start; + ip.ip_src.s_addr = htonl(naddr); + } while (0); + /* update checksums if needed */ + if (oaddr != naddr) { + ip_sum = cksum_add(ip_sum, ~oaddr >> 16); + ip_sum = cksum_add(ip_sum, ~oaddr & 0xffff); + ip_sum = cksum_add(ip_sum, naddr >> 16); + ip_sum = cksum_add(ip_sum, naddr & 0xffff); } - - if (g->options & OPT_RANDOM_DST) { - udp->uh_dport = random(); - ip->ip_dst.s_addr = random(); - } else { - p = ntohs(udp->uh_dport); - if (p < g->dst_ip.port1) { /* just inc, no wrap */ - udp->uh_dport = htons(p + 1); + if (oport != nport) { + udp_sum = cksum_add(udp_sum, ~oport); + udp_sum = cksum_add(udp_sum, nport); + } + do { + naddr = oaddr = ntohl(ip.ip_dst.s_addr); + nport = oport = ntohs(udp.uh_dport); + if (g->options & OPT_RANDOM_DST) { + ip.ip_dst.s_addr = nrand48(t->seed); + udp.uh_dport = nrand48(t->seed); + naddr = ntohl(ip.ip_dst.s_addr); + nport = ntohs(udp.uh_dport); break; } - udp->uh_dport = htons(g->dst_ip.port0); - - a = ntohl(ip->ip_dst.s_addr); - if (a < g->dst_ip.end) { /* just inc, no wrap */ - ip->ip_dst.s_addr = htonl(a + 1); + if (oport < g->dst_ip.port1) { + nport = oport + 1; + udp.uh_dport = htons(nport); break; } + nport = g->dst_ip.port0; + udp.uh_dport = htons(nport); + if (oaddr < g->dst_ip.ipv4.end) { + naddr = oaddr + 1; + ip.ip_dst.s_addr = htonl(naddr); + break; + } + naddr = g->dst_ip.ipv4.start; + ip.ip_dst.s_addr = htonl(naddr); + } while (0); + /* update checksums */ + if (oaddr != naddr) { + ip_sum = cksum_add(ip_sum, ~oaddr >> 16); + ip_sum = cksum_add(ip_sum, ~oaddr & 0xffff); + ip_sum = cksum_add(ip_sum, naddr >> 16); + ip_sum = cksum_add(ip_sum, naddr & 0xffff); } - ip->ip_dst.s_addr = htonl(g->dst_ip.start); - } while (0); - // update checksum + if (oport != nport) { + udp_sum = cksum_add(udp_sum, ~oport); + udp_sum = cksum_add(udp_sum, nport); + } + if (udp_sum != 0) + udp.uh_sum = ~cksum_add(~udp.uh_sum, htons(udp_sum)); + if (ip_sum != 0) { + ip.ip_sum = ~cksum_add(~ip.ip_sum, htons(ip_sum)); + udp.uh_sum = ~cksum_add(~udp.uh_sum, htons(ip_sum)); + } + memcpy(&pkt->ipv4.ip, &ip, sizeof(ip)); + memcpy(&pkt->ipv4.udp, &udp, sizeof(udp)); } +#ifndef s6_addr16 +#define s6_addr16 __u6_addr.__u6_addr16 +#endif +static void +update_ip6(struct pkt *pkt, struct targ *t) +{ + struct glob_arg *g = t->g; + struct ip6_hdr ip6; + struct udphdr udp; + uint16_t udp_sum; + uint16_t oaddr, naddr; + uint16_t oport, nport; + uint8_t group; + + memcpy(&ip6, &pkt->ipv6.ip, sizeof(ip6)); + memcpy(&udp, &pkt->ipv6.udp, sizeof(udp)); + do { + udp_sum = 0; + group = g->src_ip.ipv6.sgroup; + naddr = oaddr = ntohs(ip6.ip6_src.s6_addr16[group]); + nport = oport = ntohs(udp.uh_sport); + if (g->options & OPT_RANDOM_SRC) { + ip6.ip6_src.s6_addr16[group] = nrand48(t->seed); + udp.uh_sport = nrand48(t->seed); + naddr = ntohs(ip6.ip6_src.s6_addr16[group]); + nport = ntohs(udp.uh_sport); + break; + } + if (oport < g->src_ip.port1) { + nport = oport + 1; + udp.uh_sport = htons(nport); + break; + } + nport = g->src_ip.port0; + udp.uh_sport = htons(nport); + if (oaddr < ntohs(g->src_ip.ipv6.end.s6_addr16[group])) { + naddr = oaddr + 1; + ip6.ip6_src.s6_addr16[group] = htons(naddr); + break; + } + naddr = ntohs(g->src_ip.ipv6.start.s6_addr16[group]); + ip6.ip6_src.s6_addr16[group] = htons(naddr); + } while (0); + /* update checksums if needed */ + if (oaddr != naddr) + udp_sum = cksum_add(~oaddr, naddr); + if (oport != nport) + udp_sum = cksum_add(udp_sum, + cksum_add(~oport, nport)); + do { + group = g->dst_ip.ipv6.egroup; + naddr = oaddr = ntohs(ip6.ip6_dst.s6_addr16[group]); + nport = oport = ntohs(udp.uh_dport); + if (g->options & OPT_RANDOM_DST) { + ip6.ip6_dst.s6_addr16[group] = nrand48(t->seed); + udp.uh_dport = nrand48(t->seed); + naddr = ntohs(ip6.ip6_dst.s6_addr16[group]); + nport = ntohs(udp.uh_dport); + break; + } + if (oport < g->dst_ip.port1) { + nport = oport + 1; + udp.uh_dport = htons(nport); + break; + } + nport = g->dst_ip.port0; + udp.uh_dport = htons(nport); + if (oaddr < ntohs(g->dst_ip.ipv6.end.s6_addr16[group])) { + naddr = oaddr + 1; + ip6.ip6_dst.s6_addr16[group] = htons(naddr); + break; + } + naddr = ntohs(g->dst_ip.ipv6.start.s6_addr16[group]); + ip6.ip6_dst.s6_addr16[group] = htons(naddr); + } while (0); + /* update checksums */ + if (oaddr != naddr) + udp_sum = cksum_add(udp_sum, + cksum_add(~oaddr, naddr)); + if (oport != nport) + udp_sum = cksum_add(udp_sum, + cksum_add(~oport, nport)); + if (udp_sum != 0) + udp.uh_sum = ~cksum_add(~udp.uh_sum, udp_sum); + memcpy(&pkt->ipv6.ip, &ip6, sizeof(ip6)); + memcpy(&pkt->ipv6.udp, &udp, sizeof(udp)); +} + +static void +update_addresses(struct pkt *pkt, struct targ *t) +{ + + if (t->g->af == AF_INET) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-12@freebsd.org Mon Nov 19 08:56:35 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24F8F1139724; Mon, 19 Nov 2018 08:56:35 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA7586C448; Mon, 19 Nov 2018 08:56:34 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B30E1FE07; Mon, 19 Nov 2018 08:56:34 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ8uYPf097921; Mon, 19 Nov 2018 08:56:34 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ8uYN2097920; Mon, 19 Nov 2018 08:56:34 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201811190856.wAJ8uYN2097920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 19 Nov 2018 08:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340620 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 340620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA7586C448 X-Spamd-Result: default: False [0.36 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.25)[0.245,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 08:56:35 -0000 Author: vmaffione Date: Mon Nov 19 08:56:34 2018 New Revision: 340620 URL: https://svnweb.freebsd.org/changeset/base/340620 Log: MFC r340475 ifnet(9): Add description of IFCAP_NETMAP Describe IFCAP_NETMAP adding a cross reference to netmap(4). Differential Revision: https://reviews.freebsd.org/D17988 Modified: stable/12/share/man/man9/ifnet.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/ifnet.9 ============================================================================== --- stable/12/share/man/man9/ifnet.9 Mon Nov 19 08:55:26 2018 (r340619) +++ stable/12/share/man/man9/ifnet.9 Mon Nov 19 08:56:34 2018 (r340620) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 6, 2017 +.Dd November 14, 2018 .Dt IFNET 9 .Os .Sh NAME @@ -759,6 +759,9 @@ interfaces (implies .Dv IFCAP_TSO ) . .It Dv IFCAP_LINKSTATE This Ethernet interface supports dynamic link state changes. +.It Dv IFCAP_NETMAP +This Ethernet interface supports +.Xr netmap 4 . .El .Pp The ability of advanced network interfaces to offload certain From owner-svn-src-stable-12@freebsd.org Mon Nov 19 09:40:03 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 712D5113A4D6; Mon, 19 Nov 2018 09:40:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FD696D8AA; Mon, 19 Nov 2018 09:40:03 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E223820484; Mon, 19 Nov 2018 09:40:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJ9e2Gk018531; Mon, 19 Nov 2018 09:40:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJ9e2cb018530; Mon, 19 Nov 2018 09:40:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201811190940.wAJ9e2cb018530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Nov 2018 09:40:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340623 - stable/12/usr.sbin/newsyslog/newsyslog.conf.d X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/newsyslog/newsyslog.conf.d X-SVN-Commit-Revision: 340623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0FD696D8AA X-Spamd-Result: default: False [0.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.39)[0.394,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 09:40:03 -0000 Author: hselasky Date: Mon Nov 19 09:40:02 2018 New Revision: 340623 URL: https://svnweb.freebsd.org/changeset/base/340623 Log: MFC r340254: Put a size limit on the opensm.log and use bzip2(1). Discussed with: markj@ Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/newsyslog/newsyslog.conf.d/opensm.conf Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/newsyslog/newsyslog.conf.d/opensm.conf ============================================================================== --- stable/12/usr.sbin/newsyslog/newsyslog.conf.d/opensm.conf Mon Nov 19 09:36:09 2018 (r340622) +++ stable/12/usr.sbin/newsyslog/newsyslog.conf.d/opensm.conf Mon Nov 19 09:40:02 2018 (r340623) @@ -1,3 +1,3 @@ # $FreeBSD$ -/var/log/opensm.log 600 7 * * Z /var/run/opensm.pid 30 +/var/log/opensm.log 600 7 1000 * J /var/run/opensm.pid 30 From owner-svn-src-stable-12@freebsd.org Mon Nov 19 10:01:04 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7819F113AE07; Mon, 19 Nov 2018 10:01:04 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 139E16E798; Mon, 19 Nov 2018 10:01:04 +0000 (UTC) (envelope-from avg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E8F5D2090D; Mon, 19 Nov 2018 10:01:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJA1364029887; Mon, 19 Nov 2018 10:01:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJA13TR029886; Mon, 19 Nov 2018 10:01:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201811191001.wAJA13TR029886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 19 Nov 2018 10:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340626 - stable/12/sys/fs/nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/fs/nfsserver X-SVN-Commit-Revision: 340626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 139E16E798 X-Spamd-Result: default: False [0.26 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.14)[0.140,0]; NEURAL_SPAM_MEDIUM(0.12)[0.116,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 10:01:04 -0000 Author: avg Date: Mon Nov 19 10:01:03 2018 New Revision: 340626 URL: https://svnweb.freebsd.org/changeset/base/340626 Log: MFC r339595: nfsrvd_readdirplus: for some errors, do not fail the entire request Sponsored by: Panzura Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdport.c Mon Nov 19 09:50:06 2018 (r340625) +++ stable/12/sys/fs/nfsserver/nfs_nfsdport.c Mon Nov 19 10:01:03 2018 (r340626) @@ -2416,10 +2416,22 @@ again: } } } - if (!r) { - if (refp == NULL && - ((nd->nd_flag & ND_NFSV3) || - NFSNONZERO_ATTRBIT(&attrbits))) { + + /* + * If we failed to look up the entry, then it + * has become invalid, most likely removed. + */ + if (r != 0) { + if (needs_unbusy) + vfs_unbusy(new_mp); + goto invalid; + } + KASSERT(refp != NULL || nvp != NULL, + ("%s: undetected lookup error", __func__)); + + if (refp == NULL && + ((nd->nd_flag & ND_NFSV3) || + NFSNONZERO_ATTRBIT(&attrbits))) { r = nfsvno_getfh(nvp, &nfh, p); if (!r) r = nfsvno_getattr(nvp, nvap, nd, p, @@ -2440,17 +2452,25 @@ again: if (new_mp == mp) new_mp = nvp->v_mount; } - } - } else { - nvp = NULL; } - if (r) { + + /* + * If we failed to get attributes of the entry, + * then just skip it for NFSv3 (the traditional + * behavior in the old NFS server). + * For NFSv4 the behavior is controlled by + * RDATTRERROR: we either ignore the error or + * fail the request. + * Note that RDATTRERROR is never set for NFSv3. + */ + if (r != 0) { if (!NFSISSET_ATTRBIT(&attrbits, NFSATTRBIT_RDATTRERROR)) { - if (nvp != NULL) - vput(nvp); + vput(nvp); if (needs_unbusy != 0) vfs_unbusy(new_mp); + if ((nd->nd_flag & ND_NFSV3)) + goto invalid; nd->nd_repstat = r; break; } @@ -2519,6 +2539,7 @@ again: if (dirlen <= cnt) entrycnt++; } +invalid: cpos += dp->d_reclen; dp = (struct dirent *)cpos; cookiep++; From owner-svn-src-stable-12@freebsd.org Mon Nov 19 15:18:31 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B3FF1106436; Mon, 19 Nov 2018 15:18:31 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BFD17952F; Mon, 19 Nov 2018 15:18:31 +0000 (UTC) (envelope-from shurd@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E134E23BCD; Mon, 19 Nov 2018 15:18:30 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJFIU8L093137; Mon, 19 Nov 2018 15:18:30 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJFIUg0093136; Mon, 19 Nov 2018 15:18:30 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811191518.wAJFIUg0093136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Mon, 19 Nov 2018 15:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340629 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 340629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0BFD17952F X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.00)[-0.002,0]; NEURAL_SPAM_SHORT(0.43)[0.426,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:18:31 -0000 Author: shurd Date: Mon Nov 19 15:18:30 2018 New Revision: 340629 URL: https://svnweb.freebsd.org/changeset/base/340629 Log: MFC r340434, r340445 r340434: Fix leaks caused by ifc_nhwtxqs never being initialized r333502 removed initialization of ifc_nhwtxqs, and it's not clear there's a need to copy it into the struct iflib_ctx at all. Use ctx->ifc_sctx->isc_ntxqs instead. Further, iflib_stop() did not clear the last ring in the case where isc_nfl != isc_nrxqs (such as when IFLIB_HAS_RXCQ is set). Use ctx->ifc_sctx->isc_nrxqs here instead of isc_nfl. Reported by: pkelsey Reviewed by: pkelsey Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D17979 r340445: Clear RX completion queue state veriables in iflib_stop() iflib_stop() was not resetting the rxq completion queue state variables. This meant that for any driver that has receive completion queues, after a reinit, iflib would start asking what's available on the rx side starting at whatever the completion queue index was prior to the stop, instead of at 0. Submitted by: pkelsey Reported by: pkelsey Sponsored by: Limelight Networks Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Mon Nov 19 14:19:27 2018 (r340628) +++ stable/12/sys/net/iflib.c Mon Nov 19 15:18:30 2018 (r340629) @@ -175,8 +175,6 @@ struct iflib_ctx { struct sx ifc_ctx_sx; struct mtx ifc_state_mtx; - uint16_t ifc_nhwtxqs; - iflib_txq_t ifc_txqs; iflib_rxq_t ifc_rxqs; uint32_t ifc_if_flags; @@ -1771,6 +1769,7 @@ iflib_txq_setup(iflib_txq_t txq) { if_ctx_t ctx = txq->ift_ctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + if_shared_ctx_t sctx = ctx->ifc_sctx; iflib_dma_info_t di; int i; @@ -1784,11 +1783,11 @@ iflib_txq_setup(iflib_txq_t txq) txq->ift_pidx = txq->ift_cidx = txq->ift_npending = 0; txq->ift_size = scctx->isc_ntxd[txq->ift_br_offset]; - for (i = 0, di = txq->ift_ifdi; i < ctx->ifc_nhwtxqs; i++, di++) + for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++) bzero((void *)di->idi_vaddr, di->idi_size); IFDI_TXQ_SETUP(ctx, txq->ift_id); - for (i = 0, di = txq->ift_ifdi; i < ctx->ifc_nhwtxqs; i++, di++) + for (i = 0, di = txq->ift_ifdi; i < sctx->isc_ntxqs; i++, di++) bus_dmamap_sync(di->idi_tag, di->idi_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); return (0); @@ -2375,6 +2374,7 @@ iflib_stop(if_ctx_t ctx) iflib_txq_t txq = ctx->ifc_txqs; iflib_rxq_t rxq = ctx->ifc_rxqs; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; + if_shared_ctx_t sctx = ctx->ifc_sctx; iflib_dma_info_t di; iflib_fl_t fl; int i, j; @@ -2408,13 +2408,14 @@ iflib_stop(if_ctx_t ctx) txq->ift_no_tx_dma_setup = txq->ift_txd_encap_efbig = txq->ift_map_failed = 0; txq->ift_pullups = 0; ifmp_ring_reset_stats(txq->ift_br); - for (j = 0, di = txq->ift_ifdi; j < ctx->ifc_nhwtxqs; j++, di++) + for (j = 0, di = txq->ift_ifdi; j < sctx->isc_ntxqs; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); } for (i = 0; i < scctx->isc_nrxqsets; i++, rxq++) { /* make sure all transmitters have completed before proceeding XXX */ - for (j = 0, di = rxq->ifr_ifdi; j < rxq->ifr_nfl; j++, di++) + rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; + for (j = 0, di = rxq->ifr_ifdi; j < sctx->isc_nrxqs; j++, di++) bzero((void *)di->idi_vaddr, di->idi_size); /* also resets the free lists pidx/cidx */ for (j = 0, fl = rxq->ifr_fl; j < rxq->ifr_nfl; j++, fl++) @@ -5516,11 +5517,12 @@ static void iflib_tx_structures_free(if_ctx_t ctx) { iflib_txq_t txq = ctx->ifc_txqs; + if_shared_ctx_t sctx = ctx->ifc_sctx; int i, j; for (i = 0; i < NTXQSETS(ctx); i++, txq++) { iflib_txq_destroy(txq); - for (j = 0; j < ctx->ifc_nhwtxqs; j++) + for (j = 0; j < sctx->isc_ntxqs; j++) iflib_dma_free(&txq->ift_ifdi[j]); } free(ctx->ifc_txqs, M_IFLIB); From owner-svn-src-stable-12@freebsd.org Mon Nov 19 15:29:41 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F1281106A40; Mon, 19 Nov 2018 15:29:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 459A07A05D; Mon, 19 Nov 2018 15:29:41 +0000 (UTC) (envelope-from gjb@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0317823DA6; Mon, 19 Nov 2018 15:29:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJFTecT098578; Mon, 19 Nov 2018 15:29:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJFTeDA098576; Mon, 19 Nov 2018 15:29:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811191529.wAJFTeDA098576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 19 Nov 2018 15:29:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340630 - in stable/12/sys: amd64/conf riscv/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/12/sys: amd64/conf riscv/conf X-SVN-Commit-Revision: 340630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 459A07A05D X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.00)[-0.002,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.43)[0.426,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 15:29:41 -0000 Author: gjb Date: Mon Nov 19 15:29:40 2018 New Revision: 340630 URL: https://svnweb.freebsd.org/changeset/base/340630 Log: Remove debugging options from amd64 MINIMAL [1] and riscv GENERIC kernel configuration files. This should have been turned off when stable/12 branched. This is a direct commit to stable/12. Submitted by: Harry Schmalzbauer [1] Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/amd64/conf/MINIMAL stable/12/sys/riscv/conf/GENERIC Modified: stable/12/sys/amd64/conf/MINIMAL ============================================================================== --- stable/12/sys/amd64/conf/MINIMAL Mon Nov 19 15:18:30 2018 (r340629) +++ stable/12/sys/amd64/conf/MINIMAL Mon Nov 19 15:29:40 2018 (r340630) @@ -82,15 +82,6 @@ options INCLUDE_CONFIG_FILE # Include this file in ke # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB. -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # Make an SMP-capable kernel by default options SMP # Symmetric MultiProcessor Kernel Modified: stable/12/sys/riscv/conf/GENERIC ============================================================================== --- stable/12/sys/riscv/conf/GENERIC Mon Nov 19 15:18:30 2018 (r340629) +++ stable/12/sys/riscv/conf/GENERIC Mon Nov 19 15:29:40 2018 (r340630) @@ -114,17 +114,6 @@ device uart_ns8250 # ns8250-type UART driver # Debugging support. Always need this: options KDB # Enable kernel debugger support. options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use (turn off in stable branch): -options DDB # Support DDB. -# options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -# options WITNESS # Enable checks to detect deadlocks and cycles -# options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones -# options EARLY_PRINTF -# options VERBOSE_SYSINIT # Kernel dump features. options ZSTDIO # zstd-compressed kernel and user dumps From owner-svn-src-stable-12@freebsd.org Mon Nov 19 18:26:12 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1D6011229E0; Mon, 19 Nov 2018 18:26:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5068185717; Mon, 19 Nov 2018 18:26:12 +0000 (UTC) (envelope-from brooks@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C27D25B31; Mon, 19 Nov 2018 18:26:12 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJIQCto094430; Mon, 19 Nov 2018 18:26:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJIQCDp094429; Mon, 19 Nov 2018 18:26:12 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201811191826.wAJIQCDp094429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 19 Nov 2018 18:26:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340643 - stable/12/sys/dev/pci X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/sys/dev/pci X-SVN-Commit-Revision: 340643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5068185717 X-Spamd-Result: default: False [0.31 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_SHORT(0.32)[0.318,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:26:12 -0000 Author: brooks Date: Mon Nov 19 18:26:11 2018 New Revision: 340643 URL: https://svnweb.freebsd.org/changeset/base/340643 Log: MFC r340489-r340490 r340489: Fix freebsd32 support for PCIOCGETCONF. This fixes regresssions in pciconf -l and some ports as reported on freebsd-current: https://lists.freebsd.org/pipermail/freebsd-current/2018-November/072144.html Reported by: jbeich Reviewed by: kib (also proposed an idential patch) Tested by: jbeich Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18011 r340490: Fix stray tab. Reported by: jbeich MFC with: r340489 Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18011 Modified: stable/12/sys/dev/pci/pci_user.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/pci/pci_user.c ============================================================================== --- stable/12/sys/dev/pci/pci_user.c Mon Nov 19 18:24:08 2018 (r340642) +++ stable/12/sys/dev/pci/pci_user.c Mon Nov 19 18:26:11 2018 (r340643) @@ -945,6 +945,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, if (!(flag & FWRITE)) { switch (cmd) { case PCIOCGETCONF: +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF32: +#endif #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: #ifdef COMPAT_FREEBSD32 @@ -962,6 +965,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, switch (cmd) { case PCIOCGETCONF: +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF32: +#endif #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: #ifdef COMPAT_FREEBSD32 From owner-svn-src-stable-12@freebsd.org Mon Nov 19 18:59:09 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACB371123B1D; Mon, 19 Nov 2018 18:59:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5450587195; Mon, 19 Nov 2018 18:59:09 +0000 (UTC) (envelope-from kevans@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35EAD26039; Mon, 19 Nov 2018 18:59:09 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJIx9P5010086; Mon, 19 Nov 2018 18:59:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJIx7l3010077; Mon, 19 Nov 2018 18:59:07 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811191859.wAJIx7l3010077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 18:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340646 - in stable/12/sys/dts: . arm arm/overlays arm64 arm64/overlays mips powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12/sys/dts: . arm arm/overlays arm64 arm64/overlays mips powerpc X-SVN-Commit-Revision: 340646 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5450587195 X-Spamd-Result: default: False [0.43 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.00)[-0.002,0]; NEURAL_SPAM_SHORT(0.44)[0.436,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 18:59:09 -0000 Author: kevans Date: Mon Nov 19 18:59:06 2018 New Revision: 340646 URL: https://svnweb.freebsd.org/changeset/base/340646 Log: MFC r340390: Fix test-dts{,o} targets There were two main problems here: 1.) sys/dts/Makefile.inc is not included from various */overlays directories by default, only ../Makefile.inc 2.) When shelling out for DTS/DTSO, cwd != .CURDIR, so enumeration always failed These changes allow make test-dts and make test-dtso to function in their respective directories. Added: stable/12/sys/dts/arm/Makefile.inc - copied unchanged from r340390, head/sys/dts/arm/Makefile.inc stable/12/sys/dts/arm64/Makefile.inc - copied unchanged from r340390, head/sys/dts/arm64/Makefile.inc Modified: stable/12/sys/dts/Makefile.inc stable/12/sys/dts/arm/Makefile stable/12/sys/dts/arm/overlays/Makefile stable/12/sys/dts/arm64/Makefile stable/12/sys/dts/arm64/overlays/Makefile stable/12/sys/dts/mips/Makefile stable/12/sys/dts/powerpc/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dts/Makefile.inc ============================================================================== --- stable/12/sys/dts/Makefile.inc Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/Makefile.inc Mon Nov 19 18:59:06 2018 (r340646) @@ -5,9 +5,9 @@ SYSDIR?=${SRCTOP}/sys test-dts: .for dts in ${DTS} @env MACHINE=`basename ${.CURDIR}` ${SYSDIR}/tools/fdt/make_dtb.sh ${SYSDIR} ${dts} /tmp +.endfor test-dtso: .for dtso in ${DTSO} @env MACHINE=`basename ${.CURDIR}` ${SYSDIR}/tools/fdt/make_dtbo.sh ${SYSDIR} ${dtso} /tmp - .endfor Modified: stable/12/sys/dts/arm/Makefile ============================================================================== --- stable/12/sys/dts/arm/Makefile Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/arm/Makefile Mon Nov 19 18:59:06 2018 (r340646) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTS!=ls *.dts +DTS!=ls ${.CURDIR}/*.dts all: test-dts Copied: stable/12/sys/dts/arm/Makefile.inc (from r340390, head/sys/dts/arm/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dts/arm/Makefile.inc Mon Nov 19 18:59:06 2018 (r340646, copy of r340390, head/sys/dts/arm/Makefile.inc) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: stable/12/sys/dts/arm/overlays/Makefile ============================================================================== --- stable/12/sys/dts/arm/overlays/Makefile Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/arm/overlays/Makefile Mon Nov 19 18:59:06 2018 (r340646) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTSO!=ls *.dtso +DTSO!=ls ${.CURDIR}/*.dtso all: test-dtso Modified: stable/12/sys/dts/arm64/Makefile ============================================================================== --- stable/12/sys/dts/arm64/Makefile Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/arm64/Makefile Mon Nov 19 18:59:06 2018 (r340646) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTS!=ls *.dts +DTS!=ls ${.CURDIR}/*.dts all: test-dts Copied: stable/12/sys/dts/arm64/Makefile.inc (from r340390, head/sys/dts/arm64/Makefile.inc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/dts/arm64/Makefile.inc Mon Nov 19 18:59:06 2018 (r340646, copy of r340390, head/sys/dts/arm64/Makefile.inc) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +.include "../Makefile.inc" Modified: stable/12/sys/dts/arm64/overlays/Makefile ============================================================================== --- stable/12/sys/dts/arm64/overlays/Makefile Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/arm64/overlays/Makefile Mon Nov 19 18:59:06 2018 (r340646) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTSO!=ls *.dtso +DTSO!=ls ${.CURDIR}/*.dtso all: test-dtso Modified: stable/12/sys/dts/mips/Makefile ============================================================================== --- stable/12/sys/dts/mips/Makefile Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/mips/Makefile Mon Nov 19 18:59:06 2018 (r340646) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTS!=ls *.dts +DTS!=ls ${.CURDIR}/*.dts all: test-dts Modified: stable/12/sys/dts/powerpc/Makefile ============================================================================== --- stable/12/sys/dts/powerpc/Makefile Mon Nov 19 18:58:34 2018 (r340645) +++ stable/12/sys/dts/powerpc/Makefile Mon Nov 19 18:59:06 2018 (r340646) @@ -1,6 +1,6 @@ # $FreeBSD$ -DTS!=ls *.dts +DTS!=ls ${.CURDIR}/*.dts all: test-dts From owner-svn-src-stable-12@freebsd.org Mon Nov 19 19:04:51 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB9A61123EC9; Mon, 19 Nov 2018 19:04:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6DA87861; Mon, 19 Nov 2018 19:04:51 +0000 (UTC) (envelope-from kevans@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38FCF261D0; Mon, 19 Nov 2018 19:04:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAJJ4pFH015218; Mon, 19 Nov 2018 19:04:51 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAJJ4p2j015217; Mon, 19 Nov 2018 19:04:51 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811191904.wAJJ4p2j015217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Nov 2018 19:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340647 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340647 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F6DA87861 X-Spamd-Result: default: False [0.42 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_SHORT(0.43)[0.428,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2018 19:04:51 -0000 Author: kevans Date: Mon Nov 19 19:04:50 2018 New Revision: 340647 URL: https://svnweb.freebsd.org/changeset/base/340647 Log: MFC r340392: Add dynamic_kenv assertion to init_static_kenv Both to formally document the requirement that this not be called after the dynamic kenv is setup, and to perhaps help static analyzers figure out what's going on. While calling init_static_kenv this late isn't fatal, there are some caveats that the caller should be aware of: - Late calls are effectively a no-op, as far as default FreeBSD is concerned, as everything will switch to searching the dynamic kenv once it's available. - Each of the kern_getenv calls will leak memory, as it's assumed that these are searching static environment and allocations will not be made. As such, this usage is not sensible and should be detected. Modified: stable/12/sys/kern/kern_environment.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_environment.c ============================================================================== --- stable/12/sys/kern/kern_environment.c Mon Nov 19 18:59:06 2018 (r340646) +++ stable/12/sys/kern/kern_environment.c Mon Nov 19 19:04:50 2018 (r340647) @@ -249,6 +249,7 @@ init_static_kenv(char *buf, size_t len) { char *eval; + KASSERT(!dynamic_kenv, ("kenv: dynamic_kenv already initialized")); /* * Give the static environment a chance to disable the loader(8) * environment first. This is done with loader_env.disabled=1. From owner-svn-src-stable-12@freebsd.org Tue Nov 20 00:55:53 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAA961131404; Tue, 20 Nov 2018 00:55:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8DFFB6D6FC; Tue, 20 Nov 2018 00:55:52 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B5A31AD9; Tue, 20 Nov 2018 00:55:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK0tqdl096785; Tue, 20 Nov 2018 00:55:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK0tpnm096782; Tue, 20 Nov 2018 00:55:51 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811200055.wAK0tpnm096782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 00:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340658 - in stable/12/sys: dev/mrsas kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: dev/mrsas kern X-SVN-Commit-Revision: 340658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DFFB6D6FC X-Spamd-Result: default: False [0.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_SHORT(0.35)[0.351,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:55:53 -0000 Author: markj Date: Tue Nov 20 00:55:51 2018 New Revision: 340658 URL: https://svnweb.freebsd.org/changeset/base/340658 Log: MFC r340192: Use plain atomic_{add,subtract} when that's sufficient. Modified: stable/12/sys/dev/mrsas/mrsas.h stable/12/sys/kern/uipc_mqueue.c stable/12/sys/kern/vfs_bio.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mrsas/mrsas.h ============================================================================== --- stable/12/sys/dev/mrsas/mrsas.h Tue Nov 20 00:43:14 2018 (r340657) +++ stable/12/sys/dev/mrsas/mrsas.h Tue Nov 20 00:55:51 2018 (r340658) @@ -612,8 +612,8 @@ typedef union { #define mrsas_atomic_read(v) atomic_load_acq_int(&(v)->val) #define mrsas_atomic_set(v,i) atomic_store_rel_int(&(v)->val, i) -#define mrsas_atomic_dec(v) atomic_fetchadd_int(&(v)->val, -1) -#define mrsas_atomic_inc(v) atomic_fetchadd_int(&(v)->val, 1) +#define mrsas_atomic_dec(v) atomic_subtract_int(&(v)->val, 1) +#define mrsas_atomic_inc(v) atomic_add_int(&(v)->val, 1) /* IOCInit Request message */ typedef struct _MPI2_IOC_INIT_REQUEST { Modified: stable/12/sys/kern/uipc_mqueue.c ============================================================================== --- stable/12/sys/kern/uipc_mqueue.c Tue Nov 20 00:43:14 2018 (r340657) +++ stable/12/sys/kern/uipc_mqueue.c Tue Nov 20 00:55:51 2018 (r340658) @@ -393,7 +393,7 @@ mqnode_free(struct mqfs_node *node) static __inline void mqnode_addref(struct mqfs_node *node) { - atomic_fetchadd_int(&node->mn_refcount, 1); + atomic_add_int(&node->mn_refcount, 1); } static __inline void Modified: stable/12/sys/kern/vfs_bio.c ============================================================================== --- stable/12/sys/kern/vfs_bio.c Tue Nov 20 00:43:14 2018 (r340657) +++ stable/12/sys/kern/vfs_bio.c Tue Nov 20 00:55:51 2018 (r340658) @@ -1656,7 +1656,7 @@ buf_alloc(struct bufdomain *bd) if (freebufs > 0) bp = uma_zalloc(buf_zone, M_NOWAIT); if (bp == NULL) { - atomic_fetchadd_int(&bd->bd_freebuffers, 1); + atomic_add_int(&bd->bd_freebuffers, 1); bufspace_daemon_wakeup(bd); counter_u64_add(numbufallocfails, 1); return (NULL); From owner-svn-src-stable-12@freebsd.org Tue Nov 20 00:56:56 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A0FD113147C; Tue, 20 Nov 2018 00:56:56 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B45686D83F; Tue, 20 Nov 2018 00:56:55 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 955841ADA; Tue, 20 Nov 2018 00:56:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAK0utn9096919; Tue, 20 Nov 2018 00:56:55 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAK0utEd096917; Tue, 20 Nov 2018 00:56:55 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811200056.wAK0utEd096917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 00:56:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340659 - in stable/12/sys: kern vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: kern vm X-SVN-Commit-Revision: 340659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B45686D83F X-Spamd-Result: default: False [0.34 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_SHORT(0.35)[0.351,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 00:56:56 -0000 Author: markj Date: Tue Nov 20 00:56:54 2018 New Revision: 340659 URL: https://svnweb.freebsd.org/changeset/base/340659 Log: MFC r340205: Avoid specifying VM_PROT_EXECUTE in mappings from pipe_map and exec_map. Modified: stable/12/sys/kern/sys_pipe.c stable/12/sys/vm/vm_kern.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sys_pipe.c ============================================================================== --- stable/12/sys/kern/sys_pipe.c Tue Nov 20 00:55:51 2018 (r340658) +++ stable/12/sys/kern/sys_pipe.c Tue Nov 20 00:56:54 2018 (r340659) @@ -509,9 +509,8 @@ retry: size = round_page(size); buffer = (caddr_t) vm_map_min(pipe_map); - error = vm_map_find(pipe_map, NULL, 0, - (vm_offset_t *) &buffer, size, 0, VMFS_ANY_SPACE, - VM_PROT_ALL, VM_PROT_ALL, 0); + error = vm_map_find(pipe_map, NULL, 0, (vm_offset_t *)&buffer, size, 0, + VMFS_ANY_SPACE, VM_PROT_RW, VM_PROT_RW, 0); if (error != KERN_SUCCESS) { if ((cpipe->pipe_buffer.buffer == NULL) && (size > SMALL_PIPE_SIZE)) { Modified: stable/12/sys/vm/vm_kern.c ============================================================================== --- stable/12/sys/vm/vm_kern.c Tue Nov 20 00:55:51 2018 (r340658) +++ stable/12/sys/vm/vm_kern.c Tue Nov 20 00:56:54 2018 (r340659) @@ -650,8 +650,8 @@ kmap_alloc_wait(vm_map_t map, vm_size_t size) map->needs_wakeup = TRUE; vm_map_unlock_and_wait(map, 0); } - vm_map_insert(map, NULL, 0, addr, addr + size, VM_PROT_ALL, - VM_PROT_ALL, MAP_ACC_CHARGED); + vm_map_insert(map, NULL, 0, addr, addr + size, VM_PROT_RW, VM_PROT_RW, + MAP_ACC_CHARGED); vm_map_unlock(map); return (addr); } From owner-svn-src-stable-12@freebsd.org Tue Nov 20 10:43:19 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71F86110D43A; Tue, 20 Nov 2018 10:43:19 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16CC685B92; Tue, 20 Nov 2018 10:43:19 +0000 (UTC) (envelope-from eugen@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC64A10438; Tue, 20 Nov 2018 10:43:18 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKAhIih005135; Tue, 20 Nov 2018 10:43:18 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKAhI6B005134; Tue, 20 Nov 2018 10:43:18 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201811201043.wAKAhI6B005134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 20 Nov 2018 10:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340669 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 340669 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16CC685B92 X-Spamd-Result: default: False [0.61 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.01)[-0.012,0]; NEURAL_SPAM_SHORT(0.62)[0.617,0]; NEURAL_SPAM_LONG(0.01)[0.007,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 10:43:19 -0000 Author: eugen Date: Tue Nov 20 10:43:18 2018 New Revision: 340669 URL: https://svnweb.freebsd.org/changeset/base/340669 Log: MFC r339558: New sysctl: net.inet.icmp.error_keeptags Currently, icmp_error() function copies FIB number from original packet into generated ICMP response but not mbuf_tags(9) chain. This prevents us from easily matching ICMP responses corresponding to tagged original packets by means of packet filter such as ipfw(8). For example, ICMP "time-exceeded in-transit" packets usually generated in response to traceroute probes lose tags attached to original packets. This change adds new sysctl net.inet.icmp.error_keeptags that defaults to 0 to avoid extra overhead when this feature not needed. Set net.inet.icmp.error_keeptags=1 to make icmp_error() copy mbuf_tags from original packet to generated ICMP response. PR: 215874 Modified: stable/12/sys/netinet/ip_icmp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/ip_icmp.c ============================================================================== --- stable/12/sys/netinet/ip_icmp.c Tue Nov 20 10:01:56 2018 (r340668) +++ stable/12/sys/netinet/ip_icmp.c Tue Nov 20 10:43:18 2018 (r340669) @@ -158,6 +158,12 @@ SYSCTL_INT(_net_inet_icmp, OID_AUTO, tstamprepl, CTLFL &VNET_NAME(icmptstamprepl), 0, "Respond to ICMP Timestamp packets"); +VNET_DEFINE_STATIC(int, error_keeptags) = 0; +#define V_error_keeptags VNET(error_keeptags) +SYSCTL_INT(_net_inet_icmp, OID_AUTO, error_keeptags, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(error_keeptags), 0, + "ICMP error response keeps copy of mbuf_tags of original packet"); + #ifdef ICMPPRINTFS int icmpprintfs = 0; #endif @@ -370,6 +376,10 @@ stdreply: icmpelen = max(8, min(V_icmp_quotelen, ntohs nip->ip_p = IPPROTO_ICMP; nip->ip_tos = 0; nip->ip_off = 0; + + if (V_error_keeptags) + m_tag_copy_chain(m, n, M_NOWAIT); + icmp_reflect(m); freeit: From owner-svn-src-stable-12@freebsd.org Tue Nov 20 16:35:54 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A59C1113531A; Tue, 20 Nov 2018 16:35:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4937F74F2B; Tue, 20 Nov 2018 16:35:54 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29F2D13DBC; Tue, 20 Nov 2018 16:35:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKGZscg084579; Tue, 20 Nov 2018 16:35:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKGZsnc084578; Tue, 20 Nov 2018 16:35:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811201635.wAKGZsnc084578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 20 Nov 2018 16:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340680 - stable/12/sys/arm64/arm64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm64/arm64 X-SVN-Commit-Revision: 340680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4937F74F2B X-Spamd-Result: default: False [0.33 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.13)[0.127,0]; NEURAL_SPAM_MEDIUM(0.19)[0.189,0]; NEURAL_SPAM_LONG(0.01)[0.010,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 16:35:54 -0000 Author: markj Date: Tue Nov 20 16:35:53 2018 New Revision: 340680 URL: https://svnweb.freebsd.org/changeset/base/340680 Log: MFC r340678: Handle kernel superpage mappings in pmap_remove_l2(). Modified: stable/12/sys/arm64/arm64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/pmap.c ============================================================================== --- stable/12/sys/arm64/arm64/pmap.c Tue Nov 20 15:14:30 2018 (r340679) +++ stable/12/sys/arm64/arm64/pmap.c Tue Nov 20 16:35:53 2018 (r340680) @@ -2382,8 +2382,40 @@ pmap_pv_insert_l2(pmap_t pmap, vm_offset_t va, pd_entr return (true); } +static void +pmap_remove_kernel_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t va) +{ + pt_entry_t newl2, oldl2; + vm_page_t ml3; + vm_paddr_t ml3pa; + + KASSERT(!VIRT_IN_DMAP(va), ("removing direct mapping of %#lx", va)); + KASSERT(pmap == kernel_pmap, ("pmap %p is not kernel_pmap", pmap)); + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + + ml3 = pmap_remove_pt_page(pmap, va); + if (ml3 == NULL) + panic("pmap_remove_kernel_l2: Missing pt page"); + + ml3pa = VM_PAGE_TO_PHYS(ml3); + newl2 = ml3pa | L2_TABLE; + + /* + * Initialize the page table page. + */ + pagezero((void *)PHYS_TO_DMAP(ml3pa)); + + /* + * Demote the mapping. The caller must have already invalidated the + * mapping (i.e., the "break" in break-before-make). + */ + oldl2 = pmap_load_store(l2, newl2); + KASSERT(oldl2 == 0, ("%s: found existing mapping at %p: %#lx", + __func__, l2, oldl2)); +} + /* - * pmap_remove_l2: do the things to unmap a level 2 superpage in a process + * pmap_remove_l2: Do the things to unmap a level 2 superpage. */ static int pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_t sva, @@ -2419,16 +2451,18 @@ pmap_remove_l2(pmap_t pmap, pt_entry_t *l2, vm_offset_ vm_page_aflag_clear(m, PGA_WRITEABLE); } } - KASSERT(pmap != kernel_pmap, - ("Attempting to remove an l2 kernel page")); - ml3 = pmap_remove_pt_page(pmap, sva); - if (ml3 != NULL) { - pmap_resident_count_dec(pmap, 1); - KASSERT(ml3->wire_count == NL3PG, - ("pmap_remove_l2: l3 page wire count error")); - ml3->wire_count = 1; - vm_page_unwire_noq(ml3); - pmap_add_delayed_free_list(ml3, free, FALSE); + if (pmap == kernel_pmap) { + pmap_remove_kernel_l2(pmap, l2, sva); + } else { + ml3 = pmap_remove_pt_page(pmap, sva); + if (ml3 != NULL) { + pmap_resident_count_dec(pmap, 1); + KASSERT(ml3->wire_count == NL3PG, + ("pmap_remove_l2: l3 page wire count error")); + ml3->wire_count = 1; + vm_page_unwire_noq(ml3); + pmap_add_delayed_free_list(ml3, free, FALSE); + } } return (pmap_unuse_pt(pmap, sva, l1e, free)); } From owner-svn-src-stable-12@freebsd.org Tue Nov 20 17:01:56 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB914113676B; Tue, 20 Nov 2018 17:01:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F28F76693; Tue, 20 Nov 2018 17:01:56 +0000 (UTC) (envelope-from mjg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61C161426D; Tue, 20 Nov 2018 17:01:56 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKH1uFC096847; Tue, 20 Nov 2018 17:01:56 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKH1uBG096846; Tue, 20 Nov 2018 17:01:56 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811201701.wAKH1uBG096846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Nov 2018 17:01:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340682 - stable/12/sys/amd64/include X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/12/sys/amd64/include X-SVN-Commit-Revision: 340682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7F28F76693 X-Spamd-Result: default: False [0.32 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.007,0]; NEURAL_SPAM_MEDIUM(0.17)[0.172,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.14)[0.138,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 17:01:57 -0000 Author: mjg Date: Tue Nov 20 17:01:55 2018 New Revision: 340682 URL: https://svnweb.freebsd.org/changeset/base/340682 Log: MFC r339449: amd64: relax constraints in curthread and curpcb This makes the compiler less likely to reload the content from %gs. The 'P' modifier drops all synteax prefixes and 'n' constraint treats input as a known at compilation time immediate integer. Example reloading victim was spinlock_enter. Modified: stable/12/sys/amd64/include/pcpu.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/include/pcpu.h ============================================================================== --- stable/12/sys/amd64/include/pcpu.h Tue Nov 20 16:54:42 2018 (r340681) +++ stable/12/sys/amd64/include/pcpu.h Tue Nov 20 17:01:55 2018 (r340682) @@ -227,8 +227,7 @@ __curthread(void) { struct thread *td; - __asm("movq %%gs:%1,%0" : "=r" (td) - : "m" (*(char *)OFFSETOF_CURTHREAD)); + __asm("movq %%gs:%P1,%0" : "=r" (td) : "n" (OFFSETOF_CURTHREAD)); return (td); } #ifdef __clang__ @@ -242,7 +241,7 @@ __curpcb(void) { struct pcb *pcb; - __asm("movq %%gs:%1,%0" : "=r" (pcb) : "m" (*(char *)OFFSETOF_CURPCB)); + __asm("movq %%gs:%P1,%0" : "=r" (pcb) : "n" (OFFSETOF_CURPCB)); return (pcb); } #define curpcb (__curpcb()) From owner-svn-src-stable-12@freebsd.org Tue Nov 20 17:10:46 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B4C91136BD3; Tue, 20 Nov 2018 17:10:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D91676CE4; Tue, 20 Nov 2018 17:10:46 +0000 (UTC) (envelope-from mjg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2E50142BF; Tue, 20 Nov 2018 17:10:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKHAj07000805; Tue, 20 Nov 2018 17:10:45 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKHAimp000800; Tue, 20 Nov 2018 17:10:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201811201710.wAKHAimp000800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 20 Nov 2018 17:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340684 - in stable/12: . lib/libc/amd64/string sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in stable/12: . lib/libc/amd64/string sys/amd64/amd64 X-SVN-Commit-Revision: 340684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D91676CE4 X-Spamd-Result: default: False [0.37 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.014,0]; NEURAL_SPAM_MEDIUM(0.21)[0.206,0]; NEURAL_SPAM_SHORT(0.15)[0.151,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 17:10:46 -0000 Author: mjg Date: Tue Nov 20 17:10:44 2018 New Revision: 340684 URL: https://svnweb.freebsd.org/changeset/base/340684 Log: MFC r339531,r339579,r340252,r340463,r340464,340472,r340587 amd64: tidy up memset to have rax set earlier for small sizes amd64: finish the tail in memset with an overlapping store amd64: align memset buffers to 16 bytes before using rep stos amd64: convert libc bzero to a C func to avoid future bloat amd64: sync up libc memset with the kernel version amd64: handle small memset buffers with overlapping stores Fix -DNO_CLEAN amd64 build after r340463 Added: stable/12/lib/libc/amd64/string/bzero.c - copied unchanged from r340463, head/lib/libc/amd64/string/bzero.c Deleted: stable/12/lib/libc/amd64/string/bzero.S Modified: stable/12/Makefile.inc1 stable/12/lib/libc/amd64/string/Makefile.inc stable/12/lib/libc/amd64/string/memset.S stable/12/sys/amd64/amd64/support.S Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Tue Nov 20 17:05:32 2018 (r340683) +++ stable/12/Makefile.inc1 Tue Nov 20 17:10:44 2018 (r340684) @@ -948,6 +948,13 @@ _cleanobj_fast_depend_hack: .PHONY ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ fi .endfor +# 20181115 r340463 bzero reimplemented as .c + @if [ -e "${OBJTOP}/lib/libc/.depend.bzero.o" ] && \ + egrep -qw 'bzero\.[sS]' ${OBJTOP}/lib/libc/.depend.bzero.o; then \ + echo "Removing stale dependencies for bzero"; \ + rm -f ${OBJTOP}/lib/libc/.depend.bzero.* \ + ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.bzero.*}; \ + fi # 20181009 track migration from ntp's embedded libevent to updated one @if [ -e "${OBJTOP}/usr.sbin/ntp/libntpevent/.depend.bufferevent_openssl.o" ] && \ egrep -q 'contrib/ntp/sntp/libevent/bufferevent_openssl.c' \ Modified: stable/12/lib/libc/amd64/string/Makefile.inc ============================================================================== --- stable/12/lib/libc/amd64/string/Makefile.inc Tue Nov 20 17:05:32 2018 (r340683) +++ stable/12/lib/libc/amd64/string/Makefile.inc Tue Nov 20 17:10:44 2018 (r340684) @@ -2,7 +2,6 @@ MDSRCS+= \ bcmp.S \ - bzero.S \ memcmp.S \ memcpy.S \ memmove.S \ Copied: stable/12/lib/libc/amd64/string/bzero.c (from r340463, head/lib/libc/amd64/string/bzero.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/lib/libc/amd64/string/bzero.c Tue Nov 20 17:10:44 2018 (r340684, copy of r340463, head/lib/libc/amd64/string/bzero.c) @@ -0,0 +1,15 @@ +/*- + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +void +bzero(void *b, size_t len) +{ + + memset(b, 0, len); +} Modified: stable/12/lib/libc/amd64/string/memset.S ============================================================================== --- stable/12/lib/libc/amd64/string/memset.S Tue Nov 20 17:05:32 2018 (r340683) +++ stable/12/lib/libc/amd64/string/memset.S Tue Nov 20 17:10:44 2018 (r340684) @@ -31,101 +31,112 @@ #include __FBSDID("$FreeBSD$"); -.macro MEMSET bzero erms -.if \bzero == 1 - movq %rsi,%rcx - movq %rsi,%rdx - xorl %eax,%eax -.else - movq %rdi,%r9 +#define ALIGN_TEXT .p2align 4,0x90 /* 16-byte alignment, nop filled */ + +.macro MEMSET erms + movq %rdi,%rax movq %rdx,%rcx movzbq %sil,%r8 - movabs $0x0101010101010101,%rax - imulq %r8,%rax -.endif + movabs $0x0101010101010101,%r10 + imulq %r8,%r10 cmpq $32,%rcx - jb 1016f + jbe 101632f cmpq $256,%rcx ja 1256f -1032: - movq %rax,(%rdi) - movq %rax,8(%rdi) - movq %rax,16(%rdi) - movq %rax,24(%rdi) +103200: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,16(%rdi) + movq %r10,24(%rdi) leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx - jae 1032b - cmpb $0,%cl - je 1000f -1016: + ja 103200b cmpb $16,%cl - jl 1008f - movq %rax,(%rdi) - movq %rax,8(%rdi) - subb $16,%cl - jz 1000f - leaq 16(%rdi),%rdi -1008: + ja 201632f + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + ret + ALIGN_TEXT +101632: + cmpb $16,%cl + jl 100816f +201632: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + ret + ALIGN_TEXT +100816: cmpb $8,%cl - jl 1004f - movq %rax,(%rdi) - subb $8,%cl - jz 1000f - leaq 8(%rdi),%rdi -1004: + jl 100408f + movq %r10,(%rdi) + movq %r10,-8(%rdi,%rcx) + ret + ALIGN_TEXT +100408: cmpb $4,%cl - jl 1002f - movl %eax,(%rdi) - subb $4,%cl - jz 1000f - leaq 4(%rdi),%rdi -1002: + jl 100204f + movl %r10d,(%rdi) + movl %r10d,-4(%rdi,%rcx) + ret + ALIGN_TEXT +100204: cmpb $2,%cl - jl 1001f - movw %ax,(%rdi) - subb $2,%cl - jz 1000f - leaq 2(%rdi),%rdi -1001: - cmpb $1,%cl - jl 1000f - movb %al,(%rdi) -1000: -.if \bzero == 0 - movq %r9,%rax -.endif + jl 100001f + movw %r10w,(%rdi) + movw %r10w,-2(%rdi,%rcx) ret - + ALIGN_TEXT +100001: + cmpb $0,%cl + je 100000f + movb %r10b,(%rdi) +100000: + ret + ALIGN_TEXT 1256: + movq %rdi,%r9 + movq %r10,%rax + testl $15,%edi + jnz 3f +1: .if \erms == 1 rep stosb + movq %r9,%rax .else + movq %rcx,%rdx shrq $3,%rcx rep stosq - movq %rdx,%rcx - andb $7,%cl - jne 1004b -.endif -.if \bzero == 0 movq %r9,%rax + andl $7,%edx + jnz 2f + ret +2: + movq %r10,-8(%rdi,%rdx) .endif ret + ALIGN_TEXT +3: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %rdi,%r8 + andq $15,%r8 + leaq -16(%rcx,%r8),%rcx + neg %r8 + leaq 16(%rdi,%r8),%rdi + jmp 1b .endm -#ifndef BZERO + ENTRY(memset) - MEMSET bzero=0 erms=0 + MEMSET erms=0 END(memset) -#else -ENTRY(bzero) - MEMSET bzero=1 erms=0 -END(bzero) -#endif .section .note.GNU-stack,"",%progbits Modified: stable/12/sys/amd64/amd64/support.S ============================================================================== --- stable/12/sys/amd64/amd64/support.S Tue Nov 20 17:05:32 2018 (r340683) +++ stable/12/sys/amd64/amd64/support.S Tue Nov 20 17:10:44 2018 (r340684) @@ -452,82 +452,112 @@ END(memcpy_erms) */ .macro MEMSET erms PUSH_FRAME_POINTER - movq %rdi,%r9 + movq %rdi,%rax movq %rdx,%rcx movzbq %sil,%r8 - movabs $0x0101010101010101,%rax - imulq %r8,%rax + movabs $0x0101010101010101,%r10 + imulq %r8,%r10 cmpq $32,%rcx - jb 1016f + jbe 101632f cmpq $256,%rcx ja 1256f -1032: - movq %rax,(%rdi) - movq %rax,8(%rdi) - movq %rax,16(%rdi) - movq %rax,24(%rdi) +103200: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,16(%rdi) + movq %r10,24(%rdi) leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx - jae 1032b - cmpb $0,%cl - je 1000f -1016: + ja 103200b cmpb $16,%cl - jl 1008f - movq %rax,(%rdi) - movq %rax,8(%rdi) - subb $16,%cl - jz 1000f - leaq 16(%rdi),%rdi -1008: + ja 201632f + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +101632: + cmpb $16,%cl + jl 100816f +201632: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %r10,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100816: cmpb $8,%cl - jl 1004f - movq %rax,(%rdi) - subb $8,%cl - jz 1000f - leaq 8(%rdi),%rdi -1004: + jl 100408f + movq %r10,(%rdi) + movq %r10,-8(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100408: cmpb $4,%cl - jl 1002f - movl %eax,(%rdi) - subb $4,%cl - jz 1000f - leaq 4(%rdi),%rdi -1002: + jl 100204f + movl %r10d,(%rdi) + movl %r10d,-4(%rdi,%rcx) + POP_FRAME_POINTER + ret + ALIGN_TEXT +100204: cmpb $2,%cl - jl 1001f - movw %ax,(%rdi) - subb $2,%cl - jz 1000f - leaq 2(%rdi),%rdi -1001: - cmpb $1,%cl - jl 1000f - movb %al,(%rdi) -1000: - movq %r9,%rax + jl 100001f + movw %r10w,(%rdi) + movw %r10w,-2(%rdi,%rcx) POP_FRAME_POINTER ret ALIGN_TEXT +100001: + cmpb $0,%cl + je 100000f + movb %r10b,(%rdi) +100000: + POP_FRAME_POINTER + ret + ALIGN_TEXT 1256: + movq %rdi,%r9 + movq %r10,%rax + testl $15,%edi + jnz 3f +1: .if \erms == 1 rep stosb + movq %r9,%rax .else + movq %rcx,%rdx shrq $3,%rcx rep stosq - movq %rdx,%rcx - andb $7,%cl - jne 1004b -.endif movq %r9,%rax + andl $7,%edx + jnz 2f POP_FRAME_POINTER ret +2: + movq %r10,-8(%rdi,%rdx) +.endif + POP_FRAME_POINTER + ret + ALIGN_TEXT +3: + movq %r10,(%rdi) + movq %r10,8(%rdi) + movq %rdi,%r8 + andq $15,%r8 + leaq -16(%rcx,%r8),%rcx + neg %r8 + leaq 16(%rdi,%r8),%rdi + jmp 1b .endm ENTRY(memset_std) From owner-svn-src-stable-12@freebsd.org Tue Nov 20 19:37:10 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6020113B904; Tue, 20 Nov 2018 19:37:10 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AFCC7F416; Tue, 20 Nov 2018 19:37:10 +0000 (UTC) (envelope-from zeising@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33C5315B9A; Tue, 20 Nov 2018 19:37:10 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKJbAkf082799; Tue, 20 Nov 2018 19:37:10 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKJb9da082796; Tue, 20 Nov 2018 19:37:09 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201811201937.wAKJb9da082796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Tue, 20 Nov 2018 19:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340695 - in stable/12/sys: amd64/conf i386/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: in stable/12/sys: amd64/conf i386/conf X-SVN-Commit-Revision: 340695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6AFCC7F416 X-Spamd-Result: default: False [0.73 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.010,0]; NEURAL_SPAM_MEDIUM(0.19)[0.189,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.531,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 19:37:11 -0000 Author: zeising (doc,ports committer) Date: Tue Nov 20 19:37:09 2018 New Revision: 340695 URL: https://svnweb.freebsd.org/changeset/base/340695 Log: MFC r340387: Add evdev support to amd64 and i386 This merge is done sans sys/i386/conf/MINIMAL, since that doesn't exist in stable/12, only current. Include evdev support and drivers in the amd64 GENERIC and MINIMAL, and i386 GENERIC kernels. Evdev is used by X and wayland to handle input devices, and this change, together with upcomming changes in ports will make us handle input devices better in graphical UIs. Reviewed by: wulf, bapt, imp Approved by: imp Modified: stable/12/sys/amd64/conf/GENERIC stable/12/sys/amd64/conf/MINIMAL stable/12/sys/i386/conf/GENERIC Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/conf/GENERIC ============================================================================== --- stable/12/sys/amd64/conf/GENERIC Tue Nov 20 19:31:02 2018 (r340694) +++ stable/12/sys/amd64/conf/GENERIC Tue Nov 20 19:37:09 2018 (r340695) @@ -360,3 +360,8 @@ device vmx # VMware VMXNET3 Ethernet # Netmap provides direct access to TX/RX rings on supported NICs device netmap # netmap(4) support + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev Modified: stable/12/sys/amd64/conf/MINIMAL ============================================================================== --- stable/12/sys/amd64/conf/MINIMAL Tue Nov 20 19:31:02 2018 (r340694) +++ stable/12/sys/amd64/conf/MINIMAL Tue Nov 20 19:37:09 2018 (r340695) @@ -137,3 +137,8 @@ device bpf # Berkeley packet filter # NOTE: XENHVM depends on xenpci. They must be added or removed together. options XENHVM # Xen HVM kernel infrastructure device xenpci # Xen HVM Hypervisor services driver + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev Modified: stable/12/sys/i386/conf/GENERIC ============================================================================== --- stable/12/sys/i386/conf/GENERIC Tue Nov 20 19:31:02 2018 (r340694) +++ stable/12/sys/i386/conf/GENERIC Tue Nov 20 19:37:09 2018 (r340695) @@ -358,3 +358,8 @@ device xenpci # Xen HVM Hypervisor services driver # VMware support device vmx # VMware VMXNET3 Ethernet + +# evdev interface +options EVDEV_SUPPORT # evdev support in legacy drivers +device evdev # input event device support +device uinput # install /dev/uinput cdev From owner-svn-src-stable-12@freebsd.org Tue Nov 20 20:07:39 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A9DC113C305; Tue, 20 Nov 2018 20:07:39 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0C3780709; Tue, 20 Nov 2018 20:07:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAKK7b7j068425; Tue, 20 Nov 2018 12:07:37 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAKK7bSP068424; Tue, 20 Nov 2018 12:07:37 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811202007.wAKK7bSP068424@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340695 - in stable/12/sys: amd64/conf i386/conf In-Reply-To: <201811201937.wAKJb9da082796@repo.freebsd.org> To: Niclas Zeising Date: Tue, 20 Nov 2018 12:07:37 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: C0C3780709 X-Spamd-Result: default: False [1.63 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.60)[0.601,0]; NEURAL_HAM_SHORT(-0.59)[-0.589,0]; NEURAL_SPAM_MEDIUM(0.75)[0.752,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:07:39 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: zeising (doc,ports committer) > Date: Tue Nov 20 19:37:09 2018 > New Revision: 340695 > URL: https://svnweb.freebsd.org/changeset/base/340695 > > Log: > MFC r340387: Add evdev support to amd64 and i386 > > This merge is done sans sys/i386/conf/MINIMAL, since that doesn't exist in > stable/12, only current. Could you do me a favor and track down why MINIMAL has not be mfc'ed? And if there is not a good reason for it to not be MFC'ed see that it does get done. Thanks, Rod Include evdev support and drivers in the amd64 GENERIC and MINIMAL, and i386 > GENERIC kernels. Evdev is used by X and wayland to handle input devices, and > this change, together with upcomming changes in ports will make us handle input > devices better in graphical UIs. > > Reviewed by: wulf, bapt, imp > Approved by: imp > > Modified: > stable/12/sys/amd64/conf/GENERIC > stable/12/sys/amd64/conf/MINIMAL > stable/12/sys/i386/conf/GENERIC > Directory Properties: > stable/12/ (props changed) > > Modified: stable/12/sys/amd64/conf/GENERIC > ============================================================================== > --- stable/12/sys/amd64/conf/GENERIC Tue Nov 20 19:31:02 2018 (r340694) > +++ stable/12/sys/amd64/conf/GENERIC Tue Nov 20 19:37:09 2018 (r340695) > @@ -360,3 +360,8 @@ device vmx # VMware VMXNET3 Ethernet > > # Netmap provides direct access to TX/RX rings on supported NICs > device netmap # netmap(4) support > + > +# evdev interface > +options EVDEV_SUPPORT # evdev support in legacy drivers > +device evdev # input event device support > +device uinput # install /dev/uinput cdev > > Modified: stable/12/sys/amd64/conf/MINIMAL > ============================================================================== > --- stable/12/sys/amd64/conf/MINIMAL Tue Nov 20 19:31:02 2018 (r340694) > +++ stable/12/sys/amd64/conf/MINIMAL Tue Nov 20 19:37:09 2018 (r340695) > @@ -137,3 +137,8 @@ device bpf # Berkeley packet filter > # NOTE: XENHVM depends on xenpci. They must be added or removed together. > options XENHVM # Xen HVM kernel infrastructure > device xenpci # Xen HVM Hypervisor services driver > + > +# evdev interface > +options EVDEV_SUPPORT # evdev support in legacy drivers > +device evdev # input event device support > +device uinput # install /dev/uinput cdev > > Modified: stable/12/sys/i386/conf/GENERIC > ============================================================================== > --- stable/12/sys/i386/conf/GENERIC Tue Nov 20 19:31:02 2018 (r340694) > +++ stable/12/sys/i386/conf/GENERIC Tue Nov 20 19:37:09 2018 (r340695) > @@ -358,3 +358,8 @@ device xenpci # Xen HVM Hypervisor services driver > > # VMware support > device vmx # VMware VMXNET3 Ethernet > + > +# evdev interface > +options EVDEV_SUPPORT # evdev support in legacy drivers > +device evdev # input event device support > +device uinput # install /dev/uinput cdev > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable-12@freebsd.org Tue Nov 20 20:08:52 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17DD7113C388; Tue, 20 Nov 2018 20:08:52 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE4B780863; Tue, 20 Nov 2018 20:08:51 +0000 (UTC) (envelope-from garga@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F54816077; Tue, 20 Nov 2018 20:08:51 +0000 (UTC) (envelope-from garga@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKK8pxZ098698; Tue, 20 Nov 2018 20:08:51 GMT (envelope-from garga@FreeBSD.org) Received: (from garga@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKK8pxn098697; Tue, 20 Nov 2018 20:08:51 GMT (envelope-from garga@FreeBSD.org) Message-Id: <201811202008.wAKK8pxn098697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: garga set sender to garga@FreeBSD.org using -f From: Renato Botelho Date: Tue, 20 Nov 2018 20:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340696 - stable/12/usr.sbin/ntp/ntpd X-SVN-Group: stable-12 X-SVN-Commit-Author: garga X-SVN-Commit-Paths: stable/12/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 340696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE4B780863 X-Spamd-Result: default: False [0.71 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.531,0]; NEURAL_SPAM_MEDIUM(0.17)[0.172,0]; NEURAL_SPAM_LONG(0.01)[0.007,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:08:52 -0000 Author: garga (ports committer) Date: Tue Nov 20 20:08:51 2018 New Revision: 340696 URL: https://svnweb.freebsd.org/changeset/base/340696 Log: MFC r340439,r340440 Fix /etc/ntp permissions. According to mtree it must be 0700 Approved by: imp Sponsored by: Rubicon Communications, LLC (Netgate) Modified: stable/12/usr.sbin/ntp/ntpd/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/ntp/ntpd/Makefile ============================================================================== --- stable/12/usr.sbin/ntp/ntpd/Makefile Tue Nov 20 19:37:09 2018 (r340695) +++ stable/12/usr.sbin/ntp/ntpd/Makefile Tue Nov 20 20:08:51 2018 (r340696) @@ -7,9 +7,12 @@ MAN= .PATH: ${SRCTOP}/contrib/ntp/ntpd \ ${.OBJDIR} +DIRS= ETC_NTP +ETC_NTP= /etc/ntp +ETC_NTP_MODE= 0700 CONFS= ntp.conf FILES= leap-seconds -FILESDIR= /etc/ntp +FILESDIR= ETC_NTP FILESMODE= 644 PROG= ntpd From owner-svn-src-stable-12@freebsd.org Tue Nov 20 20:16:05 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2180113C64D; Tue, 20 Nov 2018 20:16:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6651680DD1; Tue, 20 Nov 2018 20:16:05 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4451A1620F; Tue, 20 Nov 2018 20:16:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKKG5jh003923; Tue, 20 Nov 2018 20:16:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKKG30c003916; Tue, 20 Nov 2018 20:16:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811202016.wAKKG30c003916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Nov 2018 20:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340697 - in stable/12: . rescue/rescue share/mk tools/build/options X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable/12: . rescue/rescue share/mk tools/build/options X-SVN-Commit-Revision: 340697 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6651680DD1 X-Spamd-Result: default: False [0.73 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.010,0]; NEURAL_SPAM_MEDIUM(0.19)[0.189,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.53)[0.531,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:16:06 -0000 Author: emaste Date: Tue Nov 20 20:16:03 2018 New Revision: 340697 URL: https://svnweb.freebsd.org/changeset/base/340697 Log: Introduce src.conf knob to build userland with retpoline MFC r339511: Introduce src.conf knob to build userland with retpoline WITH_RETPOLINE enables -mretpoline vulnerability mitigation in userland for CVE-2017-5715. MFC r340099: libcompat: disable retpoline when building build tools These are built with the host toolchain which may not support retpoline. While here, move the MK_ overrides to a separate line and sort them alphabetically to support future changes. MFC r340650: Avoid retpolineplt with static linking Statically linked binaries linked with -zretpolineplt crash at startup as lld produces a broken PLT. MFC r340652: rescue: set NO_SHARED in Makefile The rescue binary is built statically via the Makefile generated by crunchgen, but that does not trigger other shared/static logic in bsd.prog.mk - in particular PR: 233336 Reported by: Peter Malcom (r339511), Charlie Li (r340652) Approved by: re (gjb, early MFC) Sponsored by: The FreeBSD Foundation Added: stable/12/tools/build/options/WITH_RETPOLINE - copied unchanged from r339511, head/tools/build/options/WITH_RETPOLINE Modified: stable/12/Makefile.inc1 stable/12/Makefile.libcompat stable/12/rescue/rescue/Makefile stable/12/share/mk/bsd.lib.mk stable/12/share/mk/bsd.opts.mk stable/12/share/mk/bsd.prog.mk Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Tue Nov 20 20:08:51 2018 (r340696) +++ stable/12/Makefile.inc1 Tue Nov 20 20:16:03 2018 (r340697) @@ -659,7 +659,7 @@ BSARGS= DESTDIR= \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ - MK_LLDB=no MK_TESTS=no \ + MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no \ MK_INCLUDES=yes BMAKE= \ @@ -680,7 +680,7 @@ TMAKE= \ -DNO_LINT \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ - MK_LLDB=no MK_TESTS=no + MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no # cross-tools stage # TOOLS_PREFIX set in BMAKE @@ -703,7 +703,7 @@ KTMAKE= \ SSP_CFLAGS= \ MK_HTML=no -DNO_LINT MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ - -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no + -DNO_CPU_CFLAGS MK_RETPOLINE=no MK_WARNS=no MK_CTF=no # world stage WMAKEENV= ${CROSSENV} \ @@ -2390,6 +2390,7 @@ NXBMAKEARGS+= \ MK_OFED=no \ MK_OPENSSH=no \ MK_PROFILE=no \ + MK_RETPOLINE=no \ MK_SENDMAIL=no \ MK_SVNLITE=no \ MK_TESTS=no \ Modified: stable/12/Makefile.libcompat ============================================================================== --- stable/12/Makefile.libcompat Tue Nov 20 20:08:51 2018 (r340696) +++ stable/12/Makefile.libcompat Tue Nov 20 20:16:03 2018 (r340697) @@ -200,7 +200,8 @@ build${libcompat}: .PHONY OBJTOP=${LIBCOMPAT_OBJTOP} \ OBJROOT='$${OBJTOP}/' \ MAKEOBJDIRPREFIX= \ - DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ + DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS \ + MK_CTF=no MK_RETPOLINE=no MK_WARNS=no \ ${_t} .endfor .endfor Modified: stable/12/rescue/rescue/Makefile ============================================================================== --- stable/12/rescue/rescue/Makefile Tue Nov 20 20:08:51 2018 (r340696) +++ stable/12/rescue/rescue/Makefile Tue Nov 20 20:16:03 2018 (r340697) @@ -6,6 +6,7 @@ PACKAGE=rescue MAN= MK_SSP= no +NO_SHARED= yes PROG= rescue BINDIR?=/rescue Modified: stable/12/share/mk/bsd.lib.mk ============================================================================== --- stable/12/share/mk/bsd.lib.mk Tue Nov 20 20:08:51 2018 (r340696) +++ stable/12/share/mk/bsd.lib.mk Tue Nov 20 20:16:03 2018 (r340697) @@ -69,6 +69,12 @@ TAGS+= package=${PACKAGE:Uruntime} TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} .endif +.if ${MK_RETPOLINE} != "no" +CFLAGS+= -mretpoline +CXXFLAGS+= -mretpoline +LDFLAGS+= -Wl,-zretpolineplt +.endif + .if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ empty(DEBUG_FLAGS:M-gdwarf*) CFLAGS+= ${DEBUG_FILES_CFLAGS} Modified: stable/12/share/mk/bsd.opts.mk ============================================================================== --- stable/12/share/mk/bsd.opts.mk Tue Nov 20 20:08:51 2018 (r340696) +++ stable/12/share/mk/bsd.opts.mk Tue Nov 20 20:16:03 2018 (r340697) @@ -72,6 +72,7 @@ __DEFAULT_NO_OPTIONS = \ CCACHE_BUILD \ CTF \ INSTALL_AS_USER \ + RETPOLINE \ STALE_STAGED __DEFAULT_DEPENDENT_OPTIONS = \ Modified: stable/12/share/mk/bsd.prog.mk ============================================================================== --- stable/12/share/mk/bsd.prog.mk Tue Nov 20 20:08:51 2018 (r340696) +++ stable/12/share/mk/bsd.prog.mk Tue Nov 20 20:16:03 2018 (r340697) @@ -34,6 +34,15 @@ PROG= ${PROG_CXX} MK_DEBUG_FILES= no .endif +.if ${MK_RETPOLINE} != "no" +CFLAGS+= -mretpoline +CXXFLAGS+= -mretpoline +# retpolineplt is broken with static linking (PR 233336) +.if !defined(NO_SHARED) || ${NO_SHARED} == "no" || ${NO_SHARED} == "NO" +LDFLAGS+= -Wl,-zretpolineplt +.endif +.endif + .if defined(CRUNCH_CFLAGS) CFLAGS+=${CRUNCH_CFLAGS} .else Copied: stable/12/tools/build/options/WITH_RETPOLINE (from r339511, head/tools/build/options/WITH_RETPOLINE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITH_RETPOLINE Tue Nov 20 20:16:03 2018 (r340697, copy of r339511, head/tools/build/options/WITH_RETPOLINE) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to build the base system with the retpoline speculative execution +vulnerability mitigation for CVE-2017-5715. From owner-svn-src-stable-12@freebsd.org Tue Nov 20 20:40:11 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AD83113D2B4; Tue, 20 Nov 2018 20:40:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEE1B8285C; Tue, 20 Nov 2018 20:40:10 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81A521658C; Tue, 20 Nov 2018 20:40:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKKeAOg014998; Tue, 20 Nov 2018 20:40:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKKeA2g014997; Tue, 20 Nov 2018 20:40:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811202040.wAKKeA2g014997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 20 Nov 2018 20:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340700 - stable/12/share/man/man5 X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/man/man5 X-SVN-Commit-Revision: 340700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BEE1B8285C X-Spamd-Result: default: False [0.75 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.53)[0.531,0]; NEURAL_SPAM_MEDIUM(0.21)[0.206,0]; NEURAL_SPAM_LONG(0.01)[0.014,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:40:11 -0000 Author: emaste Date: Tue Nov 20 20:40:10 2018 New Revision: 340700 URL: https://svnweb.freebsd.org/changeset/base/340700 Log: src.conf.5: regen after r340697 Modified: stable/12/share/man/man5/src.conf.5 Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Tue Nov 20 20:32:10 2018 (r340699) +++ stable/12/share/man/man5/src.conf.5 Tue Nov 20 20:40:10 2018 (r340700) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 18, 2018 +.Dd November 20, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -149,7 +149,7 @@ of the normal system build. The resulting system cannot build programs from source. .Pp This is a default setting on -arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. +arm64/aarch64 and riscv/riscv64. When set, it enforces these options: .Pp .Bl -item -compact @@ -171,7 +171,7 @@ toolchain is provided. .Ef .Pp This is a default setting on -arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. +arm64/aarch64 and riscv/riscv64. .It Va WITH_BINUTILS_BOOTSTRAP Set build binutils (as, ld, and objdump) as part of the bootstrap process. @@ -310,7 +310,7 @@ When set, it enforces these options: Set to not build the Clang C/C++ compiler during the regular phase of the build. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. When set, it enforces these options: .Pp .Bl -item -compact @@ -366,7 +366,7 @@ To be able to build the system, either gcc or clang bo enabled unless an alternate compiler is provided via XCC. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_CLANG_BOOTSTRAP Set to build the Clang C/C++ compiler during the bootstrap phase of the build. .Pp @@ -379,7 +379,7 @@ Set to avoid building the ARCMigrate, Rewriter and Sta the Clang C/C++ compiler. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_CLANG_FULL Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. @@ -394,7 +394,7 @@ and .Pa /usr/bin/cpp . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_CLANG_IS_CC Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , @@ -470,7 +470,7 @@ Set to not build .Xr cxgbetool 8 .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe and riscv/riscv64. .It Va WITH_CXGBETOOL Set to build .Xr cxgbetool 8 @@ -635,7 +635,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_EFI Set to build .Xr efivar 3 @@ -699,7 +699,7 @@ Set to not build games. Set to not build and install gcc and g++ as part of the normal build process. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. .It Va WITH_GCC Set to build and install gcc and g++. .Pp @@ -712,7 +712,7 @@ unless an alternative compiler is provided via XCC. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. .It Va WITH_GCC_BOOTSTRAP Set to build gcc and g++ as part of the bootstrap process. .Pp @@ -727,7 +727,7 @@ Set to not build .Xr gdb 1 . .Pp This is a default setting on -arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. +arm64/aarch64 and riscv/riscv64. .It Va WITH_GDB Set to build .Xr gdb 1 . @@ -754,7 +754,7 @@ to be used as a fallback for if a newer version is not installed. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and riscv/riscv64. .It Va WITHOUT_GNUCXX Do not build the GNU C++ stack (g++, libstdc++). This is the default on platforms where clang is the system compiler. @@ -766,7 +766,7 @@ Build the GNU C++ stack (g++, libstdc++). This is the default on platforms where gcc is the system compiler. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_GNU_DIFF Set to not build GNU .Xr diff 1 @@ -794,7 +794,7 @@ Set to build the GPL'd version of the device tree comp instead of the BSD licensed one. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_GSSAPI Set to not build libgssapi. .It Va WITHOUT_HAST @@ -809,7 +809,7 @@ Set to not build HTML docs. Set to not build or install HyperV utilities. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_HYPERV Set to build or install HyperV utilities. .Pp @@ -986,7 +986,7 @@ library. Set to not build LLVM's lld linker. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLD Set to build LLVM's lld linker. .Pp @@ -996,7 +996,7 @@ amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarc Set to not build the LLDB debugger. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLDB Set to build the LLDB debugger. .Pp @@ -1009,7 +1009,7 @@ To be able to build the system, either Binutils or LLD enabled unless an alternate linker is provided via XLD. .Pp This is a default setting on -arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLD_BOOTSTRAP Set to build the LLD linker during the bootstrap phase of the build. .Pp @@ -1019,7 +1019,7 @@ amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386. Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on -arm/arm, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +arm/arm, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp @@ -1031,7 +1031,7 @@ Set to not build the tool. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_COV Set to build the .Xr llvm-cov 1 @@ -1048,7 +1048,7 @@ arm/arm, arm/armv6, arm/armv7, powerpc/powerpc, powerp Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. .It Va WITHOUT_LLVM_TARGET_AARCH64 Set to not build LLVM target support for AArch64. The @@ -1056,7 +1056,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_AARCH64 Set to build LLVM target support for AArch64. The @@ -1070,7 +1070,7 @@ Set to only build the required LLVM target support. This option is preferred to specific target support options. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. When set, these options are also in effect: .Pp .Bl -inset -compact @@ -1109,7 +1109,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_ARM Set to build LLVM target support for ARM. The @@ -1130,7 +1130,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_MIPS Set to build LLVM target support for MIPS. The @@ -1146,7 +1146,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_POWERPC Set to build LLVM target support for PowerPC. The @@ -1162,7 +1162,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_SPARC Set to build LLVM target support for SPARC. The @@ -1178,7 +1178,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +riscv/riscv64 and sparc64/sparc64. .It Va WITH_LLVM_TARGET_X86 Set to build LLVM target support for X86. The @@ -1194,17 +1194,17 @@ on all other platforms. Disable inclusion of GELI crypto support in the boot chain binaries. .Pp This is a default setting on -sparc64/sparc64. +powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LOADER_LUA Set to build LUA bindings for the boot loader. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. .It Va WITHOUT_LOADER_OFW Disable building of openfirmware bootloader components. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. .It Va WITH_LOADER_OFW Set to build openfirmware bootloader components. .Pp @@ -1214,7 +1214,7 @@ powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe Disable building of ubldr. .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64. .It Va WITH_LOADER_UBOOT Set to build ubldr. .Pp @@ -1349,7 +1349,7 @@ Set to not build .Xr mlx5tool 8 .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe and riscv/riscv64. .It Va WITH_MLX5TOOL Set to build .Xr mlx5tool 8 @@ -1517,7 +1517,7 @@ Set to build profiled libraries for use with .Xr gprof 8 . .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITHOUT_QUOTAS Set to not build .Xr quota 1 @@ -1549,6 +1549,9 @@ Successive builds will not be bit-for-bit identical. .It Va WITHOUT_RESCUE Set to not build .Xr rescue 8 . +.It Va WITH_RETPOLINE +Set to build the base system with the retpoline speculative execution +vulnerability mitigation for CVE-2017-5715. .It Va WITHOUT_ROUTED Set to not build .Xr routed 8 @@ -1604,7 +1607,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mi Set to build world with propolice stack smashing protection. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. .It Va WITH_STAGING Enable staging of files to a stage tree. This can be best thought of as auto-install to From owner-svn-src-stable-12@freebsd.org Tue Nov 20 20:50:19 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3CB113D79F; Tue, 20 Nov 2018 20:50:19 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [176.58.89.161]) (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 29D0F82F8C; Tue, 20 Nov 2018 20:50:19 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 42zyWl3Yr0zDj70; Tue, 20 Nov 2018 20:50:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id CdQm2PoKhW61; Tue, 20 Nov 2018 20:50:11 +0000 (UTC) Received: from garnet.daemonic.se (unknown [IPv6:2001:470:dca9:201:25b3:f7a5:c407:630b]) by mail.daemonic.se (Postfix) with ESMTPSA id 42zyWk6RDHzDhFd; Tue, 20 Nov 2018 20:50:10 +0000 (UTC) Subject: Re: svn commit: r340695 - in stable/12/sys: amd64/conf i386/conf To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201811202007.wAKK7bSP068424@pdx.rh.CN85.dnsmgr.net> From: Niclas Zeising Message-ID: Date: Tue, 20 Nov 2018 21:50:10 +0100 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <201811202007.wAKK7bSP068424@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 29D0F82F8C X-Spamd-Result: default: False [-0.72 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.66)[-0.662,0]; NEURAL_SPAM_SHORT(0.60)[0.604,0]; NEURAL_HAM_LONG(-0.66)[-0.660,0]; ASN(0.00)[asn:36236, ipnet:176.58.89.0/24, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 20:50:19 -0000 On 11/20/18 9:07 PM, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: zeising (doc,ports committer) >> Date: Tue Nov 20 19:37:09 2018 >> New Revision: 340695 >> URL: https://svnweb.freebsd.org/changeset/base/340695 >> >> Log: >> MFC r340387: Add evdev support to amd64 and i386 >> >> This merge is done sans sys/i386/conf/MINIMAL, since that doesn't exist in >> stable/12, only current. > > Could you do me a favor and track down why MINIMAL has > not be mfc'ed? And if there is not a good reason for > it to not be MFC'ed see that it does get done. > I asked about it cem (the original author of i386/conf/MINIMAL) about it here: https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172337.html The reply is here: https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172353.html Regards -- Niclas Zeising From owner-svn-src-stable-12@freebsd.org Tue Nov 20 21:35:30 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06744113EC39; Tue, 20 Nov 2018 21:35:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A52C684F7F; Tue, 20 Nov 2018 21:35:29 +0000 (UTC) (envelope-from jkim@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BB8E16FB1; Tue, 20 Nov 2018 21:35:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKLZT2a046073; Tue, 20 Nov 2018 21:35:29 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKLZLwh046031; Tue, 20 Nov 2018 21:35:21 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811202135.wAKLZLwh046031@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 21:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340705 - in stable/12: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/async/arch crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypt... X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in stable/12: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/async/arch crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/bn/asm crypto/openssl/c... X-SVN-Commit-Revision: 340705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A52C684F7F X-Spamd-Result: default: False [0.86 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.02)[0.022,0]; NEURAL_SPAM_MEDIUM(0.24)[0.240,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.60)[0.595,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 21:35:30 -0000 Author: jkim Date: Tue Nov 20 21:35:20 2018 New Revision: 340705 URL: https://svnweb.freebsd.org/changeset/base/340705 Log: MFC: r340703 Merge OpenSSL 1.1.1a. Added: stable/12/crypto/openssl/crypto/getenv.c - copied unchanged from r340703, head/crypto/openssl/crypto/getenv.c stable/12/crypto/openssl/doc/man3/SSL_get_peer_tmp_key.pod - copied unchanged from r340703, head/crypto/openssl/doc/man3/SSL_get_peer_tmp_key.pod stable/12/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 - copied unchanged from r340703, head/secure/lib/libcrypto/man/SSL_get_peer_tmp_key.3 Deleted: stable/12/crypto/openssl/doc/man3/SSL_CTX_set_client_CA_list.pod stable/12/crypto/openssl/doc/man3/SSL_get_client_CA_list.pod stable/12/crypto/openssl/doc/man3/SSL_get_server_tmp_key.pod stable/12/secure/lib/libcrypto/man/SSL_CTX_set_client_CA_list.3 stable/12/secure/lib/libcrypto/man/SSL_get_client_CA_list.3 stable/12/secure/lib/libcrypto/man/SSL_get_server_tmp_key.3 Modified: stable/12/crypto/openssl/CHANGES stable/12/crypto/openssl/Configure stable/12/crypto/openssl/INSTALL stable/12/crypto/openssl/NEWS stable/12/crypto/openssl/README stable/12/crypto/openssl/apps/app_rand.c stable/12/crypto/openssl/apps/apps.c stable/12/crypto/openssl/apps/apps.h stable/12/crypto/openssl/apps/ca.c stable/12/crypto/openssl/apps/ocsp.c stable/12/crypto/openssl/apps/openssl.cnf stable/12/crypto/openssl/apps/opt.c stable/12/crypto/openssl/apps/rehash.c stable/12/crypto/openssl/apps/rsa.c stable/12/crypto/openssl/apps/s_cb.c stable/12/crypto/openssl/apps/s_server.c stable/12/crypto/openssl/apps/speed.c stable/12/crypto/openssl/apps/x509.c stable/12/crypto/openssl/crypto/LPdir_unix.c stable/12/crypto/openssl/crypto/async/arch/async_posix.h stable/12/crypto/openssl/crypto/bio/b_sock2.c stable/12/crypto/openssl/crypto/bio/bio_lib.c stable/12/crypto/openssl/crypto/bio/bss_log.c stable/12/crypto/openssl/crypto/bn/asm/x86_64-gcc.c stable/12/crypto/openssl/crypto/bn/bn_exp.c stable/12/crypto/openssl/crypto/bn/bn_lib.c stable/12/crypto/openssl/crypto/build.info stable/12/crypto/openssl/crypto/conf/conf_api.c stable/12/crypto/openssl/crypto/conf/conf_mod.c stable/12/crypto/openssl/crypto/cryptlib.c stable/12/crypto/openssl/crypto/ct/ct_log.c stable/12/crypto/openssl/crypto/dsa/dsa_gen.c stable/12/crypto/openssl/crypto/dsa/dsa_ossl.c stable/12/crypto/openssl/crypto/ec/ec_ameth.c stable/12/crypto/openssl/crypto/ec/ec_mult.c stable/12/crypto/openssl/crypto/ec/ec_pmeth.c stable/12/crypto/openssl/crypto/ec/ecdh_kdf.c stable/12/crypto/openssl/crypto/engine/eng_devcrypto.c stable/12/crypto/openssl/crypto/engine/eng_list.c stable/12/crypto/openssl/crypto/err/openssl.txt stable/12/crypto/openssl/crypto/evp/e_aes.c stable/12/crypto/openssl/crypto/evp/e_rc2.c stable/12/crypto/openssl/crypto/evp/pmeth_lib.c stable/12/crypto/openssl/crypto/include/internal/ec_int.h stable/12/crypto/openssl/crypto/include/internal/rand_int.h stable/12/crypto/openssl/crypto/kdf/hkdf.c stable/12/crypto/openssl/crypto/mem_sec.c stable/12/crypto/openssl/crypto/o_fopen.c stable/12/crypto/openssl/crypto/pkcs12/p12_mutl.c stable/12/crypto/openssl/crypto/poly1305/poly1305_ieee754.c stable/12/crypto/openssl/crypto/rand/drbg_ctr.c stable/12/crypto/openssl/crypto/rand/drbg_lib.c stable/12/crypto/openssl/crypto/rand/rand_err.c stable/12/crypto/openssl/crypto/rand/rand_lcl.h stable/12/crypto/openssl/crypto/rand/rand_lib.c stable/12/crypto/openssl/crypto/rand/rand_unix.c stable/12/crypto/openssl/crypto/rand/randfile.c stable/12/crypto/openssl/crypto/rsa/rsa_lib.c stable/12/crypto/openssl/crypto/rsa/rsa_meth.c stable/12/crypto/openssl/crypto/rsa/rsa_ossl.c stable/12/crypto/openssl/crypto/sha/asm/keccak1600-s390x.pl stable/12/crypto/openssl/crypto/sha/asm/sha512p8-ppc.pl stable/12/crypto/openssl/crypto/siphash/siphash.c stable/12/crypto/openssl/crypto/sm2/sm2_crypt.c stable/12/crypto/openssl/crypto/sm2/sm2_sign.c stable/12/crypto/openssl/crypto/ui/ui_openssl.c stable/12/crypto/openssl/crypto/x509/by_dir.c stable/12/crypto/openssl/crypto/x509/by_file.c stable/12/crypto/openssl/crypto/x509/x509_vfy.c stable/12/crypto/openssl/doc/man1/ca.pod stable/12/crypto/openssl/doc/man1/enc.pod stable/12/crypto/openssl/doc/man1/openssl.pod stable/12/crypto/openssl/doc/man1/req.pod stable/12/crypto/openssl/doc/man1/rsa.pod stable/12/crypto/openssl/doc/man1/s_server.pod stable/12/crypto/openssl/doc/man1/storeutl.pod stable/12/crypto/openssl/doc/man1/x509.pod stable/12/crypto/openssl/doc/man3/DES_random_key.pod stable/12/crypto/openssl/doc/man3/EVP_DigestInit.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_CTX_ctrl.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_hkdf_md.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_CTX_set_rsa_pss_keygen_md.pod stable/12/crypto/openssl/doc/man3/EVP_PKEY_set1_RSA.pod stable/12/crypto/openssl/doc/man3/EVP_aes.pod stable/12/crypto/openssl/doc/man3/EVP_aria.pod stable/12/crypto/openssl/doc/man3/EVP_bf_cbc.pod stable/12/crypto/openssl/doc/man3/EVP_camellia.pod stable/12/crypto/openssl/doc/man3/EVP_cast5_cbc.pod stable/12/crypto/openssl/doc/man3/EVP_des.pod stable/12/crypto/openssl/doc/man3/EVP_idea_cbc.pod stable/12/crypto/openssl/doc/man3/EVP_md5.pod stable/12/crypto/openssl/doc/man3/EVP_rc2_cbc.pod stable/12/crypto/openssl/doc/man3/EVP_rc5_32_12_16_cbc.pod stable/12/crypto/openssl/doc/man3/EVP_seed_cbc.pod stable/12/crypto/openssl/doc/man3/EVP_sm4_cbc.pod stable/12/crypto/openssl/doc/man3/OPENSSL_VERSION_NUMBER.pod stable/12/crypto/openssl/doc/man3/RSA_meth_new.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_set0_CA_list.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_set1_curves.pod stable/12/crypto/openssl/doc/man3/SSL_CTX_set_quiet_shutdown.pod stable/12/crypto/openssl/doc/man3/SSL_get_error.pod stable/12/crypto/openssl/doc/man3/SSL_get_peer_signature_nid.pod stable/12/crypto/openssl/doc/man3/SSL_set_bio.pod stable/12/crypto/openssl/doc/man3/SSL_set_shutdown.pod stable/12/crypto/openssl/doc/man3/SSL_shutdown.pod stable/12/crypto/openssl/doc/man7/RAND_DRBG.pod stable/12/crypto/openssl/e_os.h stable/12/crypto/openssl/include/internal/cryptlib.h stable/12/crypto/openssl/include/internal/tsan_assist.h stable/12/crypto/openssl/include/openssl/cryptoerr.h stable/12/crypto/openssl/include/openssl/ec.h stable/12/crypto/openssl/include/openssl/ocsp.h stable/12/crypto/openssl/include/openssl/opensslv.h stable/12/crypto/openssl/include/openssl/rand_drbg.h stable/12/crypto/openssl/include/openssl/randerr.h stable/12/crypto/openssl/include/openssl/rsa.h stable/12/crypto/openssl/include/openssl/ssl.h stable/12/crypto/openssl/include/openssl/symhacks.h stable/12/crypto/openssl/include/openssl/tls1.h stable/12/crypto/openssl/ssl/d1_lib.c stable/12/crypto/openssl/ssl/record/rec_layer_d1.c stable/12/crypto/openssl/ssl/record/record.h stable/12/crypto/openssl/ssl/record/record_locl.h stable/12/crypto/openssl/ssl/record/ssl3_record.c stable/12/crypto/openssl/ssl/s3_cbc.c stable/12/crypto/openssl/ssl/s3_enc.c stable/12/crypto/openssl/ssl/s3_lib.c stable/12/crypto/openssl/ssl/ssl_cert.c stable/12/crypto/openssl/ssl/ssl_ciph.c stable/12/crypto/openssl/ssl/ssl_lib.c stable/12/crypto/openssl/ssl/ssl_locl.h stable/12/crypto/openssl/ssl/statem/extensions.c stable/12/crypto/openssl/ssl/statem/extensions_clnt.c stable/12/crypto/openssl/ssl/statem/statem.c stable/12/crypto/openssl/ssl/statem/statem_clnt.c stable/12/crypto/openssl/ssl/statem/statem_lib.c stable/12/crypto/openssl/ssl/statem/statem_locl.h stable/12/crypto/openssl/ssl/statem/statem_srvr.c stable/12/crypto/openssl/ssl/t1_lib.c stable/12/crypto/openssl/ssl/tls13_enc.c stable/12/secure/lib/libcrypto/Makefile stable/12/secure/lib/libcrypto/Makefile.inc stable/12/secure/lib/libcrypto/Makefile.man stable/12/secure/lib/libcrypto/man/ADMISSIONS.3 stable/12/secure/lib/libcrypto/man/ASN1_INTEGER_get_int64.3 stable/12/secure/lib/libcrypto/man/ASN1_ITEM_lookup.3 stable/12/secure/lib/libcrypto/man/ASN1_OBJECT_new.3 stable/12/secure/lib/libcrypto/man/ASN1_STRING_TABLE_add.3 stable/12/secure/lib/libcrypto/man/ASN1_STRING_length.3 stable/12/secure/lib/libcrypto/man/ASN1_STRING_new.3 stable/12/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3 stable/12/secure/lib/libcrypto/man/ASN1_TIME_set.3 stable/12/secure/lib/libcrypto/man/ASN1_TYPE_get.3 stable/12/secure/lib/libcrypto/man/ASN1_generate_nconf.3 stable/12/secure/lib/libcrypto/man/ASYNC_WAIT_CTX_new.3 stable/12/secure/lib/libcrypto/man/ASYNC_start_job.3 stable/12/secure/lib/libcrypto/man/BF_encrypt.3 stable/12/secure/lib/libcrypto/man/BIO_ADDR.3 stable/12/secure/lib/libcrypto/man/BIO_ADDRINFO.3 stable/12/secure/lib/libcrypto/man/BIO_connect.3 stable/12/secure/lib/libcrypto/man/BIO_ctrl.3 stable/12/secure/lib/libcrypto/man/BIO_f_base64.3 stable/12/secure/lib/libcrypto/man/BIO_f_buffer.3 stable/12/secure/lib/libcrypto/man/BIO_f_cipher.3 stable/12/secure/lib/libcrypto/man/BIO_f_md.3 stable/12/secure/lib/libcrypto/man/BIO_f_null.3 stable/12/secure/lib/libcrypto/man/BIO_f_ssl.3 stable/12/secure/lib/libcrypto/man/BIO_find_type.3 stable/12/secure/lib/libcrypto/man/BIO_get_data.3 stable/12/secure/lib/libcrypto/man/BIO_get_ex_new_index.3 stable/12/secure/lib/libcrypto/man/BIO_meth_new.3 stable/12/secure/lib/libcrypto/man/BIO_new.3 stable/12/secure/lib/libcrypto/man/BIO_new_CMS.3 stable/12/secure/lib/libcrypto/man/BIO_parse_hostserv.3 stable/12/secure/lib/libcrypto/man/BIO_printf.3 stable/12/secure/lib/libcrypto/man/BIO_push.3 stable/12/secure/lib/libcrypto/man/BIO_read.3 stable/12/secure/lib/libcrypto/man/BIO_s_accept.3 stable/12/secure/lib/libcrypto/man/BIO_s_bio.3 stable/12/secure/lib/libcrypto/man/BIO_s_connect.3 stable/12/secure/lib/libcrypto/man/BIO_s_fd.3 stable/12/secure/lib/libcrypto/man/BIO_s_file.3 stable/12/secure/lib/libcrypto/man/BIO_s_mem.3 stable/12/secure/lib/libcrypto/man/BIO_s_null.3 stable/12/secure/lib/libcrypto/man/BIO_s_socket.3 stable/12/secure/lib/libcrypto/man/BIO_set_callback.3 stable/12/secure/lib/libcrypto/man/BIO_should_retry.3 stable/12/secure/lib/libcrypto/man/BN_BLINDING_new.3 stable/12/secure/lib/libcrypto/man/BN_CTX_new.3 stable/12/secure/lib/libcrypto/man/BN_CTX_start.3 stable/12/secure/lib/libcrypto/man/BN_add.3 stable/12/secure/lib/libcrypto/man/BN_add_word.3 stable/12/secure/lib/libcrypto/man/BN_bn2bin.3 stable/12/secure/lib/libcrypto/man/BN_cmp.3 stable/12/secure/lib/libcrypto/man/BN_copy.3 stable/12/secure/lib/libcrypto/man/BN_generate_prime.3 stable/12/secure/lib/libcrypto/man/BN_mod_inverse.3 stable/12/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3 stable/12/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3 stable/12/secure/lib/libcrypto/man/BN_new.3 stable/12/secure/lib/libcrypto/man/BN_num_bytes.3 stable/12/secure/lib/libcrypto/man/BN_rand.3 stable/12/secure/lib/libcrypto/man/BN_security_bits.3 stable/12/secure/lib/libcrypto/man/BN_set_bit.3 stable/12/secure/lib/libcrypto/man/BN_swap.3 stable/12/secure/lib/libcrypto/man/BN_zero.3 stable/12/secure/lib/libcrypto/man/BUF_MEM_new.3 stable/12/secure/lib/libcrypto/man/CMS_add0_cert.3 stable/12/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3 stable/12/secure/lib/libcrypto/man/CMS_add1_signer.3 stable/12/secure/lib/libcrypto/man/CMS_compress.3 stable/12/secure/lib/libcrypto/man/CMS_decrypt.3 stable/12/secure/lib/libcrypto/man/CMS_encrypt.3 stable/12/secure/lib/libcrypto/man/CMS_final.3 stable/12/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3 stable/12/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3 stable/12/secure/lib/libcrypto/man/CMS_get0_type.3 stable/12/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3 stable/12/secure/lib/libcrypto/man/CMS_sign.3 stable/12/secure/lib/libcrypto/man/CMS_sign_receipt.3 stable/12/secure/lib/libcrypto/man/CMS_uncompress.3 stable/12/secure/lib/libcrypto/man/CMS_verify.3 stable/12/secure/lib/libcrypto/man/CMS_verify_receipt.3 stable/12/secure/lib/libcrypto/man/CONF_modules_free.3 stable/12/secure/lib/libcrypto/man/CONF_modules_load_file.3 stable/12/secure/lib/libcrypto/man/CRYPTO_THREAD_run_once.3 stable/12/secure/lib/libcrypto/man/CRYPTO_get_ex_new_index.3 stable/12/secure/lib/libcrypto/man/CTLOG_STORE_get0_log_by_id.3 stable/12/secure/lib/libcrypto/man/CTLOG_STORE_new.3 stable/12/secure/lib/libcrypto/man/CTLOG_new.3 stable/12/secure/lib/libcrypto/man/CT_POLICY_EVAL_CTX_new.3 stable/12/secure/lib/libcrypto/man/DEFINE_STACK_OF.3 stable/12/secure/lib/libcrypto/man/DES_random_key.3 stable/12/secure/lib/libcrypto/man/DH_generate_key.3 stable/12/secure/lib/libcrypto/man/DH_generate_parameters.3 stable/12/secure/lib/libcrypto/man/DH_get0_pqg.3 stable/12/secure/lib/libcrypto/man/DH_get_1024_160.3 stable/12/secure/lib/libcrypto/man/DH_meth_new.3 stable/12/secure/lib/libcrypto/man/DH_new.3 stable/12/secure/lib/libcrypto/man/DH_new_by_nid.3 stable/12/secure/lib/libcrypto/man/DH_set_method.3 stable/12/secure/lib/libcrypto/man/DH_size.3 stable/12/secure/lib/libcrypto/man/DSA_SIG_new.3 stable/12/secure/lib/libcrypto/man/DSA_do_sign.3 stable/12/secure/lib/libcrypto/man/DSA_dup_DH.3 stable/12/secure/lib/libcrypto/man/DSA_generate_key.3 stable/12/secure/lib/libcrypto/man/DSA_generate_parameters.3 stable/12/secure/lib/libcrypto/man/DSA_get0_pqg.3 stable/12/secure/lib/libcrypto/man/DSA_meth_new.3 stable/12/secure/lib/libcrypto/man/DSA_new.3 stable/12/secure/lib/libcrypto/man/DSA_set_method.3 stable/12/secure/lib/libcrypto/man/DSA_sign.3 stable/12/secure/lib/libcrypto/man/DSA_size.3 stable/12/secure/lib/libcrypto/man/DTLS_get_data_mtu.3 stable/12/secure/lib/libcrypto/man/DTLS_set_timer_cb.3 stable/12/secure/lib/libcrypto/man/DTLSv1_listen.3 stable/12/secure/lib/libcrypto/man/ECDSA_SIG_new.3 stable/12/secure/lib/libcrypto/man/ECPKParameters_print.3 stable/12/secure/lib/libcrypto/man/EC_GFp_simple_method.3 stable/12/secure/lib/libcrypto/man/EC_GROUP_copy.3 stable/12/secure/lib/libcrypto/man/EC_GROUP_new.3 stable/12/secure/lib/libcrypto/man/EC_KEY_get_enc_flags.3 stable/12/secure/lib/libcrypto/man/EC_KEY_new.3 stable/12/secure/lib/libcrypto/man/EC_POINT_add.3 stable/12/secure/lib/libcrypto/man/EC_POINT_new.3 stable/12/secure/lib/libcrypto/man/ENGINE_add.3 stable/12/secure/lib/libcrypto/man/ERR_GET_LIB.3 stable/12/secure/lib/libcrypto/man/ERR_clear_error.3 stable/12/secure/lib/libcrypto/man/ERR_error_string.3 stable/12/secure/lib/libcrypto/man/ERR_get_error.3 stable/12/secure/lib/libcrypto/man/ERR_load_crypto_strings.3 stable/12/secure/lib/libcrypto/man/ERR_load_strings.3 stable/12/secure/lib/libcrypto/man/ERR_print_errors.3 stable/12/secure/lib/libcrypto/man/ERR_put_error.3 stable/12/secure/lib/libcrypto/man/ERR_remove_state.3 stable/12/secure/lib/libcrypto/man/ERR_set_mark.3 stable/12/secure/lib/libcrypto/man/EVP_BytesToKey.3 stable/12/secure/lib/libcrypto/man/EVP_CIPHER_CTX_get_cipher_data.3 stable/12/secure/lib/libcrypto/man/EVP_CIPHER_meth_new.3 stable/12/secure/lib/libcrypto/man/EVP_DigestInit.3 stable/12/secure/lib/libcrypto/man/EVP_DigestSignInit.3 stable/12/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3 stable/12/secure/lib/libcrypto/man/EVP_EncodeInit.3 stable/12/secure/lib/libcrypto/man/EVP_EncryptInit.3 stable/12/secure/lib/libcrypto/man/EVP_MD_meth_new.3 stable/12/secure/lib/libcrypto/man/EVP_OpenInit.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_ASN1_METHOD.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set1_pbe_pass.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_rsa_pss_keygen_md.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_scrypt_N.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_CTX_set_tls1_prf_md.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_asn1_get_count.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_cmp.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_derive.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest_nid.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_keygen.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_meth_get_count.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_new.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_print_private.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_sign.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_verify.3 stable/12/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3 stable/12/secure/lib/libcrypto/man/EVP_SealInit.3 stable/12/secure/lib/libcrypto/man/EVP_SignInit.3 stable/12/secure/lib/libcrypto/man/EVP_VerifyInit.3 stable/12/secure/lib/libcrypto/man/EVP_aes.3 stable/12/secure/lib/libcrypto/man/EVP_aria.3 stable/12/secure/lib/libcrypto/man/EVP_bf_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_blake2b512.3 stable/12/secure/lib/libcrypto/man/EVP_camellia.3 stable/12/secure/lib/libcrypto/man/EVP_cast5_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_chacha20.3 stable/12/secure/lib/libcrypto/man/EVP_des.3 stable/12/secure/lib/libcrypto/man/EVP_desx_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_idea_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_md2.3 stable/12/secure/lib/libcrypto/man/EVP_md4.3 stable/12/secure/lib/libcrypto/man/EVP_md5.3 stable/12/secure/lib/libcrypto/man/EVP_mdc2.3 stable/12/secure/lib/libcrypto/man/EVP_rc2_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_rc4.3 stable/12/secure/lib/libcrypto/man/EVP_rc5_32_12_16_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_ripemd160.3 stable/12/secure/lib/libcrypto/man/EVP_seed_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_sha1.3 stable/12/secure/lib/libcrypto/man/EVP_sha224.3 stable/12/secure/lib/libcrypto/man/EVP_sha3_224.3 stable/12/secure/lib/libcrypto/man/EVP_sm3.3 stable/12/secure/lib/libcrypto/man/EVP_sm4_cbc.3 stable/12/secure/lib/libcrypto/man/EVP_whirlpool.3 stable/12/secure/lib/libcrypto/man/HMAC.3 stable/12/secure/lib/libcrypto/man/MD5.3 stable/12/secure/lib/libcrypto/man/MDC2_Init.3 stable/12/secure/lib/libcrypto/man/OBJ_nid2obj.3 stable/12/secure/lib/libcrypto/man/OCSP_REQUEST_new.3 stable/12/secure/lib/libcrypto/man/OCSP_cert_to_id.3 stable/12/secure/lib/libcrypto/man/OCSP_request_add1_nonce.3 stable/12/secure/lib/libcrypto/man/OCSP_resp_find_status.3 stable/12/secure/lib/libcrypto/man/OCSP_response_status.3 stable/12/secure/lib/libcrypto/man/OCSP_sendreq_new.3 stable/12/secure/lib/libcrypto/man/OPENSSL_Applink.3 stable/12/secure/lib/libcrypto/man/OPENSSL_LH_COMPFUNC.3 stable/12/secure/lib/libcrypto/man/OPENSSL_LH_stats.3 stable/12/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3 stable/12/secure/lib/libcrypto/man/OPENSSL_config.3 stable/12/secure/lib/libcrypto/man/OPENSSL_fork_prepare.3 stable/12/secure/lib/libcrypto/man/OPENSSL_ia32cap.3 stable/12/secure/lib/libcrypto/man/OPENSSL_init_crypto.3 stable/12/secure/lib/libcrypto/man/OPENSSL_init_ssl.3 stable/12/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3 stable/12/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3 stable/12/secure/lib/libcrypto/man/OPENSSL_malloc.3 stable/12/secure/lib/libcrypto/man/OPENSSL_secure_malloc.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_INFO.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_LOADER.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_SEARCH.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_expect.3 stable/12/secure/lib/libcrypto/man/OSSL_STORE_open.3 stable/12/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3 stable/12/secure/lib/libcrypto/man/PEM_bytes_read_bio.3 stable/12/secure/lib/libcrypto/man/PEM_read.3 stable/12/secure/lib/libcrypto/man/PEM_read_CMS.3 stable/12/secure/lib/libcrypto/man/PEM_read_bio_PrivateKey.3 stable/12/secure/lib/libcrypto/man/PEM_read_bio_ex.3 stable/12/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3 stable/12/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3 stable/12/secure/lib/libcrypto/man/PKCS12_create.3 stable/12/secure/lib/libcrypto/man/PKCS12_newpass.3 stable/12/secure/lib/libcrypto/man/PKCS12_parse.3 stable/12/secure/lib/libcrypto/man/PKCS5_PBKDF2_HMAC.3 stable/12/secure/lib/libcrypto/man/PKCS7_decrypt.3 stable/12/secure/lib/libcrypto/man/PKCS7_encrypt.3 stable/12/secure/lib/libcrypto/man/PKCS7_sign.3 stable/12/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3 stable/12/secure/lib/libcrypto/man/PKCS7_verify.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_generate.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_get0_master.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_new.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_reseed.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_set_callbacks.3 stable/12/secure/lib/libcrypto/man/RAND_DRBG_set_ex_data.3 stable/12/secure/lib/libcrypto/man/RAND_add.3 stable/12/secure/lib/libcrypto/man/RAND_bytes.3 stable/12/secure/lib/libcrypto/man/RAND_cleanup.3 stable/12/secure/lib/libcrypto/man/RAND_egd.3 stable/12/secure/lib/libcrypto/man/RAND_load_file.3 stable/12/secure/lib/libcrypto/man/RAND_set_rand_method.3 stable/12/secure/lib/libcrypto/man/RC4_set_key.3 stable/12/secure/lib/libcrypto/man/RIPEMD160_Init.3 stable/12/secure/lib/libcrypto/man/RSA_blinding_on.3 stable/12/secure/lib/libcrypto/man/RSA_check_key.3 stable/12/secure/lib/libcrypto/man/RSA_generate_key.3 stable/12/secure/lib/libcrypto/man/RSA_get0_key.3 stable/12/secure/lib/libcrypto/man/RSA_meth_new.3 stable/12/secure/lib/libcrypto/man/RSA_new.3 stable/12/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3 stable/12/secure/lib/libcrypto/man/RSA_print.3 stable/12/secure/lib/libcrypto/man/RSA_private_encrypt.3 stable/12/secure/lib/libcrypto/man/RSA_public_encrypt.3 stable/12/secure/lib/libcrypto/man/RSA_set_method.3 stable/12/secure/lib/libcrypto/man/RSA_sign.3 stable/12/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3 stable/12/secure/lib/libcrypto/man/RSA_size.3 stable/12/secure/lib/libcrypto/man/SCT_new.3 stable/12/secure/lib/libcrypto/man/SCT_print.3 stable/12/secure/lib/libcrypto/man/SCT_validate.3 stable/12/secure/lib/libcrypto/man/SHA256_Init.3 stable/12/secure/lib/libcrypto/man/SMIME_read_CMS.3 stable/12/secure/lib/libcrypto/man/SMIME_read_PKCS7.3 stable/12/secure/lib/libcrypto/man/SMIME_write_CMS.3 stable/12/secure/lib/libcrypto/man/SMIME_write_PKCS7.3 stable/12/secure/lib/libcrypto/man/SSL_CIPHER_get_name.3 stable/12/secure/lib/libcrypto/man/SSL_COMP_add_compression_method.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_CTX_new.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_CTX_set1_prefix.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_CTX_set_flags.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_CTX_set_ssl_ctx.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_cmd.3 stable/12/secure/lib/libcrypto/man/SSL_CONF_cmd_argv.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_add1_chain_cert.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_add_extra_chain_cert.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_add_session.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_config.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_ctrl.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_dane_enable.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_flush_sessions.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_free.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_get0_param.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_get_verify_mode.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_has_client_custom_ext.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_load_verify_locations.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_new.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_sess_number.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_sess_set_cache_size.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_sess_set_get_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_sessions.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set0_CA_list.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set1_curves.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set1_sigalgs.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set1_verify_cert_store.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_alpn_select_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_cert_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_cert_store.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_cert_verify_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_cipher_list.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_client_cert_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_client_hello_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_ct_validation_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_ctlog_list_file.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_default_passwd_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_ex_data.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_generate_session_id.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_info_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_keylog_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_max_cert_list.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_min_proto_version.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_mode.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_msg_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_num_tickets.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_options.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_psk_client_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_quiet_shutdown.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_read_ahead.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_record_padding_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_security_level.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_session_cache_mode.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_session_id_context.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_session_ticket_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_split_send_fragment.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_ssl_version.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_stateless_cookie_generate_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_timeout.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_servername_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_status_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_ticket_key_cb.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tlsext_use_srtp.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_tmp_dh_callback.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_set_verify.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_use_certificate.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_use_psk_identity_hint.3 stable/12/secure/lib/libcrypto/man/SSL_CTX_use_serverinfo.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_free.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get0_cipher.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get0_hostname.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get0_id_context.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get0_peer.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get_compress_id.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get_ex_data.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get_protocol_version.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_get_time.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_has_ticket.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_is_resumable.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_print.3 stable/12/secure/lib/libcrypto/man/SSL_SESSION_set1_id.3 stable/12/secure/lib/libcrypto/man/SSL_accept.3 stable/12/secure/lib/libcrypto/man/SSL_alert_type_string.3 stable/12/secure/lib/libcrypto/man/SSL_alloc_buffers.3 stable/12/secure/lib/libcrypto/man/SSL_check_chain.3 stable/12/secure/lib/libcrypto/man/SSL_clear.3 stable/12/secure/lib/libcrypto/man/SSL_connect.3 stable/12/secure/lib/libcrypto/man/SSL_do_handshake.3 stable/12/secure/lib/libcrypto/man/SSL_export_keying_material.3 stable/12/secure/lib/libcrypto/man/SSL_extension_supported.3 stable/12/secure/lib/libcrypto/man/SSL_free.3 stable/12/secure/lib/libcrypto/man/SSL_get0_peer_scts.3 stable/12/secure/lib/libcrypto/man/SSL_get_SSL_CTX.3 stable/12/secure/lib/libcrypto/man/SSL_get_all_async_fds.3 stable/12/secure/lib/libcrypto/man/SSL_get_ciphers.3 stable/12/secure/lib/libcrypto/man/SSL_get_client_random.3 stable/12/secure/lib/libcrypto/man/SSL_get_current_cipher.3 stable/12/secure/lib/libcrypto/man/SSL_get_default_timeout.3 stable/12/secure/lib/libcrypto/man/SSL_get_error.3 stable/12/secure/lib/libcrypto/man/SSL_get_extms_support.3 stable/12/secure/lib/libcrypto/man/SSL_get_fd.3 stable/12/secure/lib/libcrypto/man/SSL_get_peer_cert_chain.3 stable/12/secure/lib/libcrypto/man/SSL_get_peer_certificate.3 stable/12/secure/lib/libcrypto/man/SSL_get_peer_signature_nid.3 stable/12/secure/lib/libcrypto/man/SSL_get_psk_identity.3 stable/12/secure/lib/libcrypto/man/SSL_get_rbio.3 stable/12/secure/lib/libcrypto/man/SSL_get_session.3 stable/12/secure/lib/libcrypto/man/SSL_get_shared_sigalgs.3 stable/12/secure/lib/libcrypto/man/SSL_get_verify_result.3 stable/12/secure/lib/libcrypto/man/SSL_get_version.3 stable/12/secure/lib/libcrypto/man/SSL_in_init.3 stable/12/secure/lib/libcrypto/man/SSL_key_update.3 stable/12/secure/lib/libcrypto/man/SSL_library_init.3 stable/12/secure/lib/libcrypto/man/SSL_load_client_CA_file.3 stable/12/secure/lib/libcrypto/man/SSL_new.3 stable/12/secure/lib/libcrypto/man/SSL_pending.3 stable/12/secure/lib/libcrypto/man/SSL_read.3 stable/12/secure/lib/libcrypto/man/SSL_read_early_data.3 stable/12/secure/lib/libcrypto/man/SSL_rstate_string.3 stable/12/secure/lib/libcrypto/man/SSL_session_reused.3 stable/12/secure/lib/libcrypto/man/SSL_set1_host.3 stable/12/secure/lib/libcrypto/man/SSL_set_bio.3 stable/12/secure/lib/libcrypto/man/SSL_set_connect_state.3 stable/12/secure/lib/libcrypto/man/SSL_set_fd.3 stable/12/secure/lib/libcrypto/man/SSL_set_session.3 stable/12/secure/lib/libcrypto/man/SSL_set_shutdown.3 stable/12/secure/lib/libcrypto/man/SSL_set_verify_result.3 stable/12/secure/lib/libcrypto/man/SSL_shutdown.3 stable/12/secure/lib/libcrypto/man/SSL_state_string.3 stable/12/secure/lib/libcrypto/man/SSL_want.3 stable/12/secure/lib/libcrypto/man/SSL_write.3 stable/12/secure/lib/libcrypto/man/UI_STRING.3 stable/12/secure/lib/libcrypto/man/UI_UTIL_read_pw.3 stable/12/secure/lib/libcrypto/man/UI_create_method.3 stable/12/secure/lib/libcrypto/man/UI_new.3 stable/12/secure/lib/libcrypto/man/X509V3_get_d2i.3 stable/12/secure/lib/libcrypto/man/X509_ALGOR_dup.3 stable/12/secure/lib/libcrypto/man/X509_CRL_get0_by_serial.3 stable/12/secure/lib/libcrypto/man/X509_EXTENSION_set_object.3 stable/12/secure/lib/libcrypto/man/X509_LOOKUP_hash_dir.3 stable/12/secure/lib/libcrypto/man/X509_LOOKUP_meth_new.3 stable/12/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 stable/12/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3 stable/12/secure/lib/libcrypto/man/X509_NAME_get0_der.3 stable/12/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3 stable/12/secure/lib/libcrypto/man/X509_NAME_print_ex.3 stable/12/secure/lib/libcrypto/man/X509_PUBKEY_new.3 stable/12/secure/lib/libcrypto/man/X509_SIG_get0.3 stable/12/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3 stable/12/secure/lib/libcrypto/man/X509_STORE_CTX_new.3 stable/12/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3 stable/12/secure/lib/libcrypto/man/X509_STORE_add_cert.3 stable/12/secure/lib/libcrypto/man/X509_STORE_get0_param.3 stable/12/secure/lib/libcrypto/man/X509_STORE_new.3 stable/12/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3 stable/12/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 stable/12/secure/lib/libcrypto/man/X509_check_ca.3 stable/12/secure/lib/libcrypto/man/X509_check_host.3 stable/12/secure/lib/libcrypto/man/X509_check_issued.3 stable/12/secure/lib/libcrypto/man/X509_check_private_key.3 stable/12/secure/lib/libcrypto/man/X509_cmp_time.3 stable/12/secure/lib/libcrypto/man/X509_digest.3 stable/12/secure/lib/libcrypto/man/X509_dup.3 stable/12/secure/lib/libcrypto/man/X509_get0_notBefore.3 stable/12/secure/lib/libcrypto/man/X509_get0_signature.3 stable/12/secure/lib/libcrypto/man/X509_get0_uids.3 stable/12/secure/lib/libcrypto/man/X509_get_extension_flags.3 stable/12/secure/lib/libcrypto/man/X509_get_pubkey.3 stable/12/secure/lib/libcrypto/man/X509_get_serialNumber.3 stable/12/secure/lib/libcrypto/man/X509_get_subject_name.3 stable/12/secure/lib/libcrypto/man/X509_get_version.3 stable/12/secure/lib/libcrypto/man/X509_new.3 stable/12/secure/lib/libcrypto/man/X509_sign.3 stable/12/secure/lib/libcrypto/man/X509_verify_cert.3 stable/12/secure/lib/libcrypto/man/X509v3_get_ext_by_NID.3 stable/12/secure/lib/libcrypto/man/d2i_DHparams.3 stable/12/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey_bio.3 stable/12/secure/lib/libcrypto/man/d2i_PrivateKey.3 stable/12/secure/lib/libcrypto/man/d2i_SSL_SESSION.3 stable/12/secure/lib/libcrypto/man/d2i_X509.3 stable/12/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3 stable/12/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3 stable/12/secure/lib/libcrypto/man/i2d_re_X509_tbs.3 stable/12/secure/lib/libcrypto/man/o2i_SCT_LIST.3 stable/12/secure/lib/libssl/Version.map (contents, props changed) stable/12/secure/usr.bin/openssl/man/CA.pl.1 stable/12/secure/usr.bin/openssl/man/asn1parse.1 stable/12/secure/usr.bin/openssl/man/ca.1 stable/12/secure/usr.bin/openssl/man/ciphers.1 stable/12/secure/usr.bin/openssl/man/cms.1 stable/12/secure/usr.bin/openssl/man/crl.1 stable/12/secure/usr.bin/openssl/man/crl2pkcs7.1 stable/12/secure/usr.bin/openssl/man/dgst.1 stable/12/secure/usr.bin/openssl/man/dhparam.1 stable/12/secure/usr.bin/openssl/man/dsa.1 stable/12/secure/usr.bin/openssl/man/dsaparam.1 stable/12/secure/usr.bin/openssl/man/ec.1 stable/12/secure/usr.bin/openssl/man/ecparam.1 stable/12/secure/usr.bin/openssl/man/enc.1 stable/12/secure/usr.bin/openssl/man/engine.1 stable/12/secure/usr.bin/openssl/man/errstr.1 stable/12/secure/usr.bin/openssl/man/gendsa.1 stable/12/secure/usr.bin/openssl/man/genpkey.1 stable/12/secure/usr.bin/openssl/man/genrsa.1 stable/12/secure/usr.bin/openssl/man/list.1 stable/12/secure/usr.bin/openssl/man/nseq.1 stable/12/secure/usr.bin/openssl/man/ocsp.1 stable/12/secure/usr.bin/openssl/man/openssl.1 stable/12/secure/usr.bin/openssl/man/passwd.1 stable/12/secure/usr.bin/openssl/man/pkcs12.1 stable/12/secure/usr.bin/openssl/man/pkcs7.1 stable/12/secure/usr.bin/openssl/man/pkcs8.1 stable/12/secure/usr.bin/openssl/man/pkey.1 stable/12/secure/usr.bin/openssl/man/pkeyparam.1 stable/12/secure/usr.bin/openssl/man/pkeyutl.1 stable/12/secure/usr.bin/openssl/man/prime.1 stable/12/secure/usr.bin/openssl/man/rand.1 stable/12/secure/usr.bin/openssl/man/req.1 stable/12/secure/usr.bin/openssl/man/rsa.1 stable/12/secure/usr.bin/openssl/man/rsautl.1 stable/12/secure/usr.bin/openssl/man/s_client.1 stable/12/secure/usr.bin/openssl/man/s_server.1 stable/12/secure/usr.bin/openssl/man/s_time.1 stable/12/secure/usr.bin/openssl/man/sess_id.1 stable/12/secure/usr.bin/openssl/man/smime.1 stable/12/secure/usr.bin/openssl/man/speed.1 stable/12/secure/usr.bin/openssl/man/spkac.1 stable/12/secure/usr.bin/openssl/man/srp.1 stable/12/secure/usr.bin/openssl/man/storeutl.1 stable/12/secure/usr.bin/openssl/man/ts.1 stable/12/secure/usr.bin/openssl/man/tsget.1 stable/12/secure/usr.bin/openssl/man/verify.1 stable/12/secure/usr.bin/openssl/man/version.1 stable/12/secure/usr.bin/openssl/man/x509.1 Directory Properties: stable/12/ (props changed) stable/12/secure/lib/libcrypto/Version.map (props changed) Modified: stable/12/crypto/openssl/CHANGES ============================================================================== --- stable/12/crypto/openssl/CHANGES Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/CHANGES Tue Nov 20 21:35:20 2018 (r340705) @@ -7,6 +7,42 @@ https://github.com/openssl/openssl/commits/ and pick the appropriate release branch. + Changes between 1.1.1 and 1.1.1a [20 Nov 2018] + + *) Timing vulnerability in DSA signature generation + + The OpenSSL DSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 16th October 2018 by Samuel Weiser. + (CVE-2018-0734) + [Paul Dale] + + *) Timing vulnerability in ECDSA signature generation + + The OpenSSL ECDSA signature algorithm has been shown to be vulnerable to a + timing side channel attack. An attacker could use variations in the signing + algorithm to recover the private key. + + This issue was reported to OpenSSL on 25th October 2018 by Samuel Weiser. + (CVE-2018-0735) + [Paul Dale] + + *) Added EVP_PKEY_ECDH_KDF_X9_63 and ecdh_KDF_X9_63() as replacements for + the EVP_PKEY_ECDH_KDF_X9_62 KDF type and ECDH_KDF_X9_62(). The old names + are retained for backwards compatibility. + [Antoine Salon] + + *) Fixed the issue that RAND_add()/RAND_seed() silently discards random input + if its length exceeds 4096 bytes. The limit has been raised to a buffer size + of two gigabytes and the error handling improved. + + This issue was reported to OpenSSL by Dr. Falko Strenzke. It has been + categorized as a normal bug, not a security issue, because the DRBG reseeds + automatically and is fully functional even without additional randomness + provided by the application. + Changes between 1.1.0i and 1.1.1 [11 Sep 2018] *) Add a new ClientHello callback. Provides a callback interface that gives @@ -13103,4 +13139,3 @@ des-cbc 3624.96k 5258.21k 5530.91k *) A minor bug in ssl/s3_clnt.c where there would always be 4 0 bytes sent in the client random. [Edward Bishop ] - Modified: stable/12/crypto/openssl/Configure ============================================================================== --- stable/12/crypto/openssl/Configure Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/Configure Tue Nov 20 21:35:20 2018 (r340705) @@ -1013,13 +1013,18 @@ if (scalar(@seed_sources) == 0) { if (scalar(grep { $_ eq 'none' } @seed_sources) > 0) { die "Cannot seed with none and anything else" if scalar(@seed_sources) > 1; warn <<_____ if scalar(@seed_sources) == 1; -You have selected the --with-rand-seed=none option, which effectively disables -automatic reseeding of the OpenSSL random generator. All operations depending -on the random generator such as creating keys will not work unless the random -generator is seeded manually by the application. -Please read the 'Note on random number generation' section in the INSTALL -instructions and the RAND_DRBG(7) manual page for more details. +============================== WARNING =============================== +You have selected the --with-rand-seed=none option, which effectively +disables automatic reseeding of the OpenSSL random generator. +All operations depending on the random generator such as creating keys +will not work unless the random generator is seeded manually by the +application. + +Please read the 'Note on random number generation' section in the +INSTALL instructions and the RAND_DRBG(7) manual page for more details. +============================== WARNING =============================== + _____ } push @{$config{openssl_other_defines}}, @@ -2174,6 +2179,16 @@ EOF # Massage the result + # If the user configured no-shared, we allow no shared sources + if ($disabled{shared}) { + foreach (keys %{$unified_info{shared_sources}}) { + foreach (keys %{$unified_info{shared_sources}->{$_}}) { + delete $unified_info{sources}->{$_}; + } + } + $unified_info{shared_sources} = {}; + } + # If we depend on a header file or a perl module, add an inclusion of # its directory to allow smoothe inclusion foreach my $dest (keys %{$unified_info{depends}}) { @@ -2198,8 +2213,8 @@ EOF next unless defined($unified_info{includes}->{$dest}->{$k}); my @incs = reverse @{$unified_info{includes}->{$dest}->{$k}}; foreach my $obj (grep /\.o$/, - (keys %{$unified_info{sources}->{$dest}}, - keys %{$unified_info{shared_sources}->{$dest}})) { + (keys %{$unified_info{sources}->{$dest} // {}}, + keys %{$unified_info{shared_sources}->{$dest} // {}})) { foreach my $inc (@incs) { unshift @{$unified_info{includes}->{$obj}->{$k}}, $inc unless grep { $_ eq $inc } @{$unified_info{includes}->{$obj}->{$k}}; @@ -2238,6 +2253,42 @@ EOF [ @{$unified_info{includes}->{$dest}->{source}} ]; } } + + # For convenience collect information regarding directories where + # files are generated, those generated files and the end product + # they end up in where applicable. Then, add build rules for those + # directories + my %loopinfo = ( "lib" => [ @{$unified_info{libraries}} ], + "dso" => [ @{$unified_info{engines}} ], + "bin" => [ @{$unified_info{programs}} ], + "script" => [ @{$unified_info{scripts}} ] ); + foreach my $type (keys %loopinfo) { + foreach my $product (@{$loopinfo{$type}}) { + my %dirs = (); + my $pd = dirname($product); + + foreach (@{$unified_info{sources}->{$product} // []}, + @{$unified_info{shared_sources}->{$product} // []}) { + my $d = dirname($_); + + # We don't want to create targets for source directories + # when building out of source + next if ($config{sourcedir} ne $config{builddir} + && $d =~ m|^\Q$config{sourcedir}\E|); + # We already have a "test" target, and the current directory + # is just silly to make a target for + next if $d eq "test" || $d eq "."; + + $dirs{$d} = 1; + push @{$unified_info{dirinfo}->{$d}->{deps}}, $_ + if $d ne $pd; + } + foreach (keys %dirs) { + push @{$unified_info{dirinfo}->{$_}->{products}->{$type}}, + $product; + } + } + } } # For the schemes that need it, we provide the old *_obj configs @@ -2712,10 +2763,16 @@ print <<"EOF"; ********************************************************************** *** *** -*** If you want to report a building issue, please include the *** -*** output from this command: *** +*** OpenSSL has been successfully configured *** *** *** -*** perl configdata.pm --dump *** +*** If you encounter a problem while building, please open an *** +*** issue on GitHub *** +*** and include the output from the following command: *** +*** *** +*** perl configdata.pm --dump *** +*** *** +*** (If you are new to OpenSSL, you might want to consult the *** +*** 'Troubleshooting' section in the INSTALL file first) *** *** *** ********************************************************************** EOF Modified: stable/12/crypto/openssl/INSTALL ============================================================================== --- stable/12/crypto/openssl/INSTALL Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/INSTALL Tue Nov 20 21:35:20 2018 (r340705) @@ -614,8 +614,8 @@ Windows, and as a comma separated list of libraries on VMS. RANLIB The library archive indexer. - RC The Windows resources manipulator. - RCFLAGS Flags for the Windows reources manipulator. + RC The Windows resource compiler. + RCFLAGS Flags for the Windows resource compiler. RM The command to remove files and directories. These cannot be mixed with compiling / linking flags given @@ -969,7 +969,7 @@ BUILDFILE Use a different build file name than the platform default - ("Makefile" on Unixly platforms, "makefile" on native Windows, + ("Makefile" on Unix-like platforms, "makefile" on native Windows, "descrip.mms" on OpenVMS). This requires that there is a corresponding build file template. See Configurations/README for further information. @@ -1171,7 +1171,7 @@ part of the file name, i.e. for OpenSSL 1.1.x, 1.1 is somehow part of the name. - On most POSIXly platforms, shared libraries are named libcrypto.so.1.1 + On most POSIX platforms, shared libraries are named libcrypto.so.1.1 and libssl.so.1.1. on Cygwin, shared libraries are named cygcrypto-1.1.dll and cygssl-1.1.dll @@ -1202,7 +1202,7 @@ The seeding method can be configured using the --with-rand-seed option, which can be used to specify a comma separated list of seed methods. However in most cases OpenSSL will choose a suitable default method, - so it is not necessary to explicitely provide this option. Note also + so it is not necessary to explicitly provide this option. Note also that not all methods are available on all platforms. I) On operating systems which provide a suitable randomness source (in Modified: stable/12/crypto/openssl/NEWS ============================================================================== --- stable/12/crypto/openssl/NEWS Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/NEWS Tue Nov 20 21:35:20 2018 (r340705) @@ -5,6 +5,11 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.1.1 and OpenSSL 1.1.1a [20 Nov 2018] + + o Timing vulnerability in DSA signature generation (CVE-2018-0734) + o Timing vulnerability in ECDSA signature generation (CVE-2018-0735) + Major changes between OpenSSL 1.1.0i and OpenSSL 1.1.1 [11 Sep 2018] o Support for TLSv1.3 added (see https://wiki.openssl.org/index.php/TLS1.3 Modified: stable/12/crypto/openssl/README ============================================================================== --- stable/12/crypto/openssl/README Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/README Tue Nov 20 21:35:20 2018 (r340705) @@ -1,5 +1,5 @@ - OpenSSL 1.1.1 11 Sep 2018 + OpenSSL 1.1.1a 20 Nov 2018 Copyright (c) 1998-2018 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson Modified: stable/12/crypto/openssl/apps/app_rand.c ============================================================================== --- stable/12/crypto/openssl/apps/app_rand.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/app_rand.c Tue Nov 20 21:35:20 2018 (r340705) @@ -1,5 +1,5 @@ /* - * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -26,7 +26,6 @@ void app_RAND_load_conf(CONF *c, const char *section) if (RAND_load_file(randfile, -1) < 0) { BIO_printf(bio_err, "Can't load %s into RNG\n", randfile); ERR_print_errors(bio_err); - return; } if (save_rand_file == NULL) save_rand_file = OPENSSL_strdup(randfile); Modified: stable/12/crypto/openssl/apps/apps.c ============================================================================== --- stable/12/crypto/openssl/apps/apps.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/apps.c Tue Nov 20 21:35:20 2018 (r340705) @@ -1831,6 +1831,12 @@ X509_NAME *parse_name(const char *cp, long chtype, int opt_getprog(), typestr); continue; } + if (*valstr == '\0') { + BIO_printf(bio_err, + "%s: No value provided for Subject Attribute %s, skipped\n", + opt_getprog(), typestr); + continue; + } if (!X509_NAME_add_entry_by_NID(n, nid, chtype, valstr, strlen((char *)valstr), -1, ismulti ? -1 : 0)) Modified: stable/12/crypto/openssl/apps/apps.h ============================================================================== --- stable/12/crypto/openssl/apps/apps.h Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/apps.h Tue Nov 20 21:35:20 2018 (r340705) @@ -369,7 +369,7 @@ typedef struct string_int_pair_st { # define OPT_FMT_SMIME (1L << 3) # define OPT_FMT_ENGINE (1L << 4) # define OPT_FMT_MSBLOB (1L << 5) -# define OPT_FMT_NETSCAPE (1L << 6) +/* (1L << 6) was OPT_FMT_NETSCAPE, but wasn't used */ # define OPT_FMT_NSS (1L << 7) # define OPT_FMT_TEXT (1L << 8) # define OPT_FMT_HTTP (1L << 9) @@ -378,8 +378,8 @@ typedef struct string_int_pair_st { # define OPT_FMT_PDS (OPT_FMT_PEMDER | OPT_FMT_SMIME) # define OPT_FMT_ANY ( \ OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_SMIME | \ - OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NETSCAPE | \ - OPT_FMT_NSS | OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) + OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NSS | \ + OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) char *opt_progname(const char *argv0); char *opt_getprog(void); Modified: stable/12/crypto/openssl/apps/ca.c ============================================================================== --- stable/12/crypto/openssl/apps/ca.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/ca.c Tue Nov 20 21:35:20 2018 (r340705) @@ -605,7 +605,7 @@ end_of_options: /* * outdir is a directory spec, but access() for VMS demands a * filename. We could use the DEC C routine to convert the - * directory syntax to Unixly, and give that to app_isdir, + * directory syntax to Unix, and give that to app_isdir, * but for now the fopen will catch the error if it's not a * directory */ @@ -976,7 +976,7 @@ end_of_options: BIO_printf(bio_err, "Write out database with %d new entries\n", sk_X509_num(cert_sk)); - if (!rand_ser + if (serialfile != NULL && !save_serial(serialfile, "new", serial, NULL)) goto end; @@ -1044,7 +1044,8 @@ end_of_options: if (sk_X509_num(cert_sk)) { /* Rename the database and the serial file */ - if (!rotate_serial(serialfile, "new", "old")) + if (serialfile != NULL + && !rotate_serial(serialfile, "new", "old")) goto end; if (!rotate_index(dbfile, "new", "old")) @@ -1177,10 +1178,9 @@ end_of_options: } /* we have a CRL number that need updating */ - if (crlnumberfile != NULL) - if (!rand_ser - && !save_serial(crlnumberfile, "new", crlnumber, NULL)) - goto end; + if (crlnumberfile != NULL + && !save_serial(crlnumberfile, "new", crlnumber, NULL)) + goto end; BN_free(crlnumber); crlnumber = NULL; @@ -1195,9 +1195,10 @@ end_of_options: PEM_write_bio_X509_CRL(Sout, crl); - if (crlnumberfile != NULL) /* Rename the crlnumber file */ - if (!rotate_serial(crlnumberfile, "new", "old")) - goto end; + /* Rename the crlnumber file */ + if (crlnumberfile != NULL + && !rotate_serial(crlnumberfile, "new", "old")) + goto end; } /*****************************************************************/ Modified: stable/12/crypto/openssl/apps/ocsp.c ============================================================================== --- stable/12/crypto/openssl/apps/ocsp.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/ocsp.c Tue Nov 20 21:35:20 2018 (r340705) @@ -950,6 +950,7 @@ static void spawn_loop(void) sleep(30); break; case 0: /* child */ + OPENSSL_free(kidpids); signal(SIGINT, SIG_DFL); signal(SIGTERM, SIG_DFL); if (termsig) @@ -976,6 +977,7 @@ static void spawn_loop(void) } /* The loop above can only break on termsig */ + OPENSSL_free(kidpids); syslog(LOG_INFO, "terminating on signal: %d", termsig); killall(0, kidpids); } Modified: stable/12/crypto/openssl/apps/openssl.cnf ============================================================================== --- stable/12/crypto/openssl/apps/openssl.cnf Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/openssl.cnf Tue Nov 20 21:35:20 2018 (r340705) @@ -11,7 +11,6 @@ # This definition stops the following lines choking if HOME isn't # defined. HOME = . -RANDFILE = $ENV::HOME/.rnd # Extra OBJECT IDENTIFIER info: #oid_file = $ENV::HOME/.oid @@ -58,7 +57,6 @@ crlnumber = $dir/crlnumber # the current crl number # must be commented out to leave a V1 CRL crl = $dir/crl.pem # The current CRL private_key = $dir/private/cakey.pem# The private key -RANDFILE = $dir/private/.rand # private random number file x509_extensions = usr_cert # The extensions to add to the cert Modified: stable/12/crypto/openssl/apps/opt.c ============================================================================== --- stable/12/crypto/openssl/apps/opt.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/opt.c Tue Nov 20 21:35:20 2018 (r340705) @@ -168,7 +168,6 @@ static OPT_PAIR formats[] = { {"smime", OPT_FMT_SMIME}, {"engine", OPT_FMT_ENGINE}, {"msblob", OPT_FMT_MSBLOB}, - {"netscape", OPT_FMT_NETSCAPE}, {"nss", OPT_FMT_NSS}, {"text", OPT_FMT_TEXT}, {"http", OPT_FMT_HTTP}, Modified: stable/12/crypto/openssl/apps/rehash.c ============================================================================== --- stable/12/crypto/openssl/apps/rehash.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/rehash.c Tue Nov 20 21:35:20 2018 (r340705) @@ -1,6 +1,6 @@ /* * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. - * Copyright (c) 2013-2014 Timo Teräs + * Copyright (c) 2013-2014 Timo Teräs * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy Modified: stable/12/crypto/openssl/apps/rsa.c ============================================================================== --- stable/12/crypto/openssl/apps/rsa.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/rsa.c Tue Nov 20 21:35:20 2018 (r340705) @@ -38,8 +38,8 @@ typedef enum OPTION_choice { const OPTIONS rsa_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, - {"inform", OPT_INFORM, 'f', "Input format, one of DER NET PEM"}, - {"outform", OPT_OUTFORM, 'f', "Output format, one of DER NET PEM PVK"}, + {"inform", OPT_INFORM, 'f', "Input format, one of DER PEM"}, + {"outform", OPT_OUTFORM, 'f', "Output format, one of DER PEM PVK"}, {"in", OPT_IN, 's', "Input file"}, {"out", OPT_OUT, '>', "Output file"}, {"pubin", OPT_PUBIN, '-', "Expect a public key in input file"}, @@ -269,6 +269,9 @@ int rsa_main(int argc, char **argv) } else if (outformat == FORMAT_MSBLOB || outformat == FORMAT_PVK) { EVP_PKEY *pk; pk = EVP_PKEY_new(); + if (pk == NULL) + goto end; + EVP_PKEY_set1_RSA(pk, rsa); if (outformat == FORMAT_PVK) { if (pubin) { Modified: stable/12/crypto/openssl/apps/s_cb.c ============================================================================== --- stable/12/crypto/openssl/apps/s_cb.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/s_cb.c Tue Nov 20 21:35:20 2018 (r340705) @@ -394,7 +394,8 @@ int ssl_print_groups(BIO *out, SSL *s, int noshared) int ssl_print_tmp_key(BIO *out, SSL *s) { EVP_PKEY *key; - if (!SSL_get_server_tmp_key(s, &key)) + + if (!SSL_get_peer_tmp_key(s, &key)) return 1; BIO_puts(out, "Server Temp Key: "); switch (EVP_PKEY_id(key)) { Modified: stable/12/crypto/openssl/apps/s_server.c ============================================================================== --- stable/12/crypto/openssl/apps/s_server.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/s_server.c Tue Nov 20 21:35:20 2018 (r340705) @@ -193,9 +193,8 @@ static int psk_find_session_cb(SSL *ssl, const unsigne if (strlen(psk_identity) != identity_len || memcmp(psk_identity, identity, identity_len) != 0) { - BIO_printf(bio_s_out, - "PSK warning: client identity not what we expected" - " (got '%s' expected '%s')\n", identity, psk_identity); + *sess = NULL; + return 1; } if (psksess != NULL) { @@ -1622,6 +1621,11 @@ int s_server_main(int argc, char *argv[]) goto end; } #endif + if (early_data && (www > 0 || rev)) { + BIO_printf(bio_err, + "Can't use -early_data in combination with -www, -WWW, -HTTP, or -rev\n"); + goto end; + } #ifndef OPENSSL_NO_SCTP if (protocol == IPPROTO_SCTP) { Modified: stable/12/crypto/openssl/apps/speed.c ============================================================================== --- stable/12/crypto/openssl/apps/speed.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/speed.c Tue Nov 20 21:35:20 2018 (r340705) @@ -2896,7 +2896,7 @@ int speed_main(int argc, char **argv) if (rsa_count <= 1) { /* if longer than 10s, don't do any more */ - for (testnum++; testnum < EC_NUM; testnum++) + for (testnum++; testnum < ECDSA_NUM; testnum++) ecdsa_doit[testnum] = 0; } } Modified: stable/12/crypto/openssl/apps/x509.c ============================================================================== --- stable/12/crypto/openssl/apps/x509.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/apps/x509.c Tue Nov 20 21:35:20 2018 (r340705) @@ -67,10 +67,10 @@ typedef enum OPTION_choice { const OPTIONS x509_options[] = { {"help", OPT_HELP, '-', "Display this summary"}, {"inform", OPT_INFORM, 'f', - "Input format - default PEM (one of DER, NET or PEM)"}, + "Input format - default PEM (one of DER or PEM)"}, {"in", OPT_IN, '<', "Input file - default stdin"}, {"outform", OPT_OUTFORM, 'f', - "Output format - default PEM (one of DER, NET or PEM)"}, + "Output format - default PEM (one of DER or PEM)"}, {"out", OPT_OUT, '>', "Output file - default stdout"}, {"keyform", OPT_KEYFORM, 'F', "Private key format - default PEM"}, {"passin", OPT_PASSIN, 's', "Private key password/pass-phrase source"}, Modified: stable/12/crypto/openssl/crypto/LPdir_unix.c ============================================================================== --- stable/12/crypto/openssl/crypto/LPdir_unix.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/LPdir_unix.c Tue Nov 20 21:35:20 2018 (r340705) @@ -51,7 +51,7 @@ #endif /* - * The POSIXly macro for the maximum number of characters in a file path is + * The POSIX macro for the maximum number of characters in a file path is * NAME_MAX. However, some operating systems use PATH_MAX instead. * Therefore, it seems natural to first check for PATH_MAX and use that, and * if it doesn't exist, use NAME_MAX. Modified: stable/12/crypto/openssl/crypto/async/arch/async_posix.h ============================================================================== --- stable/12/crypto/openssl/crypto/async/arch/async_posix.h Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/async/arch/async_posix.h Tue Nov 20 21:35:20 2018 (r340705) @@ -17,7 +17,8 @@ # include -# if _POSIX_VERSION >= 200112L +# if _POSIX_VERSION >= 200112L \ + && (_POSIX_VERSION < 200809L || defined(__GLIBC__)) # include Modified: stable/12/crypto/openssl/crypto/bio/b_sock2.c ============================================================================== --- stable/12/crypto/openssl/crypto/bio/b_sock2.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/bio/b_sock2.c Tue Nov 20 21:35:20 2018 (r340705) @@ -133,7 +133,9 @@ int BIO_connect(int sock, const BIO_ADDR *addr, int op */ int BIO_bind(int sock, const BIO_ADDR *addr, int options) { +# ifndef OPENSSL_SYS_WINDOWS int on = 1; +# endif if (sock == -1) { BIOerr(BIO_F_BIO_BIND, BIO_R_INVALID_SOCKET); Modified: stable/12/crypto/openssl/crypto/bio/bio_lib.c ============================================================================== --- stable/12/crypto/openssl/crypto/bio/bio_lib.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/bio/bio_lib.c Tue Nov 20 21:35:20 2018 (r340705) @@ -52,7 +52,7 @@ static long bio_call_callback(BIO *b, int oper, const argi = (int)len; } - if (inret && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { + if (inret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { if (*processed > INT_MAX) return -1; inret = *processed; @@ -60,7 +60,7 @@ static long bio_call_callback(BIO *b, int oper, const ret = b->callback(b, oper, argp, argi, argl, inret); - if (ret >= 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { + if (ret > 0 && (oper & BIO_CB_RETURN) && bareoper != BIO_CB_CTRL) { *processed = (size_t)ret; ret = 1; } Modified: stable/12/crypto/openssl/crypto/bio/bss_log.c ============================================================================== --- stable/12/crypto/openssl/crypto/bio/bss_log.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/bio/bss_log.c Tue Nov 20 21:35:20 2018 (r340705) @@ -408,4 +408,9 @@ static void xcloselog(BIO *bp) # endif /* Unix */ +#else /* NO_SYSLOG */ +const BIO_METHOD *BIO_s_log(void) +{ + return NULL; +} #endif /* NO_SYSLOG */ Modified: stable/12/crypto/openssl/crypto/bn/asm/x86_64-gcc.c ============================================================================== --- stable/12/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/bn/asm/x86_64-gcc.c Tue Nov 20 21:35:20 2018 (r340705) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2002-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -63,12 +63,6 @@ * very much like 64-bit code compiled with no-asm on the same * machine. */ - -# if defined(_WIN64) || !defined(__LP64__) -# define BN_ULONG unsigned long long -# else -# define BN_ULONG unsigned long -# endif # undef mul # undef mul_add Modified: stable/12/crypto/openssl/crypto/bn/bn_exp.c ============================================================================== --- stable/12/crypto/openssl/crypto/bn/bn_exp.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/bn/bn_exp.c Tue Nov 20 21:35:20 2018 (r340705) @@ -1077,7 +1077,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM * is not only slower but also makes each bit vulnerable to * EM (and likely other) side-channel attacks like One&Done * (for details see "One&Done: A Single-Decryption EM-Based - * Attack on OpenSSL’s Constant-Time Blinded RSA" by M. Alam, + * Attack on OpenSSL's Constant-Time Blinded RSA" by M. Alam, * H. Khan, M. Dey, N. Sinha, R. Callan, A. Zajic, and * M. Prvulovic, in USENIX Security'18) */ Modified: stable/12/crypto/openssl/crypto/bn/bn_lib.c ============================================================================== --- stable/12/crypto/openssl/crypto/bn/bn_lib.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/bn/bn_lib.c Tue Nov 20 21:35:20 2018 (r340705) @@ -767,26 +767,30 @@ void BN_consttime_swap(BN_ULONG condition, BIGNUM *a, b->neg ^= t; /*- - * Idea behind BN_FLG_STATIC_DATA is actually to - * indicate that data may not be written to. - * Intention is actually to treat it as it's - * read-only data, and some (if not most) of it does - * reside in read-only segment. In other words - * observation of BN_FLG_STATIC_DATA in - * BN_consttime_swap should be treated as fatal - * condition. It would either cause SEGV or - * effectively cause data corruption. - * BN_FLG_MALLOCED refers to BN structure itself, - * and hence must be preserved. Remaining flags are - * BN_FLG_CONSTIME and BN_FLG_SECURE. Latter must be - * preserved, because it determines how x->d was - * allocated and hence how to free it. This leaves - * BN_FLG_CONSTTIME that one can do something about. - * To summarize it's sufficient to mask and swap - * BN_FLG_CONSTTIME alone. BN_FLG_STATIC_DATA should - * be treated as fatal. + * BN_FLG_STATIC_DATA: indicates that data may not be written to. Intention + * is actually to treat it as it's read-only data, and some (if not most) + * of it does reside in read-only segment. In other words observation of + * BN_FLG_STATIC_DATA in BN_consttime_swap should be treated as fatal + * condition. It would either cause SEGV or effectively cause data + * corruption. + * + * BN_FLG_MALLOCED: refers to BN structure itself, and hence must be + * preserved. + * + * BN_FLG_SECURE: must be preserved, because it determines how x->d was + * allocated and hence how to free it. + * + * BN_FLG_CONSTTIME: sufficient to mask and swap + * + * BN_FLG_FIXED_TOP: indicates that we haven't called bn_correct_top() on + * the data, so the d array may be padded with additional 0 values (i.e. + * top could be greater than the minimal value that it could be). We should + * be swapping it */ - t = ((a->flags ^ b->flags) & BN_FLG_CONSTTIME) & condition; + +#define BN_CONSTTIME_SWAP_FLAGS (BN_FLG_CONSTTIME | BN_FLG_FIXED_TOP) + + t = ((a->flags ^ b->flags) & BN_CONSTTIME_SWAP_FLAGS) & condition; a->flags ^= t; b->flags ^= t; Modified: stable/12/crypto/openssl/crypto/build.info ============================================================================== --- stable/12/crypto/openssl/crypto/build.info Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/build.info Tue Nov 20 21:35:20 2018 (r340705) @@ -2,7 +2,7 @@ LIBS=../libcrypto SOURCE[../libcrypto]=\ cryptlib.c mem.c mem_dbg.c cversion.c ex_data.c cpt_err.c \ ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fopen.c ctype.c \ - threads_pthread.c threads_win.c threads_none.c \ + threads_pthread.c threads_win.c threads_none.c getenv.c \ o_init.c o_fips.c mem_sec.c init.c {- $target{cpuid_asm_src} -} \ {- $target{uplink_aux_src} -} EXTRA= ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \ Modified: stable/12/crypto/openssl/crypto/conf/conf_api.c ============================================================================== --- stable/12/crypto/openssl/crypto/conf/conf_api.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/conf/conf_api.c Tue Nov 20 21:35:20 2018 (r340705) @@ -10,6 +10,7 @@ /* Part of the code in here was originally in conf.c, which is now removed */ #include "e_os.h" +#include "internal/cryptlib.h" #include #include #include @@ -82,7 +83,7 @@ char *_CONF_get_string(const CONF *conf, const char *s if (v != NULL) return v->value; if (strcmp(section, "ENV") == 0) { - p = getenv(name); + p = ossl_safe_getenv(name); if (p != NULL) return p; } @@ -95,7 +96,7 @@ char *_CONF_get_string(const CONF *conf, const char *s else return NULL; } else - return getenv(name); + return ossl_safe_getenv(name); } static unsigned long conf_value_hash(const CONF_VALUE *v) Modified: stable/12/crypto/openssl/crypto/conf/conf_mod.c ============================================================================== --- stable/12/crypto/openssl/crypto/conf/conf_mod.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/conf/conf_mod.c Tue Nov 20 21:35:20 2018 (r340705) @@ -480,11 +480,8 @@ char *CONF_get1_default_config_file(void) char *file, *sep = ""; int len; - if (!OPENSSL_issetugid()) { - file = getenv("OPENSSL_CONF"); - if (file) - return OPENSSL_strdup(file); - } + if ((file = ossl_safe_getenv("OPENSSL_CONF")) != NULL) + return OPENSSL_strdup(file); len = strlen(X509_get_default_cert_area()); #ifndef OPENSSL_SYS_VMS Modified: stable/12/crypto/openssl/crypto/cryptlib.c ============================================================================== --- stable/12/crypto/openssl/crypto/cryptlib.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/cryptlib.c Tue Nov 20 21:35:20 2018 (r340705) @@ -204,7 +204,7 @@ int OPENSSL_isservice(void) if (_OPENSSL_isservice.p == NULL) { HANDLE mod = GetModuleHandle(NULL); - FARPROC f; + FARPROC f = NULL; if (mod != NULL) f = GetProcAddress(mod, "_OPENSSL_isservice"); Modified: stable/12/crypto/openssl/crypto/ct/ct_log.c ============================================================================== --- stable/12/crypto/openssl/crypto/ct/ct_log.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/ct/ct_log.c Tue Nov 20 21:35:20 2018 (r340705) @@ -137,7 +137,7 @@ static int ctlog_new_from_conf(CTLOG **ct_log, const C int CTLOG_STORE_load_default_file(CTLOG_STORE *store) { - const char *fpath = getenv(CTLOG_FILE_EVP); + const char *fpath = ossl_safe_getenv(CTLOG_FILE_EVP); if (fpath == NULL) fpath = CTLOG_FILE; Modified: stable/12/crypto/openssl/crypto/dsa/dsa_gen.c ============================================================================== --- stable/12/crypto/openssl/crypto/dsa/dsa_gen.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/dsa/dsa_gen.c Tue Nov 20 21:35:20 2018 (r340705) @@ -327,6 +327,12 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N if (mctx == NULL) goto err; + /* make sure L > N, otherwise we'll get trapped in an infinite loop */ + if (L <= N) { + DSAerr(DSA_F_DSA_BUILTIN_PARAMGEN2, DSA_R_INVALID_PARAMETERS); + goto err; + } + if (evpmd == NULL) { if (N == 160) evpmd = EVP_sha1(); Modified: stable/12/crypto/openssl/crypto/dsa/dsa_ossl.c ============================================================================== --- stable/12/crypto/openssl/crypto/dsa/dsa_ossl.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/dsa/dsa_ossl.c Tue Nov 20 21:35:20 2018 (r340705) @@ -9,6 +9,7 @@ #include #include "internal/cryptlib.h" +#include "internal/bn_int.h" #include #include #include "dsa_locl.h" @@ -23,6 +24,8 @@ static int dsa_do_verify(const unsigned char *dgst, in DSA_SIG *sig, DSA *dsa); static int dsa_init(DSA *dsa); static int dsa_finish(DSA *dsa); +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx); static DSA_METHOD openssl_dsa_meth = { "OpenSSL DSA method", @@ -178,9 +181,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, { BN_CTX *ctx = NULL; BIGNUM *k, *kinv = NULL, *r = *rp; - BIGNUM *l, *m; + BIGNUM *l; int ret = 0; - int q_bits; + int q_bits, q_words; if (!dsa->p || !dsa->q || !dsa->g) { DSAerr(DSA_F_DSA_SIGN_SETUP, DSA_R_MISSING_PARAMETERS); @@ -189,8 +192,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, k = BN_new(); l = BN_new(); - m = BN_new(); - if (k == NULL || l == NULL || m == NULL) + if (k == NULL || l == NULL) goto err; if (ctx_in == NULL) { @@ -201,9 +203,9 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, /* Preallocate space */ q_bits = BN_num_bits(dsa->q); - if (!BN_set_bit(k, q_bits) - || !BN_set_bit(l, q_bits) - || !BN_set_bit(m, q_bits)) + q_words = bn_get_top(dsa->q); + if (!bn_wexpand(k, q_words + 2) + || !bn_wexpand(l, q_words + 2)) goto err; /* Get random k */ @@ -221,6 +223,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, } while (BN_is_zero(k)); BN_set_flags(k, BN_FLG_CONSTTIME); + BN_set_flags(l, BN_FLG_CONSTTIME); if (dsa->flags & DSA_FLAG_CACHE_MONT_P) { if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p, @@ -238,14 +241,17 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, * small timing information leakage. We then choose the sum that is * one bit longer than the modulus. * - * TODO: revisit the BN_copy aiming for a memory access agnostic - * conditional copy. + * There are some concerns about the efficacy of doing this. More + * specificly refer to the discussion starting with: + * https://github.com/openssl/openssl/pull/7486#discussion_r228323705 + * The fix is to rework BN so these gymnastics aren't required. */ if (!BN_add(l, k, dsa->q) - || !BN_add(m, l, dsa->q) - || !BN_copy(k, BN_num_bits(l) > q_bits ? l : m)) + || !BN_add(k, l, dsa->q)) goto err; + BN_consttime_swap(BN_is_bit_set(l, q_bits), k, l, q_words + 2); + if ((dsa)->meth->bn_mod_exp != NULL) { if (!dsa->meth->bn_mod_exp(dsa, r, dsa->g, k, dsa->p, ctx, dsa->method_mont_p)) @@ -258,8 +264,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, if (!BN_mod(r, r, dsa->q, ctx)) goto err; - /* Compute part of 's = inv(k) (m + xr) mod q' */ - if ((kinv = BN_mod_inverse(NULL, k, dsa->q, ctx)) == NULL) + /* Compute part of 's = inv(k) (m + xr) mod q' */ + if ((kinv = dsa_mod_inverse_fermat(k, dsa->q, ctx)) == NULL) goto err; BN_clear_free(*kinvp); @@ -273,7 +279,6 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BN_CTX_free(ctx); BN_clear_free(k); BN_clear_free(l); - BN_clear_free(m); return ret; } @@ -392,4 +397,32 @@ static int dsa_finish(DSA *dsa) { BN_MONT_CTX_free(dsa->method_mont_p); return 1; +} + +/* + * Compute the inverse of k modulo q. + * Since q is prime, Fermat's Little Theorem applies, which reduces this to + * mod-exp operation. Both the exponent and modulus are public information + * so a mod-exp that doesn't leak the base is sufficient. A newly allocated + * BIGNUM is returned which the caller must free. + */ +static BIGNUM *dsa_mod_inverse_fermat(const BIGNUM *k, const BIGNUM *q, + BN_CTX *ctx) +{ + BIGNUM *res = NULL; + BIGNUM *r, *e; + + if ((r = BN_new()) == NULL) + return NULL; + + BN_CTX_start(ctx); + if ((e = BN_CTX_get(ctx)) != NULL + && BN_set_word(r, 2) + && BN_sub(e, q, r) + && BN_mod_exp_mont(r, k, e, q, ctx, NULL)) + res = r; + else + BN_free(r); + BN_CTX_end(ctx); + return res; } Modified: stable/12/crypto/openssl/crypto/ec/ec_ameth.c ============================================================================== --- stable/12/crypto/openssl/crypto/ec/ec_ameth.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/ec/ec_ameth.c Tue Nov 20 21:35:20 2018 (r340705) @@ -699,7 +699,7 @@ static int ecdh_cms_set_kdf_param(EVP_PKEY_CTX *pctx, if (EVP_PKEY_CTX_set_ecdh_cofactor_mode(pctx, cofactor) <= 0) return 0; - if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_62) <= 0) + if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, EVP_PKEY_ECDH_KDF_X9_63) <= 0) return 0; kdf_md = EVP_get_digestbynid(kdfmd_nid); @@ -864,7 +864,7 @@ static int ecdh_cms_encrypt(CMS_RecipientInfo *ri) ecdh_nid = NID_dh_cofactor_kdf; if (kdf_type == EVP_PKEY_ECDH_KDF_NONE) { - kdf_type = EVP_PKEY_ECDH_KDF_X9_62; + kdf_type = EVP_PKEY_ECDH_KDF_X9_63; if (EVP_PKEY_CTX_set_ecdh_kdf_type(pctx, kdf_type) <= 0) goto err; } else Modified: stable/12/crypto/openssl/crypto/ec/ec_mult.c ============================================================================== --- stable/12/crypto/openssl/crypto/ec/ec_mult.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/ec/ec_mult.c Tue Nov 20 21:35:20 2018 (r340705) @@ -206,8 +206,8 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POI */ cardinality_bits = BN_num_bits(cardinality); group_top = bn_get_top(cardinality); - if ((bn_wexpand(k, group_top + 1) == NULL) - || (bn_wexpand(lambda, group_top + 1) == NULL)) { + if ((bn_wexpand(k, group_top + 2) == NULL) + || (bn_wexpand(lambda, group_top + 2) == NULL)) { ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB); goto err; } @@ -244,7 +244,7 @@ int ec_scalar_mul_ladder(const EC_GROUP *group, EC_POI * k := scalar + 2*cardinality */ kbit = BN_is_bit_set(lambda, cardinality_bits); - BN_consttime_swap(kbit, k, lambda, group_top + 1); + BN_consttime_swap(kbit, k, lambda, group_top + 2); group_top = bn_get_top(group->field); if ((bn_wexpand(s->X, group_top) == NULL) Modified: stable/12/crypto/openssl/crypto/ec/ec_pmeth.c ============================================================================== --- stable/12/crypto/openssl/crypto/ec/ec_pmeth.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/ec/ec_pmeth.c Tue Nov 20 21:35:20 2018 (r340705) @@ -209,7 +209,7 @@ static int pkey_ec_kdf_derive(EVP_PKEY_CTX *ctx, if (!pkey_ec_derive(ctx, ktmp, &ktmplen)) goto err; /* Do KDF stuff */ - if (!ECDH_KDF_X9_62(key, *keylen, ktmp, ktmplen, + if (!ecdh_KDF_X9_63(key, *keylen, ktmp, ktmplen, dctx->kdf_ukm, dctx->kdf_ukmlen, dctx->kdf_md)) goto err; rv = 1; @@ -281,7 +281,7 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, i case EVP_PKEY_CTRL_EC_KDF_TYPE: if (p1 == -2) return dctx->kdf_type; - if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_62) + if (p1 != EVP_PKEY_ECDH_KDF_NONE && p1 != EVP_PKEY_ECDH_KDF_X9_63) return -2; dctx->kdf_type = p1; return 1; Modified: stable/12/crypto/openssl/crypto/ec/ecdh_kdf.c ============================================================================== --- stable/12/crypto/openssl/crypto/ec/ecdh_kdf.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/ec/ecdh_kdf.c Tue Nov 20 21:35:20 2018 (r340705) @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -10,12 +10,13 @@ #include #include #include +#include "ec_lcl.h" -/* Key derivation function from X9.62/SECG */ +/* Key derivation function from X9.63/SECG */ /* Way more than we will ever need */ #define ECDH_KDF_MAX (1 << 30) -int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, +int ecdh_KDF_X9_63(unsigned char *out, size_t outlen, const unsigned char *Z, size_t Zlen, const unsigned char *sinfo, size_t sinfolen, const EVP_MD *md) @@ -65,4 +66,16 @@ int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, err: EVP_MD_CTX_free(mctx); return rv; +} + +/*- + * The old name for ecdh_KDF_X9_63 + * Retained for ABI compatibility + */ +int ECDH_KDF_X9_62(unsigned char *out, size_t outlen, + const unsigned char *Z, size_t Zlen, + const unsigned char *sinfo, size_t sinfolen, + const EVP_MD *md) +{ + return ecdh_KDF_X9_63(out, outlen, Z, Zlen, sinfo, sinfolen, md); } Modified: stable/12/crypto/openssl/crypto/engine/eng_devcrypto.c ============================================================================== --- stable/12/crypto/openssl/crypto/engine/eng_devcrypto.c Tue Nov 20 21:26:25 2018 (r340704) +++ stable/12/crypto/openssl/crypto/engine/eng_devcrypto.c Tue Nov 20 21:35:20 2018 (r340705) @@ -28,6 +28,13 @@ # define CHECK_BSD_STYLE_MACROS #endif +/* + * ONE global file descriptor for all sessions. This allows operations + * such as digest session data copying (see digest_copy()), but is also + * saner... why re-open /dev/crypto for every session? + */ +static int cfd; + /****************************************************************************** * * Ciphers @@ -39,7 +46,6 @@ *****/ struct cipher_ctx { - int cfd; struct session_op sess; /* to pass from init to do_cipher */ @@ -69,7 +75,7 @@ static const struct cipher_data_st { { NID_aes_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC }, { NID_aes_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC }, #ifndef OPENSSL_NO_RC4 - { NID_rc4, 1, 16, 0, CRYPTO_ARC4 }, + { NID_rc4, 1, 16, 0, EVP_CIPH_STREAM_CIPHER, CRYPTO_ARC4 }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-12@freebsd.org Tue Nov 20 22:24:20 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E395D114060D; Tue, 20 Nov 2018 22:24:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8073E87192; Tue, 20 Nov 2018 22:24:19 +0000 (UTC) (envelope-from jkim@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6185617824; Tue, 20 Nov 2018 22:24:19 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAKMOJYt071575; Tue, 20 Nov 2018 22:24:19 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAKMOJAK071574; Tue, 20 Nov 2018 22:24:19 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811202224.wAKMOJAK071574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 20 Nov 2018 22:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340708 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 340708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8073E87192 X-Spamd-Result: default: False [0.52 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.007,0]; NEURAL_SPAM_MEDIUM(0.17)[0.172,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.34)[0.343,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2018 22:24:20 -0000 Author: jkim Date: Tue Nov 20 22:24:18 2018 New Revision: 340708 URL: https://svnweb.freebsd.org/changeset/base/340708 Log: MFC: r340706 Remove stale manual pages after OpenSSL 1.1.1a merge. Modified: stable/12/ObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Tue Nov 20 22:21:19 2018 (r340707) +++ stable/12/ObsoleteFiles.inc Tue Nov 20 22:24:18 2018 (r340708) @@ -38,6 +38,14 @@ # xargs -n1 | sort | uniq -d; # done +# 20181120: OpenSSL 1.1.1a +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_add_client_CA.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_get_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_set_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_add_client_CA.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_get_client_CA_list.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_get_server_tmp_key.3.gz +OLD_FILES+=usr/share/openssl/man/man3/SSL_set_client_CA_list.3.gz # 20181030: malloc_domain(9) KPI change OLD_FILES+=usr/share/man/man9/malloc_domain.9.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports From owner-svn-src-stable-12@freebsd.org Wed Nov 21 00:04:39 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3B041142FA0; Wed, 21 Nov 2018 00:04:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 573FB8B1CA; Wed, 21 Nov 2018 00:04:39 +0000 (UTC) (envelope-from jkim@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38016188D2; Wed, 21 Nov 2018 00:04:39 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL04d5V023414; Wed, 21 Nov 2018 00:04:39 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL04cLU023413; Wed, 21 Nov 2018 00:04:38 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201811210004.wAL04cLU023413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 21 Nov 2018 00:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340714 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 340714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 573FB8B1CA X-Spamd-Result: default: False [0.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.007,0]; NEURAL_SPAM_MEDIUM(0.17)[0.172,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.22)[0.223,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 00:04:39 -0000 Author: jkim Date: Wed Nov 21 00:04:38 2018 New Revision: 340714 URL: https://svnweb.freebsd.org/changeset/base/340714 Log: MFC: r340713. Revert r340708. Some files became symlinks and vice versa. Modified: stable/12/ObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Wed Nov 21 00:00:00 2018 (r340713) +++ stable/12/ObsoleteFiles.inc Wed Nov 21 00:04:38 2018 (r340714) @@ -38,14 +38,6 @@ # xargs -n1 | sort | uniq -d; # done -# 20181120: OpenSSL 1.1.1a -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_add_client_CA.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_get_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_CTX_set_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_add_client_CA.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_get_client_CA_list.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_get_server_tmp_key.3.gz -OLD_FILES+=usr/share/openssl/man/man3/SSL_set_client_CA_list.3.gz # 20181030: malloc_domain(9) KPI change OLD_FILES+=usr/share/man/man9/malloc_domain.9.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports From owner-svn-src-stable-12@freebsd.org Wed Nov 21 01:24:28 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78E4C1145292; Wed, 21 Nov 2018 01:24:28 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 204F68E67D; Wed, 21 Nov 2018 01:24:28 +0000 (UTC) (envelope-from mmacy@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7A98195FD; Wed, 21 Nov 2018 01:24:27 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL1ORxH064260; Wed, 21 Nov 2018 01:24:27 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL1OR2f064258; Wed, 21 Nov 2018 01:24:27 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201811210124.wAL1OR2f064258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Wed, 21 Nov 2018 01:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340718 - in stable/12: lib/libpmc lib/libpmc/pmu-events lib/libpmc/pmu-events/arch/x86/amdfam17h sys/dev/hwpmc X-SVN-Group: stable-12 X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in stable/12: lib/libpmc lib/libpmc/pmu-events lib/libpmc/pmu-events/arch/x86/amdfam17h sys/dev/hwpmc X-SVN-Commit-Revision: 340718 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 204F68E67D X-Spamd-Result: default: False [0.68 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.42)[0.422,0]; NEURAL_SPAM_MEDIUM(0.24)[0.240,0]; NEURAL_SPAM_LONG(0.02)[0.022,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 01:24:28 -0000 Author: mmacy Date: Wed Nov 21 01:24:27 2018 New Revision: 340718 URL: https://svnweb.freebsd.org/changeset/base/340718 Log: hwpmc: new counters and bug fix MFCs MFC r340108 and r340149 Added: stable/12/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json - copied unchanged from r340108, head/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json stable/12/lib/libpmc/pmu-events/arch/x86/amdfam17h/l3cache.json - copied unchanged from r340108, head/lib/libpmc/pmu-events/arch/x86/amdfam17h/l3cache.json Modified: stable/12/lib/libpmc/libpmc_pmu_util.c stable/12/lib/libpmc/pmu-events/jevents.c stable/12/sys/dev/hwpmc/hwpmc_amd.c stable/12/sys/dev/hwpmc/hwpmc_amd.h stable/12/sys/dev/hwpmc/hwpmc_mod.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libpmc/libpmc_pmu_util.c ============================================================================== --- stable/12/lib/libpmc/libpmc_pmu_util.c Wed Nov 21 00:22:31 2018 (r340717) +++ stable/12/lib/libpmc/libpmc_pmu_util.c Wed Nov 21 01:24:27 2018 (r340718) @@ -146,6 +146,8 @@ pmu_alias_get(const char *name) struct pmu_event_desc { uint64_t ped_period; uint64_t ped_offcore_rsp; + uint64_t ped_l3_thread; + uint64_t ped_l3_slice; uint32_t ped_event; uint32_t ped_frontend; uint32_t ped_ldlat; @@ -270,6 +272,10 @@ pmu_parse_event(struct pmu_event_desc *ped, const char ped->ped_ch_mask = strtol(value, NULL, 16); else if (strcmp(key, "config1") == 0) ped->ped_config1 = strtol(value, NULL, 16); + else if (strcmp(key, "l3_thread_mask") == 0) + ped->ped_l3_thread = strtol(value, NULL, 16); + else if (strcmp(key, "l3_slice_mask") == 0) + ped->ped_l3_slice = strtol(value, NULL, 16); else { debug = getenv("PMUDEBUG"); if (debug != NULL && strcmp(debug, "true") == 0 && value != NULL) @@ -407,33 +413,50 @@ pmc_pmu_print_counter_full(const char *ev) } static int -pmc_pmu_amd_pmcallocate(const char *event_name __unused, struct pmc_op_pmcallocate *pm, +pmc_pmu_amd_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm, struct pmu_event_desc *ped) { struct pmc_md_amd_op_pmcallocate *amd; + const struct pmu_event *pe; + int idx = -1; amd = &pm->pm_md.pm_amd; - amd->pm_amd_config = AMD_PMC_TO_EVENTMASK(ped->ped_event); if (ped->ped_umask > 0) { pm->pm_caps |= PMC_CAP_QUALIFIER; amd->pm_amd_config |= AMD_PMC_TO_UNITMASK(ped->ped_umask); } pm->pm_class = PMC_CLASS_K8; + pe = pmu_event_get(NULL, event_name, &idx); - if ((pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == 0 || - (pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == - (PMC_CAP_USER|PMC_CAP_SYSTEM)) - amd->pm_amd_config |= (AMD_PMC_USR | AMD_PMC_OS); - else if (pm->pm_caps & PMC_CAP_USER) - amd->pm_amd_config |= AMD_PMC_USR; - else if (pm->pm_caps & PMC_CAP_SYSTEM) - amd->pm_amd_config |= AMD_PMC_OS; - if (ped->ped_edge) - amd->pm_amd_config |= AMD_PMC_EDGE; - if (ped->ped_inv) - amd->pm_amd_config |= AMD_PMC_EDGE; - if (pm->pm_caps & PMC_CAP_INTERRUPT) - amd->pm_amd_config |= AMD_PMC_INT; + if (strcmp("l3cache", pe->topic) == 0){ + amd->pm_amd_config |= AMD_PMC_TO_EVENTMASK(ped->ped_event); + amd->pm_amd_sub_class = PMC_AMD_SUB_CLASS_L3_CACHE; + amd->pm_amd_config |= AMD_PMC_TO_L3SLICE(ped->ped_l3_slice); + amd->pm_amd_config |= AMD_PMC_TO_L3CORE(ped->ped_l3_thread); + } + else if (strcmp("data fabric", pe->topic) == 0){ + + amd->pm_amd_config |= AMD_PMC_TO_EVENTMASK_DF(ped->ped_event); + amd->pm_amd_sub_class = PMC_AMD_SUB_CLASS_DATA_FABRIC; + } + else{ + amd->pm_amd_config |= AMD_PMC_TO_EVENTMASK(ped->ped_event); + amd->pm_amd_sub_class = PMC_AMD_SUB_CLASS_CORE; + if ((pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == 0 || + (pm->pm_caps & (PMC_CAP_USER|PMC_CAP_SYSTEM)) == + (PMC_CAP_USER|PMC_CAP_SYSTEM)) + amd->pm_amd_config |= (AMD_PMC_USR | AMD_PMC_OS); + else if (pm->pm_caps & PMC_CAP_USER) + amd->pm_amd_config |= AMD_PMC_USR; + else if (pm->pm_caps & PMC_CAP_SYSTEM) + amd->pm_amd_config |= AMD_PMC_OS; + if (ped->ped_edge) + amd->pm_amd_config |= AMD_PMC_EDGE; + if (ped->ped_inv) + amd->pm_amd_config |= AMD_PMC_EDGE; + if (pm->pm_caps & PMC_CAP_INTERRUPT) + amd->pm_amd_config |= AMD_PMC_INT; + } return (0); } Copied: stable/12/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json (from r340108, head/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json Wed Nov 21 01:24:27 2018 (r340718, copy of r340108, head/lib/libpmc/pmu-events/arch/x86/amdfam17h/data-fabric.json) @@ -0,0 +1,2668 @@ +[ + { + "EventName": "df_ccm_reqa.Node0.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x0F" + }, + { + "EventName": "df_ccm_reqa.Node1.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x2F" + }, + { + "EventName": "df_ccm_reqa.Node2.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x4F" + }, + { + "EventName": "df_ccm_reqa.Node3.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x6F" + }, + { + "EventName": "df_ccm_reqa.Node4.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0x8F" + }, + { + "EventName": "df_ccm_reqa.Node5.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0xAF" + }, + { + "EventName": "df_ccm_reqa.Node6.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0xCF" + }, + { + "EventName": "df_ccm_reqa.Node7.anydram", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Any DRAM transaction", + "UMask": "0xEF" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x0E" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x2E" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x4E" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsizedfullzero", + "EventCode": "0x8E", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x6E" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0x8E" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0xAE" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0xCE" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered WrSizedFullZero", + "UMask": "0xEE" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x0D" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsizedfullnc", + "EventCode": "0x8A", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x2D" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x4D" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x6D" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x8D" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xAD" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xCD" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xED" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x0C" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x2C" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x4C" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x6C" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x8C" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xAC" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xCC" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xEC" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x0B" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x2B" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x4B" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x6B" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0x8B" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0xAB" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0xCB" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsizedfullzero", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullzero", + "UMask": "0xEB" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x0A" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x2A" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x4A" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x6A" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0x8A" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xAA" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xCA" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsizedfullnc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsizedfullnc", + "UMask": "0xEA" + }, + { + "EventName": "df_ccm_reqa.Node0.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x09" + }, + { + "EventName": "df_ccm_reqa.Node1.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x29" + }, + { + "EventName": "df_ccm_reqa.Node2.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x49" + }, + { + "EventName": "df_ccm_reqa.Node3.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x69" + }, + { + "EventName": "df_ccm_reqa.Node4.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0x89" + }, + { + "EventName": "df_ccm_reqa.Node5.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xA9" + }, + { + "EventName": "df_ccm_reqa.Node6.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xC9" + }, + { + "EventName": "df_ccm_reqa.Node7.wrsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wrsized", + "UMask": "0xE9" + }, + { + "EventName": "df_ccm_reqa.Node0.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x08" + }, + { + "EventName": "df_ccm_reqa.Node1.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x28" + }, + { + "EventName": "df_ccm_reqa.Node2.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x48" + }, + { + "EventName": "df_ccm_reqa.Node3.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x68" + }, + { + "EventName": "df_ccm_reqa.Node4.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0x88" + }, + { + "EventName": "df_ccm_reqa.Node5.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0xA8" + }, + { + "EventName": "df_ccm_reqa.Node6.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0xC8" + }, + { + "EventName": "df_ccm_reqa.Node7.rdsizednc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsizednc", + "UMask": "0xE8" + }, + { + "EventName": "df_ccm_reqa.Node0.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x07" + }, + { + "EventName": "df_ccm_reqa.Node1.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x27" + }, + { + "EventName": "df_ccm_reqa.Node2.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x47" + }, + { + "EventName": "df_ccm_reqa.Node3.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x67" + }, + { + "EventName": "df_ccm_reqa.Node4.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0x87" + }, + { + "EventName": "df_ccm_reqa.Node5.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0xA7" + }, + { + "EventName": "df_ccm_reqa.Node6.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0xC7" + }, + { + "EventName": "df_ccm_reqa.Node7.rdsized", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdsized", + "UMask": "0xE7" + }, + { + "EventName": "df_ccm_reqa.Node0.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x06" + }, + { + "EventName": "df_ccm_reqa.Node1.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x26" + }, + { + "EventName": "df_ccm_reqa.Node2.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x46" + }, + { + "EventName": "df_ccm_reqa.Node3.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x66" + }, + { + "EventName": "df_ccm_reqa.Node4.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0x86" + }, + { + "EventName": "df_ccm_reqa.Node5.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0xA6" + }, + { + "EventName": "df_ccm_reqa.Node6.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0xC6" + }, + { + "EventName": "df_ccm_reqa.Node7.specdramrd", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered specdramrd", + "UMask": "0xE6" + }, + { + "EventName": "df_ccm_reqa.Node0.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x05" + }, + { + "EventName": "df_ccm_reqa.Node1.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x25" + }, + { + "EventName": "df_ccm_reqa.Node2.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x45" + }, + { + "EventName": "df_ccm_reqa.Node3.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x65" + }, + { + "EventName": "df_ccm_reqa.Node4.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0x85" + }, + { + "EventName": "df_ccm_reqa.Node5.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0xA5" + }, + { + "EventName": "df_ccm_reqa.Node6.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0xC5" + }, + { + "EventName": "df_ccm_reqa.Node7.anyrdblk", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered anyrdblk", + "UMask": "0xE5" + }, + { + "EventName": "df_ccm_reqa.Node0.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x04" + }, + { + "EventName": "df_ccm_reqa.Node1.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x24" + }, + { + "EventName": "df_ccm_reqa.Node2.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x44" + }, + { + "EventName": "df_ccm_reqa.Node3.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x64" + }, + { + "EventName": "df_ccm_reqa.Node4.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0x84" + }, + { + "EventName": "df_ccm_reqa.Node5.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0xA4" + }, + { + "EventName": "df_ccm_reqa.Node6.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0xC4" + }, + { + "EventName": "df_ccm_reqa.Node7.rdvlkc", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkc", + "UMask": "0xE4" + }, + { + "EventName": "df_ccm_reqa.Node0.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x03" + }, + { + "EventName": "df_ccm_reqa.Node1.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x23" + }, + { + "EventName": "df_ccm_reqa.Node2.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x43" + }, + { + "EventName": "df_ccm_reqa.Node3.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x63" + }, + { + "EventName": "df_ccm_reqa.Node4.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0x83" + }, + { + "EventName": "df_ccm_reqa.Node5.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0xA3" + }, + { + "EventName": "df_ccm_reqa.Node6.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0xC3" + }, + { + "EventName": "df_ccm_reqa.Node7.rdvlkx", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkx", + "UMask": "0xE3" + }, + { + "EventName": "df_ccm_reqa.Node0.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x02" + }, + { + "EventName": "df_ccm_reqa.Node1.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x22" + }, + { + "EventName": "df_ccm_reqa.Node2.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x42" + }, + { + "EventName": "df_ccm_reqa.Node3.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x62" + }, + { + "EventName": "df_ccm_reqa.Node4.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0x82" + }, + { + "EventName": "df_ccm_reqa.Node5.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0xA2" + }, + { + "EventName": "df_ccm_reqa.Node6.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0xC2" + }, + { + "EventName": "df_ccm_reqa.Node7.rdvlks", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlks", + "UMask": "0xE2" + }, + { + "EventName": "df_ccm_reqa.Node0.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x01" + }, + { + "EventName": "df_ccm_reqa.Node1.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x21" + }, + { + "EventName": "df_ccm_reqa.Node2.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x41" + }, + { + "EventName": "df_ccm_reqa.Node3.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x61" + }, + { + "EventName": "df_ccm_reqa.Node4.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0x81" + }, + { + "EventName": "df_ccm_reqa.Node5.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0xA1" + }, + { + "EventName": "df_ccm_reqa.Node6.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0xC1" + }, + { + "EventName": "df_ccm_reqa.Node7.rdvlkl", + "EventCode": "0x8B", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered rdvlkl", + "UMask": "0xE1" + }, + { + "EventName": "df_ccm_reqb.Node0.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x0E" + }, + { + "EventName": "df_ccm_reqb.Node1.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x2E" + }, + { + "EventName": "df_ccm_reqb.Node2.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x4E" + }, + { + "EventName": "df_ccm_reqb.Node3.chgtox", + "EventCode": "0x8E", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x6E" + }, + { + "EventName": "df_ccm_reqb.Node4.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0x8E" + }, + { + "EventName": "df_ccm_reqb.Node5.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0xAE" + }, + { + "EventName": "df_ccm_reqb.Node6.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0xCE" + }, + { + "EventName": "df_ccm_reqb.Node7.chgtox", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered chgtox", + "UMask": "0xEE" + }, + { + "EventName": "df_ccm_reqb.Node0.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x0D" + }, + { + "EventName": "df_ccm_reqb.Node1.vicblkfull.", + "EventCode": "0x8A", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x2D" + }, + { + "EventName": "df_ccm_reqb.Node2.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x4D" + }, + { + "EventName": "df_ccm_reqb.Node3.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x6D" + }, + { + "EventName": "df_ccm_reqb.Node4.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0x8D" + }, + { + "EventName": "df_ccm_reqb.Node5.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0xAD" + }, + { + "EventName": "df_ccm_reqb.Node6.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0xCD" + }, + { + "EventName": "df_ccm_reqb.Node7.vicblkfull.", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfull.", + "UMask": "0xED" + }, + { + "EventName": "df_ccm_reqb.Node0.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x0C" + }, + { + "EventName": "df_ccm_reqb.Node1.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x2C" + }, + { + "EventName": "df_ccm_reqb.Node2.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x4C" + }, + { + "EventName": "df_ccm_reqb.Node3.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x6C" + }, + { + "EventName": "df_ccm_reqb.Node4.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0x8C" + }, + { + "EventName": "df_ccm_reqb.Node5.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0xAC" + }, + { + "EventName": "df_ccm_reqb.Node6.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0xCC" + }, + { + "EventName": "df_ccm_reqb.Node7.wbinvblkall", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered wbinvblkall", + "UMask": "0xEC" + }, + { + "EventName": "df_ccm_reqb.Node0.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x0B" + }, + { + "EventName": "df_ccm_reqb.Node1.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x2B" + }, + { + "EventName": "df_ccm_reqb.Node2.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x4B" + }, + { + "EventName": "df_ccm_reqb.Node3.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x6B" + }, + { + "EventName": "df_ccm_reqb.Node4.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0x8B" + }, + { + "EventName": "df_ccm_reqb.Node5.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0xAB" + }, + { + "EventName": "df_ccm_reqb.Node6.vicblkfullzero", + "EventCode": "0x8c", + "BriefDescription": "Data Fabric CCM Performance Monitor Event DF CCM Request Ordered vicblkfullzero", + "UMask": "0xCB" + }, + { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-12@freebsd.org Wed Nov 21 03:05:57 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 626BD11007D5; Wed, 21 Nov 2018 03:05:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA3F06B0FD; Wed, 21 Nov 2018 03:05:56 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAL35s3D069880; Tue, 20 Nov 2018 19:05:54 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAL35sEJ069879; Tue, 20 Nov 2018 19:05:54 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811210305.wAL35sEJ069879@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340695 - in stable/12/sys: amd64/conf i386/conf In-Reply-To: To: Niclas Zeising Date: Tue, 20 Nov 2018 19:05:54 -0800 (PST) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: BA3F06B0FD X-Spamd-Result: default: False [1.28 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.02)[country: US(-0.09)]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.54)[0.536,0]; NEURAL_HAM_SHORT(-0.64)[-0.644,0]; NEURAL_SPAM_MEDIUM(0.52)[0.515,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 03:05:57 -0000 > On 11/20/18 9:07 PM, Rodney W. Grimes wrote: > >> Author: zeising (doc,ports committer) > >> Date: Tue Nov 20 19:37:09 2018 > >> New Revision: 340695 > >> URL: https://svnweb.freebsd.org/changeset/base/340695 > >> > >> Log: > >> MFC r340387: Add evdev support to amd64 and i386 > >> > >> This merge is done sans sys/i386/conf/MINIMAL, since that doesn't exist in > >> stable/12, only current. > > > > Could you do me a favor and track down why MINIMAL has > > not be mfc'ed? And if there is not a good reason for > > it to not be MFC'ed see that it does get done. > > > > I asked about it cem (the original author of i386/conf/MINIMAL) about it > here: > https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172337.html > The reply is here: > https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172353.html Thanks. I'll find another way to deal with this. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable-12@freebsd.org Wed Nov 21 03:23:14 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2099B11021CE for ; Wed, 21 Nov 2018 03:23:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AF766BF69 for ; Wed, 21 Nov 2018 03:23:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io1-xd2f.google.com with SMTP id f6so3039444iob.1 for ; Tue, 20 Nov 2018 19:23:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6nTXJAOvBxbkmR5CQZRCwJez7XYEdLWdmC0o23ZM4r8=; b=lcC+siOih5fdLvF3FtEcFRr2uc/fTyukh9beboe9Cl0gu0anuzrQzLUDsLbKatOFaI 0S1OOBTpBV1XfG0E5SVWjn7ReZ3nxq48xMOfwk6W4YzfeHmygqVjUdvzxEzHqcNWYJKC qPczu8bAtvLsxOeFUdc1tIfAhqzfpIWlmXTMHXvnLMkYRhJvd28c6hNmpk41QGG3vFjZ HZY4qBcqs5AQY6V9RvdLkTocOVlwz4eFFV+uamUvkoH1HfdJxYr4GeMjEP8GQVVvqVui tx9Wr48D1IRSdsvOCfTVKNREU0P/DWb/8XqIkYI5/pVmYpjgNeYCVPVvUMTBSIKH23Eq HElA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=6nTXJAOvBxbkmR5CQZRCwJez7XYEdLWdmC0o23ZM4r8=; b=SdZO8HYv/hRP0KCSi6Wh7FK2eYtOyKF5/I8fH2eVkUOXPEwiytPZMJnAxZJUrp/Qrj aLnAudf9y4no9nP68X+nJgXYAkuYc15/amegA08ewCQbHSIsma0reclM7cELaucJ1SOs GHNB87JnihgLxkB5n+Wj2lj0hdUZ/75l3XN9VjBWyFI7M4C97iqkdySCre+Ht50I1L9q PJPt5P1QiMV52zYZYeUX4mioWJjDfW126XNhYaugK0Nd23KR4jmBEl/kQFOpjZ/QP31s hUZ0myjVxQKXfwi1pvzSl4T2EVe6bDAGaDMyMbyzA6cEfKTc5Zra1+xAe/uDNbHmBIb8 WNbw== X-Gm-Message-State: AA+aEWbV4V1eOcDrHFh+GEIMCtDpCGT7Xq0Jyt0ChpC3b1i5eVpmTisC qSWm3FE4yfeFGWjCS6EPAZgnzelOXJUo9VRuunjnH7Vi X-Google-Smtp-Source: AFSGD/XH2bnYL7d7to+sPxfx5M70Qy7njz3VOOaYYTh3iTGVlPg3BvG1qe5aDn2e2qoCMjsLUhrAglXDobLYvriQfr8= X-Received: by 2002:a5d:870c:: with SMTP id u12mr3134493iom.168.1542770592243; Tue, 20 Nov 2018 19:23:12 -0800 (PST) MIME-Version: 1.0 References: <201811210305.wAL35sEJ069879@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201811210305.wAL35sEJ069879@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Tue, 20 Nov 2018 20:23:00 -0700 Message-ID: Subject: Re: svn commit: r340695 - in stable/12/sys: amd64/conf i386/conf To: "Rodney W. Grimes" Cc: Niclas Zeising , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org X-Rspamd-Queue-Id: 0AF766BF69 X-Spamd-Result: default: False [-5.33 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-stable-12@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT1.aspmx.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[f.2.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.35)[ip: (-7.70), ipnet: 2607:f8b0::/32(-2.38), asn: 15169(-1.59), country: US(-0.09)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Server: mx1.freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 03:23:14 -0000 On Tue, Nov 20, 2018, 8:06 PM Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > On 11/20/18 9:07 PM, Rodney W. Grimes wrote: > > >> Author: zeising (doc,ports committer) > > >> Date: Tue Nov 20 19:37:09 2018 > > >> New Revision: 340695 > > >> URL: https://svnweb.freebsd.org/changeset/base/340695 > > >> > > >> Log: > > >> MFC r340387: Add evdev support to amd64 and i386 > > >> > > >> This merge is done sans sys/i386/conf/MINIMAL, since that doesn't > exist in > > >> stable/12, only current. > > > > > > Could you do me a favor and track down why MINIMAL has > > > not be mfc'ed? And if there is not a good reason for > > > it to not be MFC'ed see that it does get done. > > > > > > > I asked about it cem (the original author of i386/conf/MINIMAL) about it > > here: > > > https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172337.html > > The reply is here: > > > https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172353.html > > Thanks. I'll find another way to deal I was thinking of implementing the GENERIC is MINIMAL plus stuff, and that would be a good time to fix this.. Warner > From owner-svn-src-stable-12@freebsd.org Wed Nov 21 03:32:17 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74D1A1102794; Wed, 21 Nov 2018 03:32:17 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B34BD6C58D; Wed, 21 Nov 2018 03:32:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id wAL3WEKm069991; Tue, 20 Nov 2018 19:32:14 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id wAL3WEjV069990; Tue, 20 Nov 2018 19:32:14 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201811210332.wAL3WEjV069990@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r340695 - in stable/12/sys: amd64/conf i386/conf In-Reply-To: To: Warner Losh Date: Tue, 20 Nov 2018 19:32:14 -0800 (PST) CC: "Rodney W. Grimes" , Niclas Zeising , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: B34BD6C58D X-Spamd-Result: default: False [1.12 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[rgrimes@freebsd.org]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[dnsmgr.net]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.40)[0.403,0]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: pdx.rh.CN85.dnsmgr.net]; NEURAL_SPAM_LONG(0.45)[0.451,0]; RCPT_COUNT_SEVEN(0.00)[7]; NEURAL_HAM_SHORT(-0.60)[-0.603,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13868, ipnet:69.59.192.0/19, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-0.02)[country: US(-0.09)] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 03:32:17 -0000 > On Tue, Nov 20, 2018, 8:06 PM Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net wrote: > > > > On 11/20/18 9:07 PM, Rodney W. Grimes wrote: > > > >> Author: zeising (doc,ports committer) > > > >> Date: Tue Nov 20 19:37:09 2018 > > > >> New Revision: 340695 > > > >> URL: https://svnweb.freebsd.org/changeset/base/340695 > > > >> > > > >> Log: > > > >> MFC r340387: Add evdev support to amd64 and i386 > > > >> > > > >> This merge is done sans sys/i386/conf/MINIMAL, since that doesn't > > exist in > > > >> stable/12, only current. > > > > > > > > Could you do me a favor and track down why MINIMAL has > > > > not be mfc'ed? And if there is not a good reason for > > > > it to not be MFC'ed see that it does get done. > > > > > > > > > > I asked about it cem (the original author of i386/conf/MINIMAL) about it > > > here: > > > > > https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172337.html > > > The reply is here: > > > > > https://lists.freebsd.org/pipermail/svn-src-all/2018-November/172353.html > > > > Thanks. I'll find another way to deal > > > I was thinking of implementing the GENERIC is MINIMAL plus stuff, and that > would be a good time to fix this.. If you can get this done before I get mentor approval to do the MFC adding it to stable/12 and stable/11 and fixing up the merged bits that got left out because it was not there then wonderful, if not I should have MINIMAL correctly merged and cleaned up by end of week. > > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-stable-12@freebsd.org Wed Nov 21 06:36:19 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D01F1107B8F; Wed, 21 Nov 2018 06:36:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5DBD71728; Wed, 21 Nov 2018 06:36:18 +0000 (UTC) (envelope-from kib@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86F841C960; Wed, 21 Nov 2018 06:36:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAL6aISa023463; Wed, 21 Nov 2018 06:36:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAL6aGC4023449; Wed, 21 Nov 2018 06:36:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201811210636.wAL6aGC4023449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 21 Nov 2018 06:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340721 - in stable/12: lib/libc/sys share/man/man5 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/cd9660 sys/fs/devfs sys/fs/ext2fs sys/fs/fdescfs sys/fs/msdosfs sys/fs/nandfs s... X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12: lib/libc/sys share/man/man5 sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/fs/cd9660 sys/fs/devfs sys/fs/ext2fs sys/fs/fdescfs sys/fs/msdosfs sys/fs/nandfs sys/fs/pseudofs sys/fs/udf... X-SVN-Commit-Revision: 340721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5DBD71728 X-Spamd-Result: default: False [0.45 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.014,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.13)[0.129,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 06:36:19 -0000 Author: kib Date: Wed Nov 21 06:36:15 2018 New Revision: 340721 URL: https://svnweb.freebsd.org/changeset/base/340721 Log: MFC r340431: Add d_off support for multiple filesystems. Modified: stable/12/lib/libc/sys/getdirentries.2 stable/12/share/man/man5/dir.5 stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/12/sys/fs/cd9660/cd9660_vnops.c stable/12/sys/fs/devfs/devfs_vnops.c stable/12/sys/fs/ext2fs/ext2_lookup.c stable/12/sys/fs/fdescfs/fdesc_vnops.c stable/12/sys/fs/msdosfs/msdosfs_vnops.c stable/12/sys/fs/nandfs/nandfs_vnops.c stable/12/sys/fs/pseudofs/pseudofs_vnops.c stable/12/sys/fs/udf/udf_vnops.c stable/12/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/getdirentries.2 ============================================================================== --- stable/12/lib/libc/sys/getdirentries.2 Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/lib/libc/sys/getdirentries.2 Wed Nov 21 06:36:15 2018 (r340721) @@ -28,7 +28,7 @@ .\" @(#)getdirentries.2 8.2 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd May 28, 2017 +.Dd Nov 14, 2018 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -88,6 +88,11 @@ Files that are linked by hard links (see have the same .Fa d_fileno . The +.Fa d_off +field returns a cookie which can be used with +.Xr lseek 2 +to position the directory descriptor to the next entry. +The .Fa d_reclen entry is the length, in bytes, of the directory record. The @@ -140,8 +145,17 @@ a value returned in the location pointed to by .Fa basep .Po Fn getdirentries only -.Pc +.Pc , +a value returned in the +.Fa d_off +field, or zero. +.Sh IMPLEMENTATION NOTES +The +.Fa d_off +field is being used as a cookie to readdir for nfs servers. +These cookies can be cached and allow to read directory entries at a specific +offset on demand. .Sh RETURN VALUES If successful, the number of bytes actually transferred is returned. Otherwise, -1 is returned and the global variable Modified: stable/12/share/man/man5/dir.5 ============================================================================== --- stable/12/share/man/man5/dir.5 Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/share/man/man5/dir.5 Wed Nov 21 06:36:15 2018 (r340721) @@ -28,7 +28,7 @@ .\" @(#)dir.5 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd June 20, 2018 +.Dd November 14, 2018 .Dt DIR 5 .Os .Sh NAME @@ -101,7 +101,7 @@ The directory entry format is defined in the file struct dirent { ino_t d_fileno; /* file number of entry */ - off_t d_off; /* directory offset of entry */ + off_t d_off; /* directory offset of the next entry */ __uint16_t d_reclen; /* length of this record */ __uint8_t d_type; /* file type, see below */ __uint8_t d_namlen; /* length of string in d_name */ Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Wed Nov 21 06:36:15 2018 (r340721) @@ -1097,6 +1097,8 @@ zfsctl_snapdir_readdir(ap) strcpy(entry.d_name, snapname); entry.d_namlen = strlen(entry.d_name); entry.d_reclen = sizeof(entry); + /* NOTE: d_off is the offset for the *next* entry. */ + entry.d_off = cookie + dots_offset; error = vfs_read_dirent(ap, &entry, uio->uio_offset); if (error != 0) { if (error == ENAMETOOLONG) Modified: stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -2529,8 +2529,8 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * */ eodp->ed_ino = objnum; eodp->ed_reclen = reclen; - /* NOTE: ed_off is the offset for the *next* entry */ - next = &(eodp->ed_off); + /* NOTE: ed_off is the offset for the *next* entry. */ + next = &eodp->ed_off; eodp->ed_eflags = zap.za_normalization_conflict ? ED_CASE_CONFLICT : 0; (void) strncpy(eodp->ed_name, zap.za_name, @@ -2543,6 +2543,8 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * odp->d_ino = objnum; odp->d_reclen = reclen; odp->d_namlen = strlen(zap.za_name); + /* NOTE: d_off is the offset for the *next* entry. */ + next = &odp->d_off; (void) strlcpy(odp->d_name, zap.za_name, odp->d_namlen + 1); odp->d_type = type; odp = (dirent64_t *)((intptr_t)odp + reclen); @@ -2567,6 +2569,9 @@ zfs_readdir(vnode_t *vp, uio_t *uio, cred_t *cr, int * offset += 1; } + /* Fill the offset right after advancing the cursor. */ + if (next != NULL) + *next = offset; if (cooks != NULL) { *cooks++ = offset; ncooks--; Modified: stable/12/sys/fs/cd9660/cd9660_vnops.c ============================================================================== --- stable/12/sys/fs/cd9660/cd9660_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/cd9660/cd9660_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -576,6 +576,8 @@ cd9660_readdir(ap) entryoffsetinblock; idp->curroff += reclen; + /* NOTE: d_off is the offset of *next* entry. */ + idp->current.d_off = idp->curroff; switch (imp->iso_ftype) { case ISO_FTYPE_RRIP: Modified: stable/12/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/12/sys/fs/devfs/devfs_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/devfs/devfs_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -1355,6 +1355,8 @@ devfs_readdir(struct vop_readdir_args *ap) if (dp->d_reclen > uio->uio_resid) break; dp->d_fileno = de->de_inode; + /* NOTE: d_off is the offset for the *next* entry. */ + dp->d_off = off + dp->d_reclen; if (off >= uio->uio_offset) { error = vfs_read_dirent(ap, dp, off); if (error) Modified: stable/12/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/12/sys/fs/ext2fs/ext2_lookup.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/ext2fs/ext2_lookup.c Wed Nov 21 06:36:15 2018 (r340721) @@ -224,6 +224,8 @@ ext2_readdir(struct vop_readdir_args *ap) dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->e2d_name, dstdp.d_name, dstdp.d_namlen); dstdp.d_name[dstdp.d_namlen] = '\0'; + /* NOTE: d_off is the offset of the *next* entry. */ + dstdp.d_off = offset + dp->e2d_reclen; if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; Modified: stable/12/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- stable/12/sys/fs/fdescfs/fdesc_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/fdescfs/fdesc_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -574,6 +574,8 @@ fdesc_readdir(struct vop_readdir_args *ap) dp->d_fileno = i + FD_DESC; break; } + /* NOTE: d_off is the offset of the *next* entry. */ + dp->d_off = UIO_MX * (i + 1); if (dp->d_namlen != 0) { /* * And ship to userland Modified: stable/12/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/12/sys/fs/msdosfs/msdosfs_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/msdosfs/msdosfs_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -1558,6 +1558,8 @@ msdosfs_readdir(struct vop_readdir_args *ap) break; } dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); + /* NOTE: d_off is the offset of the *next* entry. */ + dirbuf.d_off = offset + sizeof(struct direntry); if (uio->uio_resid < dirbuf.d_reclen) goto out; error = uiomove(&dirbuf, dirbuf.d_reclen, uio); @@ -1681,6 +1683,8 @@ msdosfs_readdir(struct vop_readdir_args *ap) mbnambuf_flush(&nb, &dirbuf); chksum = -1; dirbuf.d_reclen = GENERIC_DIRSIZ(&dirbuf); + /* NOTE: d_off is the offset of the *next* entry. */ + dirbuf.d_off = offset + sizeof(struct direntry); if (uio->uio_resid < dirbuf.d_reclen) { brelse(bp); goto out; Modified: stable/12/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- stable/12/sys/fs/nandfs/nandfs_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/nandfs/nandfs_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -1233,6 +1233,8 @@ nandfs_readdir(struct vop_readdir_args *ap) dirent.d_namlen = name_len; strncpy(dirent.d_name, ndirent->name, name_len); dirent.d_reclen = GENERIC_DIRSIZ(&dirent); + /* NOTE: d_off is the offset of the *next* entry. */ + dirent.d_off = diroffset + ndirent->rec_len; DPRINTF(READDIR, ("copying `%*.*s`\n", name_len, name_len, dirent.d_name)); } Modified: stable/12/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/12/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/pseudofs/pseudofs_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -830,6 +830,8 @@ pfs_readdir(struct vop_readdir_args *va) pfsent->entry.d_name[i] = pn->pn_name[i]; pfsent->entry.d_name[i] = 0; pfsent->entry.d_namlen = i; + /* NOTE: d_off is the offset of the *next* entry. */ + pfsent->entry.d_off = offset + PFS_DELEN; switch (pn->pn_type) { case pfstype_procdir: KASSERT(p != NULL, Modified: stable/12/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/12/sys/fs/udf/udf_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/fs/udf/udf_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -846,6 +846,7 @@ udf_readdir(struct vop_readdir_args *a) dir.d_name[1] = '\0'; dir.d_namlen = 1; dir.d_reclen = GENERIC_DIRSIZ(&dir); + dir.d_off = 1; uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 1); if (error) @@ -858,6 +859,7 @@ udf_readdir(struct vop_readdir_args *a) dir.d_name[2] = '\0'; dir.d_namlen = 2; dir.d_reclen = GENERIC_DIRSIZ(&dir); + dir.d_off = 2; uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, 2); } else { @@ -867,6 +869,7 @@ udf_readdir(struct vop_readdir_args *a) dir.d_type = (fid->file_char & UDF_FILE_CHAR_DIR) ? DT_DIR : DT_UNKNOWN; dir.d_reclen = GENERIC_DIRSIZ(&dir); + dir.d_off = ds->this_off; uiodir.dirent = &dir; error = udf_uiodir(&uiodir, dir.d_reclen, uio, ds->this_off); Modified: stable/12/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/12/sys/ufs/ufs/ufs_vnops.c Wed Nov 21 04:34:18 2018 (r340720) +++ stable/12/sys/ufs/ufs/ufs_vnops.c Wed Nov 21 06:36:15 2018 (r340721) @@ -2218,6 +2218,8 @@ ufs_readdir(ap) dstdp.d_reclen = GENERIC_DIRSIZ(&dstdp); bcopy(dp->d_name, dstdp.d_name, dstdp.d_namlen); dstdp.d_name[dstdp.d_namlen] = '\0'; + /* NOTE: d_off is the offset of the *next* entry. */ + dstdp.d_off = offset + dp->d_reclen; if (dstdp.d_reclen > uio->uio_resid) { if (uio->uio_resid == startresid) error = EINVAL; From owner-svn-src-stable-12@freebsd.org Wed Nov 21 17:04:43 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CFDE113E8F6; Wed, 21 Nov 2018 17:04:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2F1B6AE0A; Wed, 21 Nov 2018 17:04:42 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 847D52339D; Wed, 21 Nov 2018 17:04:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALH4gH0049159; Wed, 21 Nov 2018 17:04:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALH4g87049158; Wed, 21 Nov 2018 17:04:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211704.wALH4g87049158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:04:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340727 - stable/12/sbin/dumpon X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/dumpon X-SVN-Commit-Revision: 340727 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2F1B6AE0A X-Spamd-Result: default: False [0.44 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.014,0]; NEURAL_SPAM_SHORT(0.11)[0.113,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:04:43 -0000 Author: markj Date: Wed Nov 21 17:04:42 2018 New Revision: 340727 URL: https://svnweb.freebsd.org/changeset/base/340727 Log: MFC r339785 (by cem): dumpon.8: Significantly revamp page Modified: stable/12/sbin/dumpon/dumpon.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/dumpon/dumpon.8 ============================================================================== --- stable/12/sbin/dumpon/dumpon.8 Wed Nov 21 16:47:11 2018 (r340726) +++ stable/12/sbin/dumpon/dumpon.8 Wed Nov 21 17:04:42 2018 (r340727) @@ -59,27 +59,120 @@ .Sh DESCRIPTION The .Nm -utility is used to specify a device where the kernel can save a crash -dump in the case of a panic. +utility is used to configure where the kernel can save a crash dump in the case +of a panic. .Pp -Calls to +System administrators should typically configure .Nm -normally occur from the system multi-user initialization file -.Pa /etc/rc , -controlled by the -.Dq dumpdev +in a persistent fashion using the +.Xr rc.conf 5 +variables +.Va dumpdev and -.Dq dumpon_flags -variables in the boot time configuration file -.Pa /etc/rc.conf . +.Va dumpon_flags . +For more information on this usage, see +.Xr rc.conf 5 . +.Ss General options +.Bl -tag -width _k_pubkey +.It Fl k Ar pubkey +Configure encrypted kernel dumps. .Pp +A random, one-time symmetric key is automatically generated for bulk kernel +dump encryption every time +.Nm +is used. +The provided +.Ar pubkey +is used to encrypt a copy of the symmetric key. +The encrypted dump contents consist of a standard dump header, the +pubkey-encrypted symmetric key contents, and the symmetric key encrypted core +dump contents. +.Pp +As a result, only someone with the corresponding private key can decrypt the symmetric key. +The symmetric key is necessary to decrypt the kernel core. +The goal of the mechanism is to provide confidentiality. +.Pp +The +.Va pubkey +file should be a PEM-formatted RSA key of at least 1024 bits. +.It Fl l +List the currently configured dump device, or /dev/null if no device is +configured. +.It Fl v +Enable verbose mode. +.It Fl Z +Enable compression (Zstandard). +.It Fl z +Enable compression (gzip). +Only one compression method may be enabled at a time, so +.Fl z +is incompatible with +.Fl Z . +.Pp +Zstandard provides superior compression ratio and performance. +.El +.Ss Netdump +.Nm +may also configure the kernel to dump to a remote +.Xr netdumpd 8 +server. +(The +.Xr netdumpd 8 +server is available in ports.) +.Xr netdump 4 +eliminates the need to reserve space for crash dumps. +It is especially useful in diskless environments. +When +.Nm +is used to configure netdump, the +.Ar device +(or +.Ar iface ) +parameter should specify a network interface (e.g., +.Va igb1 ) . +The specified NIC must be up (online) to configure netdump. +.Pp +.Xr netdump 4 +specific options include: +.Bl -tag -width _g_gateway +.It Fl c Ar client +The local IP address of the +.Xr netdump 4 +client. +.It Fl g Ar gateway +Optional. +If not specified, it is assumed that the +.Ar server +is on the same link as the +.Ar client . +.Pp +If specified, +.Ar gateway +is the address of the first-hop router between the +.Ar client +and the +.Ar server . +The special value +.Dv Dq default +indicates that the currently configured system default route should be used. +.It Fl s Ar server +The IP address of the +.Xr netdumpd 8 +server. +.El +.Pp +All of these options can be specified in the +.Xr rc.conf 5 +variable +.Va dumpon_flags . +.Ss Minidumps The default type of kernel crash dump is the mini crash dump. Mini crash dumps hold only memory pages in use by the kernel. Alternatively, full memory dumps can be enabled by setting the .Va debug.minidump .Xr sysctl 8 variable to 0. -.Pp +.Ss Full dumps For systems using full memory dumps, the size of the specified dump device must be at least the size of physical memory. Even though an additional 64 kB header is added to the dump, the BIOS for a @@ -93,155 +186,18 @@ total amount of physical memory as reported by the .Va hw.physmem .Xr sysctl 8 variable. -.Pp -.Nm -is used to configure a local storage device as the dump device. -With additional parameters, the kernel can instead be configured to -transmit a dump to a remote server using -.Xr netdump 4 . -This eliminates the need to reserve space for saving crash dumps and -is especially useful in diskless environments. -The -.Xr netdump 4 -server address is specified with -.Fl s Ar server , -and the local address is specified with -.Fl c Ar client . -The -.Fl g Ar gateway -parameter may be used to specify a first-hop router to the server, -or to specify that the currently configured default gateway is to -be used. -Note that the -.Xr netdump 4 -configuration is not automatically updated if any network configuration -(e.g., the default route) changes after the -.Nm -invocation. -The name of the interface to be used must be specified as -.Ar iface . -The interface must be up in order to configure -.Xr netdump 4 . -.Pp -The -.Fl k Ar pubkey -flag causes -.Nm -to generate a one-time key for kernel crash dump encryption. -The key will be replaced by a new one when the -.Nm -utility is run again. -The key is encrypted using -.Ar pubkey . -This process is sandboxed using -.Xr capsicum 4 . -Both plain and encrypted keys are sent to the kernel using -.Dv DIOCSKERNELDUMP -.Xr ioctl 2 . -A user can specify the -.Ar pubkey -in the -.Dq dumpon_flags -variable defined in -.Pa /etc/rc.conf -for use with the -.Pa /etc/rc.d/dumpon -.Xr rc 8 -script. -This flag requires a kernel compiled with the -.Dv EKCD -kernel option. -.Pp -The -.Fl z -and -.Fl Z -options configure the kernel to compress the dump before writing it to -the dump device. -This reduces the amount of space required for the dump and accelerates -recovery with -.Xr savecore 8 -since less data needs to be copied from the dump device. -When compression is enabled, the -.Nm -utility will not verify that the dump device is sufficiently large for a full -dump. -The -.Fl z -and -.Fl Z -options cause the dump to be written in -.Xr gzip 1 -and -.Xr zstd 1 -format, respectively. -These flags require a kernel compiled with the -.Dv GZIO -or -.Dv ZSTDIO -kernel options. -.Pp -The -.Fl l -flag causes -.Nm -to print the current dump device or _PATH_DEVNULL ("/dev/null") if no device is -configured. -.Pp -The -.Fl v -flag causes -.Nm -to be verbose about its activity. .Sh IMPLEMENTATION NOTES -Since a -.Xr panic 9 -condition may occur in a situation -where the kernel cannot trust its internal representation -of the state of any given file system, -one of the system swap devices, -and -.Em not -a device containing a file system, -should be used as the dump device. +Because the file system layer is already dead by the time a crash dump +is taken, it is not possible to send crash dumps directly to a file. .Pp The -.Nm -utility operates by opening -.Ar device -and making a -.Dv DIOCSKERNELDUMP -.Xr ioctl 2 -request on it to save kernel crash dumps. -If -.Ar device -is the text string: -.Dq Li off , -.Nm -performs a -.Dv DIOCSKERNELDUMP -.Xr ioctl 2 -on -.Pa /dev/null -and thus instructs the kernel not to save crash dumps. -.Pp -Since -.Nm -cannot be used during kernel initialization, the -.Va dumpdev -variable of .Xr loader 8 -must be used to enable dumps for system panics which occur -during kernel initialization. -.Sh FILES -.Bl -tag -width "/dev/{ada,da}?s?b" -compact -.It Pa /dev/{ada,da}?s?b -standard swap areas -.It Pa /etc/rc.conf -boot-time system configuration -.El +variable +.Va dumpdev +may be used to enable early kernel core dumps for system panics which occur +before userspace starts. .Sh EXAMPLES -In order to generate an RSA private key a user can use the +In order to generate an RSA private key, a user can use the .Xr genrsa 1 tool: .Pp @@ -253,7 +209,8 @@ tool: .Pp .Dl # openssl rsa -in private.pem -out public.pem -pubout .Pp -Once the RSA keys are created the private key should be moved to a safe place. +Once the RSA keys are created in a safe place, the public key may be moved to +the untrusted netdump client machine. Now .Pa public.pem can be used by @@ -278,21 +235,23 @@ reboot: .Pp After reboot .Xr savecore 8 -should be able to save the core dump in the core directory which is +should be able to save the core dump in the +.Va Dq dumpdir +directory, which is .Pa /var/crash by default: .Pp -.Dl # savecore /var/crash /dev/ada0s1b +.Dl # savecore /dev/ada0s1b .Pp Three files should be created in the core directory: .Pa info.# , .Pa key.# and .Pa vmcore_encrypted.# -where +(where .Dq # is the number of the last core dump saved by -.Xr savecore 8 . +.Xr savecore 8 ) . The .Pa vmcore_encrypted.# can be decrypted using the @@ -320,12 +279,15 @@ The core was decrypted properly if .Xr kgdb 1 does not print any errors. Note that the live kernel might be at a different path -which can be examined by looking at the kern.bootfile sysctl. +which can be examined by looking at the +.Va kern.bootfile +.Xr sysctl 8 . .Sh SEE ALSO .Xr gzip 1 , .Xr kgdb 1 , .Xr zstd 1 , .Xr ddb 4 , +.Xr netdump 4 , .Xr fstab 5 , .Xr rc.conf 5 , .Xr config 8 , @@ -341,10 +303,49 @@ The .Nm utility appeared in .Fx 2.0.5 . -.Sh BUGS -Because the file system layer is already dead by the time a crash dump -is taken, it is not possible to send crash dumps directly to a file. .Pp +Support for encrypted kernel core dumps and netdump was added in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +manual page was written by +.An Mark Johnston Aq Mt markj@FreeBSD.org , +.An Conrad Meyer Aq Mt cem@FreeBSD.org , +.An Konrad Witaszczyk Aq Mt def@FreeBSD.org , +and countless others. +.Sh CAVEATS +To configure encrypted kernel core dumps, the running kernel must have been +compiled with the +.Dv EKCD +option. +.Pp +Netdump does not automatically update the configured +.Ar gateway +if routing topology changes. +.Pp +The size of a compressed dump or a minidump is not a fixed function of RAM +size. +Therefore, when at least one of these options is enabled, the +.Nm +utility cannot verify that the +.Ar device +has sufficient space for a dump. +.Nm +is also unable to verify that a configured +.Xr netdumpd 8 +server has sufficient space for a dump. +.Pp +.Fl Z +requires a kernel compiled with the +.Dv ZSTDIO +kernel option. +Similarly, +.Fl z +requires the +.Dv GZIO +option. +.Sh BUGS It is currently not possible to configure both compression and encryption. The encrypted dump format assumes that the kernel dump size is a multiple of the cipher block size, which may not be true when the dump is compressed. From owner-svn-src-stable-12@freebsd.org Wed Nov 21 17:07:08 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 599E5113EC2F; Wed, 21 Nov 2018 17:07:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C36D26B0E2; Wed, 21 Nov 2018 17:07:07 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A478A233A0; Wed, 21 Nov 2018 17:07:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALH77tt049332; Wed, 21 Nov 2018 17:07:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALH776e049331; Wed, 21 Nov 2018 17:07:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811211707.wALH776e049331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 21 Nov 2018 17:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340728 - stable/12/sbin/dumpon X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/dumpon X-SVN-Commit-Revision: 340728 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C36D26B0E2 X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.010,0]; NEURAL_SPAM_SHORT(0.11)[0.114,0]; NEURAL_SPAM_MEDIUM(0.29)[0.287,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:07:08 -0000 Author: markj Date: Wed Nov 21 17:07:07 2018 New Revision: 340728 URL: https://svnweb.freebsd.org/changeset/base/340728 Log: MFC r340547, r340686: Change dumpon(8)'s handling of -g. Modified: stable/12/sbin/dumpon/dumpon.8 stable/12/sbin/dumpon/dumpon.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/dumpon/dumpon.8 ============================================================================== --- stable/12/sbin/dumpon/dumpon.8 Wed Nov 21 17:04:42 2018 (r340727) +++ stable/12/sbin/dumpon/dumpon.8 Wed Nov 21 17:07:07 2018 (r340728) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd June 13, 2018 +.Dd November 17, 2018 .Dt DUMPON 8 .Os .Sh NAME @@ -46,7 +46,7 @@ .Op Fl k Ar pubkey .Op Fl Z .Op Fl z -.Op Fl g Ar gateway | Li default +.Op Fl g Ar gateway .Fl s Ar server .Fl c Ar client .Ar iface @@ -140,21 +140,22 @@ The local IP address of the .Xr netdump 4 client. .It Fl g Ar gateway -Optional. -If not specified, it is assumed that the -.Ar server -is on the same link as the -.Ar client . -.Pp -If specified, -.Ar gateway -is the address of the first-hop router between the +The first-hop router between .Ar client -and the +and .Ar server . -The special value -.Dv Dq default -indicates that the currently configured system default route should be used. +If the +.Fl g +option is not specified and the system has a default route, the default +router is used as the +.Xr netdump 4 +gateway. +If the +.Fl g +option is not specified and the system does not have a default route, +.Ar server +is assumed to be on the same link as +.Ar client . .It Fl s Ar server The IP address of the .Xr netdumpd 8 Modified: stable/12/sbin/dumpon/dumpon.c ============================================================================== --- stable/12/sbin/dumpon/dumpon.c Wed Nov 21 17:04:42 2018 (r340727) +++ stable/12/sbin/dumpon/dumpon.c Wed Nov 21 17:07:07 2018 (r340728) @@ -88,7 +88,7 @@ usage(void) fprintf(stderr, "usage: dumpon [-v] [-k ] [-Zz] \n" " dumpon [-v] [-k ] [-Zz]\n" - " [-g |default] -s -c \n" + " [-g ] -s -c \n" " dumpon [-v] off\n" " dumpon [-v] -l\n"); exit(EX_USAGE); @@ -109,8 +109,6 @@ find_gateway(const char *ifname) size_t sz; int error, i, ifindex, mib[7]; - ret = NULL; - /* First look up the interface index. */ if (getifaddrs(&ifap) != 0) err(EX_OSERR, "getifaddrs"); @@ -148,6 +146,7 @@ find_gateway(const char *ifname) free(buf); } + ret = NULL; for (next = buf; next < buf + sz; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)(void *)next; if (rtm->rtm_version != RTM_VERSION) @@ -452,12 +451,16 @@ main(int argc, char *argv[]) if (inet_aton(client, &ndconf.ndc_client) == 0) errx(EX_USAGE, "invalid client address '%s'", client); - if (gateway == NULL) - gateway = server; - else if (strcmp(gateway, "default") == 0 && - (gateway = find_gateway(argv[0])) == NULL) - errx(EX_NOHOST, - "failed to look up next-hop router for %s", server); + if (gateway == NULL) { + gateway = find_gateway(argv[0]); + if (gateway == NULL) { + if (verbose) + printf( + "failed to look up gateway for %s\n", + server); + gateway = server; + } + } if (inet_aton(gateway, &ndconf.ndc_gateway) == 0) errx(EX_USAGE, "invalid gateway address '%s'", gateway); From owner-svn-src-stable-12@freebsd.org Wed Nov 21 17:14:59 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDF04113EF3E; Wed, 21 Nov 2018 17:14:58 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 850376B796; Wed, 21 Nov 2018 17:14:58 +0000 (UTC) (envelope-from shurd@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6727E23538; Wed, 21 Nov 2018 17:14:58 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALHEwsM054873; Wed, 21 Nov 2018 17:14:58 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALHEw4W054872; Wed, 21 Nov 2018 17:14:58 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201811211714.wALHEw4W054872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 21 Nov 2018 17:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340729 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 340729 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 850376B796 X-Spamd-Result: default: False [0.41 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.01)[0.010,0]; NEURAL_SPAM_SHORT(0.11)[0.114,0]; NEURAL_SPAM_MEDIUM(0.29)[0.287,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 17:14:59 -0000 Author: shurd Date: Wed Nov 21 17:14:57 2018 New Revision: 340729 URL: https://svnweb.freebsd.org/changeset/base/340729 Log: MFC r340435: Prevent POLA violation with TSO/CSUM offload Ensure that any time CSUM_IP_TSO or CSUM_IP6_TSO is set that the corresponding CSUM_IP6?_TCP / CSUM_IP flags are also set. Rather than requireing drivers to bake-in an understanding that TSO implies checksum offloads, make it explicit. This change requires us to move the IFLIB_NEED_ZERO_CSUM implementation to ensure it's zeroed for TSO. Reported by: Jacob Keller Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D17801 Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Wed Nov 21 17:07:07 2018 (r340728) +++ stable/12/sys/net/iflib.c Wed Nov 21 17:14:57 2018 (r340729) @@ -2974,9 +2974,6 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ipproto = ip->ip_p; pi->ipi_flags |= IPI_TX_IPV4; - if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) - ip->ip_sum = 0; - /* TCP checksum offload may require TCP header length */ if (IS_TX_OFFLOAD4(pi)) { if (__predict_true(pi->ipi_ipproto == IPPROTO_TCP)) { @@ -2993,6 +2990,10 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (IS_TSO4(pi)) { if (__predict_false(ip->ip_p != IPPROTO_TCP)) return (ENXIO); + /* + * TSO always requires hardware checksum offload. + */ + pi->ipi_csum_flags |= (CSUM_IP_TCP | CSUM_IP); th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; @@ -3002,6 +3003,9 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, } } } + if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) + ip->ip_sum = 0; + break; } #endif @@ -3039,9 +3043,7 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) return (ENXIO); /* - * The corresponding flag is set by the stack in the IPv4 - * TSO case, but not in IPv6 (at least in FreeBSD 10.2). - * So, set it here because the rest of the flow requires it. + * TSO always requires hardware checksum offload. */ pi->ipi_csum_flags |= CSUM_IP6_TCP; th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); From owner-svn-src-stable-12@freebsd.org Wed Nov 21 18:53:14 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8BC11141D98; Wed, 21 Nov 2018 18:53:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38E88700DD; Wed, 21 Nov 2018 18:53:14 +0000 (UTC) (envelope-from marius@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 160A024608; Wed, 21 Nov 2018 18:53:14 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wALIrDav006606; Wed, 21 Nov 2018 18:53:13 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wALIrD7p006605; Wed, 21 Nov 2018 18:53:13 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811211853.wALIrD7p006605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Wed, 21 Nov 2018 18:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340739 - stable/12/sys/dev/mmc X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/dev/mmc X-SVN-Commit-Revision: 340739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 38E88700DD X-Spamd-Result: default: False [0.77 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_SHORT(0.47)[0.468,0]; NEURAL_SPAM_MEDIUM(0.29)[0.287,0]; NEURAL_SPAM_LONG(0.01)[0.010,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 18:53:15 -0000 Author: marius Date: Wed Nov 21 18:53:13 2018 New Revision: 340739 URL: https://svnweb.freebsd.org/changeset/base/340739 Log: MFC: r340495 - Restore setting the clock for devices which support the default/legacy transfer mode only (lost with r321385). [1] - Similarly, don't try to set the power class on MMC devices that comply to version 4.0 of the system specification but are operated in default/ legacy transfer or 1-bit bus mode as no power class is specified for these cases. Trying to set a power class nevertheless resulted in an - albeit harmless - error message. PR: 231713 [1] Modified: stable/12/sys/dev/mmc/mmc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mmc/mmc.c ============================================================================== --- stable/12/sys/dev/mmc/mmc.c Wed Nov 21 18:19:15 2018 (r340738) +++ stable/12/sys/dev/mmc/mmc.c Wed Nov 21 18:53:13 2018 (r340739) @@ -830,9 +830,14 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i const uint8_t *ext_csd; uint32_t clock; uint8_t value; + enum mmc_bus_timing timing; + enum mmc_bus_width bus_width; dev = sc->dev; - if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4) + timing = mmcbr_get_timing(dev); + bus_width = ivar->bus_width; + if (mmcbr_get_mode(dev) != mode_mmc || ivar->csd.spec_vers < 4 || + timing == bus_timing_normal || bus_width == bus_width_1) return (MMC_ERR_NONE); value = 0; @@ -843,8 +848,8 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_195]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) >= bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing >= bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_195_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_195]; @@ -863,13 +868,13 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i if (clock <= MMC_TYPE_HS_26_MAX) value = ext_csd[EXT_CSD_PWR_CL_26_360]; else if (clock <= MMC_TYPE_HS_52_MAX) { - if (mmcbr_get_timing(dev) == bus_timing_mmc_ddr52 && - ivar->bus_width >= bus_width_4) + if (timing == bus_timing_mmc_ddr52 && + bus_width >= bus_width_4) value = ext_csd[EXT_CSD_PWR_CL_52_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_52_360]; } else if (clock <= MMC_TYPE_HS200_HS400ES_MAX) { - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = ext_csd[EXT_CSD_PWR_CL_200_360_DDR]; else value = ext_csd[EXT_CSD_PWR_CL_200_360]; @@ -881,7 +886,7 @@ mmc_set_power_class(struct mmc_softc *sc, struct mmc_i return (MMC_ERR_INVALID); } - if (ivar->bus_width == bus_width_8) + if (bus_width == bus_width_8) value = (value & EXT_CSD_POWER_CLASS_8BIT_MASK) >> EXT_CSD_POWER_CLASS_8BIT_SHIFT; else @@ -2164,7 +2169,7 @@ mmc_calculate_clock(struct mmc_softc *sc) for (i = 0; i < sc->child_count; i++) { ivar = device_get_ivars(sc->child_list[i]); if ((ivar->timings & ~(1 << bus_timing_normal)) == 0) - continue; + goto clock; rca = ivar->rca; if (mmc_select_card(sc, rca) != MMC_ERR_NONE) { @@ -2230,6 +2235,7 @@ mmc_calculate_clock(struct mmc_softc *sc) } } +clock: /* Set clock (must be done before initial tuning). */ mmcbr_set_clock(dev, max_dtr); mmcbr_update_ios(dev); From owner-svn-src-stable-12@freebsd.org Thu Nov 22 01:25:47 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3F5C11075D3; Thu, 22 Nov 2018 01:25:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 569BA811A9; Thu, 22 Nov 2018 01:25:47 +0000 (UTC) (envelope-from kevans@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1ECBC8E8; Thu, 22 Nov 2018 01:25:47 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM1PlqD011141; Thu, 22 Nov 2018 01:25:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM1PjMK011131; Thu, 22 Nov 2018 01:25:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811220125.wAM1PjMK011131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 22 Nov 2018 01:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340751 - in stable/12: etc/mtree lib/libbe sbin/bectl sbin/bectl/tests X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: etc/mtree lib/libbe sbin/bectl sbin/bectl/tests X-SVN-Commit-Revision: 340751 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 569BA811A9 X-Spamd-Result: default: False [1.35 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.44)[0.445,0]; NEURAL_SPAM_MEDIUM(0.56)[0.564,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.34)[0.338,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 01:25:48 -0000 Author: kevans Date: Thu Nov 22 01:25:44 2018 New Revision: 340751 URL: https://svnweb.freebsd.org/changeset/base/340751 Log: MFC r340507-r340508, r340592-r340594, r340635-r340636: bectl(8) fixes r340507: libbe(3): rewrite init to support chroot usage libbe(3) currently uses zfs_be_root and locates which of its children is currently mounted at "/". This is reasonable, but not correct in the case of a chroot, for two reasons: - chroot root may be of a different zpool than zfs_be_root - chroot root will not show up as mounted at "/" Fix both of these by rewriting libbe_init to work from the rootfs down. zfs_path_to_zhandle on / will resolve to the dataset mounted at the new root, rather than the real root. From there, we can derive the BE root/pool and grab the bootfs off of the new pool. This does no harm in the average case, and opens up bectl to operating on different pools for scenarios where one may be, for instance, updating a pool that generally gets re-rooted into from a separate UFS root or zfs bootpool. While here, I've also: - Eliminated the check for /boot and / to be on the same partition. This leaves one open to a setup where /boot (and consequently, kernel/modules) are not included in the boot environment. This may very well be an intentional setup done by someone that knows what they're doing, we should not kill BE usage because of it. - Eliminated the validation bits of BEs and snapshots that enforced 'mountpoint' to be "/" -- this broke when trying to operate on an imported pool with an altroot, but we need not be this picky. Reported by: philip Reviewed by: philip, allanjude (previous version) Tested by: philip Differential Revision: https://reviews.freebsd.org/D18012 r340508: libbe(3): Rewrite be_unmount to stop mucking with getmntinfo(2) Go through the ZFS layer instead; given a BE, we can derive the dataset, zfs_open it, then zfs_unmount. ZFS takes care of the dirty details and likely gets it more correct than we did for more interesting setups. r340592: bectl(3)/libbe(3): Allow BE root to be specified Add an undocumented -r option preceding the bectl subcommand to specify a BE root to operate out of. This will remain undocumented for now, as some caveats apply: - BEs cannot be activated in the pool that doesn't contain the rootfs - bectl create cannot work out of the box without the -e option right now, since it defaults to the rootfs and cross-pool cloning doesn't work like that (IIRC) Plumb the BE root through to libbe(3) so that some things -can- be done to it, e.g. bectl -r tank/ROOT create -e default upgrade bectl -r tank/ROOT mount upgrade /mnt this aides in some upgrade setups where rootfs is not necessarily ZFS, and also makes it easier/possible to regression-test bectl when combined with a file-backed zpool. Differential Revision: https://reviews.freebsd.org/D18029 r340593: libbe(3): Properly account for altroot when creating new BEs Previously we would blindly copy the 'mountpoint' property, which includes the altroot. The altroot needs to be snipped off prior to setting it on the new BE, though, or you'll end up with a new BE and a mountpoint of /mnt with altroot=/mnt r340594: bectl(8): Add some regression tests These tests operate on a file-backed zpool that gets created in the kyua temp dir. root and ZFS support are both required for these tests. Current tests cover create, destroy, export/import, jail, list (kind of), mount, rename, and jail. List tests should later be extended to cover formatting and the different list flags, but for now only covers basic "are create/destroy actually reflected properly" r340635: libbe(3): Handle non-ZFS rootfs better If rootfs isn't ZFS, current version will emit an error claiming so and fail to initialize libbe. As a consumer, bectl -r (undocumented) can be specified to operate on a BE independently of whether on a UFS or ZFS root. Unbreak this for the UFS case by only erroring out the init if we can't determine a ZFS dataset for rootfs and no BE root was specified. Consumers of libbe should take care to ensure that rootfs is non-empty if they're trying to use it, because this could certainly be the case. Some check is needed before zfs_path_to_zhandle because it will unconditionally emit to stderr if the path isn't a ZFS filesystem, which is unhelpful for our purposes. This should also unbreak the bectl(8) tests on a UFS root, as is the case in Jenkins' -test runs. r340636: bectl(8) tests: attempt to load the ZFS module Observed in a CI test image, bectl_create test will run and be marked as skipped because the module is not loaded. The first zpool invocation will automagically load the module, but bectl_create is still skipped. Subsequent tests all pass as expected because the module is now loaded and everything is OK. Added: stable/12/sbin/bectl/tests/ - copied from r340594, head/sbin/bectl/tests/ Modified: stable/12/etc/mtree/BSD.tests.dist stable/12/lib/libbe/be.c stable/12/lib/libbe/be.h stable/12/lib/libbe/be_access.c stable/12/lib/libbe/be_impl.h stable/12/lib/libbe/be_info.c stable/12/lib/libbe/libbe.3 stable/12/sbin/bectl/Makefile stable/12/sbin/bectl/bectl.c stable/12/sbin/bectl/tests/bectl_test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/etc/mtree/BSD.tests.dist ============================================================================== --- stable/12/etc/mtree/BSD.tests.dist Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/etc/mtree/BSD.tests.dist Thu Nov 22 01:25:44 2018 (r340751) @@ -390,6 +390,8 @@ .. .. sbin + bectl + .. dhclient .. devd Modified: stable/12/lib/libbe/be.c ============================================================================== --- stable/12/lib/libbe/be.c Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/lib/libbe/be.c Thu Nov 22 01:25:44 2018 (r340751) @@ -29,11 +29,12 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include -#include +#include #include -#include #include #include #include @@ -55,23 +56,30 @@ static int be_create_child_cloned(libbe_handle_t *lbh, * zfs_be_root set by loader(8). data is expected to be a libbe_handle_t *. */ static int -be_locate_rootfs(zfs_handle_t *chkds, void *data) +be_locate_rootfs(libbe_handle_t *lbh) { - libbe_handle_t *lbh; - char *mntpoint; + struct statfs sfs; + struct extmnttab entry; + zfs_handle_t *zfs; - lbh = (libbe_handle_t *)data; - if (lbh == NULL) + /* + * Check first if root is ZFS; if not, we'll bail on rootfs capture. + * Unfortunately needed because zfs_path_to_zhandle will emit to + * stderr if / isn't actually a ZFS filesystem, which we'd like + * to avoid. + */ + if (statfs("/", &sfs) == 0) { + statfs2mnttab(&sfs, &entry); + if (strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0) + return (1); + } else return (1); - - mntpoint = NULL; - if (zfs_is_mounted(chkds, &mntpoint) && strcmp(mntpoint, "/") == 0) { - strlcpy(lbh->rootfs, zfs_get_name(chkds), sizeof(lbh->rootfs)); - free(mntpoint); + zfs = zfs_path_to_zhandle(lbh->lzh, "/", ZFS_TYPE_FILESYSTEM); + if (zfs == NULL) return (1); - } else if(mntpoint != NULL) - free(mntpoint); + strlcpy(lbh->rootfs, zfs_get_name(zfs), sizeof(lbh->rootfs)); + zfs_close(zfs); return (0); } @@ -80,52 +88,40 @@ be_locate_rootfs(zfs_handle_t *chkds, void *data) * dataset, for example, zroot/ROOT. */ libbe_handle_t * -libbe_init(void) +libbe_init(const char *root) { - struct stat sb; - dev_t root_dev, boot_dev; libbe_handle_t *lbh; - zfs_handle_t *rootds; char *poolname, *pos; int pnamelen; lbh = NULL; poolname = pos = NULL; - rootds = NULL; - /* Verify that /boot and / are mounted on the same filesystem */ - /* TODO: use errno here?? */ - if (stat("/", &sb) != 0) - goto err; - - root_dev = sb.st_dev; - - if (stat("/boot", &sb) != 0) - goto err; - - boot_dev = sb.st_dev; - - if (root_dev != boot_dev) { - fprintf(stderr, "/ and /boot not on same device, quitting\n"); - goto err; - } - if ((lbh = calloc(1, sizeof(libbe_handle_t))) == NULL) goto err; if ((lbh->lzh = libzfs_init()) == NULL) goto err; - /* Obtain path to boot environment root */ - if ((kenv(KENV_GET, "zfs_be_root", lbh->root, - sizeof(lbh->root))) == -1) - goto err; + /* + * Grab rootfs, we'll work backwards from there if an optional BE root + * has not been passed in. + */ + if (be_locate_rootfs(lbh) != 0) { + if (root == NULL) + goto err; + *lbh->rootfs = '\0'; + } + if (root == NULL) { + /* Strip off the final slash from rootfs to get the be root */ + strlcpy(lbh->root, lbh->rootfs, sizeof(lbh->root)); + pos = strrchr(lbh->root, '/'); + if (pos == NULL) + goto err; + *pos = '\0'; + } else + strlcpy(lbh->root, root, sizeof(lbh->root)); - /* Remove leading 'zfs:' if present, otherwise use value as-is */ - if (strcmp(lbh->root, "zfs:") == 0) - strlcpy(lbh->root, strchr(lbh->root, ':') + sizeof(char), - sizeof(lbh->root)); - if ((pos = strchr(lbh->root, '/')) == NULL) goto err; @@ -144,17 +140,6 @@ libbe_init(void) sizeof(lbh->bootfs), NULL, true) != 0) goto err; - /* Obtain path to boot environment rootfs (currently booted) */ - /* XXX Get dataset mounted at / by kenv/GUID from mountroot? */ - if ((rootds = zfs_open(lbh->lzh, lbh->root, ZFS_TYPE_DATASET)) == NULL) - goto err; - - zfs_iter_filesystems(rootds, be_locate_rootfs, lbh); - zfs_close(rootds); - rootds = NULL; - if (*lbh->rootfs == '\0') - goto err; - return (lbh); err: if (lbh != NULL) { @@ -337,6 +322,7 @@ be_deep_clone_prop(int prop, void *cb) zprop_source_t src; char pval[BE_MAXPATHLEN]; char source[BE_MAXPATHLEN]; + char *val; dccb = cb; /* Skip some properties we don't want to touch */ @@ -356,7 +342,15 @@ be_deep_clone_prop(int prop, void *cb) if (src != ZPROP_SRC_LOCAL) return (ZPROP_CONT); - nvlist_add_string(dccb->props, zfs_prop_to_name(prop), (char *)pval); + /* Augment mountpoint with altroot, if needed */ + val = pval; + if (prop == ZFS_PROP_MOUNTPOINT && *dccb->altroot != '\0') { + if (pval[strlen(dccb->altroot)] == '\0') + strlcpy(pval, "/", sizeof(pval)); + else + val = pval + strlen(dccb->altroot); + } + nvlist_add_string(dccb->props, zfs_prop_to_name(prop), val); return (ZPROP_CONT); } @@ -399,6 +393,10 @@ be_deep_clone(zfs_handle_t *ds, void *data) dccb.zhp = ds; dccb.props = props; + if (zpool_get_prop(isdc->lbh->active_phandle, ZPOOL_PROP_ALTROOT, + dccb.altroot, sizeof(dccb.altroot), NULL, true) != 0 || + strcmp(dccb.altroot, "-") == 0) + *dccb.altroot = '\0'; if (zprop_iter(be_deep_clone_prop, &dccb, B_FALSE, B_FALSE, ZFS_TYPE_FILESYSTEM) == ZPROP_INVAL) return (-1); @@ -503,10 +501,6 @@ be_create_from_existing(libbe_handle_t *lbh, const cha int be_validate_snap(libbe_handle_t *lbh, const char *snap_name) { - zfs_handle_t *zfs_hdl; - char buf[BE_MAXPATHLEN]; - char *delim_pos; - int err = BE_ERR_SUCCESS; if (strlen(snap_name) >= BE_MAXPATHLEN) return (BE_ERR_PATHLEN); @@ -515,27 +509,7 @@ be_validate_snap(libbe_handle_t *lbh, const char *snap ZFS_TYPE_SNAPSHOT)) return (BE_ERR_NOENT); - strlcpy(buf, snap_name, sizeof(buf)); - - /* Find the base filesystem of the snapshot */ - if ((delim_pos = strchr(buf, '@')) == NULL) - return (BE_ERR_INVALIDNAME); - *delim_pos = '\0'; - - if ((zfs_hdl = - zfs_open(lbh->lzh, buf, ZFS_TYPE_DATASET)) == NULL) - return (BE_ERR_NOORIGIN); - - if ((err = zfs_prop_get(zfs_hdl, ZFS_PROP_MOUNTPOINT, buf, - sizeof(buf), NULL, NULL, 0, 1)) != 0) - err = BE_ERR_BADMOUNT; - - if ((err != 0) && (strncmp(buf, "/", sizeof(buf)) != 0)) - err = BE_ERR_BADMOUNT; - - zfs_close(zfs_hdl); - - return (err); + return (BE_ERR_SUCCESS); } Modified: stable/12/lib/libbe/be.h ============================================================================== --- stable/12/lib/libbe/be.h Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/lib/libbe/be.h Thu Nov 22 01:25:44 2018 (r340751) @@ -63,7 +63,7 @@ typedef enum be_error { /* Library handling functions: be.c */ -libbe_handle_t *libbe_init(void); +libbe_handle_t *libbe_init(const char *root); void libbe_close(libbe_handle_t *); /* Bootenv information functions: be_info.c */ Modified: stable/12/lib/libbe/be_access.c ============================================================================== --- stable/12/lib/libbe/be_access.c Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/lib/libbe/be_access.c Thu Nov 22 01:25:44 2018 (r340751) @@ -164,37 +164,18 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla { int err, mntflags; char be[BE_MAXPATHLEN]; - struct statfs *mntbuf; - int mntsize; - char *mntpath; + zfs_handle_t *root_hdl; if ((err = be_root_concat(lbh, bootenv, be)) != 0) return (set_error(lbh, err)); - if ((mntsize = getmntinfo(&mntbuf, MNT_NOWAIT)) == 0) { - if (errno == EIO) - return (set_error(lbh, BE_ERR_IO)); - return (set_error(lbh, BE_ERR_NOMOUNT)); - } + if ((root_hdl = zfs_open(lbh->lzh, be, ZFS_TYPE_FILESYSTEM)) == NULL) + return (set_error(lbh, BE_ERR_ZFSOPEN)); - mntpath = NULL; - for (int i = 0; i < mntsize; ++i) { - /* 0x000000de is the type number of zfs */ - if (mntbuf[i].f_type != 0x000000de) - continue; + mntflags = (flags & BE_MNT_FORCE) ? MS_FORCE : 0; - if (strcmp(mntbuf[i].f_mntfromname, be) == 0) { - mntpath = mntbuf[i].f_mntonname; - break; - } - } - - if (mntpath == NULL) - return (set_error(lbh, BE_ERR_NOMOUNT)); - - mntflags = (flags & BE_MNT_FORCE) ? MNT_FORCE : 0; - - if ((err = unmount(mntpath, mntflags)) != 0) { + if (zfs_unmount(root_hdl, NULL, mntflags) != 0) { + zfs_close(root_hdl); switch (errno) { case ENAMETOOLONG: return (set_error(lbh, BE_ERR_PATHLEN)); @@ -210,6 +191,7 @@ be_unmount(libbe_handle_t *lbh, char *bootenv, int fla return (set_error(lbh, BE_ERR_UNKNOWN)); } } + zfs_close(root_hdl); - return (set_error(lbh, BE_ERR_SUCCESS)); + return (BE_ERR_SUCCESS); } Modified: stable/12/lib/libbe/be_impl.h ============================================================================== --- stable/12/lib/libbe/be_impl.h Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/lib/libbe/be_impl.h Thu Nov 22 01:25:44 2018 (r340751) @@ -55,6 +55,7 @@ struct libbe_deep_clone { struct libbe_dccb { zfs_handle_t *zhp; nvlist_t *props; + char altroot[MAXPATHLEN]; }; typedef struct prop_data { Modified: stable/12/lib/libbe/be_info.c ============================================================================== --- stable/12/lib/libbe/be_info.c Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/lib/libbe/be_info.c Thu Nov 22 01:25:44 2018 (r340751) @@ -42,7 +42,10 @@ const char * be_active_name(libbe_handle_t *lbh) { - return (strrchr(lbh->rootfs, '/') + sizeof(char)); + if (*lbh->rootfs != '\0') + return (strrchr(lbh->rootfs, '/') + sizeof(char)); + else + return (lbh->rootfs); } @@ -63,7 +66,10 @@ const char * be_nextboot_name(libbe_handle_t *lbh) { - return (strrchr(lbh->bootfs, '/') + sizeof(char)); + if (*lbh->bootfs != '\0') + return (strrchr(lbh->bootfs, '/') + sizeof(char)); + else + return (lbh->bootfs); } @@ -289,30 +295,11 @@ int be_exists(libbe_handle_t *lbh, char *be) { char buf[BE_MAXPATHLEN]; - nvlist_t *dsprops; - char *mntpoint; - bool valid; be_root_concat(lbh, be, buf); if (!zfs_dataset_exists(lbh->lzh, buf, ZFS_TYPE_DATASET)) return (BE_ERR_NOENT); - /* Also check if it's mounted at / */ - if (be_prop_list_alloc(&dsprops) != 0) - return (BE_ERR_UNKNOWN); - - if (be_get_dataset_props(lbh, buf, dsprops) != 0) { - nvlist_free(dsprops); - return (BE_ERR_UNKNOWN); - } - - if (nvlist_lookup_string(dsprops, "mountpoint", &mntpoint) == 0) { - valid = (strcmp(mntpoint, "/") == 0); - nvlist_free(dsprops); - return (valid ? BE_ERR_SUCCESS : BE_ERR_BADMOUNT); - } - - nvlist_free(dsprops); - return (BE_ERR_BADMOUNT); + return (BE_ERR_SUCCESS); } Modified: stable/12/lib/libbe/libbe.3 ============================================================================== --- stable/12/lib/libbe/libbe.3 Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/lib/libbe/libbe.3 Thu Nov 22 01:25:44 2018 (r340751) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 31, 2018 +.Dd November 17, 2018 .Dt LIBBE 3 .Os .Sh NAME @@ -39,7 +39,7 @@ .Sh SYNOPSIS .In be.h .Ft "libbe_handle_t *hdl" Ns -.Fn libbe_init void +.Fn libbe_init "const char *be_root" .Pp .Ft void .Fn libbe_close "libbe_handle_t *hdl" @@ -157,13 +157,16 @@ errno otherwise as described in .Pp The .Fn libbe_init -function initializes +function takes an optional BE root and initializes .Nm , returning a .Vt "libbe_handle_t *" on success, or .Dv NULL on error. +If a BE root is supplied, +.Nm +will only operate out of that pool and BE root. An error may occur if: .Bl -column .It /boot and / are not on the same filesystem and device, @@ -184,11 +187,15 @@ invalidating the handle in the process. .Pp The .Fn be_active_name -function returns the name of the currently booted boot environment, +function returns the name of the currently booted boot environment. +This boot environment may not belong to the same BE root as the root libbe +is operating on! .Pp The .Fn be_active_path function returns the full path of the currently booted boot environment. +This boot environment may not belong to the same BE root as the root libbe +is operating on! .Pp The .Fn be_nextboot_name Modified: stable/12/sbin/bectl/Makefile ============================================================================== --- stable/12/sbin/bectl/Makefile Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/sbin/bectl/Makefile Thu Nov 22 01:25:44 2018 (r340751) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= bectl MAN= bectl.8 @@ -15,5 +17,8 @@ CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris CFLAGS+= -I${SRCTOP}/sys/cddl/contrib/opensolaris/uts/common CFLAGS+= -DNEED_SOLARIS_BOOLEAN + +HAS_TESTS= yes +SUBDIR.${MK_TESTS}+= tests .include Modified: stable/12/sbin/bectl/bectl.c ============================================================================== --- stable/12/sbin/bectl/bectl.c Wed Nov 21 22:37:49 2018 (r340750) +++ stable/12/sbin/bectl/bectl.c Thu Nov 22 01:25:44 2018 (r340751) @@ -489,12 +489,25 @@ int main(int argc, char *argv[]) { const char *command; + char *root; int command_index, rc; + root = NULL; if (argc < 2) return (usage(false)); - command = argv[1]; + if (strcmp(argv[1], "-r") == 0) { + if (argc < 4) + return (usage(false)); + root = strdup(argv[2]); + command = argv[3]; + argc -= 3; + argv += 3; + } else { + command = argv[1]; + argc -= 1; + argv += 1; + } /* Handle command aliases */ if (strcmp(command, "umount") == 0) @@ -512,13 +525,12 @@ main(int argc, char *argv[]) } - if ((be = libbe_init()) == NULL) + if ((be = libbe_init(root)) == NULL) return (-1); libbe_print_on_error(be, true); - /* XXX TODO: can be simplified if offset by 2 instead of one */ - rc = command_map[command_index].fn(argc-1, argv+1); + rc = command_map[command_index].fn(argc, argv); libbe_close(be); return (rc); Modified: stable/12/sbin/bectl/tests/bectl_test.sh ============================================================================== --- head/sbin/bectl/tests/bectl_test.sh Mon Nov 19 02:30:12 2018 (r340594) +++ stable/12/sbin/bectl/tests/bectl_test.sh Thu Nov 22 01:25:44 2018 (r340751) @@ -34,7 +34,7 @@ bectl_create_setup() disk=$2 mnt=$3 - kldstat -qm zfs || atf_skip "ZFS module not loaded on the current system" + kldload -n -q zfs || atf_skip "ZFS module not loaded on the current system" atf_check mkdir -p ${mnt} atf_check truncate -s 1G ${disk} atf_check zpool create -o altroot=${mnt} ${zpool} ${disk} From owner-svn-src-stable-12@freebsd.org Thu Nov 22 03:04:14 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC2E61132262; Thu, 22 Nov 2018 03:04:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7024485924; Thu, 22 Nov 2018 03:04:14 +0000 (UTC) (envelope-from kevans@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4DD7A1C37; Thu, 22 Nov 2018 03:04:14 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM34ElU062889; Thu, 22 Nov 2018 03:04:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM34Eq8062888; Thu, 22 Nov 2018 03:04:14 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201811220304.wAM34Eq8062888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 22 Nov 2018 03:04:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340752 - stable/12/tools/boot X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/tools/boot X-SVN-Commit-Revision: 340752 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7024485924 X-Spamd-Result: default: False [1.24 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_SHORT(0.36)[0.365,0]; NEURAL_SPAM_MEDIUM(0.49)[0.492,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 03:04:15 -0000 Author: kevans Date: Thu Nov 22 03:04:13 2018 New Revision: 340752 URL: https://svnweb.freebsd.org/changeset/base/340752 Log: MFC r339701: Update lualoader test script a little bit Use userboot.so from the test directory if possible, fall back to .OBJDIR. This avoids a problem that we've had since userboot coexistence was added, where userboot.so alone no longer exists in the .OBJDIR but is instead just a link installed later. Update lualo Modified: stable/12/tools/boot/lua-test.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/tools/boot/lua-test.sh ============================================================================== --- stable/12/tools/boot/lua-test.sh Thu Nov 22 01:25:44 2018 (r340751) +++ stable/12/tools/boot/lua-test.sh Thu Nov 22 03:04:13 2018 (r340752) @@ -13,13 +13,16 @@ scriptdir=$(dirname $(realpath $0)) cd $(make -V SRCTOP)/stand obj=$(make -V .OBJDIR) t=$obj/userboot/test/test -u=$obj/userboot/userboot/userboot.so [ -n "$dir" ] || dir=/tmp/loadertest [ -d "$dir" ] || ${scriptdir}/lua-img.sh ${dir} +# We'll try userboot.so from the test directory before plucking it straight out +# of .OBJDIR. +u=$dir/boot/userboot.so +[ -f "$u" ] || u=$obj/userboot/userboot_lua/userboot_lua.so [ -f "$dir/boot/lua/loader.lua" ] || die "No boot/lua/loader.lua found" [ -f "$dir/boot/kernel/kernel" ] || die "No kernel to load" [ -x "$t" ] || die "no userboot test jig found ($t)" -[ -x "$u" ] || die "no userboot.so ($u) found" +[ -f "$u" ] || die "no userboot.so ($u) found" $t -h $dir -b $u From owner-svn-src-stable-12@freebsd.org Thu Nov 22 09:41:46 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A29D41142988; Thu, 22 Nov 2018 09:41:46 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 460776E403; Thu, 22 Nov 2018 09:41:46 +0000 (UTC) (envelope-from tijl@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 270AF626C; Thu, 22 Nov 2018 09:41:46 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM9fk5V065920; Thu, 22 Nov 2018 09:41:46 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM9fk38065919; Thu, 22 Nov 2018 09:41:46 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811220941.wAM9fk38065919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 22 Nov 2018 09:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340755 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 340755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 460776E403 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_MEDIUM(0.52)[0.517,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.59)[0.589,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 09:41:46 -0000 Author: tijl Date: Thu Nov 22 09:41:45 2018 New Revision: 340755 URL: https://svnweb.freebsd.org/changeset/base/340755 Log: MFC r340631: Do proper copyin of control message data in the Linux sendmsg syscall. Instead of calling m_append with a user address, allocate an mbuf cluster and copy data into it using copyin. For the SCM_CREDS case, instead of zeroing a stack variable and appending that to the mbuf, zero part of the mbuf cluster directly. One mbuf cluster is also the size limit used by the FreeBSD sendmsg syscall (uipc_syscalls.c:sockargs()). PR: 217901 Reviewed by: kib Modified: stable/12/sys/compat/linux/linux_socket.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_socket.c ============================================================================== --- stable/12/sys/compat/linux/linux_socket.c Thu Nov 22 04:48:27 2018 (r340754) +++ stable/12/sys/compat/linux/linux_socket.c Thu Nov 22 09:41:45 2018 (r340755) @@ -1085,7 +1085,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc l_uint flags) { struct cmsghdr *cmsg; - struct cmsgcred cmcred; struct mbuf *control; struct msghdr msg; struct l_cmsghdr linux_cmsg; @@ -1096,6 +1095,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc struct sockaddr *sa; sa_family_t sa_family; void *data; + l_size_t len; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1126,7 +1126,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc return (error); control = NULL; - cmsg = NULL; if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { error = kern_getsockname(td, s, &sa, &datalen); @@ -1136,8 +1135,10 @@ linux_sendmsg_common(struct thread *td, l_int s, struc free(sa, M_SONAME); error = ENOBUFS; - cmsg = malloc(CMSG_HDRSZ, M_LINUX, M_WAITOK|M_ZERO); control = m_get(M_WAITOK, MT_CONTROL); + MCLGET(control, M_WAITOK); + data = mtod(control, void *); + datalen = 0; do { error = copyin(ptr_cmsg, &linux_cmsg, @@ -1149,10 +1150,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) goto bad; + if (datalen + CMSG_HDRSZ > MCLBYTES) + goto bad; + /* * Now we support only SCM_RIGHTS and SCM_CRED, * so return EINVAL in any other cmsg_type */ + cmsg = data; cmsg->cmsg_type = linux_to_bsd_cmsg_type(linux_cmsg.cmsg_type); cmsg->cmsg_level = @@ -1170,35 +1175,34 @@ linux_sendmsg_common(struct thread *td, l_int s, struc if (sa_family != AF_UNIX) continue; - data = LINUX_CMSG_DATA(ptr_cmsg); - datalen = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (cmsg->cmsg_type == SCM_CREDS) { + len = sizeof(struct cmsgcred); + if (datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; - switch (cmsg->cmsg_type) - { - case SCM_RIGHTS: - break; - - case SCM_CREDS: - data = &cmcred; - datalen = sizeof(cmcred); - /* * The lower levels will fill in the structure */ - bzero(data, datalen); - break; + memset(CMSG_DATA(data), 0, len); + } else { + len = linux_cmsg.cmsg_len - L_CMSG_HDRSZ; + if (datalen + CMSG_SPACE(len) < datalen || + datalen + CMSG_SPACE(len) > MCLBYTES) + goto bad; + + error = copyin(LINUX_CMSG_DATA(ptr_cmsg), + CMSG_DATA(data), len); + if (error != 0) + goto bad; } - cmsg->cmsg_len = CMSG_LEN(datalen); - - error = ENOBUFS; - if (!m_append(control, CMSG_HDRSZ, (c_caddr_t)cmsg)) - goto bad; - if (!m_append(control, datalen, (c_caddr_t)data)) - goto bad; + cmsg->cmsg_len = CMSG_LEN(len); + data = (char *)data + CMSG_SPACE(len); + datalen += CMSG_SPACE(len); } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); - if (m_length(control, NULL) == 0) { + control->m_len = datalen; + if (datalen == 0) { m_freem(control); control = NULL; } @@ -1212,8 +1216,6 @@ linux_sendmsg_common(struct thread *td, l_int s, struc bad: m_freem(control); free(iov, M_IOV); - if (cmsg) - free(cmsg, M_LINUX); return (error); } From owner-svn-src-stable-12@freebsd.org Thu Nov 22 09:47:43 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99A6F1142F1E; Thu, 22 Nov 2018 09:47:43 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 402336EB73; Thu, 22 Nov 2018 09:47:43 +0000 (UTC) (envelope-from tijl@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22A9A63D0; Thu, 22 Nov 2018 09:47:43 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAM9lhTA067226; Thu, 22 Nov 2018 09:47:43 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAM9lh5R067225; Thu, 22 Nov 2018 09:47:43 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201811220947.wAM9lh5R067225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 22 Nov 2018 09:47:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340757 - stable/12/sys/compat/linux X-SVN-Group: stable-12 X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: stable/12/sys/compat/linux X-SVN-Commit-Revision: 340757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 402336EB73 X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_MEDIUM(0.52)[0.517,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.59)[0.589,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 09:47:43 -0000 Author: tijl Date: Thu Nov 22 09:47:42 2018 New Revision: 340757 URL: https://svnweb.freebsd.org/changeset/base/340757 Log: MFC r340674: Fix another user address dereference in linux_sendmsg syscall. This was hidden behind the LINUX_CMSG_NXTHDR macro which dereferences its second argument. Stop using the macro as well as LINUX_CMSG_FIRSTHDR. Use the size field of the kernel copy of the control message header to obtain the next control message. PR: 217901 Modified: stable/12/sys/compat/linux/linux_socket.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_socket.c ============================================================================== --- stable/12/sys/compat/linux/linux_socket.c Thu Nov 22 09:41:54 2018 (r340756) +++ stable/12/sys/compat/linux/linux_socket.c Thu Nov 22 09:47:42 2018 (r340757) @@ -1096,6 +1096,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc sa_family_t sa_family; void *data; l_size_t len; + l_size_t clen; int error; error = copyin(msghdr, &linux_msg, sizeof(linux_msg)); @@ -1127,7 +1128,7 @@ linux_sendmsg_common(struct thread *td, l_int s, struc control = NULL; - if ((ptr_cmsg = LINUX_CMSG_FIRSTHDR(&linux_msg)) != NULL) { + if (linux_msg.msg_controllen >= sizeof(struct l_cmsghdr)) { error = kern_getsockname(td, s, &sa, &datalen); if (error != 0) goto bad; @@ -1140,6 +1141,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc data = mtod(control, void *); datalen = 0; + ptr_cmsg = PTRIN(linux_msg.msg_control); + clen = linux_msg.msg_controllen; do { error = copyin(ptr_cmsg, &linux_cmsg, sizeof(struct l_cmsghdr)); @@ -1147,7 +1150,8 @@ linux_sendmsg_common(struct thread *td, l_int s, struc goto bad; error = EINVAL; - if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr)) + if (linux_cmsg.cmsg_len < sizeof(struct l_cmsghdr) || + linux_cmsg.cmsg_len > clen) goto bad; if (datalen + CMSG_HDRSZ > MCLBYTES) @@ -1199,7 +1203,14 @@ linux_sendmsg_common(struct thread *td, l_int s, struc cmsg->cmsg_len = CMSG_LEN(len); data = (char *)data + CMSG_SPACE(len); datalen += CMSG_SPACE(len); - } while ((ptr_cmsg = LINUX_CMSG_NXTHDR(&linux_msg, ptr_cmsg))); + + if (clen <= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)) + break; + + clen -= LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len); + ptr_cmsg = (struct l_cmsghdr *)((char *)ptr_cmsg + + LINUX_CMSG_ALIGN(linux_cmsg.cmsg_len)); + } while(clen >= sizeof(struct l_cmsghdr)); control->m_len = datalen; if (datalen == 0) { From owner-svn-src-stable-12@freebsd.org Thu Nov 22 13:03:12 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13A3A114833C; Thu, 22 Nov 2018 13:03:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE41775A88; Thu, 22 Nov 2018 13:03:11 +0000 (UTC) (envelope-from marius@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DAC710424; Thu, 22 Nov 2018 13:03:11 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMD3BGA071747; Thu, 22 Nov 2018 13:03:11 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMD3BPr071746; Thu, 22 Nov 2018 13:03:11 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811221303.wAMD3BPr071746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 22 Nov 2018 13:03:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340759 - stable/12/sys/sparc64/sparc64 X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/sparc64/sparc64 X-SVN-Commit-Revision: 340759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE41775A88 X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_SHORT(0.15)[0.145,0]; NEURAL_SPAM_MEDIUM(0.52)[0.517,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 13:03:12 -0000 Author: marius Date: Thu Nov 22 13:03:11 2018 New Revision: 340759 URL: https://svnweb.freebsd.org/changeset/base/340759 Log: MFC: r340656 Given that the idea of D15374 was to "make memmove a first class citizen", provide a _MEMMOVE extension of _MEMCPY that deals with overlap based on the previous bcopy(9) implementation and use the former for bcopy(9) and memmove(9). This addresses my D15374 review comment, avoiding extra MOVs in case of memmove(9) and trashing the stack pointer. Modified: stable/12/sys/sparc64/sparc64/support.S Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sparc64/sparc64/support.S ============================================================================== --- stable/12/sys/sparc64/sparc64/support.S Thu Nov 22 09:47:51 2018 (r340758) +++ stable/12/sys/sparc64/sparc64/support.S Thu Nov 22 13:03:11 2018 (r340759) @@ -207,6 +207,30 @@ __FBSDID("$FreeBSD$"); 6: /* + * Extension of _MEMCPY dealing with overlap, but unaware of ASIs. + * Used for bcopy() and memmove(). + */ +#define _MEMMOVE(dst, src, len) \ + /* Check for overlap, and copy backwards if so. */ \ + sub dst, src, %g1 ; \ + cmp %g1, len ; \ + bgeu,a,pt %xcc, 2f ; \ + nop ; \ + /* Copy backwards. */ \ + add src, len, src ; \ + add dst, len, dst ; \ +1: deccc 1, len ; \ + bl,pn %xcc, 3f ; \ + dec 1, src ; \ + ldub [src], %g1 ; \ + dec 1, dst ; \ + ba %xcc, 1b ; \ + stb %g1, [dst] ; \ +2: /* Do the fast version. */ \ + _MEMCPY(dst, src, len, EMPTY, EMPTY, EMPTY, EMPTY) ; \ +3: + +/* * void ascopy(u_long asi, vm_offset_t src, vm_offset_t dst, size_t len) */ ENTRY(ascopy) @@ -265,49 +289,14 @@ ENTRY(bcmp) END(bcmp) /* - * void *memmove(void *dst, const void *src, size_t len) * void bcopy(const void *src, void *dst, size_t len) */ -ENTRY(memmove) - /* - * Swap src/dst for memmove/bcopy differences - */ - mov %o0, %o6 - mov %o1, %o0 - mov %o6, %o1 -ALTENTRY(bcopy) - /* - * Check for overlap, and copy backwards if so. - */ - sub %o1, %o0, %g1 - cmp %g1, %o2 - bgeu,a,pt %xcc, 3f +ENTRY(bcopy) + _MEMMOVE(%o1, %o0, %o2) + retl nop +END(bcopy) - /* - * Copy backwards. - */ - add %o0, %o2, %o0 - add %o1, %o2, %o1 -1: deccc 1, %o2 - bl,a,pn %xcc, 2f - nop - dec 1, %o0 - ldub [%o0], %g1 - dec 1, %o1 - ba %xcc, 1b - stb %g1, [%o1] -2: retl - mov %o6, %o0 - - /* - * Do the fast version. - */ -3: _MEMCPY(%o1, %o0, %o2, EMPTY, EMPTY, EMPTY, EMPTY) - retl - mov %o6, %o0 -END(memmove) - /* * void bzero(void *b, size_t len) */ @@ -335,6 +324,16 @@ ENTRY(memcpy) retl nop END(memcpy) + +/* + * void *memmove(void *dst, const void *src, size_t len) + */ +ENTRY(memmove) + mov %o0, %o3 + _MEMMOVE(%o3, %o1, %o2) + retl + nop +END(memmove) /* * void *memset(void *b, int c, size_t len) From owner-svn-src-stable-12@freebsd.org Thu Nov 22 13:09:04 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA59E114840B; Thu, 22 Nov 2018 13:09:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4208175C5A; Thu, 22 Nov 2018 13:09:04 +0000 (UTC) (envelope-from marius@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2099910428; Thu, 22 Nov 2018 13:09:04 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMD94tE072036; Thu, 22 Nov 2018 13:09:04 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMD93iE072034; Thu, 22 Nov 2018 13:09:03 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201811221309.wAMD93iE072034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 22 Nov 2018 13:09:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340760 - stable/12/sys/dev/sdhci X-SVN-Group: stable-12 X-SVN-Commit-Author: marius X-SVN-Commit-Paths: stable/12/sys/dev/sdhci X-SVN-Commit-Revision: 340760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4208175C5A X-Spamd-Result: default: False [1.07 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_SHORT(0.15)[0.145,0]; NEURAL_SPAM_MEDIUM(0.52)[0.517,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 13:09:04 -0000 Author: marius Date: Thu Nov 22 13:09:03 2018 New Revision: 340760 URL: https://svnweb.freebsd.org/changeset/base/340760 Log: MFC: r340543, r340654 Add a quirk handling for AMDI0040 controllers allowing them to do HS400. Submitted by: Shreyank Amartya (original version) Modified: stable/12/sys/dev/sdhci/sdhci.c stable/12/sys/dev/sdhci/sdhci.h stable/12/sys/dev/sdhci/sdhci_acpi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sdhci/sdhci.c ============================================================================== --- stable/12/sys/dev/sdhci/sdhci.c Thu Nov 22 13:03:11 2018 (r340759) +++ stable/12/sys/dev/sdhci/sdhci.c Thu Nov 22 13:09:03 2018 (r340760) @@ -898,6 +898,9 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, if (slot->quirks & SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 && caps2 & SDHCI_CAN_MMC_HS400) host_caps |= MMC_CAP_MMC_HS400; + if (slot->quirks & SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 && + caps2 & SDHCI_CAN_SDR104) + host_caps |= MMC_CAP_MMC_HS400; /* * Disable UHS-I and eMMC modes if the set_uhs_timing method is the Modified: stable/12/sys/dev/sdhci/sdhci.h ============================================================================== --- stable/12/sys/dev/sdhci/sdhci.h Thu Nov 22 13:03:11 2018 (r340759) +++ stable/12/sys/dev/sdhci/sdhci.h Thu Nov 22 13:09:03 2018 (r340760) @@ -93,6 +93,8 @@ #define SDHCI_QUIRK_PRESET_VALUE_BROKEN (1 << 27) /* Controller does not support or the support for ACMD12 is broken. */ #define SDHCI_QUIRK_BROKEN_AUTO_STOP (1 << 28) +/* Controller supports eMMC HS400 mode if SDHCI_CAN_SDR104 is set. */ +#define SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 (1 << 29) /* * Controller registers Modified: stable/12/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- stable/12/sys/dev/sdhci/sdhci_acpi.c Thu Nov 22 13:03:11 2018 (r340759) +++ stable/12/sys/dev/sdhci/sdhci_acpi.c Thu Nov 22 13:09:03 2018 (r340760) @@ -45,12 +45,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "mmcbr_if.h" #include "sdhci_if.h" +#define SDHCI_AMD_RESET_DLL_REG 0x908 + static const struct sdhci_acpi_device { const char* hid; int uid; @@ -80,7 +83,8 @@ static const struct sdhci_acpi_device { SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 | SDHCI_QUIRK_PRESET_VALUE_BROKEN }, { "AMDI0040", 0, "AMD eMMC 5.0 Controller", - SDHCI_QUIRK_32BIT_DMA_SIZE }, + SDHCI_QUIRK_32BIT_DMA_SIZE | + SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 }, { NULL, 0, NULL, 0} }; @@ -94,12 +98,11 @@ static char *sdhci_ids[] = { }; struct sdhci_acpi_softc { - u_int quirks; /* Chip specific quirks */ - struct resource *irq_res; /* IRQ resource */ - void *intrhand; /* Interrupt handle */ - struct sdhci_slot slot; struct resource *mem_res; /* Memory resource */ + struct resource *irq_res; /* IRQ resource */ + void *intrhand; /* Interrupt handle */ + const struct sdhci_acpi_device *acpi_dev; }; static void sdhci_acpi_intr(void *arg); @@ -189,6 +192,52 @@ sdhci_acpi_write_multi_4(device_t dev, struct sdhci_sl bus_write_multi_stream_4(sc->mem_res, off, data, count); } +static void +sdhci_acpi_set_uhs_timing(device_t dev, struct sdhci_slot *slot) +{ + const struct sdhci_acpi_softc *sc; + const struct sdhci_acpi_device *acpi_dev; + const struct mmc_ios *ios; + device_t bus; + uint16_t old_timing; + enum mmc_bus_timing timing; + + bus = slot->bus; + old_timing = SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2); + old_timing &= SDHCI_CTRL2_UHS_MASK; + sdhci_generic_set_uhs_timing(dev, slot); + + sc = device_get_softc(dev); + acpi_dev = sc->acpi_dev; + /* + * AMDI0040 controllers require SDHCI_CTRL2_SAMPLING_CLOCK to be + * disabled when switching from HS200 to high speed and to always + * be turned on again when tuning for HS400. In the later case, + * an AMD-specific DLL reset additionally is needed. + */ + if (strcmp(acpi_dev->hid, "AMDI0040") == 0 && acpi_dev->uid == 0) { + ios = &slot->host.ios; + timing = ios->timing; + if (old_timing == SDHCI_CTRL2_UHS_SDR104 && + timing == bus_timing_hs) + SDHCI_WRITE_2(bus, slot, SDHCI_HOST_CONTROL2, + SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2) & + ~SDHCI_CTRL2_SAMPLING_CLOCK); + if (ios->clock > SD_SDR50_MAX && + old_timing != SDHCI_CTRL2_MMC_HS400 && + timing == bus_timing_mmc_hs400) { + SDHCI_WRITE_2(bus, slot, SDHCI_HOST_CONTROL2, + SDHCI_READ_2(bus, slot, SDHCI_HOST_CONTROL2) | + SDHCI_CTRL2_SAMPLING_CLOCK); + SDHCI_WRITE_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + 0x40003210); + DELAY(20); + SDHCI_WRITE_4(bus, slot, SDHCI_AMD_RESET_DLL_REG, + 0x40033210); + } + } +} + static const struct sdhci_acpi_device * sdhci_acpi_find_device(device_t dev) { @@ -237,13 +286,15 @@ sdhci_acpi_attach(device_t dev) { struct sdhci_acpi_softc *sc = device_get_softc(dev); int rid, err; + u_int quirks; const struct sdhci_acpi_device *acpi_dev; acpi_dev = sdhci_acpi_find_device(dev); if (acpi_dev == NULL) return (ENXIO); - sc->quirks = acpi_dev->quirks; + sc->acpi_dev = acpi_dev; + quirks = acpi_dev->quirks; /* Allocate IRQ. */ rid = 0; @@ -271,11 +322,10 @@ sdhci_acpi_attach(device_t dev) if (strcmp(acpi_dev->hid, "80860F14") == 0 && acpi_dev->uid == 1 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES) == 0x446cc8b2 && SDHCI_READ_4(dev, &sc->slot, SDHCI_CAPABILITIES2) == 0x00000807) - sc->quirks |= SDHCI_QUIRK_MMC_DDR52 | - SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; - sc->quirks &= ~sdhci_quirk_clear; - sc->quirks |= sdhci_quirk_set; - sc->slot.quirks = sc->quirks; + quirks |= SDHCI_QUIRK_MMC_DDR52 | SDHCI_QUIRK_DATA_TIMEOUT_1MHZ; + quirks &= ~sdhci_quirk_clear; + quirks |= sdhci_quirk_set; + sc->slot.quirks = quirks; err = sdhci_init_slot(dev, &sc->slot, 0); if (err) { @@ -392,7 +442,7 @@ static device_method_t sdhci_methods[] = { DEVMETHOD(sdhci_write_2, sdhci_acpi_write_2), DEVMETHOD(sdhci_write_4, sdhci_acpi_write_4), DEVMETHOD(sdhci_write_multi_4, sdhci_acpi_write_multi_4), - DEVMETHOD(sdhci_set_uhs_timing, sdhci_generic_set_uhs_timing), + DEVMETHOD(sdhci_set_uhs_timing, sdhci_acpi_set_uhs_timing), DEVMETHOD_END }; From owner-svn-src-stable-12@freebsd.org Thu Nov 22 16:52:31 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3B4C114C127; Thu, 22 Nov 2018 16:52:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B09A7CE93; Thu, 22 Nov 2018 16:52:31 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4C15F12939; Thu, 22 Nov 2018 16:52:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMGqVSH089429; Thu, 22 Nov 2018 16:52:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMGqVtc089428; Thu, 22 Nov 2018 16:52:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811221652.wAMGqVtc089428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 22 Nov 2018 16:52:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340769 - stable/12/usr.bin/ldd X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.bin/ldd X-SVN-Commit-Revision: 340769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B09A7CE93 X-Spamd-Result: default: False [1.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.49)[0.492,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.12)[0.118,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:52:31 -0000 Author: markj Date: Thu Nov 22 16:52:30 2018 New Revision: 340769 URL: https://svnweb.freebsd.org/changeset/base/340769 Log: MFC r339653: Add an IMPLEMENTATION NOTES section to ldd.1. PR: 231926 Modified: stable/12/usr.bin/ldd/ldd.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/ldd/ldd.1 ============================================================================== --- stable/12/usr.bin/ldd/ldd.1 Thu Nov 22 16:27:30 2018 (r340768) +++ stable/12/usr.bin/ldd/ldd.1 Thu Nov 22 16:52:30 2018 (r340769) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd May 15, 2008 +.Dd October 23, 2018 .Dt LDD 1 .Os .Sh NAME @@ -57,6 +57,14 @@ option displays a verbose listing of the dynamic linki encoded in the executable. See the source code and include files for the definitive meaning of all the fields. +.Sh IMPLEMENTATION NOTES +.Nm +lists the dependencies of an executable by setting +.Xr rtld 1 +environment variables and running the executable in a child process. +If the executable is corrupt or invalid, +.Nm +may therefore fail without providing any diagnostic error messages. .Sh EXAMPLES The following is an example of a shell pipeline which uses the .Fl f @@ -67,6 +75,7 @@ which link against libc.so.6: .Sh SEE ALSO .Xr ld 1 , .Xr nm 1 , +.Xr readelf 1 , .Xr rtld 1 .Sh HISTORY A From owner-svn-src-stable-12@freebsd.org Thu Nov 22 16:53:31 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4EA9114C18B; Thu, 22 Nov 2018 16:53:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D2FC7CFEC; Thu, 22 Nov 2018 16:53:31 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AB0912946; Thu, 22 Nov 2018 16:53:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMGrVNt089556; Thu, 22 Nov 2018 16:53:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMGrUrd089555; Thu, 22 Nov 2018 16:53:30 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811221653.wAMGrUrd089555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 22 Nov 2018 16:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340770 - stable/12/sys/fs/fuse X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/fs/fuse X-SVN-Commit-Revision: 340770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5D2FC7CFEC X-Spamd-Result: default: False [1.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.49)[0.492,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.12)[0.118,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 16:53:31 -0000 Author: markj Date: Thu Nov 22 16:53:30 2018 New Revision: 340770 URL: https://svnweb.freebsd.org/changeset/base/340770 Log: MFC r340639: Remove comments made obsolete by the ino64 work. Modified: stable/12/sys/fs/fuse/fuse_internal.c stable/12/sys/fs/fuse/fuse_internal.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/fuse/fuse_internal.c ============================================================================== --- stable/12/sys/fs/fuse/fuse_internal.c Thu Nov 22 16:52:30 2018 (r340769) +++ stable/12/sys/fs/fuse/fuse_internal.c Thu Nov 22 16:53:30 2018 (r340770) @@ -350,7 +350,7 @@ fuse_internal_readdir_processdata(struct uio *uio, fiov_adjust(cookediov, bytesavail); de = (struct dirent *)cookediov->base; - de->d_fileno = fudge->ino; /* XXX: truncation */ + de->d_fileno = fudge->ino; de->d_reclen = bytesavail; de->d_type = fudge->type; de->d_namlen = fudge->namelen; Modified: stable/12/sys/fs/fuse/fuse_internal.h ============================================================================== --- stable/12/sys/fs/fuse/fuse_internal.h Thu Nov 22 16:52:30 2018 (r340769) +++ stable/12/sys/fs/fuse/fuse_internal.h Thu Nov 22 16:53:30 2018 (r340770) @@ -212,7 +212,7 @@ fuse_internal_attr_fat2vat(struct mount *mp, vattr_null(vap); vap->va_fsid = mp->mnt_stat.f_fsid.val[0]; - vap->va_fileid = fat->ino; /* XXX cast from 64 bits to 32 */ + vap->va_fileid = fat->ino; vap->va_mode = fat->mode & ~S_IFMT; vap->va_nlink = fat->nlink; vap->va_uid = fat->uid; From owner-svn-src-stable-12@freebsd.org Thu Nov 22 19:56:51 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33D2711056B0; Thu, 22 Nov 2018 19:56:51 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC9C383BA9; Thu, 22 Nov 2018 19:56:50 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD9551464A; Thu, 22 Nov 2018 19:56:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMJuoHg083752; Thu, 22 Nov 2018 19:56:50 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMJuoE8083751; Thu, 22 Nov 2018 19:56:50 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811221956.wAMJuoE8083751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 22 Nov 2018 19:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340775 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 340775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CC9C383BA9 X-Spamd-Result: default: False [1.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.027,0]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.70)[0.699,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 19:56:51 -0000 Author: kp Date: Thu Nov 22 19:56:50 2018 New Revision: 340775 URL: https://svnweb.freebsd.org/changeset/base/340775 Log: MFC r340265: pf: Prevent tables referenced by rules in anchors from getting disabled. PR: 183198 Obtained from: OpenBSD Modified: stable/12/sys/netpfil/pf/pf_table.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/pf_table.c ============================================================================== --- stable/12/sys/netpfil/pf/pf_table.c Thu Nov 22 19:49:52 2018 (r340774) +++ stable/12/sys/netpfil/pf/pf_table.c Thu Nov 22 19:56:50 2018 (r340775) @@ -1754,6 +1754,7 @@ pfr_setflags_ktable(struct pfr_ktable *kt, int newf) PF_RULES_WASSERT(); if (!(newf & PFR_TFLAG_REFERENCED) && + !(newf & PFR_TFLAG_REFDANCHOR) && !(newf & PFR_TFLAG_PERSIST)) newf &= ~PFR_TFLAG_ACTIVE; if (!(newf & PFR_TFLAG_ACTIVE)) From owner-svn-src-stable-12@freebsd.org Thu Nov 22 19:59:03 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B7E61105954; Thu, 22 Nov 2018 19:59:03 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E81F8840CD; Thu, 22 Nov 2018 19:59:02 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9C5714666; Thu, 22 Nov 2018 19:59:02 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMJx2AK084034; Thu, 22 Nov 2018 19:59:02 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMJx2YX084033; Thu, 22 Nov 2018 19:59:02 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811221959.wAMJx2YX084033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 22 Nov 2018 19:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340778 - stable/12/sbin/pfctl X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sbin/pfctl X-SVN-Commit-Revision: 340778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E81F8840CD X-Spamd-Result: default: False [1.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.027,0]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.70)[0.699,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 19:59:03 -0000 Author: kp Date: Thu Nov 22 19:59:02 2018 New Revision: 340778 URL: https://svnweb.freebsd.org/changeset/base/340778 Log: MFC r340264: pfctl: Populate ifname in ifa_lookup() pfctl_adjust_skip_ifaces() relies on this name. Modified: stable/12/sbin/pfctl/pfctl_parser.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/pfctl/pfctl_parser.c ============================================================================== --- stable/12/sbin/pfctl/pfctl_parser.c Thu Nov 22 19:56:52 2018 (r340777) +++ stable/12/sbin/pfctl/pfctl_parser.c Thu Nov 22 19:59:02 2018 (r340778) @@ -1400,6 +1400,7 @@ ifa_lookup(const char *ifa_name, int flags) set_ipmask(n, 128); } n->ifindex = p->ifindex; + n->ifname = strdup(p->ifname); n->next = NULL; n->tail = n; From owner-svn-src-stable-12@freebsd.org Thu Nov 22 20:00:57 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A09C11105C09; Thu, 22 Nov 2018 20:00:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3443084647; Thu, 22 Nov 2018 20:00:57 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16DE714783; Thu, 22 Nov 2018 20:00:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAMK0uIa085192; Thu, 22 Nov 2018 20:00:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAMK0urW085183; Thu, 22 Nov 2018 20:00:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201811222000.wAMK0urW085183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 22 Nov 2018 20:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340780 - stable/12/tests/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/tests/sys/netpfil/pf X-SVN-Commit-Revision: 340780 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3443084647 X-Spamd-Result: default: False [1.06 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.03)[-0.027,0]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.70)[0.699,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2018 20:00:57 -0000 Author: kp Date: Thu Nov 22 20:00:56 2018 New Revision: 340780 URL: https://svnweb.freebsd.org/changeset/base/340780 Log: MFC r340266: pf tests: Test PR 183198 Create a table which is only used inside an anchor, ensure that the table exists. PR: 183198 Added: stable/12/tests/sys/netpfil/pf/anchor.sh - copied unchanged from r340266, head/tests/sys/netpfil/pf/anchor.sh Modified: stable/12/tests/sys/netpfil/pf/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/netpfil/pf/Makefile ============================================================================== --- stable/12/tests/sys/netpfil/pf/Makefile Thu Nov 22 19:59:04 2018 (r340779) +++ stable/12/tests/sys/netpfil/pf/Makefile Thu Nov 22 20:00:56 2018 (r340780) @@ -5,7 +5,8 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/netpfil/pf TESTS_SUBDIRS+= ioctl -ATF_TESTS_SH+= pass_block \ +ATF_TESTS_SH+= anchor \ + pass_block \ forward \ fragmentation \ set_tos \ Copied: stable/12/tests/sys/netpfil/pf/anchor.sh (from r340266, head/tests/sys/netpfil/pf/anchor.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/netpfil/pf/anchor.sh Thu Nov 22 20:00:56 2018 (r340780, copy of r340266, head/tests/sys/netpfil/pf/anchor.sh) @@ -0,0 +1,40 @@ +# $FreeBSD$ + +. $(atf_get_srcdir)/utils.subr + +atf_test_case "pr183198" "cleanup" +pr183198_head() +{ + atf_set descr 'Test tables referenced by rules in anchors' + atf_set require.user root +} + +pr183198_body() +{ + pft_init + + epair=$(pft_mkepair) + pft_mkjail alcatraz ${epair}b + jexec alcatraz pfctl -e + + # Forward with pf enabled + pft_set_rules alcatraz \ + "table { 10.0.0.1, 10.0.0.2, 10.0.0.3 }" \ + "block in" \ + "anchor \"epair\" on ${epair}b { \n\ + pass in from \n\ + }" + + atf_check -s exit:0 -o ignore jexec alcatraz pfctl -sr -a '*' + atf_check -s exit:0 -o ignore jexec alcatraz pfctl -t test -T show +} + +pr183198_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "pr183198" +} From owner-svn-src-stable-12@freebsd.org Fri Nov 23 00:56:43 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E1001135C9E; Fri, 23 Nov 2018 00:56:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFD6D6F96A; Fri, 23 Nov 2018 00:56:42 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8A9791775B; Fri, 23 Nov 2018 00:56:42 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN0ugJ0042083; Fri, 23 Nov 2018 00:56:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN0ugd2042082; Fri, 23 Nov 2018 00:56:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811230056.wAN0ugd2042082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 23 Nov 2018 00:56:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340788 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFD6D6F96A X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_SHORT(0.42)[0.424,0]; NEURAL_SPAM_MEDIUM(0.70)[0.699,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 00:56:43 -0000 Author: markj Date: Fri Nov 23 00:56:42 2018 New Revision: 340788 URL: https://svnweb.freebsd.org/changeset/base/340788 Log: MFC r340699: Clear pad bytes in the struct exported by kern.ntp_pll.gettime. Modified: stable/12/sys/kern/kern_ntptime.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_ntptime.c ============================================================================== --- stable/12/sys/kern/kern_ntptime.c Fri Nov 23 00:17:47 2018 (r340787) +++ stable/12/sys/kern/kern_ntptime.c Fri Nov 23 00:56:42 2018 (r340788) @@ -300,6 +300,8 @@ ntp_sysctl(SYSCTL_HANDLER_ARGS) { struct ntptimeval ntv; /* temporary structure */ + memset(&ntv, 0, sizeof(ntv)); + NTP_LOCK(); ntp_gettime1(&ntv); NTP_UNLOCK(); From owner-svn-src-stable-12@freebsd.org Fri Nov 23 01:05:44 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D713C1136041; Fri, 23 Nov 2018 01:05:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DA5D6FF89; Fri, 23 Nov 2018 01:05:43 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 573EC178EF; Fri, 23 Nov 2018 01:05:43 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAN15hnq047140; Fri, 23 Nov 2018 01:05:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAN15hcG047139; Fri, 23 Nov 2018 01:05:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811230105.wAN15hcG047139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 01:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340790 - stable/12/usr.sbin/kldxref X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.sbin/kldxref X-SVN-Commit-Revision: 340790 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DA5D6FF89 X-Spamd-Result: default: False [1.56 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.41)[0.407,0]; NEURAL_SPAM_MEDIUM(0.72)[0.717,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.44)[0.440,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 01:05:44 -0000 Author: emaste Date: Fri Nov 23 01:05:42 2018 New Revision: 340790 URL: https://svnweb.freebsd.org/changeset/base/340790 Log: MFC r340285: kldxref: use appropriate Elf_Off type for offsets Submitted by: Mitchell Horne Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.sbin/kldxref/ef.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/kldxref/ef.c ============================================================================== --- stable/12/usr.sbin/kldxref/ef.c Fri Nov 23 00:59:42 2018 (r340789) +++ stable/12/usr.sbin/kldxref/ef.c Fri Nov 23 01:05:42 2018 (r340790) @@ -80,7 +80,7 @@ struct ef_file { }; static void ef_print_phdr(Elf_Phdr *); -static u_long ef_get_offset(elf_file_t, Elf_Off); +static Elf_Off ef_get_offset(elf_file_t, Elf_Off); static int ef_parse_dynamic(elf_file_t); static int ef_get_type(elf_file_t ef); @@ -126,16 +126,17 @@ ef_print_phdr(Elf_Phdr *phdr) { if ((phdr->p_flags & PF_W) == 0) { - printf("text=0x%lx ", (long)phdr->p_filesz); + printf("text=0x%jx ", (uintmax_t)phdr->p_filesz); } else { - printf("data=0x%lx", (long)phdr->p_filesz); + printf("data=0x%jx", (uintmax_t)phdr->p_filesz); if (phdr->p_filesz < phdr->p_memsz) - printf("+0x%lx", (long)(phdr->p_memsz - phdr->p_filesz)); + printf("+0x%jx", + (uintmax_t)(phdr->p_memsz - phdr->p_filesz)); printf(" "); } } -static u_long +static Elf_Off ef_get_offset(elf_file_t ef, Elf_Off off) { Elf_Phdr *ph; @@ -292,8 +293,8 @@ ef_parse_dynamic(elf_file_t ef) error = ef_read(ef, ef_get_offset(ef, dp->d_un.d_ptr), sizeof(hashhdr), hashhdr); if (error != 0) { - warnx("can't read hash header (%lx)", - ef_get_offset(ef, dp->d_un.d_ptr)); + warnx("can't read hash header (%jx)", + (uintmax_t)ef_get_offset(ef, dp->d_un.d_ptr)); return (error); } ef->ef_nbuckets = hashhdr[0]; @@ -365,8 +366,8 @@ ef_parse_dynamic(elf_file_t ef) ef->ef_nchains * sizeof(Elf_Sym), (void **)&ef->ef_symtab) != 0) { if (ef->ef_verbose) - warnx("%s: can't load .dynsym section (0x%lx)", - ef->ef_name, (long)ef->ef_symoff); + warnx("%s: can't load .dynsym section (0x%jx)", + ef->ef_name, (uintmax_t)ef->ef_symoff); return (EIO); } if (ef_read_entry(ef, ef_get_offset(ef, ef->ef_stroff), ef->ef_strsz, @@ -461,13 +462,13 @@ ef_read_entry(elf_file_t ef, Elf_Off offset, size_t le static int ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, void *dest) { - u_long ofs; + Elf_Off ofs; ofs = ef_get_offset(ef, offset); if (ofs == 0) { if (ef->ef_verbose) - warnx("ef_seg_read(%s): zero offset (%lx:%ld)", - ef->ef_name, (long)offset, ofs); + warnx("ef_seg_read(%s): zero offset (%jx:%ju)", + ef->ef_name, (uintmax_t)offset, (uintmax_t)ofs); return (EFAULT); } return (ef_read(ef, ofs, len, dest)); @@ -476,7 +477,7 @@ ef_seg_read(elf_file_t ef, Elf_Off offset, size_t len, static int ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t len, void *dest) { - u_long ofs; + Elf_Off ofs; const Elf_Rela *a; const Elf_Rel *r; int error; @@ -484,8 +485,8 @@ ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t ofs = ef_get_offset(ef, offset); if (ofs == 0) { if (ef->ef_verbose) - warnx("ef_seg_read_rel(%s): zero offset (%lx:%ld)", - ef->ef_name, (long)offset, ofs); + warnx("ef_seg_read_rel(%s): zero offset (%jx:%ju)", + ef->ef_name, (uintmax_t)offset, (uintmax_t)ofs); return (EFAULT); } if ((error = ef_read(ef, ofs, len, dest)) != 0) @@ -509,14 +510,14 @@ ef_seg_read_rel(elf_file_t ef, Elf_Off offset, size_t static int ef_seg_read_string(elf_file_t ef, Elf_Off offset, size_t len, char *dest) { - u_long ofs; + Elf_Off ofs; ssize_t r; ofs = ef_get_offset(ef, offset); if (ofs == 0 || ofs == (Elf_Off)-1) { if (ef->ef_verbose) - warnx("ef_seg_read_string(%s): bad offset (%lx:%ld)", - ef->ef_name, (long)offset, ofs); + warnx("ef_seg_read_string(%s): bad offset (%jx:%ju)", + ef->ef_name, (uintmax_t)offset, (uintmax_t)ofs); return (EFAULT); } From owner-svn-src-stable-12@freebsd.org Fri Nov 23 20:29:48 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD14B1102F3A; Fri, 23 Nov 2018 20:29:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 641AB73B8E; Fri, 23 Nov 2018 20:29:48 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4537B238D3; Fri, 23 Nov 2018 20:29:48 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANKTmsZ049590; Fri, 23 Nov 2018 20:29:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANKTmsw049589; Fri, 23 Nov 2018 20:29:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811232029.wANKTmsw049589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 20:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340849 - stable/12/sys/fs/nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/fs/nfsserver X-SVN-Commit-Revision: 340849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 641AB73B8E X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_SHORT(0.32)[0.320,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 20:29:48 -0000 Author: emaste Date: Fri Nov 23 20:29:47 2018 New Revision: 340849 URL: https://svnweb.freebsd.org/changeset/base/340849 Log: MFC r340661 (rmacklem): r304026 added code that started statistics gathering for an operation before the operation number (the variable called "op") was sanity checked. This patch moves the code down to below the range sanity check for "op". Modified: stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c Fri Nov 23 19:45:57 2018 (r340848) +++ stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c Fri Nov 23 20:29:47 2018 (r340849) @@ -766,11 +766,6 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram *repp = *tl; op = fxdr_unsigned(int, *tl); NFSD_DEBUG(4, "op=%d\n", op); - - binuptime(&start_time); - nfsrvd_statstart(op, &start_time); - statsinprog = 1; - if (op < NFSV4OP_ACCESS || (op >= NFSV4OP_NOPS && (nd->nd_flag & ND_NFSV41) == 0) || (op >= NFSV41_NOPS && (nd->nd_flag & ND_NFSV41) != 0)) { @@ -782,6 +777,11 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram } else { repp++; } + + binuptime(&start_time); + nfsrvd_statstart(op, &start_time); + statsinprog = 1; + if (i == 0) op0 = op; if (i == numops - 1) From owner-svn-src-stable-12@freebsd.org Fri Nov 23 20:31:28 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08DBA1103170; Fri, 23 Nov 2018 20:31:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2BFD73EB9; Fri, 23 Nov 2018 20:31:27 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 856B223A35; Fri, 23 Nov 2018 20:31:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANKVRwO054351; Fri, 23 Nov 2018 20:31:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANKVRA1054350; Fri, 23 Nov 2018 20:31:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811232031.wANKVRA1054350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 20:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340850 - stable/12/sys/fs/nfs X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/fs/nfs X-SVN-Commit-Revision: 340850 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2BFD73EB9 X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.32)[0.320,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 20:31:28 -0000 Author: emaste Date: Fri Nov 23 20:31:27 2018 New Revision: 340850 URL: https://svnweb.freebsd.org/changeset/base/340850 Log: MFC r340662 (rmacklem): nfsm_advance() would panic() when the offs argument was negative. The code assumed that this would indicate a corrupted mbuf chain, but it could simply be caused by bogus RPC message data. This patch replaces the panic() with a printf() plus error return. Modified: stable/12/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/12/sys/fs/nfs/nfs_commonsubs.c Fri Nov 23 20:29:47 2018 (r340849) +++ stable/12/sys/fs/nfs/nfs_commonsubs.c Fri Nov 23 20:31:27 2018 (r340850) @@ -725,10 +725,14 @@ nfsm_advance(struct nfsrv_descript *nd, int offs, int if (offs == 0) goto out; /* - * A negative offs should be considered a serious problem. + * A negative offs might indicate a corrupted mbuf chain and, + * as such, a printf is logged. */ - if (offs < 0) - panic("nfsrv_advance"); + if (offs < 0) { + printf("nfsrv_advance: negative offs\n"); + error = EBADRPC; + goto out; + } /* * If left == -1, calculate it here. From owner-svn-src-stable-12@freebsd.org Fri Nov 23 20:32:42 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFF711103209; Fri, 23 Nov 2018 20:32:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C4C7740B0; Fri, 23 Nov 2018 20:32:42 +0000 (UTC) (envelope-from emaste@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D2DE23A86; Fri, 23 Nov 2018 20:32:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wANKWgxx054450; Fri, 23 Nov 2018 20:32:42 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wANKWgP8054449; Fri, 23 Nov 2018 20:32:42 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201811232032.wANKWgP8054449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 23 Nov 2018 20:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340851 - stable/12/sys/fs/nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/fs/nfsserver X-SVN-Commit-Revision: 340851 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5C4C7740B0 X-Spamd-Result: default: False [1.40 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.39)[0.387,0]; NEURAL_SPAM_SHORT(0.32)[0.320,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2018 20:32:42 -0000 Author: emaste Date: Fri Nov 23 20:32:41 2018 New Revision: 340851 URL: https://svnweb.freebsd.org/changeset/base/340851 Log: MFC r340663 (rmacklem): Improve sanity checking for the dircount hint argument to NFSv3's ReaddirPlus and NFSv4's Readdir operations. The code checked for a zero argument, but did not check for a very large value. This patch clips dircount at the server's maximum data size. Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdport.c Fri Nov 23 20:31:27 2018 (r340850) +++ stable/12/sys/fs/nfsserver/nfs_nfsdport.c Fri Nov 23 20:32:41 2018 (r340851) @@ -2107,9 +2107,15 @@ nfsrvd_readdirplus(struct nfsrv_descript *nd, int isdg * cookie) should be in the reply. At least one client "hints" 0, * so I set it to cnt for that case. I also round it up to the * next multiple of DIRBLKSIZ. + * Since the size of a Readdirplus directory entry reply will always + * be greater than a directory entry returned by VOP_READDIR(), it + * does not make sense to read more than NFS_SRVMAXDATA() via + * VOP_READDIR(). */ if (siz <= 0) siz = cnt; + else if (siz > NFS_SRVMAXDATA(nd)) + siz = NFS_SRVMAXDATA(nd); siz = ((siz + DIRBLKSIZ - 1) & ~(DIRBLKSIZ - 1)); if (nd->nd_flag & ND_NFSV4) { From owner-svn-src-stable-12@freebsd.org Sat Nov 24 15:10:06 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59903115109D; Sat, 24 Nov 2018 15:10:06 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F13CF7BFFD; Sat, 24 Nov 2018 15:10:05 +0000 (UTC) (envelope-from bcr@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDA64795D; Sat, 24 Nov 2018 15:10:05 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOFA5Un040613; Sat, 24 Nov 2018 15:10:05 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOFA5QF040612; Sat, 24 Nov 2018 15:10:05 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <201811241510.wAOFA5QF040612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Sat, 24 Nov 2018 15:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340870 - stable/12/usr.bin/fortune/datfiles X-SVN-Group: stable-12 X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: stable/12/usr.bin/fortune/datfiles X-SVN-Commit-Revision: 340870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F13CF7BFFD X-Spamd-Result: default: False [1.51 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_SHORT(0.20)[0.201,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 15:10:06 -0000 Author: bcr (doc committer) Date: Sat Nov 24 15:10:05 2018 New Revision: 340870 URL: https://svnweb.freebsd.org/changeset/base/340870 Log: MFC r340649: Add a fortune describing how to upload a machine's dmesg information to the NYCBUG database. We want to encourage our users to upload their dmesgs so that the project can get a better insight into what kind of hardware is run on. This helps in making data-driven decisions about i.e., platform and driver support. Note that dmesgs may contain sensitive information like hardware serial numbers, hence uploading them without review is discouraged. Reviewed by: brooks, imp, allanjude Approved by: allanjude Differential Revision: https://reviews.freebsd.org/D17705 Modified: stable/12/usr.bin/fortune/datfiles/freebsd-tips Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/fortune/datfiles/freebsd-tips ============================================================================== --- stable/12/usr.bin/fortune/datfiles/freebsd-tips Sat Nov 24 14:46:06 2018 (r340869) +++ stable/12/usr.bin/fortune/datfiles/freebsd-tips Sat Nov 24 15:10:05 2018 (r340870) @@ -554,3 +554,9 @@ Use "sysrc name=value" to add an entry and "sysrc -x n -- Lars Engels % +You can upload the dmesg of your system to help developers get an overview of commonly used hardware and peripherals for FreeBSD. +Use the curl package to upload it in one command: +curl -v -d "nickname=$USER" -d "description=FreeBSD/$(uname -m) on \ +$(kenv smbios.system.maker) $(kenv smbios.system.product)" -d "do=addd" \ +--data-urlencode 'dmesg@/var/run/dmesg.boot' http://dmesgd.nycbug.org/index.cgi +% From owner-svn-src-stable-12@freebsd.org Sat Nov 24 17:08:13 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 768B8110480F; Sat, 24 Nov 2018 17:08:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19199831FA; Sat, 24 Nov 2018 17:08:13 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE33310D40; Sat, 24 Nov 2018 17:08:12 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOH8Cl9008404; Sat, 24 Nov 2018 17:08:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOH8Clj008401; Sat, 24 Nov 2018 17:08:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241708.wAOH8Clj008401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 17:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340901 - in stable/12: . tests/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: . tests/sys/netinet X-SVN-Commit-Revision: 340901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 19199831FA X-Spamd-Result: default: False [1.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.65)[0.649,0]; NEURAL_SPAM_SHORT(0.50)[0.495,0]; NEURAL_SPAM_MEDIUM(0.73)[0.732,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:08:13 -0000 Author: markj Date: Sat Nov 24 17:08:12 2018 New Revision: 340901 URL: https://svnweb.freebsd.org/changeset/base/340901 Log: MFC r340484: Rename the SO_REUSEPORT_LB test file to be consistent with other tests. Added: stable/12/tests/sys/netinet/so_reuseport_lb_test.c - copied unchanged from r340484, head/tests/sys/netinet/so_reuseport_lb_test.c Deleted: stable/12/tests/sys/netinet/reuseport_lb.c Modified: stable/12/ObsoleteFiles.inc stable/12/tests/sys/netinet/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/ObsoleteFiles.inc ============================================================================== --- stable/12/ObsoleteFiles.inc Sat Nov 24 17:06:01 2018 (r340900) +++ stable/12/ObsoleteFiles.inc Sat Nov 24 17:08:12 2018 (r340901) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20181116: Rename test file. +OLD_FILES+=usr/tests/sys/netinet/reuseport_lb # 20181030: malloc_domain(9) KPI change OLD_FILES+=usr/share/man/man9/malloc_domain.9.gz # 20181025: OpenSSL libraries version bump to avoid conflict with ports Modified: stable/12/tests/sys/netinet/Makefile ============================================================================== --- stable/12/tests/sys/netinet/Makefile Sat Nov 24 17:06:01 2018 (r340900) +++ stable/12/tests/sys/netinet/Makefile Sat Nov 24 17:08:12 2018 (r340901) @@ -3,7 +3,7 @@ TESTSDIR= ${TESTSBASE}/sys/netinet BINDIR= ${TESTSDIR} -ATF_TESTS_C= reuseport_lb +ATF_TESTS_C= so_reuseport_lb_test ATF_TESTS_SH= fibs_test Copied: stable/12/tests/sys/netinet/so_reuseport_lb_test.c (from r340484, head/tests/sys/netinet/so_reuseport_lb_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/netinet/so_reuseport_lb_test.c Sat Nov 24 17:08:12 2018 (r340901, copy of r340484, head/tests/sys/netinet/so_reuseport_lb_test.c) @@ -0,0 +1,242 @@ +/*- + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston under sponsorship from + * the FreeBSD Foundation. + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + +#include +#include +#include +#include + +#include + +/* + * Given an array of non-blocking listening sockets configured in a LB group + * for "addr", try connecting to "addr" in a loop and verify that connections + * are roughly balanced across the sockets. + */ +static void +lb_simple_accept_loop(int domain, const struct sockaddr *addr, int sds[], + size_t nsds, int nconns) +{ + size_t i; + int *acceptcnt; + int csd, error, excnt, sd; + + /* + * We expect each listening socket to accept roughly nconns/nsds + * connections, but allow for some error. + */ + excnt = nconns / nsds / 8; + acceptcnt = calloc(nsds, sizeof(*acceptcnt)); + ATF_REQUIRE_MSG(acceptcnt != NULL, "calloc() failed: %s", + strerror(errno)); + + while (nconns-- > 0) { + sd = socket(domain, SOCK_STREAM, 0); + ATF_REQUIRE_MSG(sd >= 0, "socket() failed: %s", + strerror(errno)); + + error = connect(sd, addr, addr->sa_len); + ATF_REQUIRE_MSG(error == 0, "connect() failed: %s", + strerror(errno)); + + /* + * Poll the listening sockets. + */ + do { + for (i = 0; i < nsds; i++) { + csd = accept(sds[i], NULL, NULL); + if (csd < 0) { + ATF_REQUIRE_MSG(errno == EWOULDBLOCK || + errno == EAGAIN, + "accept() failed: %s", + strerror(errno)); + continue; + } + + error = close(csd); + ATF_REQUIRE_MSG(error == 0, + "close() failed: %s", strerror(errno)); + + acceptcnt[i]++; + break; + } + } while (i == nsds); + + error = close(sd); + ATF_REQUIRE_MSG(error == 0, "close() failed: %s", + strerror(errno)); + } + + for (i = 0; i < nsds; i++) + ATF_REQUIRE_MSG(acceptcnt[i] > excnt, "uneven balancing"); +} + +static int +lb_listen_socket(int domain, int flags) +{ + size_t one; + int error, sd; + + sd = socket(domain, SOCK_STREAM | flags, 0); + ATF_REQUIRE_MSG(sd >= 0, "socket() failed: %s", strerror(errno)); + + one = 1; + error = setsockopt(sd, SOL_SOCKET, SO_REUSEPORT_LB, &one, sizeof(one)); + ATF_REQUIRE_MSG(error == 0, "setsockopt(SO_REUSEPORT_LB) failed: %s", + strerror(errno)); + + return (sd); +} + +ATF_TC_WITHOUT_HEAD(basic_ipv4); +ATF_TC_BODY(basic_ipv4, tc) +{ + struct sockaddr_in addr; + socklen_t slen; + size_t i; + const int nconns = 16384; + int error, sds[16]; + uint16_t port; + + sds[0] = lb_listen_socket(PF_INET, SOCK_NONBLOCK); + + memset(&addr, 0, sizeof(addr)); + addr.sin_len = sizeof(addr); + addr.sin_family = AF_INET; + addr.sin_port = htons(0); + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + error = bind(sds[0], (const struct sockaddr *)&addr, sizeof(addr)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", strerror(errno)); + error = listen(sds[0], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", strerror(errno)); + + slen = sizeof(addr); + error = getsockname(sds[0], (struct sockaddr *)&addr, &slen); + ATF_REQUIRE_MSG(error == 0, "getsockname() failed: %s", + strerror(errno)); + ATF_REQUIRE_MSG(slen == sizeof(addr), "sockaddr size changed"); + port = addr.sin_port; + + memset(&addr, 0, sizeof(addr)); + addr.sin_len = sizeof(addr); + addr.sin_family = AF_INET; + addr.sin_port = port; + addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + for (i = 1; i < nitems(sds); i++) { + sds[i] = lb_listen_socket(PF_INET, SOCK_NONBLOCK); + + error = bind(sds[i], (const struct sockaddr *)&addr, + sizeof(addr)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", + strerror(errno)); + error = listen(sds[i], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", + strerror(errno)); + } + + lb_simple_accept_loop(PF_INET, (struct sockaddr *)&addr, sds, + nitems(sds), nconns); + for (i = 0; i < nitems(sds); i++) { + error = close(sds[i]); + ATF_REQUIRE_MSG(error == 0, "close() failed: %s", + strerror(errno)); + } +} + +ATF_TC_WITHOUT_HEAD(basic_ipv6); +ATF_TC_BODY(basic_ipv6, tc) +{ + const struct in6_addr loopback6 = IN6ADDR_LOOPBACK_INIT; + struct sockaddr_in6 addr; + socklen_t slen; + size_t i; + const int nconns = 16384; + int error, sds[16]; + uint16_t port; + + sds[0] = lb_listen_socket(PF_INET6, SOCK_NONBLOCK); + + memset(&addr, 0, sizeof(addr)); + addr.sin6_len = sizeof(addr); + addr.sin6_family = AF_INET6; + addr.sin6_port = htons(0); + addr.sin6_addr = loopback6; + error = bind(sds[0], (const struct sockaddr *)&addr, sizeof(addr)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", strerror(errno)); + error = listen(sds[0], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", strerror(errno)); + + slen = sizeof(addr); + error = getsockname(sds[0], (struct sockaddr *)&addr, &slen); + ATF_REQUIRE_MSG(error == 0, "getsockname() failed: %s", + strerror(errno)); + ATF_REQUIRE_MSG(slen == sizeof(addr), "sockaddr size changed"); + port = addr.sin6_port; + + memset(&addr, 0, sizeof(addr)); + addr.sin6_len = sizeof(addr); + addr.sin6_family = AF_INET6; + addr.sin6_port = port; + addr.sin6_addr = loopback6; + for (i = 1; i < nitems(sds); i++) { + sds[i] = lb_listen_socket(PF_INET6, SOCK_NONBLOCK); + + error = bind(sds[i], (const struct sockaddr *)&addr, + sizeof(addr)); + ATF_REQUIRE_MSG(error == 0, "bind() failed: %s", + strerror(errno)); + error = listen(sds[i], 1); + ATF_REQUIRE_MSG(error == 0, "listen() failed: %s", + strerror(errno)); + } + + lb_simple_accept_loop(PF_INET6, (struct sockaddr *)&addr, sds, + nitems(sds), nconns); + for (i = 0; i < nitems(sds); i++) { + error = close(sds[i]); + ATF_REQUIRE_MSG(error == 0, "close() failed: %s", + strerror(errno)); + } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, basic_ipv4); + ATF_TP_ADD_TC(tp, basic_ipv6); + + return (atf_no_error()); +} From owner-svn-src-stable-12@freebsd.org Sat Nov 24 17:08:50 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CD5411048D1; Sat, 24 Nov 2018 17:08:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA98A83351; Sat, 24 Nov 2018 17:08:49 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABB0C10D43; Sat, 24 Nov 2018 17:08:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOH8naO008514; Sat, 24 Nov 2018 17:08:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOH8nTp008512; Sat, 24 Nov 2018 17:08:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241708.wAOH8nTp008512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 17:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340902 - stable/12/tests/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/tests/sys/netinet X-SVN-Commit-Revision: 340902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA98A83351 X-Spamd-Result: default: False [1.88 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.65)[0.649,0]; NEURAL_SPAM_MEDIUM(0.73)[0.732,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.50)[0.495,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:08:50 -0000 Author: markj Date: Sat Nov 24 17:08:49 2018 New Revision: 340902 URL: https://svnweb.freebsd.org/changeset/base/340902 Log: MFC r340485: Add regression tests for r340313 and r340483. Added: stable/12/tests/sys/netinet/ip_reass_test.c - copied unchanged from r340485, head/tests/sys/netinet/ip_reass_test.c Modified: stable/12/tests/sys/netinet/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/netinet/Makefile ============================================================================== --- stable/12/tests/sys/netinet/Makefile Sat Nov 24 17:08:12 2018 (r340901) +++ stable/12/tests/sys/netinet/Makefile Sat Nov 24 17:08:49 2018 (r340902) @@ -3,7 +3,8 @@ TESTSDIR= ${TESTSBASE}/sys/netinet BINDIR= ${TESTSDIR} -ATF_TESTS_C= so_reuseport_lb_test +ATF_TESTS_C= ip_reass_test \ + so_reuseport_lb_test ATF_TESTS_SH= fibs_test Copied: stable/12/tests/sys/netinet/ip_reass_test.c (from r340485, head/tests/sys/netinet/ip_reass_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/netinet/ip_reass_test.c Sat Nov 24 17:08:49 2018 (r340902, copy of r340485, head/tests/sys/netinet/ip_reass_test.c) @@ -0,0 +1,381 @@ +/*- + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston under sponsorship from + * the FreeBSD Foundation. + * + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +struct lopacket { + u_int family; + struct ip hdr; + char payload[]; +}; + +static void +update_cksum(struct ip *ip) +{ + size_t i; + uint32_t cksum; + uint16_t *cksump; + + ip->ip_sum = 0; + cksump = (uint16_t *)ip; + for (cksum = 0, i = 0; i < sizeof(*ip) / sizeof(*cksump); cksump++, i++) + cksum += ntohs(*cksump); + cksum = (cksum >> 16) + (cksum & 0xffff); + cksum = ~(cksum + (cksum >> 16)); + ip->ip_sum = htons((uint16_t)cksum); +} + +static struct lopacket * +alloc_lopacket(in_addr_t dstaddr, size_t payloadlen) +{ + struct ip *ip; + struct lopacket *packet; + size_t pktlen; + + pktlen = sizeof(*packet) + payloadlen; + packet = malloc(pktlen); + ATF_REQUIRE(packet != NULL); + + memset(packet, 0, pktlen); + packet->family = AF_INET; + + ip = &packet->hdr; + ip->ip_hl = sizeof(struct ip) >> 2; + ip->ip_v = 4; + ip->ip_tos = 0; + ip->ip_len = htons(sizeof(*ip) + payloadlen); + ip->ip_id = 0; + ip->ip_off = 0; + ip->ip_ttl = 1; + ip->ip_p = IPPROTO_IP; + ip->ip_sum = 0; + ip->ip_src.s_addr = dstaddr; + ip->ip_dst.s_addr = dstaddr; + update_cksum(ip); + + return (packet); +} + +static void +free_lopacket(struct lopacket *packet) +{ + + free(packet); +} + +static void +write_lopacket(int bpffd, struct lopacket *packet) +{ + struct timespec ts; + ssize_t n; + size_t len; + + len = sizeof(packet->family) + ntohs(packet->hdr.ip_len); + n = write(bpffd, packet, len); + ATF_REQUIRE_MSG(n >= 0, "packet write failed: %s", strerror(errno)); + ATF_REQUIRE_MSG((size_t)n == len, "wrote %zd bytes instead of %zu", + n, len); + + /* + * Loopback packets are dispatched asynchronously, give netisr some + * time. + */ + ts.tv_sec = 0; + ts.tv_nsec = 5000000; /* 5ms */ + (void)nanosleep(&ts, NULL); +} + +static int +open_lobpf(in_addr_t *addrp) +{ + struct ifreq ifr; + struct ifaddrs *ifa, *ifap; + int error, fd; + + fd = open("/dev/bpf0", O_RDWR); + if (fd < 0 && errno == ENOENT) + atf_tc_skip("no BPF device available"); + ATF_REQUIRE_MSG(fd >= 0, "open(/dev/bpf0): %s", strerror(errno)); + + error = getifaddrs(&ifap); + ATF_REQUIRE(error == 0); + for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) + if ((ifa->ifa_flags & IFF_LOOPBACK) != 0 && + ifa->ifa_addr->sa_family == AF_INET) + break; + if (ifa == NULL) + atf_tc_skip("no loopback address found"); + + memset(&ifr, 0, sizeof(ifr)); + strlcpy(ifr.ifr_name, ifa->ifa_name, IFNAMSIZ); + error = ioctl(fd, BIOCSETIF, &ifr); + ATF_REQUIRE_MSG(error == 0, "ioctl(BIOCSETIF): %s", strerror(errno)); + + *addrp = ((struct sockaddr_in *)(void *)ifa->ifa_addr)->sin_addr.s_addr; + + freeifaddrs(ifap); + + return (fd); +} + +static void +get_ipstat(struct ipstat *stat) +{ + size_t len; + int error; + + memset(stat, 0, sizeof(*stat)); + len = sizeof(*stat); + error = sysctlbyname("net.inet.ip.stats", stat, &len, NULL, 0); + ATF_REQUIRE_MSG(error == 0, "sysctl(net.inet.ip.stats) failed: %s", + strerror(errno)); + ATF_REQUIRE(len == sizeof(*stat)); +} + +#define CHECK_IP_COUNTER(oldp, newp, counter) \ + ATF_REQUIRE_MSG((oldp)->ips_ ## counter < (newp)->ips_ ## counter, \ + "ips_" #counter " wasn't incremented (%ju vs. %ju)", \ + (uintmax_t)old.ips_ ## counter, (uintmax_t)new.ips_## counter); + +/* + * Make sure a fragment with MF set doesn't come after the last fragment of a + * packet. Make sure that multiple fragments with MF clear have the same offset + * and length. + */ +ATF_TC(ip_reass__multiple_last_fragments); +ATF_TC_HEAD(ip_reass__multiple_last_fragments, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(ip_reass__multiple_last_fragments, tc) +{ + struct ipstat old, new; + struct ip *ip; + struct lopacket *packet1, *packet2, *packet3, *packet4; + in_addr_t addr; + int error, fd; + uint16_t ipid; + + fd = open_lobpf(&addr); + ipid = arc4random_uniform(UINT16_MAX + 1); + + packet1 = alloc_lopacket(addr, 16); + ip = &packet1->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x10); + update_cksum(ip); + + packet2 = alloc_lopacket(addr, 16); + ip = &packet2->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x20); + update_cksum(ip); + + packet3 = alloc_lopacket(addr, 16); + ip = &packet3->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x8); + update_cksum(ip); + + packet4 = alloc_lopacket(addr, 32); + ip = &packet4->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x10); + update_cksum(ip); + + write_lopacket(fd, packet1); + + /* packet2 comes after packet1. */ + get_ipstat(&old); + write_lopacket(fd, packet2); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + /* packet2 comes after packet1 and has MF set. */ + packet2->hdr.ip_off = htons(IP_MF | 0x20); + update_cksum(&packet2->hdr); + get_ipstat(&old); + write_lopacket(fd, packet2); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + /* packet3 comes before packet1 but overlaps. */ + get_ipstat(&old); + write_lopacket(fd, packet3); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + /* packet4 has the same offset as packet1 but is longer. */ + get_ipstat(&old); + write_lopacket(fd, packet4); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + error = close(fd); + ATF_REQUIRE(error == 0); + free_lopacket(packet1); + free_lopacket(packet2); +} + +/* + * Make sure that we reject zero-length fragments. + */ +ATF_TC(ip_reass__zero_length_fragment); +ATF_TC_HEAD(ip_reass__zero_length_fragment, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(ip_reass__zero_length_fragment, tc) +{ + struct ipstat old, new; + struct ip *ip; + struct lopacket *packet1, *packet2; + in_addr_t addr; + int error, fd; + uint16_t ipid; + + fd = open_lobpf(&addr); + ipid = arc4random_uniform(UINT16_MAX + 1); + + /* + * Create two packets, one with MF set, one without. + */ + packet1 = alloc_lopacket(addr, 0); + ip = &packet1->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(IP_MF | 0x10); + update_cksum(ip); + + packet2 = alloc_lopacket(addr, 0); + ip = &packet2->hdr; + ip->ip_id = ~ipid; + ip->ip_off = htons(0x10); + update_cksum(ip); + + get_ipstat(&old); + write_lopacket(fd, packet1); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, toosmall); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + get_ipstat(&old); + write_lopacket(fd, packet2); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, toosmall); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + error = close(fd); + ATF_REQUIRE(error == 0); + free_lopacket(packet1); + free_lopacket(packet2); +} + +ATF_TC(ip_reass__large_fragment); +ATF_TC_HEAD(ip_reass__large_fragment, tc) +{ + atf_tc_set_md_var(tc, "require.user", "root"); +} +ATF_TC_BODY(ip_reass__large_fragment, tc) +{ + struct ipstat old, new; + struct ip *ip; + struct lopacket *packet1, *packet2; + in_addr_t addr; + int error, fd; + uint16_t ipid; + + fd = open_lobpf(&addr); + ipid = arc4random_uniform(UINT16_MAX + 1); + + /* + * Create two packets, one with MF set, one without. + * + * 16 + (0x1fff << 3) > IP_MAXPACKET, so these should fail the check. + */ + packet1 = alloc_lopacket(addr, 16); + ip = &packet1->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(IP_MF | 0x1fff); + update_cksum(ip); + + packet2 = alloc_lopacket(addr, 16); + ip = &packet2->hdr; + ip->ip_id = ipid; + ip->ip_off = htons(0x1fff); + update_cksum(ip); + + get_ipstat(&old); + write_lopacket(fd, packet1); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, toolong); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + get_ipstat(&old); + write_lopacket(fd, packet2); + get_ipstat(&new); + CHECK_IP_COUNTER(&old, &new, toolong); + CHECK_IP_COUNTER(&old, &new, fragdropped); + + error = close(fd); + ATF_REQUIRE(error == 0); + free_lopacket(packet1); + free_lopacket(packet2); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, ip_reass__multiple_last_fragments); + ATF_TP_ADD_TC(tp, ip_reass__zero_length_fragment); + ATF_TP_ADD_TC(tp, ip_reass__large_fragment); + + return (atf_no_error()); +} From owner-svn-src-stable-12@freebsd.org Sat Nov 24 17:09:37 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE3E41104980; Sat, 24 Nov 2018 17:09:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 722AE834D4; Sat, 24 Nov 2018 17:09:36 +0000 (UTC) (envelope-from markj@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54CF910D45; Sat, 24 Nov 2018 17:09:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOH9ap9008640; Sat, 24 Nov 2018 17:09:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOH9avn008639; Sat, 24 Nov 2018 17:09:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201811241709.wAOH9avn008639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 24 Nov 2018 17:09:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340903 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 340903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 722AE834D4 X-Spamd-Result: default: False [1.79 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_SHORT(0.49)[0.486,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:09:37 -0000 Author: markj Date: Sat Nov 24 17:09:35 2018 New Revision: 340903 URL: https://svnweb.freebsd.org/changeset/base/340903 Log: MFC r340734: Avoid unsynchronized updates to kn_status. Modified: stable/12/sys/kern/kern_event.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_event.c ============================================================================== --- stable/12/sys/kern/kern_event.c Sat Nov 24 17:08:49 2018 (r340902) +++ stable/12/sys/kern/kern_event.c Sat Nov 24 17:09:35 2018 (r340903) @@ -1535,6 +1535,8 @@ findkn: kn->kn_kevent.flags &= ~(EV_ADD | EV_DELETE | EV_ENABLE | EV_DISABLE | EV_FORCEONESHOT); kn->kn_status = KN_DETACHED; + if ((kev->flags & EV_DISABLE) != 0) + kn->kn_status |= KN_DISABLED; kn_enter_flux(kn); error = knote_attach(kn, kq); @@ -1570,6 +1572,11 @@ findkn: KNOTE_ACTIVATE(kn, 1); } + if ((kev->flags & EV_ENABLE) != 0) + kn->kn_status &= ~KN_DISABLED; + else if ((kev->flags & EV_DISABLE) != 0) + kn->kn_status |= KN_DISABLED; + /* * The user may change some filter values after the initial EV_ADD, * but doing so will not reset any filter which has already been @@ -1587,19 +1594,17 @@ findkn: kn->kn_sdata = kev->data; } +done_ev_add: /* * We can get here with kn->kn_knlist == NULL. This can happen when * the initial attach event decides that the event is "completed" - * already. i.e. filt_procattach is called on a zombie process. It - * will call filt_proc which will remove it from the list, and NULL + * already, e.g., filt_procattach() is called on a zombie process. It + * will call filt_proc() which will remove it from the list, and NULL * kn_knlist. + * + * KN_DISABLED will be stable while the knote is in flux, so the + * unlocked read will not race with an update. */ -done_ev_add: - if ((kev->flags & EV_ENABLE) != 0) - kn->kn_status &= ~KN_DISABLED; - else if ((kev->flags & EV_DISABLE) != 0) - kn->kn_status |= KN_DISABLED; - if ((kn->kn_status & KN_DISABLED) == 0) event = kn->kn_fop->f_event(kn, 0); else From owner-svn-src-stable-12@freebsd.org Sat Nov 24 17:47:54 2018 Return-Path: Delivered-To: svn-src-stable-12@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B42C4113302F; Sat, 24 Nov 2018 17:47:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C5C28498B; Sat, 24 Nov 2018 17:47:54 +0000 (UTC) (envelope-from gjb@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D612113D1; Sat, 24 Nov 2018 17:47:54 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAOHlscP029938; Sat, 24 Nov 2018 17:47:54 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAOHlr6W029937; Sat, 24 Nov 2018 17:47:53 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201811241747.wAOHlr6W029937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 24 Nov 2018 17:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r340905 - in stable/12: release/pkg_repos usr.sbin/pkg X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/12: release/pkg_repos usr.sbin/pkg X-SVN-Commit-Revision: 340905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C5C28498B X-Spamd-Result: default: False [1.83 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.61)[0.611,0]; NEURAL_SPAM_MEDIUM(0.70)[0.697,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.52)[0.518,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2018 17:47:54 -0000 Author: gjb Date: Sat Nov 24 17:47:53 2018 New Revision: 340905 URL: https://svnweb.freebsd.org/changeset/base/340905 Log: Revert r340161 in stable/12, setting the default pkg(8) repository back to 'latest' from 'quarterly' prior to branching releng/12.0. Sponsored by: The FreeBSD Foundation Modified: stable/12/release/pkg_repos/release-dvd.conf stable/12/usr.sbin/pkg/FreeBSD.conf Modified: stable/12/release/pkg_repos/release-dvd.conf ============================================================================== --- stable/12/release/pkg_repos/release-dvd.conf Sat Nov 24 17:11:47 2018 (r340904) +++ stable/12/release/pkg_repos/release-dvd.conf Sat Nov 24 17:47:53 2018 (r340905) @@ -1,6 +1,6 @@ # $FreeBSD$ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", Modified: stable/12/usr.sbin/pkg/FreeBSD.conf ============================================================================== --- stable/12/usr.sbin/pkg/FreeBSD.conf Sat Nov 24 17:11:47 2018 (r340904) +++ stable/12/usr.sbin/pkg/FreeBSD.conf Sat Nov 24 17:47:53 2018 (r340905) @@ -8,7 +8,7 @@ # FreeBSD: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg",