From owner-svn-src-stable-12@freebsd.org Mon Jul 1 10:01:11 2019 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 E245015D0292; Mon, 1 Jul 2019 10:01:10 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F9E16F03E; Mon, 1 Jul 2019 10:01:10 +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 5B65CB4A4; Mon, 1 Jul 2019 10:01:10 +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 x61A1Ag0050114; Mon, 1 Jul 2019 10:01:10 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x61A19mf050108; Mon, 1 Jul 2019 10:01:09 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201907011001.x61A19mf050108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 1 Jul 2019 10:01: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: r349572 - in stable/12: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: in stable/12: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Commit-Revision: 349572 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7F9E16F03E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 01 Jul 2019 10:01:11 -0000 Author: ae Date: Mon Jul 1 10:01:08 2019 New Revision: 349572 URL: https://svnweb.freebsd.org/changeset/base/349572 Log: MFC r349267: Add "tcpmss" opcode to match the TCP MSS value. With this opcode it is possible to match TCP packets with specified MSS option, whose value corresponds to configured in opcode value. It is allowed to specify single value, range of values, or array of specific values or ranges. E.g. # ipfw add deny log tcp from any to any tcpmss 0-500 Modified: stable/12/sbin/ipfw/ipfw.8 stable/12/sbin/ipfw/ipfw2.c stable/12/sbin/ipfw/ipfw2.h stable/12/sys/netinet/ip_fw.h stable/12/sys/netpfil/ipfw/ip_fw2.c stable/12/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipfw.8 ============================================================================== --- stable/12/sbin/ipfw/ipfw.8 Mon Jul 1 06:22:41 2019 (r349571) +++ stable/12/sbin/ipfw/ipfw.8 Mon Jul 1 10:01:08 2019 (r349572) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 24, 2019 +.Dd June 21, 2019 .Dt IPFW 8 .Os .Sh NAME @@ -1989,6 +1989,12 @@ a non-zero offset. See the .Cm frag option for details on matching fragmented packets. +.It Cm tcpmss Ar tcpmss-list +Matches TCP packets whose MSS (maximum segment size) value is set to +.Ar tcpmss-list , +which is either a single value or a list of values or ranges +specified in the same way as +.Ar ports . .It Cm tcpseq Ar seq TCP packets only. Match if the TCP header sequence number field is set to Modified: stable/12/sbin/ipfw/ipfw2.c ============================================================================== --- stable/12/sbin/ipfw/ipfw2.c Mon Jul 1 06:22:41 2019 (r349571) +++ stable/12/sbin/ipfw/ipfw2.c Mon Jul 1 10:01:08 2019 (r349572) @@ -338,6 +338,7 @@ static struct _s_x rule_options[] = { { "tcpdatalen", TOK_TCPDATALEN }, { "tcpflags", TOK_TCPFLAGS }, { "tcpflgs", TOK_TCPFLAGS }, + { "tcpmss", TOK_TCPMSS }, { "tcpoptions", TOK_TCPOPTS }, { "tcpopts", TOK_TCPOPTS }, { "tcpseq", TOK_TCPSEQ }, @@ -881,6 +882,7 @@ static struct _s_x _port_name[] = { {"ipttl", O_IPTTL}, {"mac-type", O_MAC_TYPE}, {"tcpdatalen", O_TCPDATALEN}, + {"tcpmss", O_TCPMSS}, {"tcpwin", O_TCPWIN}, {"tagged", O_TAGGED}, {NULL, 0} @@ -1588,6 +1590,7 @@ print_instruction(struct buf_pr *bp, const struct form case O_IPTTL: case O_IPLEN: case O_TCPDATALEN: + case O_TCPMSS: case O_TCPWIN: if (F_LEN(cmd) == 1) { switch (cmd->opcode) { @@ -1603,6 +1606,9 @@ print_instruction(struct buf_pr *bp, const struct form case O_TCPDATALEN: s = "tcpdatalen"; break; + case O_TCPMSS: + s = "tcpmss"; + break; case O_TCPWIN: s = "tcpwin"; break; @@ -4709,14 +4715,18 @@ read_options: av++; break; + case TOK_TCPMSS: case TOK_TCPWIN: - NEED1("tcpwin requires length"); + NEED1("tcpmss/tcpwin requires size"); if (strpbrk(*av, "-,")) { - if (!add_ports(cmd, *av, 0, O_TCPWIN, cblen)) - errx(EX_DATAERR, "invalid tcpwin len %s", *av); + if (add_ports(cmd, *av, 0, + i == TOK_TCPWIN ? O_TCPWIN : O_TCPMSS, + cblen) == NULL) + errx(EX_DATAERR, "invalid %s size %s", + s, *av); } else - fill_cmd(cmd, O_TCPWIN, 0, - strtoul(*av, NULL, 0)); + fill_cmd(cmd, i == TOK_TCPWIN ? O_TCPWIN : + O_TCPMSS, 0, strtoul(*av, NULL, 0)); av++; break; Modified: stable/12/sbin/ipfw/ipfw2.h ============================================================================== --- stable/12/sbin/ipfw/ipfw2.h Mon Jul 1 06:22:41 2019 (r349571) +++ stable/12/sbin/ipfw/ipfw2.h Mon Jul 1 10:01:08 2019 (r349572) @@ -151,6 +151,7 @@ enum tokens { TOK_TCPOPTS, TOK_TCPSEQ, TOK_TCPACK, + TOK_TCPMSS, TOK_TCPWIN, TOK_ICMPTYPES, TOK_MAC, Modified: stable/12/sys/netinet/ip_fw.h ============================================================================== --- stable/12/sys/netinet/ip_fw.h Mon Jul 1 06:22:41 2019 (r349571) +++ stable/12/sys/netinet/ip_fw.h Mon Jul 1 10:01:08 2019 (r349572) @@ -293,6 +293,7 @@ enum ipfw_opcodes { /* arguments (4 byte each) */ O_EXTERNAL_DATA, /* variable length data */ O_SKIP_ACTION, /* none */ + O_TCPMSS, /* arg1=MSS value */ O_LAST_OPCODE /* not an opcode! */ }; Modified: stable/12/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw2.c Mon Jul 1 06:22:41 2019 (r349571) +++ stable/12/sys/netpfil/ipfw/ip_fw2.c Mon Jul 1 10:01:08 2019 (r349572) @@ -331,10 +331,10 @@ ipopts_match(struct ip *ip, ipfw_insn *cmd) } static int -tcpopts_match(struct tcphdr *tcp, ipfw_insn *cmd) +tcpopts_parse(struct tcphdr *tcp, uint16_t *mss) { - int optlen, bits = 0; u_char *cp = (u_char *)(tcp + 1); + int optlen, bits = 0; int x = (tcp->th_off << 2) - sizeof(struct tcphdr); for (; x > 0; x -= optlen, cp += optlen) { @@ -350,12 +350,13 @@ tcpopts_match(struct tcphdr *tcp, ipfw_insn *cmd) } switch (opt) { - default: break; case TCPOPT_MAXSEG: bits |= IP_FW_TCPOPT_MSS; + if (mss != NULL) + *mss = be16dec(cp + 2); break; case TCPOPT_WINDOW: @@ -370,13 +371,19 @@ tcpopts_match(struct tcphdr *tcp, ipfw_insn *cmd) case TCPOPT_TIMESTAMP: bits |= IP_FW_TCPOPT_TS; break; - } } - return (flags_match(cmd, bits)); + return (bits); } static int +tcpopts_match(struct tcphdr *tcp, ipfw_insn *cmd) +{ + + return (flags_match(cmd, tcpopts_parse(tcp, NULL))); +} + +static int iface_match(struct ifnet *ifp, ipfw_insn_if *cmd, struct ip_fw_chain *chain, uint32_t *tablearg) { @@ -2273,6 +2280,31 @@ do { \ match = (proto == IPPROTO_TCP && offset == 0 && ((ipfw_insn_u32 *)cmd)->d[0] == TCP(ulp)->th_ack); + break; + + case O_TCPMSS: + if (proto == IPPROTO_TCP && + (args->f_id._flags & TH_SYN) != 0 && + ulp != NULL) { + uint16_t mss, *p; + int i; + + PULLUP_LEN(hlen, ulp, + (TCP(ulp)->th_off << 2)); + if ((tcpopts_parse(TCP(ulp), &mss) & + IP_FW_TCPOPT_MSS) == 0) + break; + if (cmdlen == 1) { + match = (cmd->arg1 == mss); + break; + } + /* Otherwise we have ranges. */ + p = ((ipfw_insn_u16 *)cmd)->ports; + i = cmdlen - 1; + for (; !match && i > 0; i--, p += 2) + match = (mss >= p[0] && + mss <= p[1]); + } break; case O_TCPWIN: Modified: stable/12/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw_sockopt.c Mon Jul 1 06:22:41 2019 (r349571) +++ stable/12/sys/netpfil/ipfw/ip_fw_sockopt.c Mon Jul 1 10:01:08 2019 (r349572) @@ -1177,7 +1177,9 @@ move_objects(struct ip_fw_chain *ch, ipfw_range_tlv *r } } return (c); -}/* +} + +/* * Changes set of given rule rannge @rt * with each other. * @@ -1908,6 +1910,7 @@ check_ipfw_rule_body(ipfw_insn *cmd, int cmd_len, stru case O_IPTTL: case O_IPLEN: case O_TCPDATALEN: + case O_TCPMSS: case O_TCPWIN: case O_TAGGED: if (cmdlen < 1 || cmdlen > 31) From owner-svn-src-stable-12@freebsd.org Tue Jul 2 12:22:33 2019 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 CAAEB15D2133; Tue, 2 Jul 2019 12:22:32 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7422883A69; Tue, 2 Jul 2019 12:22:32 +0000 (UTC) (envelope-from philip@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 A980224349; Tue, 2 Jul 2019 12:22:28 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x62CMSxx080461; Tue, 2 Jul 2019 12:22:28 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x62CMRtv080453; Tue, 2 Jul 2019 12:22:27 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201907021222.x62CMRtv080453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Tue, 2 Jul 2019 12:22: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: r349597 - stable/12/contrib/tzdata X-SVN-Group: stable-12 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/12/contrib/tzdata X-SVN-Commit-Revision: 349597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7422883A69 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 02 Jul 2019 12:22:33 -0000 Author: philip Date: Tue Jul 2 12:22:27 2019 New Revision: 349597 URL: https://svnweb.freebsd.org/changeset/base/349597 Log: MFC r349592: Import tzdata 2019b Modified: stable/12/contrib/tzdata/Makefile stable/12/contrib/tzdata/NEWS stable/12/contrib/tzdata/africa stable/12/contrib/tzdata/antarctica stable/12/contrib/tzdata/asia stable/12/contrib/tzdata/australasia stable/12/contrib/tzdata/backzone stable/12/contrib/tzdata/checktab.awk stable/12/contrib/tzdata/europe stable/12/contrib/tzdata/factory stable/12/contrib/tzdata/northamerica stable/12/contrib/tzdata/pacificnew stable/12/contrib/tzdata/southamerica stable/12/contrib/tzdata/systemv stable/12/contrib/tzdata/theory.html stable/12/contrib/tzdata/version stable/12/contrib/tzdata/zishrink.awk stable/12/contrib/tzdata/zone.tab stable/12/contrib/tzdata/zone1970.tab stable/12/contrib/tzdata/zoneinfo2tdf.pl Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/tzdata/Makefile ============================================================================== --- stable/12/contrib/tzdata/Makefile Tue Jul 2 08:47:18 2019 (r349596) +++ stable/12/contrib/tzdata/Makefile Tue Jul 2 12:22:27 2019 (r349597) @@ -35,11 +35,13 @@ DATAFORM= main LOCALTIME= GMT -# If you want something other than Eastern United States time as a template -# for handling ruleless POSIX-style timezone environment variables, +# The POSIXRULES macro controls interpretation of nonstandard and obsolete +# POSIX-like TZ settings like TZ='EET-2EEST' that lack DST transition rules. +# In the reference implementation, if you want something other than Eastern +# United States time as a template for handling these settings, you can # change the line below (after finding the timezone you want in the # one of the $(TDATA) source files, or adding it to a source file). -# A ruleless environment setting like TZ='CST6CDT' uses the rules in the +# A setting like TZ='EET-2EEST' is supposed to use the rules in the # template file to determine "spring forward" and "fall back" days and # times; the environment variable itself specifies UT offsets of standard and # daylight saving time. @@ -49,6 +51,17 @@ LOCALTIME= GMT # Use the command # make zonenames # to get a list of the values you can use for POSIXRULES. +# +# If POSIXRULES is empty, no template is installed; this is the intended +# future default for POSIXRULES. +# +# Nonempty POSIXRULES is obsolete and should not be relied on, because: +# * It does not work correctly in popular implementations such as GNU/Linux. +# * It does not work in the tzdb implementation for timestamps after 2037. +# * It is incompatible with 'zic -b slim' if POSIXRULES specifies transitions +# at standard time or UT rather than at local time. +# In short, software should avoid ruleless settings like TZ='EET-2EEST' +# and so should not depend on the value of POSIXRULES. POSIXRULES= America/New_York @@ -231,6 +244,13 @@ LDLIBS= # other than simply getting garbage data # -DUSE_LTZ=0 to build zdump with the system time zone library # Also set TZDOBJS=zdump.o and CHECK_TIME_T_ALTERNATIVES= below. +# -DZIC_BLOAT_DEFAULT=\"slim\" to default zic's -b option to "slim", and +# similarly for "fat". Fat TZif files work around incompatibilities +# and bugs in some TZif readers, notably readers that mishandle 64-bit +# data in TZif files. Slim TZif files are more efficient and do not +# work around these incompatibilities and bugs. If not given, the +# current default is "fat" but this is intended to change as readers +# requiring fat files often mishandle timestamps after 2037 anyway. # -DZIC_MAX_ABBR_LEN_WO_WARN=3 # (or some other number) to set the maximum time zone abbreviation length # that zic will accept without a warning (the default is 6) @@ -364,7 +384,9 @@ ZIC= $(zic) $(ZFLAGS) # To shrink the size of installed TZif files, # append "-r @N" to omit data before N-seconds-after-the-Epoch. -# See the zic man page for more about -r. +# You can also append "-b slim" if that is not already the default; +# see ZIC_BLOAT_DEFAULT above. +# See the zic man page for more about -b and -r. ZFLAGS= # How to use zic to install TZif files. @@ -388,6 +410,9 @@ KSHELL= /bin/bash # Name of curl , used for HTML validation. CURL= curl +# Name of GNU Privacy Guard , used to sign distributions. +GPG= gpg + # The path where SGML DTDs are kept and the catalog file(s) to use when # validating HTML 4.01. The default should work on both Debian and Red Hat. SGML_TOPDIR= /usr @@ -562,7 +587,9 @@ install: all $(DATA) $(REDO) $(MANS) '$(DESTDIR)$(LIBDIR)' \ '$(DESTDIR)$(MANDIR)/man3' '$(DESTDIR)$(MANDIR)/man5' \ '$(DESTDIR)$(MANDIR)/man8' - $(ZIC_INSTALL) -l $(LOCALTIME) -p $(POSIXRULES) \ + $(ZIC_INSTALL) -l $(LOCALTIME) \ + `case '$(POSIXRULES)' in ?*) echo '-p';; esac \ + ` $(POSIXRULES) \ -t '$(DESTDIR)$(TZDEFAULT)' cp -f $(TABDATA) '$(DESTDIR)$(TZDIR)/.' cp tzselect '$(DESTDIR)$(BINDIR)/.' @@ -781,12 +808,6 @@ CHECK_CC_LIST = { n = split($$1,a,/,/); for (i=2; i<=n check_sorted: backward backzone iso3166.tab zone.tab zone1970.tab $(AWK) '/^Link/ {print $$3}' backward | LC_ALL=C sort -cu $(AWK) '/^Zone/ {print $$2}' backzone | LC_ALL=C sort -cu - $(AWK) '/^[^#]/ {print $$1}' iso3166.tab | LC_ALL=C sort -cu - $(AWK) '/^[^#]/ {print $$1}' zone.tab | LC_ALL=C sort -c - $(AWK) '/^[^#]/ {print substr($$0, 1, 2)}' zone1970.tab | \ - LC_ALL=C sort -c - $(AWK) '/^[^#]/ $(CHECK_CC_LIST)' zone1970.tab | \ - LC_ALL=C sort -cu touch $@ check_links: checklinks.awk $(TDATA_TO_CHECK) tzdata.zi @@ -1051,7 +1072,7 @@ tzdata$(VERSION).tar.gz.asc: tzdata$(VERSION).tar.gz tzdata$(VERSION)-rearguard.tar.gz.asc: tzdata$(VERSION)-rearguard.tar.gz tzdb-$(VERSION).tar.lz.asc: tzdb-$(VERSION).tar.lz $(ALL_ASC): - gpg2 --armor --detach-sign $? + $(GPG) --armor --detach-sign $? TYPECHECK_CFLAGS = $(CFLAGS) -DTYPECHECK -D__time_t_defined -D_TIME_T typecheck: typecheck_long_long typecheck_unsigned Modified: stable/12/contrib/tzdata/NEWS ============================================================================== --- stable/12/contrib/tzdata/NEWS Tue Jul 2 08:47:18 2019 (r349596) +++ stable/12/contrib/tzdata/NEWS Tue Jul 2 12:22:27 2019 (r349597) @@ -1,8 +1,102 @@ News for the tz database -Release 20198 - 2019-03-25 22:01:33 -0700 +Release 2019b - 2019-07-01 00:09:53 -0700 Briefly: + Brazil no longer observes DST. + 'zic -b slim' outputs smaller TZif files; please try it out. + Palestine's 2019 spring-forward transition was on 03-29, not 03-30. + + Changes to future timestamps + + Brazil has canceled DST and will stay on standard time indefinitely. + (Thanks to Steffen Thorsen, Marcus Diniz, and Daniel Soares de + Oliveira.) + + Predictions for Morocco now go through 2087 instead of 2037, to + work around a problem on newlib when using TZif files output by + zic 2019a or earlier. (Problem reported by David Gauchard.) + + Changes to past and future timestamps + + Palestine's 2019 spring transition was 03-29 at 00:00, not 03-30 + at 01:00. (Thanks to Sharef Mustafa and Even Scharning.) Guess + future transitions to be March's last Friday at 00:00. + + Changes to past timestamps + + Hong Kong's 1941-06-15 spring-forward transition was at 03:00, not + 03:30. Its 1945 transition from JST to HKT was on 11-18 at 02:00, + not 09-15 at 00:00. In 1946 its spring-forward transition was on + 04-21 at 00:00, not the previous day at 03:30. From 1946 through + 1952 its fall-back transitions occurred at 04:30, not at 03:30. + In 1947 its fall-back transition was on 11-30, not 12-30. + (Thanks to P Chan.) + + Changes to past time zone abbreviations + + Italy's 1866 transition to Rome Mean Time was on December 12, not + September 22. This affects only the time zone abbreviation for + Europe/Rome between those dates. (Thanks to Stephen Trainor and + Luigi Rosa.) + + Changes affecting metadata only + + Add info about the Crimea situation in zone1970.tab and zone.tab. + (Problem reported by Serhii Demediuk.) + + Changes to code + + zic's new -b option supports a way to control data bloat and to + test for year-2038 bugs in software that reads TZif files. + 'zic -b fat' and 'zic -b slim' generate larger and smaller output; + for example, changing from fat to slim shrinks the Europe/London + file from 3648 to 1599 bytes, saving about 56%. Fat and slim + files represent the same set of timestamps and use the same TZif + format as documented in tzfile(5) and in Internet RFC 8536. + Fat format attempts to work around bugs or incompatibilities in + older software, notably software that mishandles 64-bit TZif data + or uses obsolete TZ strings like "EET-2EEST" that lack DST rules. + Slim format is more efficient and does not work around 64-bit bugs + or obsolete TZ strings. Currently zic defaults to fat format + unless you compile with -DZIC_BLOAT_DEFAULT=\"slim\"; this + out-of-the-box default is intended to change in future releases + as the buggy software often mishandles timestamps anyway. + + zic no longer treats a set of rules ending in 2037 specially. + Previously, zic assumed that such a ruleset meant that future + timestamps could not be predicted, and therefore omitted a + POSIX-like TZ string in the TZif output. The old behavior is no + longer needed for current tzdata, and caused problems with newlib + when used with older tzdata (reported by David Gauchard). + + zic no longer generates some artifact transitions. For example, + Europe/London no longer has a no-op transition in January 1996. + + Changes to build procedure + + tzdata.zi now assumes zic 2017c or later. This shrinks tzdata.zi + by a percent or so. + + Changes to documentation and commentary + + The Makefile now documents the POSIXRULES macro as being obsolete, + and similarly, zic's -p POSIXRULES option is now documented as + being obsolete. Although the POSIXRULES feature still exists and + works as before, in practice it is rarely used for its intended + purpose, and it does not work either in the default reference + implementation (for timestamps after 2037) or in common + implementations such as GNU/Linux (for contemporary timestamps). + Since POSIXRULES was designed primarily as a temporary transition + facility for System V platforms that died off decades ago, it is + being decommissioned rather than institutionalized. + + New info on Bonin Islands and Marcus (thanks to Wakaba and Phake Nick). + + +Release 2019a - 2019-03-25 22:01:33 -0700 + + Briefly: Palestine "springs forward" on 2019-03-30 instead of 2019-03-23. Metlakatla "fell back" to rejoin Alaska Time on 2019-01-20 at 02:00. @@ -481,7 +575,7 @@ Release 2018d - 2018-03-22 07:05:46 -0700 The code is a bit more portable to MS-Windows. Installers can compile with -DRESERVE_STD_EXT_IDS on MS-Windows platforms that reserve identifiers like 'localtime'. (Thanks to Manuela - Friedrich). + Friedrich.) Changes to documentation and commentary @@ -2276,7 +2370,7 @@ Release 2014f - 2014-08-05 17:42:36 -0700 warlord Jin Shuren in the data. Commentary about the coverage of each Russian zone has been standardized. - (Thanks to Tim Parenti). + (Thanks to Tim Parenti.) There is new commentary about contemporary timekeeping in Ethiopia. @@ -2724,7 +2818,7 @@ Release 2013e - 2013-09-19 23:50:04 -0700 Change the UT offset of Bern Mean Time from 0:29:44 to 0:29:46. This affects Europe/Zurich timestamps from 1853 to 1894. (Thanks - to Alois Treindl). + to Alois Treindl.) Change the date of the circa-1850 Zurich transition from 1849-09-12 to 1853-07-16, overriding Shanks with data from Messerli about @@ -3034,7 +3128,7 @@ Release 2013a - 2013-02-27 09:20:35 -0800 (Thanks to Arthur David Olson.) Improve the commentary about which districts observe what times - in Russia. (Thanks to Oscar van Vlijmen and Arthur David Olson). + in Russia. (Thanks to Oscar van Vlijmen and Arthur David Olson.) Add web page links to tz.js. Modified: stable/12/contrib/tzdata/africa ============================================================================== --- stable/12/contrib/tzdata/africa Tue Jul 2 08:47:18 2019 (r349596) +++ stable/12/contrib/tzdata/africa Tue Jul 2 12:22:27 2019 (r349597) @@ -89,7 +89,7 @@ Rule Algeria 1980 only - Apr 25 0:00 1:00 S Rule Algeria 1980 only - Oct 31 2:00 0 - # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's # more precise 0:09:21. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time 0:00 Algeria WE%sT 1940 Feb 25 2:00 @@ -124,7 +124,7 @@ Zone Africa/Algiers 0:12:12 - LMT 1891 Mar 15 0:01 # For now, ignore that and follow the 1911-05-26 Portuguese decree # (see Europe/Lisbon). # -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Atlantic/Cape_Verde -1:34:04 - LMT 1912 Jan 01 2:00u # Praia -2:00 - -02 1942 Sep -2:00 1:00 -01 1945 Oct 15 @@ -135,7 +135,7 @@ Zone Atlantic/Cape_Verde -1:34:04 - LMT 1912 Jan 01 2 # See Africa/Lagos. # Chad -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Djamena 1:00 - WAT 1979 Oct 14 1:00 1:00 WAST 1980 Mar 8 @@ -151,7 +151,7 @@ Zone Africa/Ndjamena 1:00:12 - LMT 1912 # N'Dja # See Africa/Lagos. # Côte d'Ivoire / Ivory Coast -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Abidjan -0:16:08 - LMT 1912 0:00 - GMT Link Africa/Abidjan Africa/Bamako # Mali @@ -356,7 +356,7 @@ Rule Egypt 2014 only - Jun 26 24:00 0 - Rule Egypt 2014 only - Jul 31 24:00 1:00 S Rule Egypt 2014 only - Sep lastThu 24:00 0 - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Cairo 2:05:09 - LMT 1900 Oct 2:00 Egypt EE%sT @@ -414,7 +414,7 @@ Zone Africa/Cairo 2:05:09 - LMT 1900 Oct # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Ghana 1920 1942 - Sep 1 0:00 0:20 - Rule Ghana 1920 1942 - Dec 31 0:00 0 - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Accra -0:00:52 - LMT 1918 0:00 Ghana GMT/+0020 @@ -428,13 +428,13 @@ Zone Africa/Accra -0:00:52 - LMT 1918 # evidently confusing the date of the Portuguese decree # (see Europe/Lisbon) with the date that it took effect. # -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Bissau -1:02:20 - LMT 1912 Jan 1 1:00u -1:00 - -01 1975 0:00 - GMT # Kenya -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Nairobi 2:27:16 - LMT 1928 Jul 3:00 - EAT 1930 2:30 - +0230 1940 @@ -469,7 +469,7 @@ Link Africa/Nairobi Indian/Mayotte # Use the abbreviation "MMT" before 1972, as the more-accurate numeric # abbreviation "-004430" would be one byte over the POSIX limit. # -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Monrovia -0:43:08 - LMT 1882 -0:43:08 - MMT 1919 Mar # Monrovia Mean Time -0:44:30 - MMT 1972 Jan 7 # approximately MMT @@ -519,7 +519,7 @@ Rule Libya 1997 only - Apr 4 0:00 1:00 S Rule Libya 1997 only - Oct 4 0:00 0 - Rule Libya 2013 only - Mar lastFri 1:00 1:00 S Rule Libya 2013 only - Oct lastFri 2:00 0 - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Tripoli 0:52:44 - LMT 1920 1:00 Libya CE%sT 1959 2:00 - EET 1982 @@ -629,7 +629,7 @@ Rule Mauritius 1982 only - Oct 10 0:00 1:00 - Rule Mauritius 1983 only - Mar 21 0:00 0 - Rule Mauritius 2008 only - Oct lastSun 2:00 1:00 - Rule Mauritius 2009 only - Mar lastSun 2:00 0 - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis 4:00 Mauritius +04/+05 # Agalega Is, Rodriguez @@ -860,18 +860,24 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # the week end after.... The government does not announce yet the decision # about this temporary change. But it s 99% sure that it will be the case, # as in previous years. An unofficial survey was done these days, showing -# that 64% of asked peopke are ok for moving from +1 to +0 during Ramadan. +# that 64% of asked people are ok for moving from +1 to +0 during Ramadan. # https://leconomiste.com/article/1035870-enquete-l-economiste-sunergia-64-des-marocains-plebiscitent-le-gmt-pendant-ramadan + +# From Naoufal Semlali (2019-04-16): +# Morocco will be on GMT starting from Sunday, May 5th 2019 at 3am. +# The switch to GMT+1 will occur on Sunday, June 9th 2019 at 2am.... +# http://fr.le360.ma/societe/voici-la-date-du-retour-a-lheure-legale-au-maroc-188222 # -# From Paul Eggert (2018-11-01): -# For now, guess that Morocco will fall back at 03:00 the last Sunday -# before Ramadan, and spring forward at 02:00 the first Sunday after +# From Paul Eggert (2019-05-20): +# This agrees with our 2018-11-01 guess that the Moroccan government +# would continue the practice of falling back at 03:00 the last Sunday +# before Ramadan, and of springing forward at 02:00 the first Sunday after # Ramadan, as this has been the practice since 2012. To implement this, -# transition dates for 2019 through 2037 were determined by running the -# following program under GNU Emacs 26.1. +# transition dates for 2019 through 2087 were determined by running the +# following program under GNU Emacs 26.2. # (let ((islamic-year 1440)) # (require 'cal-islam) -# (while (< islamic-year 1460) +# (while (< islamic-year 1511) # (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) # (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) # (sunday 0)) @@ -970,8 +976,114 @@ Rule Morocco 2036 only - Oct 19 3:00 -1:00 - Rule Morocco 2036 only - Nov 23 2:00 0 - Rule Morocco 2037 only - Oct 4 3:00 -1:00 - Rule Morocco 2037 only - Nov 15 2:00 0 - +Rule Morocco 2038 only - Sep 26 3:00 -1:00 - +Rule Morocco 2038 only - Oct 31 2:00 0 - +Rule Morocco 2039 only - Sep 18 3:00 -1:00 - +Rule Morocco 2039 only - Oct 23 2:00 0 - +Rule Morocco 2040 only - Sep 2 3:00 -1:00 - +Rule Morocco 2040 only - Oct 14 2:00 0 - +Rule Morocco 2041 only - Aug 25 3:00 -1:00 - +Rule Morocco 2041 only - Sep 29 2:00 0 - +Rule Morocco 2042 only - Aug 10 3:00 -1:00 - +Rule Morocco 2042 only - Sep 21 2:00 0 - +Rule Morocco 2043 only - Aug 2 3:00 -1:00 - +Rule Morocco 2043 only - Sep 6 2:00 0 - +Rule Morocco 2044 only - Jul 24 3:00 -1:00 - +Rule Morocco 2044 only - Aug 28 2:00 0 - +Rule Morocco 2045 only - Jul 9 3:00 -1:00 - +Rule Morocco 2045 only - Aug 20 2:00 0 - +Rule Morocco 2046 only - Jul 1 3:00 -1:00 - +Rule Morocco 2046 only - Aug 5 2:00 0 - +Rule Morocco 2047 only - Jun 23 3:00 -1:00 - +Rule Morocco 2047 only - Jul 28 2:00 0 - +Rule Morocco 2048 only - Jun 7 3:00 -1:00 - +Rule Morocco 2048 only - Jul 19 2:00 0 - +Rule Morocco 2049 only - May 30 3:00 -1:00 - +Rule Morocco 2049 only - Jul 4 2:00 0 - +Rule Morocco 2050 only - May 15 3:00 -1:00 - +Rule Morocco 2050 only - Jun 26 2:00 0 - +Rule Morocco 2051 only - May 7 3:00 -1:00 - +Rule Morocco 2051 only - Jun 11 2:00 0 - +Rule Morocco 2052 only - Apr 28 3:00 -1:00 - +Rule Morocco 2052 only - Jun 2 2:00 0 - +Rule Morocco 2053 only - Apr 13 3:00 -1:00 - +Rule Morocco 2053 only - May 25 2:00 0 - +Rule Morocco 2054 only - Apr 5 3:00 -1:00 - +Rule Morocco 2054 only - May 10 2:00 0 - +Rule Morocco 2055 only - Mar 28 3:00 -1:00 - +Rule Morocco 2055 only - May 2 2:00 0 - +Rule Morocco 2056 only - Mar 12 3:00 -1:00 - +Rule Morocco 2056 only - Apr 23 2:00 0 - +Rule Morocco 2057 only - Mar 4 3:00 -1:00 - +Rule Morocco 2057 only - Apr 8 2:00 0 - +Rule Morocco 2058 only - Feb 17 3:00 -1:00 - +Rule Morocco 2058 only - Mar 31 2:00 0 - +Rule Morocco 2059 only - Feb 9 3:00 -1:00 - +Rule Morocco 2059 only - Mar 16 2:00 0 - +Rule Morocco 2060 only - Feb 1 3:00 -1:00 - +Rule Morocco 2060 only - Mar 7 2:00 0 - +Rule Morocco 2061 only - Jan 16 3:00 -1:00 - +Rule Morocco 2061 only - Feb 27 2:00 0 - +Rule Morocco 2062 only - Jan 8 3:00 -1:00 - +Rule Morocco 2062 only - Feb 12 2:00 0 - +Rule Morocco 2062 only - Dec 31 3:00 -1:00 - +Rule Morocco 2063 only - Feb 4 2:00 0 - +Rule Morocco 2063 only - Dec 16 3:00 -1:00 - +Rule Morocco 2064 only - Jan 20 2:00 0 - +Rule Morocco 2064 only - Dec 7 3:00 -1:00 - +Rule Morocco 2065 only - Jan 11 2:00 0 - +Rule Morocco 2065 only - Nov 22 3:00 -1:00 - +Rule Morocco 2066 only - Jan 3 2:00 0 - +Rule Morocco 2066 only - Nov 14 3:00 -1:00 - +Rule Morocco 2066 only - Dec 19 2:00 0 - +Rule Morocco 2067 only - Nov 6 3:00 -1:00 - +Rule Morocco 2067 only - Dec 11 2:00 0 - +Rule Morocco 2068 only - Oct 21 3:00 -1:00 - +Rule Morocco 2068 only - Dec 2 2:00 0 - +Rule Morocco 2069 only - Oct 13 3:00 -1:00 - +Rule Morocco 2069 only - Nov 17 2:00 0 - +Rule Morocco 2070 only - Oct 5 3:00 -1:00 - +Rule Morocco 2070 only - Nov 9 2:00 0 - +Rule Morocco 2071 only - Sep 20 3:00 -1:00 - +Rule Morocco 2071 only - Oct 25 2:00 0 - +Rule Morocco 2072 only - Sep 11 3:00 -1:00 - +Rule Morocco 2072 only - Oct 16 2:00 0 - +Rule Morocco 2073 only - Aug 27 3:00 -1:00 - +Rule Morocco 2073 only - Oct 8 2:00 0 - +Rule Morocco 2074 only - Aug 19 3:00 -1:00 - +Rule Morocco 2074 only - Sep 23 2:00 0 - +Rule Morocco 2075 only - Aug 11 3:00 -1:00 - +Rule Morocco 2075 only - Sep 15 2:00 0 - +Rule Morocco 2076 only - Jul 26 3:00 -1:00 - +Rule Morocco 2076 only - Sep 6 2:00 0 - +Rule Morocco 2077 only - Jul 18 3:00 -1:00 - +Rule Morocco 2077 only - Aug 22 2:00 0 - +Rule Morocco 2078 only - Jul 10 3:00 -1:00 - +Rule Morocco 2078 only - Aug 14 2:00 0 - +Rule Morocco 2079 only - Jun 25 3:00 -1:00 - +Rule Morocco 2079 only - Jul 30 2:00 0 - +Rule Morocco 2080 only - Jun 16 3:00 -1:00 - +Rule Morocco 2080 only - Jul 21 2:00 0 - +Rule Morocco 2081 only - Jun 1 3:00 -1:00 - +Rule Morocco 2081 only - Jul 13 2:00 0 - +Rule Morocco 2082 only - May 24 3:00 -1:00 - +Rule Morocco 2082 only - Jun 28 2:00 0 - +Rule Morocco 2083 only - May 16 3:00 -1:00 - +Rule Morocco 2083 only - Jun 20 2:00 0 - +Rule Morocco 2084 only - Apr 30 3:00 -1:00 - +Rule Morocco 2084 only - Jun 11 2:00 0 - +Rule Morocco 2085 only - Apr 22 3:00 -1:00 - +Rule Morocco 2085 only - May 27 2:00 0 - +Rule Morocco 2086 only - Apr 14 3:00 -1:00 - +Rule Morocco 2086 only - May 19 2:00 0 - +Rule Morocco 2087 only - Mar 30 3:00 -1:00 - +Rule Morocco 2087 only - May 4 2:00 0 - +# For dates after the somewhat-arbitrary cutoff of 2087, assume that +# Morocco will no longer observe DST. At some point this table will +# need to be extended, though quite possibly Morocco will change the +# rules first. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 0:00 Morocco +00/+01 1984 Mar 16 1:00 - +01 1986 @@ -1001,7 +1113,7 @@ Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aai # https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf # merely made it official? # -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Maputo 2:10:20 - LMT 1903 Mar 2:00 - CAT Link Africa/Maputo Africa/Blantyre # Malawi @@ -1073,7 +1185,7 @@ Rule Namibia 1995 2017 - Apr Sun>=1 2:00 -1:00 WAT #Rule Namibia 1995 2017 - Apr Sun>=1 2:00 0 WAT # End of rearguard section. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 1:30 - +0130 1903 Mar 2:00 - SAST 1942 Sep 20 2:00 @@ -1094,7 +1206,7 @@ Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 # See Africa/Lagos. # Nigeria -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Lagos 0:13:36 - LMT 1919 Sep 1:00 - WAT Link Africa/Lagos Africa/Bangui # Central African Republic @@ -1108,7 +1220,7 @@ Link Africa/Lagos Africa/Niamey # Niger Link Africa/Lagos Africa/Porto-Novo # Benin # Réunion -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Denis 4:00 - +04 # @@ -1168,7 +1280,7 @@ Zone Africa/Sao_Tome 0:26:56 - LMT 1884 # See Africa/Abidjan. # Seychelles -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria 4:00 - +04 # From Paul Eggert (2001-05-30): @@ -1188,7 +1300,7 @@ Zone Indian/Mahe 3:41:48 - LMT 1906 Jun # Victoria # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule SA 1942 1943 - Sep Sun>=15 2:00 1:00 - Rule SA 1943 1944 - Mar Sun>=15 2:00 0 - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Johannesburg 1:52:00 - LMT 1892 Feb 8 1:30 - SAST 1903 Mar 2:00 SA SAST @@ -1223,14 +1335,14 @@ Rule Sudan 1970 only - May 1 0:00 1:00 S Rule Sudan 1970 1985 - Oct 15 0:00 0 - Rule Sudan 1971 only - Apr 30 0:00 1:00 S Rule Sudan 1972 1985 - Apr lastSun 0:00 1:00 S -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Khartoum 2:10:08 - LMT 1931 2:00 Sudan CA%sT 2000 Jan 15 12:00 3:00 - EAT 2017 Nov 1 2:00 - CAT # South Sudan -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Juba 2:06:28 - LMT 1931 2:00 Sudan CA%sT 2000 Jan 15 12:00 3:00 - EAT @@ -1336,7 +1448,7 @@ Rule Tunisia 2006 2008 - Oct lastSun 2:00s 0 - # Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's # more precise 0:09:21. # Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Africa/Tunis 0:40:44 - LMT 1881 May 12 0:09:21 - PMT 1911 Mar 11 # Paris Mean Time 1:00 Tunisia CE%sT Modified: stable/12/contrib/tzdata/antarctica ============================================================================== --- stable/12/contrib/tzdata/antarctica Tue Jul 2 08:47:18 2019 (r349596) +++ stable/12/contrib/tzdata/antarctica Tue Jul 2 12:22:27 2019 (r349597) @@ -13,7 +13,7 @@ # for information. # Unless otherwise specified, we have no time zone information. -# FORMAT is '-00' and GMTOFF is 0 for locations while uninhabited. +# FORMAT is '-00' and STDOFF is 0 for locations while uninhabited. # Argentina - year-round bases # Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05 @@ -70,7 +70,7 @@ # Australian Antarctica Division informed us that Casey changed time # zone to UTC+11 in "the morning of 22nd October 2016". -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Antarctica/Casey 0 - -00 1969 8:00 - +08 2009 Oct 18 2:00 11:00 - +11 2010 Mar 5 2:00 @@ -142,7 +142,7 @@ Zone Antarctica/Mawson 0 - -00 1954 Feb 13 # St Paul Island - near Amsterdam, uninhabited # fishing stations operated variously 1819/1931 # -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Indian/Kerguelen 0 - -00 1950 # Port-aux-Français 5:00 - +05 # @@ -153,7 +153,7 @@ Zone Indian/Kerguelen 0 - -00 1950 # Port-aux-Françai # Another base at Port-Martin, 50km east, began operation in 1947. # It was destroyed by fire on 1952-01-14. # -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Antarctica/DumontDUrville 0 - -00 1947 10:00 - +10 1952 Jan 14 0 - -00 1956 Nov @@ -181,7 +181,7 @@ Zone Antarctica/DumontDUrville 0 - -00 1947 # Syowa station, which is the first antarctic station of Japan, # was established on 1957-01-29. Since Syowa station is still the main # station of Japan, it's appropriate for the principal location. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Antarctica/Syowa 0 - -00 1957 Jan 29 3:00 - +03 # See: @@ -231,7 +231,7 @@ Rule Troll 2005 max - Mar lastSun 1:00u 2:00 +02 #Rule Troll 2004 max - Nov 7 1:00u 0:00 +00 # Remove the following line when uncommenting the above '#Rule' lines. Rule Troll 2004 max - Oct lastSun 1:00u 0:00 +00 -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Antarctica/Troll 0 - -00 2005 Feb 12 0:00 Troll %s @@ -305,7 +305,7 @@ Zone Antarctica/Vostok 0 - -00 1957 Dec 16 # From Paul Eggert (2002-10-22) # says Rothera is -03 all year. # -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Antarctica/Rothera 0 - -00 1976 Dec 1 -3:00 - -03 Modified: stable/12/contrib/tzdata/asia ============================================================================== --- stable/12/contrib/tzdata/asia Tue Jul 2 08:47:18 2019 (r349596) +++ stable/12/contrib/tzdata/asia Tue Jul 2 12:22:27 2019 (r349597) @@ -84,7 +84,7 @@ Rule RussiaAsia 1985 2010 - Mar lastSun 2:00s 1:00 - Rule RussiaAsia 1996 2010 - Oct lastSun 2:00s 0 - # Afghanistan -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Kabul 4:36:48 - LMT 1890 4:00 - +04 1945 4:30 - +0430 @@ -117,7 +117,7 @@ Zone Asia/Kabul 4:36:48 - LMT 1890 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Armenia 2011 only - Mar lastSun 2:00s 1:00 - Rule Armenia 2011 only - Oct lastSun 2:00s 0 - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 3:00 - +03 1957 Mar 4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s @@ -143,7 +143,7 @@ Zone Asia/Yerevan 2:58:00 - LMT 1924 May 2 # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Azer 1997 2015 - Mar lastSun 4:00 1:00 - Rule Azer 1997 2015 - Oct lastSun 5:00 0 - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Baku 3:19:24 - LMT 1924 May 2 3:00 - +03 1957 Mar 4:00 RussiaAsia +04/+05 1991 Mar 31 2:00s @@ -231,7 +231,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2 Rule Dhaka 2009 only - Jun 19 23:00 1:00 - Rule Dhaka 2009 only - Dec 31 24:00 0 - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Dhaka 6:01:40 - LMT 1890 5:53:20 - HMT 1941 Oct # Howrah Mean Time? 6:30 - +0630 1942 May 15 @@ -241,7 +241,7 @@ Zone Asia/Dhaka 6:01:40 - LMT 1890 6:00 Dhaka +06/+07 # Bhutan -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Thimphu 5:58:36 - LMT 1947 Aug 15 # or Thimbu 5:30 - +0530 1987 Oct 6:00 - +06 @@ -252,13 +252,13 @@ Zone Asia/Thimphu 5:58:36 - LMT 1947 Aug 15 # or Thimb # We have no information as to when standard time was introduced; # assume it occurred in 1907, the same year as Mauritius (which # then contained the Chagos Archipelago). -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Indian/Chagos 4:49:40 - LMT 1907 5:00 - +05 1996 6:00 - +06 # Brunei -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri Begawan 7:30 - +0730 1933 8:00 - +08 @@ -273,7 +273,7 @@ Zone Asia/Brunei 7:39:40 - LMT 1926 Mar # Bandar Seri # of Greenwich." This refers to the period before Burma's transition to +0630, # a transition for which Shanks is the only source. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoon 6:24:47 - RMT 1920 # Rangoon local time 6:30 - +0630 1942 May @@ -561,7 +561,7 @@ Rule PRC 1987 1991 - Apr Sun>=11 2:00 1:00 D # that the sort of users who prefer Asia/Urumqi now typically ignored the # +08 mandate back then. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] # Beijing time, used throughout China; represented by Shanghai. Zone Asia/Shanghai 8:05:43 - LMT 1901 8:00 Shang C%sT 1949 May 28 @@ -652,11 +652,41 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # https://i.imgur.com/05KkvtC.png # * 1941-09-30, Hong Kong Daily Press, Winter Time Warning. # https://i.imgur.com/dge4kFJ.png -# Also, the Liberation day of Hong Kong after WWII which British rule -# over the territory resumed was August 30, 1945, which I think should -# be the termination date for the use of JST in the territory.... -# From Paul Eggert (2018-11-17): +# From P Chan (2018-12-31): +# * According to the Hong Kong Daylight-Saving Regulations, 1941, the +# 1941 spring-forward transition was at 03:00. +# http://sunzi.lib.hku.hk/hkgro/view/g1941/304271.pdf +# http://sunzi.lib.hku.hk/hkgro/view/g1941/305516.pdf +# * According to some articles from South China Morning Post, +08 was +# resumed on 1945-11-18 at 02:00. +# https://i.imgur.com/M2IsZ3c.png +# https://i.imgur.com/iOPqrVo.png +# https://i.imgur.com/fffcGDs.png +# * Some newspapers ... said the 1946 spring-forward transition was on +# 04-21 at 00:00. The Kung Sheung Evening News 1946-04-20 (Chinese) +# https://i.imgur.com/ZSzent0.png +# https://mmis.hkpl.gov.hk///c/portal/cover?c=QF757YsWv5%2FH7zGe%2FKF%2BFLYsuqGhRBfe p.4 +# The Kung Sheung Daily News 1946-04-21 (Chinese) +# https://i.imgur.com/7ecmRlcm.png +# https://mmis.hkpl.gov.hk///c/portal/cover?c=QF757YsWv5%2BQBGt1%2BwUj5qG2GqtwR3Wh p.4 +# * According to the Summer Time Ordinance (1946), the fallback +# transitions between 1946 and 1952 were at 03:30 Standard Time (+08) +# http://oelawhk.lib.hku.hk/archive/files/bb74b06a74d5294620a15de560ab33c6.pdf +# * Some other laws and regulations related to DST from 1953 to 1979 +# Summer Time Ordinance 1953 +# https://i.imgur.com/IOlJMav.jpg +# Summer Time (Amendment) Ordinance 1965 +# https://i.imgur.com/8rofeLa.jpg +# Interpretation and General Clauses Ordinance (1966) +# https://i.imgur.com/joy3msj.jpg +# Emergency (Summer Time) Regulation 1973 +# Interpretation and General Clauses (Amendment) Ordinance 1977 +# https://i.imgur.com/RaNqnc4.jpg +# Resolution of the Legislative Council passed on 9 May 1979 +# https://www.legco.gov.hk/yr78-79/english/lc_sitg/hansard/h790509.pdf#page=39 + +# From Paul Eggert (2019-05-31): # Here are the dates given at # https://www.hko.gov.hk/gts/time/Summertime.htm # as of 2014-06-19: @@ -667,7 +697,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1944 Whole year # 1945 Whole year # 1946 20 Apr to 1 Dec -# 1947 13 Apr to 30 Dec +# 1947 13 Apr to 30 Nov # 1948 2 May to 31 Oct # 1949 3 Apr to 30 Oct # 1950 2 Apr to 29 Oct @@ -704,36 +734,28 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # The page does not give times of day for transitions, # or dates for the 1942 and 1945 transitions. # The Japanese occupation of Hong Kong began 1941-12-25. -# The Japanese surrender of Hong Kong was signed 1945-09-16; see: -# Heaver S. The days after the Pacific war ended: unsettling times -# in Hong Kong. Post Magazine. 2016-06-13. -# https://www.scmp.com/magazines/post-magazine/article/1852990/days-after-pacific-war-ended-unsettling-times-hong-kong -# For lack of anything better, use start of those days as the -# transition times. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule HK 1946 only - Apr 20 3:30 1:00 S -Rule HK 1946 only - Dec 1 3:30 0 - -Rule HK 1947 only - Apr 13 3:30 1:00 S -Rule HK 1947 only - Dec 30 3:30 0 - -Rule HK 1948 only - May 2 3:30 1:00 S -Rule HK 1948 1951 - Oct lastSun 3:30 0 - -Rule HK 1952 1953 - Nov Sun>=1 3:30 0 - +Rule HK 1946 only - Apr 21 0:00 1:00 S +Rule HK 1946 only - Dec 1 3:30s 0 - +Rule HK 1947 only - Apr 13 3:30s 1:00 S +Rule HK 1947 only - Nov 30 3:30s 0 - +Rule HK 1948 only - May 2 3:30s 1:00 S +Rule HK 1948 1952 - Oct Sun>=28 3:30s 0 - Rule HK 1949 1953 - Apr Sun>=1 3:30 1:00 S +Rule HK 1953 1964 - Oct Sun>=31 3:30 0 - Rule HK 1954 1964 - Mar Sun>=18 3:30 1:00 S -Rule HK 1954 only - Oct 31 3:30 0 - -Rule HK 1955 1964 - Nov Sun>=1 3:30 0 - Rule HK 1965 1976 - Apr Sun>=16 3:30 1:00 S Rule HK 1965 1976 - Oct Sun>=16 3:30 0 - Rule HK 1973 only - Dec 30 3:30 1:00 S -Rule HK 1979 only - May Sun>=8 3:30 1:00 S -Rule HK 1979 only - Oct Sun>=16 3:30 0 - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +Rule HK 1979 only - May 13 3:30 1:00 S +Rule HK 1979 only - Oct 21 3:30 0 - +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42 - 8:00 - HKT 1941 Jun 15 3:30 + 8:00 - HKT 1941 Jun 15 3:00 8:00 1:00 HKST 1941 Oct 1 4:00 8:30 - HKT 1941 Dec 25 - 9:00 - JST 1945 Sep 16 + 9:00 - JST 1945 Nov 18 2:00 8:00 HK HK%sT ############################################################################### @@ -857,7 +879,7 @@ Rule Taiwan 1974 1975 - Oct 1 0:00 0 S Rule Taiwan 1979 only - Jul 1 0:00 1:00 D Rule Taiwan 1979 only - Oct 1 0:00 0 S -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] # Taipei or Taibei or T'ai-pei Zone Asia/Taipei 8:06:00 - LMT 1896 Jan 1 8:00 - CST 1937 Oct 1 @@ -995,7 +1017,7 @@ Rule Macau 1975 1976 - Apr Sun>=16 03:30 1:00 D Rule Macau 1979 only - May 13 03:30 1:00 D Rule Macau 1979 only - Oct Sun>=16 03:30 0 S -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Macau 7:34:10 - LMT 1904 Oct 30 8:00 - CST 1941 Dec 21 23:00 9:00 Macau +09/+10 1945 Sep 30 24:00 @@ -1034,7 +1056,7 @@ Rule Cyprus 1977 only - Sep 25 0:00 0 - Rule Cyprus 1978 only - Oct 2 0:00 0 - Rule Cyprus 1979 1997 - Sep lastSun 0:00 0 - Rule Cyprus 1981 1998 - Mar lastSun 0:00 1:00 S -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Nicosia 2:13:28 - LMT 1921 Nov 14 2:00 Cyprus EE%sT 1998 Sep 2:00 EUAsia EE%sT @@ -1083,7 +1105,7 @@ Link Asia/Nicosia Europe/Nicosia # Byalokoz 1919 says Georgia was 2:59:11. # Go with Byalokoz. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Tbilisi 2:59:11 - LMT 1880 2:59:11 - TBMT 1924 May 2 # Tbilisi Mean Time 3:00 - +03 1957 Mar @@ -1120,7 +1142,7 @@ Zone Asia/Tbilisi 2:59:11 - LMT 1880 # which will be permanent, with no seasonal adjustment, will happen at # midnight on Saturday, September 16. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 8:00 - +08 1942 Feb 21 23:00 9:00 - +09 1976 May 3 @@ -1186,7 +1208,7 @@ Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 # time for 1870-1941. Shanks is our only (and dubious) source for the # 1941-1945 data. -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Kolkata 5:53:28 - LMT 1854 Jun 28 # Kolkata 5:53:20 - HMT 1870 # Howrah Mean Time? 5:21:10 - MMT 1906 Jan 1 # Madras local time @@ -1238,7 +1260,7 @@ Zone Asia/Kolkata 5:53:28 - LMT 1854 Jun 28 # Kolkata # WITA - +08 - Waktu Indonesia Tengah (Indonesia central time) # WIT - +09 - Waktu Indonesia Timur (Indonesia eastern time) # -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] # Java, Sumatra Zone Asia/Jakarta 7:07:12 - LMT 1867 Aug 10 # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13, @@ -1314,9 +1336,9 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # I used the following code in GNU Emacs 26.1 to generate the "Rule Iran" # lines from 2008 through 2087. Emacs 26.1 uses Ed Reingold's # cal-persia implementation of Birashk's approximation, which in the -# 2008-2087 range disagrees with the the astronomical Persian calendar -# for Persian years 1404 (Gregorian 2025) and 1437 (Gregorian 2058), -# so the following code special-case those years. See Table 15.1, page 264, of: +# 2008-2087 range disagrees with the astronomical Persian calendar +# for Persian years 1404 (Gregorian 2025) and 1437 (Gregorian 2058), so +# the following code special-cases those years. See Table 15.1, page 264, of: # Edward M. Reingold and Nachum Dershowitz, Calendrical Calculations: # The Ultimate Edition, Cambridge University Press (2018). # https://www.cambridge.org/fr/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition @@ -1510,7 +1532,7 @@ Rule Iran 2087 only - Sep 21 24:00 0 - Rule Iran 2088 max - Mar 20 24:00 1:00 - Rule Iran 2088 max - Sep 20 24:00 0 - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 3:25:44 - TMT 1946 # Tehran Mean Time 3:30 - +0330 1977 Nov @@ -1555,7 +1577,7 @@ Rule Iraq 1986 1990 - Mar lastSun 1:00s 1:00 - # Rule Iraq 1991 2007 - Apr 1 3:00s 1:00 - Rule Iraq 1991 2007 - Oct 1 3:00s 0 - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Baghdad 2:57:40 - LMT 1890 2:57:36 - BMT 1918 # Baghdad Mean Time? 3:00 - +03 1982 May @@ -1622,7 +1644,7 @@ Rule Zion 1975 only - Apr 20 0:00 1:00 D Rule Zion 1975 only - Aug 31 0:00 0 S # From Alois Treindl (2019-03-06): -# http://www.moin.gov.il/Documents/שעון קיץ/clock-50-years-7-2014.pdf +# http://www.moin.gov.il/Documents/שעון%20קיץ/clock-50-years-7-2014.pdf # From Isaac Starkman (2019-03-06): # Summer time was in that period in 1980 and 1984, see # https://www.ynet.co.il/articles/0,7340,L-3951073,00.html @@ -1760,32 +1782,15 @@ Rule Zion 2004 only - Sep 22 1:00 0 S # # ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2005+beyond.ps -# From Paul Eggert (2012-10-26): -# I used Ephraim Silverberg's dst-israel.el program -# (2005-02-20) -# along with Ed Reingold's cal-hebrew in GNU Emacs 21.4, -# to generate the transitions from 2005 through 2012. -# (I replaced "lastFri" with "Fri>=26" by hand.) -# The spring transitions all correspond to the following Rule: -# -# Rule Zion 2005 2012 - Mar Fri>=26 2:00 1:00 D -# -# but older zic implementations (e.g., Solaris 8) do not support -# "Fri>=26" to mean April 1 in years like 2005, so for now we list the -# springtime transitions explicitly. - # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Zion 2005 only - Apr 1 2:00 1:00 D +Rule Zion 2005 2012 - Apr Fri<=1 2:00 1:00 D Rule Zion 2005 only - Oct 9 2:00 0 S -Rule Zion 2006 2010 - Mar Fri>=26 2:00 1:00 D Rule Zion 2006 only - Oct 1 2:00 0 S Rule Zion 2007 only - Sep 16 2:00 0 S Rule Zion 2008 only - Oct 5 2:00 0 S Rule Zion 2009 only - Sep 27 2:00 0 S Rule Zion 2010 only - Sep 12 2:00 0 S -Rule Zion 2011 only - Apr 1 2:00 1:00 D Rule Zion 2011 only - Oct 2 2:00 0 S -Rule Zion 2012 only - Mar Fri>=26 2:00 1:00 D Rule Zion 2012 only - Sep 23 2:00 0 S # From Ephraim Silverberg (2013-06-27): @@ -1801,7 +1806,7 @@ Rule Zion 2012 only - Sep 23 2:00 0 S Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D Rule Zion 2013 max - Oct lastSun 2:00 0 S -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Jerusalem 2:20:54 - LMT 1880 2:20:40 - JMT 1918 # Jerusalem Mean Time? 2:00 Zion I%sT @@ -1893,7 +1898,7 @@ Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D # Central Time (UT+9). The adoption began on Oct 1, 1937. # https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件 -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u 9:00 Japan J%sT # Since 1938, all Japanese possessions have been like Asia/Tokyo, @@ -1996,7 +2001,7 @@ Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - Rule Jordan 2013 only - Dec 20 0:00 0 - Rule Jordan 2014 max - Mar lastThu 24:00 1:00 S Rule Jordan 2014 max - Oct lastFri 0:00s 0 - -# Zone NAME GMTOFF RULES FORMAT [UNTIL] +# Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 2:00 Jordan EE%sT @@ -2037,8 +2042,8 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # text. # # According to Izvestia newspaper No. 68 (23334) from 1991-03-20 -# (page 6; available at http://libinfo.org/newsr/newsr2574.djvu via -# http://libinfo.org/index.php?id=58564) on 1991-03-31 at 2:00 during +# -- page 6; available at http://libinfo.org/newsr/newsr2574.djvu via +# http://libinfo.org/index.php?id=58564 -- on 1991-03-31 at 2:00 during # transition to "summer" time: # Republic of Georgia, Latvian SSR, Lithuanian SSR, SSR Moldova, # Estonian SSR; Komi ASSR; Kaliningrad oblast; Nenets autonomous okrug @@ -2054,7 +2059,7 @@ Zone Asia/Amman 2:23:44 - LMT 1931 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-12@freebsd.org Tue Jul 2 16:54:47 2019 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 7302615D8405; Tue, 2 Jul 2019 16:54:47 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16BF78D945; Tue, 2 Jul 2019 16:54:47 +0000 (UTC) (envelope-from wblock@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 D4D212712E; Tue, 2 Jul 2019 16:54:46 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x62Gsk3G023722; Tue, 2 Jul 2019 16:54:46 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x62GskQq023721; Tue, 2 Jul 2019 16:54:46 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201907021654.x62GskQq023721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Tue, 2 Jul 2019 16:54: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: r349603 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: wblock X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 349603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16BF78D945 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 02 Jul 2019 16:54:47 -0000 Author: wblock (doc committer) Date: Tue Jul 2 16:54:46 2019 New Revision: 349603 URL: https://svnweb.freebsd.org/changeset/base/349603 Log: MFC r349600. Correct name of vmm(4) pptdevs variable. Modified: stable/12/usr.sbin/bhyve/bhyve.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/12/usr.sbin/bhyve/bhyve.8 Tue Jul 2 16:44:04 2019 (r349602) +++ stable/12/usr.sbin/bhyve/bhyve.8 Tue Jul 2 16:54:46 2019 (r349603) @@ -345,7 +345,7 @@ Guest memory must be wired using the option when a pass-through device is configured. .Pp The host device must have been reserved at boot-time using the -.Va pptdev +.Va pptdevs loader variable as described in .Xr vmm 4 . .Pp From owner-svn-src-stable-12@freebsd.org Tue Jul 2 17:23:39 2019 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 E85AB15D8DFA; Tue, 2 Jul 2019 17:23:38 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89D658EB54; Tue, 2 Jul 2019 17:23:38 +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 60D5227668; Tue, 2 Jul 2019 17:23:38 +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 x62HNcGI039756; Tue, 2 Jul 2019 17:23:38 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x62HNcUo039755; Tue, 2 Jul 2019 17:23:38 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201907021723.x62HNcUo039755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Tue, 2 Jul 2019 17:23: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: r349605 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 349605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 89D658EB54 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 02 Jul 2019 17:23:39 -0000 Author: zeising (doc,ports committer) Date: Tue Jul 2 17:23:37 2019 New Revision: 349605 URL: https://svnweb.freebsd.org/changeset/base/349605 Log: MFC 349133 349146 349150: document PCIOCATTACHED r349133: pci(4): Document PCIOCATTACHED Document the PCIOCATTACHED ioctl(2) in the pci(4) manual. PCIOCATTACHED is used to query if a driver has attached to a PCI. Reviewed by: bcr, imp Differential Revision: https://reviews.freebsd.org/D20652 r349146: pci.4: wordsmith and add missing words Add missing words after PCI in the description of the PCIOCWRITE and PCIOCATTACHED ioctls. Use singular in PCIOCREAD, we only read one register at the time. Reviewed by: bcr, bjk, rgrimes, cem Differential Revision: https://reviews.freebsd.org/D20671 r349150: pci.4: Use plural configuration registers It is customary to use plural when talking about PCI configure registers. Reported by: scottl Modified: stable/12/share/man/man4/pci.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/pci.4 ============================================================================== --- stable/12/share/man/man4/pci.4 Tue Jul 2 16:56:27 2019 (r349604) +++ stable/12/share/man/man4/pci.4 Tue Jul 2 17:23:37 2019 (r349605) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2018 +.Dd June 17, 2019 .Dt PCI 4 .Os .Sh NAME @@ -290,7 +290,7 @@ This .Xr ioctl 2 reads the .Tn PCI -configuration registers specified by the passed-in +configuration register specified by the passed-in .Va pci_io structure. The @@ -307,7 +307,7 @@ from the ioctl. .It pi_reg The .Tn PCI -configuration register the user would like to access. +configuration registers the user would like to access. .It pi_width The width, in bytes, of the data the user would like to read. This value @@ -323,7 +323,7 @@ This .Xr ioctl 2 allows users to write to the .Tn PCI -specified in the passed-in +configuration registers specified in the passed-in .Va pci_io structure. The @@ -333,6 +333,26 @@ The limitations on data width described for reading registers, above, also apply to writing .Tn PCI configuration registers. +.It PCIOCATTACHED +This +.Xr ioctl 2 +allows users to query if a driver is attached to the +.Tn PCI +device specified in the passed-in +.Va pci_io +structure. +The +.Va pci_io +structure is described above, however, the +.Va pi_reg +and +.Va pi_width +fields are not used. +The status of the device is stored in the +.Va pi_data +field. +A value of 0 indicates no driver is attached, while a value larger than 0 +indicates that a driver is attached. .It PCIOCBARMMAP This .Xr ioctl 2 From owner-svn-src-stable-12@freebsd.org Wed Jul 3 00:01:39 2019 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 AC46F15E0E59; Wed, 3 Jul 2019 00:01:39 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51827759BA; Wed, 3 Jul 2019 00:01:39 +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 2B3E13D40; Wed, 3 Jul 2019 00:01:39 +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 x6301d9l050154; Wed, 3 Jul 2019 00:01:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6301d4J050153; Wed, 3 Jul 2019 00:01:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907030001.x6301d4J050153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 3 Jul 2019 00:01: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: r349622 - stable/12/lib/libc/iconv X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/lib/libc/iconv X-SVN-Commit-Revision: 349622 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 51827759BA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 00:01:39 -0000 Author: emaste Date: Wed Jul 3 00:01:38 2019 New Revision: 349622 URL: https://svnweb.freebsd.org/changeset/base/349622 Log: MFC r349619: libc: correct iconv buffer overflow admbugs: 920 Submitted by: Andrea Venturoli, gabor Reported by: Andrea Venturoli , NetFence Approved by: so Security: CVE-2019-5600 Security: FreeBSD-SA-19:09.iconv Modified: stable/12/lib/libc/iconv/citrus_none.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/iconv/citrus_none.c ============================================================================== --- stable/12/lib/libc/iconv/citrus_none.c Wed Jul 3 00:00:39 2019 (r349621) +++ stable/12/lib/libc/iconv/citrus_none.c Wed Jul 3 00:01:38 2019 (r349622) @@ -144,7 +144,7 @@ _citrus_NONE_stdenc_cstomb(struct _citrus_stdenc * __r s[2] = (char)(idx >> 16); *nresult = 3; } else { - if (n < 3) { + if (n < 4) { *nresult = (size_t)-1; return (E2BIG); } From owner-svn-src-stable-12@freebsd.org Wed Jul 3 00:11:33 2019 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 DB9BC15E1574; Wed, 3 Jul 2019 00:11:32 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C6B276605; Wed, 3 Jul 2019 00:11:32 +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 57DEB3DDF; Wed, 3 Jul 2019 00:11:32 +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 x630BWiX056861; Wed, 3 Jul 2019 00:11:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x630BVqB056859; Wed, 3 Jul 2019 00:11:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907030011.x630BVqB056859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 00:11: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: r349628 - in stable/12/sys: cam/scsi compat/linux sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: cam/scsi compat/linux sys X-SVN-Commit-Revision: 349628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7C6B276605 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 00:11:33 -0000 Author: markj Date: Wed Jul 3 00:11:31 2019 New Revision: 349628 URL: https://svnweb.freebsd.org/changeset/base/349628 Log: MFC r349627: Remove the CDIOCREADSUBCHANNEL_SYSSPACE ioctl. admbugs: 768 Reported by: Alex Fortune Approved by: so Security: CVE-2019-5602 Security: FreeBSD-SA-19:11.cd_ioctl Modified: stable/12/sys/cam/scsi/scsi_cd.c stable/12/sys/compat/linux/linux_ioctl.c stable/12/sys/sys/cdio.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_cd.c Wed Jul 3 00:10:01 2019 (r349627) +++ stable/12/sys/cam/scsi/scsi_cd.c Wed Jul 3 00:11:31 2019 (r349628) @@ -1314,7 +1314,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f struct cam_periph *periph; struct cd_softc *softc; - int nocopyout, error = 0; + int error = 0; periph = (struct cam_periph *)dp->d_drv1; cam_periph_lock(periph); @@ -1356,7 +1356,6 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f */ cam_periph_unlock(periph); - nocopyout = 0; switch (cmd) { case CDIOCPLAYTRACKS: @@ -1532,9 +1531,6 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f cam_periph_unlock(periph); } break; - case CDIOCREADSUBCHANNEL_SYSSPACE: - nocopyout = 1; - /* Fallthrough */ case CDIOCREADSUBCHANNEL: { struct ioc_read_subchannel *args @@ -1579,13 +1575,7 @@ cdioctl(struct disk *dp, u_long cmd, void *addr, int f data->header.data_len[1] + sizeof(struct cd_sub_channel_header))); cam_periph_unlock(periph); - if (nocopyout == 0) { - if (copyout(data, args->data, len) != 0) { - error = EFAULT; - } - } else { - bcopy(data, args->data, len); - } + error = copyout(data, args->data, len); free(data, M_SCSICD); } break; Modified: stable/12/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/12/sys/compat/linux/linux_ioctl.c Wed Jul 3 00:10:01 2019 (r349627) +++ stable/12/sys/compat/linux/linux_ioctl.c Wed Jul 3 00:11:31 2019 (r349628) @@ -1546,16 +1546,26 @@ linux_ioctl_cdrom(struct thread *td, struct linux_ioct struct ioc_read_subchannel bsdsc; struct cd_sub_channel_info bsdinfo; + error = copyin((void *)args->arg, &sc, sizeof(sc)); + if (error) + break; + + /* + * Invoke the native ioctl and bounce the returned data through + * the userspace buffer. This works because the Linux structure + * is the same size as our structures for the subchannel header + * and position data. + */ bsdsc.address_format = CD_LBA_FORMAT; bsdsc.data_format = CD_CURRENT_POSITION; bsdsc.track = 0; - bsdsc.data_len = sizeof(bsdinfo); - bsdsc.data = &bsdinfo; - error = fo_ioctl(fp, CDIOCREADSUBCHANNEL_SYSSPACE, - (caddr_t)&bsdsc, td->td_ucred, td); + bsdsc.data_len = sizeof(sc); + bsdsc.data = (void *)args->arg; + error = fo_ioctl(fp, CDIOCREADSUBCHANNEL, (caddr_t)&bsdsc, + td->td_ucred, td); if (error) break; - error = copyin((void *)args->arg, &sc, sizeof(sc)); + error = copyin((void *)args->arg, &bsdinfo, sizeof(bsdinfo)); if (error) break; sc.cdsc_audiostatus = bsdinfo.header.audio_status; Modified: stable/12/sys/sys/cdio.h ============================================================================== --- stable/12/sys/sys/cdio.h Wed Jul 3 00:10:01 2019 (r349627) +++ stable/12/sys/sys/cdio.h Wed Jul 3 00:11:31 2019 (r349628) @@ -274,11 +274,4 @@ struct ioc_capability { /*<2>*/ #define CDIOCCAPABILITY _IOR('c',30,struct ioc_capability) /*<2>*/ -/* - * Special version of CDIOCREADSUBCHANNEL which assumes that - * ioc_read_subchannel->data points to the kernel memory. For - * use in compatibility layers. - */ -#define CDIOCREADSUBCHANNEL_SYSSPACE _IOWR('c', 31, struct ioc_read_subchannel) - #endif /* !_SYS_CDIO_H_ */ From owner-svn-src-stable-12@freebsd.org Wed Jul 3 00:32:43 2019 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 764AA15E21B2; Wed, 3 Jul 2019 00:32: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1474D77419; Wed, 3 Jul 2019 00:32:43 +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 B12B342DB; Wed, 3 Jul 2019 00:32: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 x630WgW5067378; Wed, 3 Jul 2019 00:32:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x630Wg0I067377; Wed, 3 Jul 2019 00:32:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907030032.x630Wg0I067377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 00: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: r349630 - stable/12/sbin/dhclient X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/dhclient X-SVN-Commit-Revision: 349630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1474D77419 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 00:32:43 -0000 Author: markj Date: Wed Jul 3 00:32:42 2019 New Revision: 349630 URL: https://svnweb.freebsd.org/changeset/base/349630 Log: MFC r349438: Avoid a divide-by-zero when bad checksum counters overflow. Modified: stable/12/sbin/dhclient/packet.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/dhclient/packet.c ============================================================================== --- stable/12/sbin/dhclient/packet.c Wed Jul 3 00:12:50 2019 (r349629) +++ stable/12/sbin/dhclient/packet.c Wed Jul 3 00:32:42 2019 (r349630) @@ -183,7 +183,7 @@ decode_udp_ip_header(unsigned char *buf, int bufix, st ip_packets_seen++; if (wrapsum(checksum(buf + bufix, ip_len, 0)) != 0) { ip_packets_bad_checksum++; - if (ip_packets_seen > 4 && + if (ip_packets_seen > 4 && ip_packets_bad_checksum != 0 && (ip_packets_seen / ip_packets_bad_checksum) < 2) { note("%d bad IP checksums seen in %d packets", ip_packets_bad_checksum, ip_packets_seen); @@ -235,7 +235,7 @@ decode_udp_ip_header(unsigned char *buf, int bufix, st udp_packets_seen++; if (usum && usum != sum) { udp_packets_bad_checksum++; - if (udp_packets_seen > 4 && + if (udp_packets_seen > 4 && udp_packets_bad_checksum != 0 && (udp_packets_seen / udp_packets_bad_checksum) < 2) { note("%d bad udp checksums in %d packets", udp_packets_bad_checksum, udp_packets_seen); From owner-svn-src-stable-12@freebsd.org Wed Jul 3 00:36:02 2019 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 050A915E231B; Wed, 3 Jul 2019 00:36:02 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D2977778E; Wed, 3 Jul 2019 00:36:01 +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 7794342DD; Wed, 3 Jul 2019 00:36:01 +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 x630a1D7067629; Wed, 3 Jul 2019 00:36:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x630a1EK067628; Wed, 3 Jul 2019 00:36:01 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907030036.x630a1EK067628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 00:36: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: r349632 - stable/12/sbin/dhclient X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/dhclient X-SVN-Commit-Revision: 349632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9D2977778E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 00:36:02 -0000 Author: markj Date: Wed Jul 3 00:36:00 2019 New Revision: 349632 URL: https://svnweb.freebsd.org/changeset/base/349632 Log: MFC r349439: Free DHCP options with length zero. Modified: stable/12/sbin/dhclient/options.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/dhclient/options.c ============================================================================== --- stable/12/sbin/dhclient/options.c Wed Jul 3 00:35:14 2019 (r349631) +++ stable/12/sbin/dhclient/options.c Wed Jul 3 00:36:00 2019 (r349632) @@ -896,6 +896,5 @@ do_packet(struct interface_info *interface, struct dhc /* Free the data associated with the options. */ for (i = 0; i < 256; i++) - if (tp.options[i].len && tp.options[i].data) - free(tp.options[i].data); + free(tp.options[i].data); } From owner-svn-src-stable-12@freebsd.org Wed Jul 3 09:43:28 2019 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 EF01C15CDEA1; Wed, 3 Jul 2019 09:43:27 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 82A9D6BB17; Wed, 3 Jul 2019 09:43:27 +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 5DC4D9FBA; Wed, 3 Jul 2019 09:43:27 +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 x639hRYZ055378; Wed, 3 Jul 2019 09:43:27 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x639hRlu055377; Wed, 3 Jul 2019 09:43:27 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201907030943.x639hRlu055377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 3 Jul 2019 09:43: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: r349642 - stable/12/sbin/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sbin/ipfw X-SVN-Commit-Revision: 349642 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 82A9D6BB17 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 09:43:28 -0000 Author: ae Date: Wed Jul 3 09:43:26 2019 New Revision: 349642 URL: https://svnweb.freebsd.org/changeset/base/349642 Log: MFC r349364: Restore ipfw(8)'s compact output support broken after r331668. Also modify it a bit. Now -c option omits only 'from any to any' part and works for different protocols (not just for ip). Reported by: Dmitry Selivanov Modified: stable/12/sbin/ipfw/ipfw2.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipfw2.c ============================================================================== --- stable/12/sbin/ipfw/ipfw2.c Wed Jul 3 09:14:39 2019 (r349641) +++ stable/12/sbin/ipfw/ipfw2.c Wed Jul 3 09:43:26 2019 (r349642) @@ -2223,6 +2223,8 @@ show_static_rule(struct cmdline_opts *co, struct forma } print_proto(bp, fo, &state); + if (co->do_compact != 0 && (rule->flags & IPFW_RULE_NOOPT)) + goto justopts; /* Print source */ bprintf(bp, " from"); @@ -4395,6 +4397,8 @@ chkarg: } OR_BLOCK(get_proto); + first_cmd = cmd; /* update pointer to use in compact form */ + /* * "from", mandatory */ @@ -4466,6 +4470,8 @@ chkarg: cmd = next_cmd(cmd, &cblen); } } + if (first_cmd == cmd) + rule->flags |= IPFW_RULE_NOOPT; read_options: prev = NULL; From owner-svn-src-stable-12@freebsd.org Wed Jul 3 09:45:03 2019 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 2BC6915CE043; Wed, 3 Jul 2019 09:45:03 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C29FE6BE1B; Wed, 3 Jul 2019 09:45:02 +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 9ED469FC2; Wed, 3 Jul 2019 09:45:02 +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 x639j2Rh055660; Wed, 3 Jul 2019 09:45:02 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x639j2Lq055659; Wed, 3 Jul 2019 09:45:02 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201907030945.x639j2Lq055659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 3 Jul 2019 09:45: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: r349643 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 349643 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C29FE6BE1B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 09:45:03 -0000 Author: ae Date: Wed Jul 3 09:45:02 2019 New Revision: 349643 URL: https://svnweb.freebsd.org/changeset/base/349643 Log: MFC r349365: Mark default rule with IPFW_RULE_NOOPT flag, so it can be showed in compact form. Modified: stable/12/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw2.c Wed Jul 3 09:43:26 2019 (r349642) +++ stable/12/sys/netpfil/ipfw/ip_fw2.c Wed Jul 3 09:45:02 2019 (r349643) @@ -3327,6 +3327,7 @@ vnet_ipfw_init(const void *unused) /* fill and insert the default rule */ rule = ipfw_alloc_rule(chain, sizeof(struct ip_fw)); + rule->flags |= IPFW_RULE_NOOPT; rule->cmd_len = 1; rule->cmd[0].len = 1; rule->cmd[0].opcode = default_to_accept ? O_ACCEPT : O_DENY; From owner-svn-src-stable-12@freebsd.org Wed Jul 3 09:46:31 2019 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 17A8915CE0F3; Wed, 3 Jul 2019 09:46:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1E926BF7C; Wed, 3 Jul 2019 09:46:30 +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 896739FC4; Wed, 3 Jul 2019 09:46:30 +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 x639kUfk055770; Wed, 3 Jul 2019 09:46:30 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x639kUVP055769; Wed, 3 Jul 2019 09:46:30 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201907030946.x639kUVP055769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 3 Jul 2019 09:46: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: r349644 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 349644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B1E926BF7C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 09:46:31 -0000 Author: ae Date: Wed Jul 3 09:46:30 2019 New Revision: 349644 URL: https://svnweb.freebsd.org/changeset/base/349644 Log: MFC r349366: Follow the RFC 3128 and drop short TCP fragments with offset = 1. Modified: stable/12/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw2.c Wed Jul 3 09:45:02 2019 (r349643) +++ stable/12/sys/netpfil/ipfw/ip_fw2.c Wed Jul 3 09:46:30 2019 (r349644) @@ -1688,6 +1688,11 @@ do { \ default: break; } + } else { + if (offset == 1 && proto == IPPROTO_TCP) { + /* RFC 3128 */ + goto pullup_failed; + } } ip = mtod(m, struct ip *); From owner-svn-src-stable-12@freebsd.org Wed Jul 3 16:23:07 2019 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 7B7E715D8EAC; Wed, 3 Jul 2019 16:23:07 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 205A3829B4; Wed, 3 Jul 2019 16:23:07 +0000 (UTC) (envelope-from cy@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 EED87E4BC; Wed, 3 Jul 2019 16:23:06 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63GN66g065073; Wed, 3 Jul 2019 16:23:06 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63GN6hU065072; Wed, 3 Jul 2019 16:23:06 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907031623.x63GN6hU065072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 3 Jul 2019 16:23: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: r349650 - in stable: 11/lib/libsqlite3 12/lib/libsqlite3 X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/lib/libsqlite3 12/lib/libsqlite3 X-SVN-Commit-Revision: 349650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 205A3829B4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 16:23:07 -0000 Author: cy Date: Wed Jul 3 16:23:06 2019 New Revision: 349650 URL: https://svnweb.freebsd.org/changeset/base/349650 Log: MFC r342972: Disable FTS3, FTS4, and RTREE in bundled and private sqlite3. Suggested by: delphij@ Reviewed by: delphij@ (for secteam@) Differential Revision: https://reviews.freebsd.org/D18786 Modified: stable/12/lib/libsqlite3/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libsqlite3/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libsqlite3/Makefile ============================================================================== --- stable/12/lib/libsqlite3/Makefile Wed Jul 3 16:06:11 2019 (r349649) +++ stable/12/lib/libsqlite3/Makefile Wed Jul 3 16:23:06 2019 (r349650) @@ -33,9 +33,6 @@ CFLAGS+= -I${SQLITE} \ -DHAVE_STRERROR_R=1 \ -DHAVE_POSIX_FALLOCATE=1 \ -D_REENTRANT=1 \ - -DSQLITE_THREADSAFE=1 \ - -DSQLITE_ENABLE_FTS3 \ - -DSQLITE_ENABLE_FTS4 \ - -DSQLITE_ENABLE_RTREE + -DSQLITE_THREADSAFE=1 .include From owner-svn-src-stable-12@freebsd.org Wed Jul 3 16:43:42 2019 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 57AD915D9962; Wed, 3 Jul 2019 16:43:42 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A753A83A32; Wed, 3 Jul 2019 16:43:41 +0000 (UTC) (envelope-from cy@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 82B2DE82D; Wed, 3 Jul 2019 16:43:41 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63GhfsG075543; Wed, 3 Jul 2019 16:43:41 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63GhfMe075541; Wed, 3 Jul 2019 16:43:41 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907031643.x63GhfMe075541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 3 Jul 2019 16:43: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: r349651 - in stable/12/libexec/rc: . rc.d X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/12/libexec/rc: . rc.d X-SVN-Commit-Revision: 349651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A753A83A32 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 16:43:42 -0000 Author: cy Date: Wed Jul 3 16:43:40 2019 New Revision: 349651 URL: https://svnweb.freebsd.org/changeset/base/349651 Log: MFC r349153: Allow the hostapd program to be specified. This allows users to use hostapd from ports instead of the one in base. The default is the hostapd in base. PR: 238571 Modified: stable/12/libexec/rc/rc.conf stable/12/libexec/rc/rc.d/hostapd Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/rc.conf ============================================================================== --- stable/12/libexec/rc/rc.conf Wed Jul 3 16:23:06 2019 (r349650) +++ stable/12/libexec/rc/rc.conf Wed Jul 3 16:43:40 2019 (r349651) @@ -275,6 +275,7 @@ ppp_user="root" # Which user to run ppp as # profile3 uses default ppp_mode and ppp_nat ### Network daemon (miscellaneous) ### +hostapd_program="/usr/sbin/hostapd" hostapd_enable="NO" # Run hostap daemon. syslogd_enable="YES" # Run syslog daemon (or NO). syslogd_program="/usr/sbin/syslogd" # path to syslogd, if you want a different one. Modified: stable/12/libexec/rc/rc.d/hostapd ============================================================================== --- stable/12/libexec/rc/rc.d/hostapd Wed Jul 3 16:23:06 2019 (r349650) +++ stable/12/libexec/rc/rc.d/hostapd Wed Jul 3 16:43:40 2019 (r349651) @@ -11,7 +11,7 @@ name="hostapd" desc="Authenticator for IEEE 802.11 networks" -command="/usr/sbin/${name}" +command=${hostapd_program} ifn="$2" if [ -z "$ifn" ]; then From owner-svn-src-stable-12@freebsd.org Wed Jul 3 16:48:48 2019 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 120B215D9BDA; Wed, 3 Jul 2019 16:48:48 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5C6483D42; Wed, 3 Jul 2019 16:48:47 +0000 (UTC) (envelope-from cy@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 48904E838; Wed, 3 Jul 2019 16:48:47 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63GmlN3075996; Wed, 3 Jul 2019 16:48:47 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63GmlS5075995; Wed, 3 Jul 2019 16:48:47 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907031648.x63GmlS5075995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 3 Jul 2019 16:48: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: r349652 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A5C6483D42 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 16:48:48 -0000 Author: cy Date: Wed Jul 3 16:48:46 2019 New Revision: 349652 URL: https://svnweb.freebsd.org/changeset/base/349652 Log: MFC r349331: Clean out duplicate definitions of TCP macros also found in netinet/tcp.h. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Wed Jul 3 16:43:40 2019 (r349651) +++ stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Wed Jul 3 16:48:46 2019 (r349652) @@ -829,37 +829,6 @@ typedef struct tcpiphdr tcpiphdr_t; #undef IPOPT_AH #define IPOPT_AH 256+IPPROTO_AH -#ifndef TCPOPT_EOL -# define TCPOPT_EOL 0 -#endif -#ifndef TCPOPT_NOP -# define TCPOPT_NOP 1 -#endif -#ifndef TCPOPT_MAXSEG -# define TCPOPT_MAXSEG 2 -#endif -#ifndef TCPOLEN_MAXSEG -# define TCPOLEN_MAXSEG 4 -#endif -#ifndef TCPOPT_WINDOW -# define TCPOPT_WINDOW 3 -#endif -#ifndef TCPOLEN_WINDOW -# define TCPOLEN_WINDOW 3 -#endif -#ifndef TCPOPT_SACK_PERMITTED -# define TCPOPT_SACK_PERMITTED 4 -#endif -#ifndef TCPOLEN_SACK_PERMITTED -# define TCPOLEN_SACK_PERMITTED 2 -#endif -#ifndef TCPOPT_SACK -# define TCPOPT_SACK 5 -#endif -#ifndef TCPOPT_TIMESTAMP -# define TCPOPT_TIMESTAMP 8 -#endif - #ifndef ICMP_MINLEN # define ICMP_MINLEN 8 #endif From owner-svn-src-stable-12@freebsd.org Wed Jul 3 16:54:01 2019 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 10FEE15DA07A; Wed, 3 Jul 2019 16:54:01 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A554B84619; Wed, 3 Jul 2019 16:54:00 +0000 (UTC) (envelope-from cy@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 412ADE9DE; Wed, 3 Jul 2019 16:54:00 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63Gs0Ui081275; Wed, 3 Jul 2019 16:54:00 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63Gs0SE081274; Wed, 3 Jul 2019 16:54:00 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907031654.x63Gs0SE081274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 3 Jul 2019 16:54: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: r349653 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A554B84619 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 16:54:01 -0000 Author: cy Date: Wed Jul 3 16:53:59 2019 New Revision: 349653 URL: https://svnweb.freebsd.org/changeset/base/349653 Log: MFC r349362: The definition of icmptypes in ip_compt.h is dead code as it already use the icmptypes in ip_icmp.h. Modified: stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/ip_compat.h Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/ip_compat.h ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Wed Jul 3 16:48:46 2019 (r349652) +++ stable/12/sys/contrib/ipfilter/netinet/ip_compat.h Wed Jul 3 16:53:59 2019 (r349653) @@ -829,159 +829,9 @@ typedef struct tcpiphdr tcpiphdr_t; #undef IPOPT_AH #define IPOPT_AH 256+IPPROTO_AH -#ifndef ICMP_MINLEN -# define ICMP_MINLEN 8 -#endif -#ifndef ICMP_ECHOREPLY -# define ICMP_ECHOREPLY 0 -#endif -#ifndef ICMP_UNREACH -# define ICMP_UNREACH 3 -#endif -#ifndef ICMP_UNREACH_NET -# define ICMP_UNREACH_NET 0 -#endif -#ifndef ICMP_UNREACH_HOST -# define ICMP_UNREACH_HOST 1 -#endif -#ifndef ICMP_UNREACH_PROTOCOL -# define ICMP_UNREACH_PROTOCOL 2 -#endif -#ifndef ICMP_UNREACH_PORT -# define ICMP_UNREACH_PORT 3 -#endif -#ifndef ICMP_UNREACH_NEEDFRAG -# define ICMP_UNREACH_NEEDFRAG 4 -#endif -#ifndef ICMP_UNREACH_SRCFAIL -# define ICMP_UNREACH_SRCFAIL 5 -#endif -#ifndef ICMP_UNREACH_NET_UNKNOWN -# define ICMP_UNREACH_NET_UNKNOWN 6 -#endif -#ifndef ICMP_UNREACH_HOST_UNKNOWN -# define ICMP_UNREACH_HOST_UNKNOWN 7 -#endif -#ifndef ICMP_UNREACH_ISOLATED -# define ICMP_UNREACH_ISOLATED 8 -#endif -#ifndef ICMP_UNREACH_NET_PROHIB -# define ICMP_UNREACH_NET_PROHIB 9 -#endif -#ifndef ICMP_UNREACH_HOST_PROHIB -# define ICMP_UNREACH_HOST_PROHIB 10 -#endif -#ifndef ICMP_UNREACH_TOSNET -# define ICMP_UNREACH_TOSNET 11 -#endif -#ifndef ICMP_UNREACH_TOSHOST -# define ICMP_UNREACH_TOSHOST 12 -#endif -#ifndef ICMP_UNREACH_ADMIN_PROHIBIT -# define ICMP_UNREACH_ADMIN_PROHIBIT 13 -#endif -#ifndef ICMP_UNREACH_FILTER -# define ICMP_UNREACH_FILTER 13 -#endif -#ifndef ICMP_UNREACH_HOST_PRECEDENCE -# define ICMP_UNREACH_HOST_PRECEDENCE 14 -#endif -#ifndef ICMP_UNREACH_PRECEDENCE_CUTOFF -# define ICMP_UNREACH_PRECEDENCE_CUTOFF 15 -#endif -#ifndef ICMP_SOURCEQUENCH -# define ICMP_SOURCEQUENCH 4 -#endif -#ifndef ICMP_REDIRECT_NET -# define ICMP_REDIRECT_NET 0 -#endif -#ifndef ICMP_REDIRECT_HOST -# define ICMP_REDIRECT_HOST 1 -#endif -#ifndef ICMP_REDIRECT_TOSNET -# define ICMP_REDIRECT_TOSNET 2 -#endif -#ifndef ICMP_REDIRECT_TOSHOST -# define ICMP_REDIRECT_TOSHOST 3 -#endif -#ifndef ICMP_ALTHOSTADDR -# define ICMP_ALTHOSTADDR 6 -#endif -#ifndef ICMP_TIMXCEED -# define ICMP_TIMXCEED 11 -#endif -#ifndef ICMP_TIMXCEED_INTRANS -# define ICMP_TIMXCEED_INTRANS 0 -#endif -#ifndef ICMP_TIMXCEED_REASS -# define ICMP_TIMXCEED_REASS 1 -#endif -#ifndef ICMP_PARAMPROB -# define ICMP_PARAMPROB 12 -#endif -#ifndef ICMP_PARAMPROB_ERRATPTR -# define ICMP_PARAMPROB_ERRATPTR 0 -#endif -#ifndef ICMP_PARAMPROB_OPTABSENT -# define ICMP_PARAMPROB_OPTABSENT 1 -#endif -#ifndef ICMP_PARAMPROB_LENGTH -# define ICMP_PARAMPROB_LENGTH 2 -#endif -#ifndef ICMP_TSTAMP -# define ICMP_TSTAMP 13 -#endif -#ifndef ICMP_TSTAMPREPLY -# define ICMP_TSTAMPREPLY 14 -#endif -#ifndef ICMP_IREQ -# define ICMP_IREQ 15 -#endif -#ifndef ICMP_IREQREPLY -# define ICMP_IREQREPLY 16 -#endif -#ifndef ICMP_MASKREQ -# define ICMP_MASKREQ 17 -#endif -#ifndef ICMP_MASKREPLY -# define ICMP_MASKREPLY 18 -#endif -#ifndef ICMP_TRACEROUTE -# define ICMP_TRACEROUTE 30 -#endif -#ifndef ICMP_DATACONVERR -# define ICMP_DATACONVERR 31 -#endif -#ifndef ICMP_MOBILE_REDIRECT -# define ICMP_MOBILE_REDIRECT 32 -#endif -#ifndef ICMP_IPV6_WHEREAREYOU -# define ICMP_IPV6_WHEREAREYOU 33 -#endif -#ifndef ICMP_IPV6_IAMHERE -# define ICMP_IPV6_IAMHERE 34 -#endif -#ifndef ICMP_MOBILE_REGREQUEST -# define ICMP_MOBILE_REGREQUEST 35 -#endif -#ifndef ICMP_MOBILE_REGREPLY -# define ICMP_MOBILE_REGREPLY 36 -#endif -#ifndef ICMP_SKIP -# define ICMP_SKIP 39 -#endif -#ifndef ICMP_PHOTURIS -# define ICMP_PHOTURIS 40 -#endif -#ifndef ICMP_PHOTURIS_UNKNOWN_INDEX -# define ICMP_PHOTURIS_UNKNOWN_INDEX 1 -#endif -#ifndef ICMP_PHOTURIS_AUTH_FAILED -# define ICMP_PHOTURIS_AUTH_FAILED 2 -#endif -#ifndef ICMP_PHOTURIS_DECRYPT_FAILED -# define ICMP_PHOTURIS_DECRYPT_FAILED 3 -#endif +# define ICMP_UNREACH_ADMIN_PROHIBIT ICMP_UNREACH_FILTER_PROHIB +# define ICMP_UNREACH_FILTER ICMP_UNREACH_FILTER_PROHIB + #ifndef IPVERSION # define IPVERSION 4 #endif From owner-svn-src-stable-12@freebsd.org Wed Jul 3 17:04:45 2019 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 7CA3715DA652; Wed, 3 Jul 2019 17:04:45 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F20284DA2; Wed, 3 Jul 2019 17:04:45 +0000 (UTC) (envelope-from cy@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 D834AEBCC; Wed, 3 Jul 2019 17:04:44 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63H4ike086741; Wed, 3 Jul 2019 17:04:44 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63H4iAX086740; Wed, 3 Jul 2019 17:04:44 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907031704.x63H4iAX086740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 3 Jul 2019 17:04: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: r349654 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F20284DA2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 17:04:45 -0000 Author: cy Date: Wed Jul 3 17:04:44 2019 New Revision: 349654 URL: https://svnweb.freebsd.org/changeset/base/349654 Log: MFC r349399-349400,349567-349568: Prompted by r349366, ipfilter is also does not conform to RFC 3128 by dropping TCP fragments with offset = 1. In addition to dropping these fragments, add a DTrace probe to allow for more detailed monitoring and diagnosis if required. Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/fil.c Wed Jul 3 16:53:59 2019 (r349653) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Wed Jul 3 17:04:44 2019 (r349654) @@ -1728,6 +1728,10 @@ ipf_pr_ipv4hdr(fin) fi->fi_flx |= FI_FRAG; off &= IP_OFFMASK; + if (off == 1 && p == IPPROTO_TCP) { + fin->fin_flx |= FI_SHORT; /* RFC 3128 */ + DT1(ipf_fi_tcp_frag_off_1, fr_info_t *, fin); + } if (off != 0) { fin->fin_flx |= FI_FRAGBODY; off <<= 3; From owner-svn-src-stable-12@freebsd.org Wed Jul 3 17:09:43 2019 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 C6D5F15DA7D6; Wed, 3 Jul 2019 17:09:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6CDC1850F8; Wed, 3 Jul 2019 17:09:43 +0000 (UTC) (envelope-from cy@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 44368EBD0; Wed, 3 Jul 2019 17:09:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63H9hTT087045; Wed, 3 Jul 2019 17:09:43 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63H9grI087041; Wed, 3 Jul 2019 17:09:42 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907031709.x63H9grI087041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 3 Jul 2019 17:09: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: r349655 - in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sys/contrib/ipfilter/netinet 12/sys/contrib/ipfilter/netinet X-SVN-Commit-Revision: 349655 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6CDC1850F8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 17:09:43 -0000 Author: cy Date: Wed Jul 3 17:09:41 2019 New Revision: 349655 URL: https://svnweb.freebsd.org/changeset/base/349655 Log: MFC r349401: While working on PR/238796 I discovered an unused variable in frdest, the next hop structure. It is likely this contributes to PR/238796 though other factors remain to be investigated. PR: 238796 Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/contrib/ipfilter/netinet/fil.c stable/11/sys/contrib/ipfilter/netinet/ip_fil.h Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/fil.c Wed Jul 3 17:04:44 2019 (r349654) +++ stable/12/sys/contrib/ipfilter/netinet/fil.c Wed Jul 3 17:09:41 2019 (r349655) @@ -7480,10 +7480,6 @@ ipf_resolvedest(softc, base, fdp, v) } fdp->fd_ptr = ifp; - if ((ifp != NULL) && (ifp != (void *)-1)) { - fdp->fd_local = ipf_deliverlocal(softc, v, ifp, &fdp->fd_ip6); - } - return errval; } Modified: stable/12/sys/contrib/ipfilter/netinet/ip_fil.h ============================================================================== --- stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Wed Jul 3 17:04:44 2019 (r349654) +++ stable/12/sys/contrib/ipfilter/netinet/ip_fil.h Wed Jul 3 17:09:41 2019 (r349655) @@ -560,7 +560,6 @@ typedef struct frdest { addrfamily_t fd_addr; fr_dtypes_t fd_type; int fd_name; - int fd_local; } frdest_t; #define fd_ip6 fd_addr.adf_addr From owner-svn-src-stable-12@freebsd.org Wed Jul 3 17:34:27 2019 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 9478A15DB30C; Wed, 3 Jul 2019 17:34:27 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33C4F862D0; Wed, 3 Jul 2019 17:34: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 0011FF10F; Wed, 3 Jul 2019 17:34:26 +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 x63HYQl8002870; Wed, 3 Jul 2019 17:34:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63HYQL2002869; Wed, 3 Jul 2019 17:34:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907031734.x63HYQL2002869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 3 Jul 2019 17:34: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: r349657 - stable/12/sys/dev/nand X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/dev/nand X-SVN-Commit-Revision: 349657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 33C4F862D0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 17:34:27 -0000 Author: emaste Date: Wed Jul 3 17:34:26 2019 New Revision: 349657 URL: https://svnweb.freebsd.org/changeset/base/349657 Log: MFC r349268: nandsim: correct test to avoid out-of-bounds access Previously nandsim_chip_status returned EINVAL iff both of user-provided chip->ctrl_num and chip->num were out of bounds. If only one failed the bounds check arbitrary memory would be read and returned. The NAND framework is not built by default, nandsim is not intended for production use (it is a simulator), and the nandsim device has root-only permissions. admbugs: 827 Reported by: Daniel Hodson of elttam Security: kernel information leak or DoS Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/dev/nand/nandsim.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nand/nandsim.c ============================================================================== --- stable/12/sys/dev/nand/nandsim.c Wed Jul 3 17:24:24 2019 (r349656) +++ stable/12/sys/dev/nand/nandsim.c Wed Jul 3 17:34:26 2019 (r349657) @@ -295,7 +295,7 @@ nandsim_chip_status(struct sim_chip *chip) nand_debug(NDBG_SIM,"status for chip num:%d at ctrl:%d", chip->num, chip->ctrl_num); - if (chip->ctrl_num >= MAX_SIM_DEV && + if (chip->ctrl_num >= MAX_SIM_DEV || chip->num >= MAX_CTRL_CS) return (EINVAL); From owner-svn-src-stable-12@freebsd.org Wed Jul 3 18:11:23 2019 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 8563D15DBD0B; Wed, 3 Jul 2019 18:11:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D3F187512; Wed, 3 Jul 2019 18:11:23 +0000 (UTC) (envelope-from cy@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 0917DF756; Wed, 3 Jul 2019 18:11:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63IBM4r021531; Wed, 3 Jul 2019 18:11:22 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63IBMII021530; Wed, 3 Jul 2019 18:11:22 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907031811.x63IBMII021530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 3 Jul 2019 18:11:22 +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: r349659 - in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 349659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2D3F187512 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 18:11:23 -0000 Author: cy Date: Wed Jul 3 18:11:22 2019 New Revision: 349659 URL: https://svnweb.freebsd.org/changeset/base/349659 Log: MFC r349448: Fix a typo. PR/238816 initially addressed updates to usage() however it has now become a shopping list of fixes to ipmon man pages and usage(). PR: 238816 Modified: stable/12/contrib/ipfilter/man/ipmon.8 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ipfilter/man/ipmon.8 stable/11/contrib/ipfilter/man/ipmon.8 Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/contrib/ipfilter/man/ipmon.8 ============================================================================== --- stable/12/contrib/ipfilter/man/ipmon.8 Wed Jul 3 17:35:23 2019 (r349658) +++ stable/12/contrib/ipfilter/man/ipmon.8 Wed Jul 3 18:11:22 2019 (r349659) @@ -27,7 +27,7 @@ ipmon \- monitors /dev/ipl for logged packets .LP \fBipmon\fP opens \fB/dev/ipl\fP for reading and awaits data to be saved from the packet filter. The binary data read from the device is reprinted in -human readable for, however, IP#'s are not mapped back to hostnames, nor are +human readable form, however, IP#'s are not mapped back to hostnames, nor are ports mapped back to service names. The output goes to standard output by default or a filename, if given on the command line. Should the \fB\-s\fP option be used, output is instead sent to \fBsyslogd(8)\fP. Messages sent From owner-svn-src-stable-12@freebsd.org Wed Jul 3 18:14:01 2019 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 C856E15DC15E; Wed, 3 Jul 2019 18:14:01 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C34187C47; Wed, 3 Jul 2019 18:14:01 +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 4577BF7C3; Wed, 3 Jul 2019 18:14:01 +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 x63IE1ru023961; Wed, 3 Jul 2019 18:14:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63IE1Ys023960; Wed, 3 Jul 2019 18:14:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201907031814.x63IE1Ys023960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Jul 2019 18:14: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: r349660 - stable/12/sys/fs/cuse X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/fs/cuse X-SVN-Commit-Revision: 349660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C34187C47 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 18:14:02 -0000 Author: hselasky Date: Wed Jul 3 18:14:00 2019 New Revision: 349660 URL: https://svnweb.freebsd.org/changeset/base/349660 Log: MFC r349367: Fix for deadlock situation in cuse(3) The final server unref should be done by the server thread to prevent deadlock in the client cdevpriv destructor, which cannot destroy itself. Sponsored by: Mellanox Technologies Modified: stable/12/sys/fs/cuse/cuse.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/cuse/cuse.c ============================================================================== --- stable/12/sys/fs/cuse/cuse.c Wed Jul 3 18:11:22 2019 (r349659) +++ stable/12/sys/fs/cuse/cuse.c Wed Jul 3 18:14:00 2019 (r349660) @@ -699,12 +699,38 @@ cuse_server_unref(struct cuse_server *pcs) free(pcs, M_CUSE); } +static int +cuse_server_do_close(struct cuse_server *pcs) +{ + int retval; + + cuse_lock(); + cuse_server_is_closing(pcs); + /* final client wakeup, if any */ + cuse_server_wakeup_all_client_locked(pcs); + + knlist_clear(&pcs->selinfo.si_note, 1); + + retval = pcs->refs; + cuse_unlock(); + + return (retval); +} + static void cuse_server_free(void *arg) { struct cuse_server *pcs = arg; - /* drop refcount */ + /* + * The final server unref should be done by the server thread + * to prevent deadlock in the client cdevpriv destructor, + * which cannot destroy itself. + */ + while (cuse_server_do_close(pcs) != 1) + pause("W", hz); + + /* drop final refcount */ cuse_server_unref(pcs); } @@ -746,21 +772,10 @@ static int cuse_server_close(struct cdev *dev, int fflag, int devtype, struct thread *td) { struct cuse_server *pcs; - int error; - error = cuse_server_get(&pcs); - if (error != 0) - goto done; + if (cuse_server_get(&pcs) == 0) + cuse_server_do_close(pcs); - cuse_lock(); - cuse_server_is_closing(pcs); - /* final client wakeup, if any */ - cuse_server_wakeup_all_client_locked(pcs); - - knlist_clear(&pcs->selinfo.si_note, 1); - cuse_unlock(); - -done: return (0); } From owner-svn-src-stable-12@freebsd.org Wed Jul 3 18:16:11 2019 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 305BF15DC28E; Wed, 3 Jul 2019 18:16:11 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C92BD87F5E; Wed, 3 Jul 2019 18:16:10 +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 A3B5DF7C6; Wed, 3 Jul 2019 18:16:10 +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 x63IGASO024170; Wed, 3 Jul 2019 18:16:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63IGAUh024169; Wed, 3 Jul 2019 18:16:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201907031816.x63IGAUh024169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Jul 2019 18:16: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: r349662 - stable/12/sys/fs/cuse X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/fs/cuse X-SVN-Commit-Revision: 349662 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C92BD87F5E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 18:16:11 -0000 Author: hselasky Date: Wed Jul 3 18:16:10 2019 New Revision: 349662 URL: https://svnweb.freebsd.org/changeset/base/349662 Log: MFC r349368: Free all allocated unit IDs in cuse(3) after the client character devices have been destroyed to avoid creating character devices with identical name. Sponsored by: Mellanox Technologies Modified: stable/12/sys/fs/cuse/cuse.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/cuse/cuse.c ============================================================================== --- stable/12/sys/fs/cuse/cuse.c Wed Jul 3 18:15:00 2019 (r349661) +++ stable/12/sys/fs/cuse/cuse.c Wed Jul 3 18:16:10 2019 (r349662) @@ -671,14 +671,14 @@ cuse_server_unref(struct cuse_server *pcs) TAILQ_REMOVE(&cuse_server_head, pcs, entry); - cuse_free_unit_by_id_locked(pcs, -1); - while ((pcsd = TAILQ_FIRST(&pcs->hdev)) != NULL) { TAILQ_REMOVE(&pcs->hdev, pcsd, entry); cuse_unlock(); cuse_server_free_dev(pcsd); cuse_lock(); } + + cuse_free_unit_by_id_locked(pcs, -1); while ((mem = TAILQ_FIRST(&pcs->hmem)) != NULL) { TAILQ_REMOVE(&pcs->hmem, mem, entry); From owner-svn-src-stable-12@freebsd.org Wed Jul 3 18:18:06 2019 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 6C13815DC3F8; Wed, 3 Jul 2019 18:18:06 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F350F8822B; Wed, 3 Jul 2019 18:18:05 +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 C5851F7CE; Wed, 3 Jul 2019 18:18:05 +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 x63II5Us024362; Wed, 3 Jul 2019 18:18:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63II54C024361; Wed, 3 Jul 2019 18:18:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201907031818.x63II54C024361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Jul 2019 18:18: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: r349664 - stable/12/usr.sbin/usbdump X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/usr.sbin/usbdump X-SVN-Commit-Revision: 349664 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F350F8822B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 18:18:06 -0000 Author: hselasky Date: Wed Jul 3 18:18:05 2019 New Revision: 349664 URL: https://svnweb.freebsd.org/changeset/base/349664 Log: MFC r349370: Fix parsing of corrupt data in usbdump(8). Check that the transfer type array lookup is within bounds to avoid segfault. PR: 238801 Sponsored by: Mellanox Technologies Modified: stable/12/usr.sbin/usbdump/usbdump.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/usbdump/usbdump.c ============================================================================== --- stable/12/usr.sbin/usbdump/usbdump.c Wed Jul 3 18:16:52 2019 (r349663) +++ stable/12/usr.sbin/usbdump/usbdump.c Wed Jul 3 18:18:05 2019 (r349664) @@ -149,7 +149,9 @@ static const char *errstr_table[USB_ERR_MAX] = { [USB_ERR_NOT_LOCKED] = "NOT_LOCKED", }; -static const char *xfertype_table[4] = { +#define USB_XFERTYPE_MAX 4 + +static const char *xfertype_table[USB_XFERTYPE_MAX] = { [UE_CONTROL] = "CTRL", [UE_ISOCHRONOUS] = "ISOC", [UE_BULK] = "BULK", @@ -320,6 +322,15 @@ usb_speedstr(uint8_t speed) return (speed_table[speed]); } +static const char * +usb_xferstr(uint8_t type) +{ + if (type >= USB_XFERTYPE_MAX || xfertype_table[type] == NULL) + return ("UNKN"); + else + return (xfertype_table[type]); +} + static void print_flags(uint32_t flags) { @@ -496,7 +507,7 @@ print_apacket(const struct header_32 *hdr, const uint8 (int)len, buf, tv.tv_usec, (int)up->up_busunit, (int)up->up_address, (up->up_type == USBPF_XFERTAP_SUBMIT) ? "SUBM" : "DONE", - xfertype_table[up->up_xfertype], + usb_xferstr(up->up_xfertype), (unsigned int)up->up_endpoint, usb_speedstr(up->up_speed), (int)up->up_frames, From owner-svn-src-stable-12@freebsd.org Wed Jul 3 18:23:38 2019 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 14C5E15DC763; Wed, 3 Jul 2019 18:23:38 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEAC68890D; Wed, 3 Jul 2019 18:23:37 +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 82201F976; Wed, 3 Jul 2019 18:23:37 +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 x63INblN029592; Wed, 3 Jul 2019 18:23:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63INbw4029591; Wed, 3 Jul 2019 18:23:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201907031823.x63INbw4029591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Jul 2019 18:23: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: r349667 - stable/12/lib/libusb X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/lib/libusb X-SVN-Commit-Revision: 349667 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AEAC68890D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 18:23:38 -0000 Author: hselasky Date: Wed Jul 3 18:23:36 2019 New Revision: 349667 URL: https://svnweb.freebsd.org/changeset/base/349667 Log: MFC r349409 and r349410: Fix support for LIBUSB_HOTPLUG_ENUMERATE in libusb. Currently all devices are enumerated regardless of of the LIBUSB_HOTPLUG_ENUMERATE flag. Make sure when the flag is not specified no arrival events are generated for currently enumerated devices. Sponsored by: Mellanox Technologies Modified: stable/12/lib/libusb/libusb10.h stable/12/lib/libusb/libusb10_hotplug.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libusb/libusb10.h ============================================================================== --- stable/12/lib/libusb/libusb10.h Wed Jul 3 18:19:29 2019 (r349666) +++ stable/12/lib/libusb/libusb10.h Wed Jul 3 18:23:36 2019 (r349667) @@ -89,6 +89,8 @@ struct libusb_hotplug_callback_handle_struct { void *user_data; }; +TAILQ_HEAD(libusb_device_head, libusb_device); + struct libusb_context { int debug; int debug_fixed; @@ -106,7 +108,7 @@ struct libusb_context { TAILQ_HEAD(, libusb_super_pollfd) pollfds; TAILQ_HEAD(, libusb_super_transfer) tr_done; TAILQ_HEAD(, libusb_hotplug_callback_handle_struct) hotplug_cbh; - TAILQ_HEAD(, libusb_device) hotplug_devs; + struct libusb_device_head hotplug_devs; struct libusb_super_pollfd ctx_poll; Modified: stable/12/lib/libusb/libusb10_hotplug.c ============================================================================== --- stable/12/lib/libusb/libusb10_hotplug.c Wed Jul 3 18:19:29 2019 (r349666) +++ stable/12/lib/libusb/libusb10_hotplug.c Wed Jul 3 18:23:36 2019 (r349667) @@ -1,6 +1,6 @@ /* $FreeBSD$ */ /*- - * Copyright (c) 2016 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2016-2019 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -85,20 +85,35 @@ libusb_hotplug_filter(libusb_context *ctx, libusb_hotp return (pcbh->fn(ctx, dev, event, pcbh->user_data)); } +static int +libusb_hotplug_enumerate(libusb_context *ctx, struct libusb_device_head *phead) +{ + libusb_device **ppdev; + ssize_t count; + ssize_t x; + + count = libusb_get_device_list(ctx, &ppdev); + if (count < 0) + return (-1); + + for (x = 0; x != count; x++) + TAILQ_INSERT_TAIL(phead, ppdev[x], hotplug_entry); + + libusb_free_device_list(ppdev, 0); + return (0); +} + static void * libusb_hotplug_scan(void *arg) { - TAILQ_HEAD(, libusb_device) hotplug_devs; + struct libusb_device_head hotplug_devs; libusb_hotplug_callback_handle acbh; libusb_hotplug_callback_handle bcbh; libusb_context *ctx = arg; - libusb_device **ppdev; libusb_device *temp; libusb_device *adev; libusb_device *bdev; unsigned do_loop = 1; - ssize_t count; - ssize_t x; while (do_loop) { usleep(4000000); @@ -108,14 +123,8 @@ libusb_hotplug_scan(void *arg) TAILQ_INIT(&hotplug_devs); if (ctx->hotplug_handler != NO_THREAD) { - count = libusb_get_device_list(ctx, &ppdev); - if (count < 0) + if (libusb_hotplug_enumerate(ctx, &hotplug_devs) < 0) continue; - for (x = 0; x != count; x++) { - TAILQ_INSERT_TAIL(&hotplug_devs, ppdev[x], - hotplug_entry); - } - libusb_free_device_list(ppdev, 0); } else { do_loop = 0; } @@ -191,6 +200,8 @@ int libusb_hotplug_register_callback(libusb_context *c HOTPLUG_LOCK(ctx); if (ctx->hotplug_handler == NO_THREAD) { + libusb_hotplug_enumerate(ctx, &ctx->hotplug_devs); + if (pthread_create(&ctx->hotplug_handler, NULL, &libusb_hotplug_scan, ctx) != 0) ctx->hotplug_handler = NO_THREAD; From owner-svn-src-stable-12@freebsd.org Wed Jul 3 18:29:19 2019 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 06D9115DC954; Wed, 3 Jul 2019 18:29:19 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F78E88D41; Wed, 3 Jul 2019 18:29:18 +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 79A24F97B; Wed, 3 Jul 2019 18:29:18 +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 x63ITIO7029989; Wed, 3 Jul 2019 18:29:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63ITIai029988; Wed, 3 Jul 2019 18:29:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201907031829.x63ITIai029988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Jul 2019 18:29: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: r349670 - stable/12/sys/dev/pci X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/dev/pci X-SVN-Commit-Revision: 349670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F78E88D41 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 18:29:19 -0000 Author: hselasky Date: Wed Jul 3 18:29:18 2019 New Revision: 349670 URL: https://svnweb.freebsd.org/changeset/base/349670 Log: MFC r349522: Need to apply the PCIM_BAR_MEM_BASE mask to the physical memory address before returning it to the user. Some of the least significant bits have special meaning and should be masked away. Discussed with: kib@ Sponsored by: Mellanox Technologies 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 Wed Jul 3 18:26:07 2019 (r349669) +++ stable/12/sys/dev/pci/pci_user.c Wed Jul 3 18:29:18 2019 (r349670) @@ -855,6 +855,7 @@ pci_bar_mmap(device_t pcidev, struct pci_bar_mmap *pbm struct thread *td; struct sglist *sg; struct pci_map *pm; + vm_paddr_t membase; vm_paddr_t pbase; vm_size_t plen; vm_offset_t addr; @@ -877,8 +878,9 @@ pci_bar_mmap(device_t pcidev, struct pci_bar_mmap *pbm return (EBUSY); /* XXXKIB enable if _ACTIVATE */ if (!PCI_BAR_MEM(pm->pm_value)) return (EIO); - pbase = trunc_page(pm->pm_value); - plen = round_page(pm->pm_value + ((pci_addr_t)1 << pm->pm_size)) - + membase = pm->pm_value & PCIM_BAR_MEM_BASE; + pbase = trunc_page(membase); + plen = round_page(membase + ((pci_addr_t)1 << pm->pm_size)) - pbase; prot = VM_PROT_READ | (((pbm->pbm_flags & PCIIO_BAR_MMAP_RW) != 0) ? VM_PROT_WRITE : 0); @@ -910,7 +912,7 @@ pci_bar_mmap(device_t pcidev, struct pci_bar_mmap *pbm } pbm->pbm_map_base = (void *)addr; pbm->pbm_map_length = plen; - pbm->pbm_bar_off = pm->pm_value - pbase; + pbm->pbm_bar_off = membase - pbase; pbm->pbm_bar_length = (pci_addr_t)1 << pm->pm_size; out: From owner-svn-src-stable-12@freebsd.org Wed Jul 3 18:53:06 2019 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 4887815DD379; Wed, 3 Jul 2019 18:53:06 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0D8E8A65B; Wed, 3 Jul 2019 18:53:05 +0000 (UTC) (envelope-from jhibbits@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 C6810FE9D; Wed, 3 Jul 2019 18:53:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63Ir4kZ047039; Wed, 3 Jul 2019 18:53:04 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63Ir40H047038; Wed, 3 Jul 2019 18:53:04 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907031853.x63Ir40H047038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 3 Jul 2019 18:53:04 +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: r349672 - stable/12/sys/powerpc/powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/powerpc/powerpc X-SVN-Commit-Revision: 349672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E0D8E8A65B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 18:53:06 -0000 Author: jhibbits Date: Wed Jul 3 18:53:04 2019 New Revision: 349672 URL: https://svnweb.freebsd.org/changeset/base/349672 Log: MFC r344958,r344960,r344961 r344958: powerpc: Print data address register on alignment exceptions r344960: powerpc: Print trap frame address for fatal traps r344961: powerpc: Print trap frame address in ddb backtraces Modified: stable/12/sys/powerpc/powerpc/db_trace.c stable/12/sys/powerpc/powerpc/trap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/powerpc/db_trace.c ============================================================================== --- stable/12/sys/powerpc/powerpc/db_trace.c Wed Jul 3 18:46:39 2019 (r349671) +++ stable/12/sys/powerpc/powerpc/db_trace.c Wed Jul 3 18:53:04 2019 (r349672) @@ -276,7 +276,7 @@ db_backtrace(struct thread *td, db_addr_t fp, int coun if (tf->exc == EXC_DSI) db_printf(" sr=%#x", (uint32_t)tf->cpu.aim.dsisr); - db_printf("\n"); + db_printf(" frame=%p\n", tf); stackframe = (db_addr_t) tf->fixreg[1]; if (kernel_only && (tf->srr1 & PSL_PR)) break; Modified: stable/12/sys/powerpc/powerpc/trap.c ============================================================================== --- stable/12/sys/powerpc/powerpc/trap.c Wed Jul 3 18:46:39 2019 (r349671) +++ stable/12/sys/powerpc/powerpc/trap.c Wed Jul 3 18:53:04 2019 (r349672) @@ -515,6 +515,7 @@ printtrap(u_int vector, struct trapframe *frame, int i case EXC_DSE: case EXC_DSI: case EXC_DTMISS: + case EXC_ALI: printf(" virtual address = 0x%" PRIxPTR "\n", frame->dar); break; case EXC_ISE: @@ -532,6 +533,7 @@ printtrap(u_int vector, struct trapframe *frame, int i printf(" current msr = 0x%" PRIxPTR "\n", mfmsr()); printf(" lr = 0x%" PRIxPTR " (0x%" PRIxPTR ")\n", frame->lr, frame->lr - (register_t)(__startkernel - KERNBASE)); + printf(" frame = %p\n", frame); printf(" curthread = %p\n", curthread); if (curthread != NULL) printf(" pid = %d, comm = %s\n", From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:01:42 2019 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 8392715DD947; Wed, 3 Jul 2019 19:01:42 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23ABD8ADA6; Wed, 3 Jul 2019 19:01:42 +0000 (UTC) (envelope-from jhibbits@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 F3A2EFEF4; Wed, 3 Jul 2019 19:01:41 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63J1fcm049019; Wed, 3 Jul 2019 19:01:41 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63J1fgP049017; Wed, 3 Jul 2019 19:01:41 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907031901.x63J1fgP049017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 3 Jul 2019 19:01: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: r349673 - in stable/12/sys/powerpc: include powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in stable/12/sys/powerpc: include powerpc X-SVN-Commit-Revision: 349673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 23ABD8ADA6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 19:01:42 -0000 Author: jhibbits Date: Wed Jul 3 19:01:41 2019 New Revision: 349673 URL: https://svnweb.freebsd.org/changeset/base/349673 Log: MFC r345829,345831,349402 r345829: powerpc: Apply r178139 from sparc64 to powerpc's fpu_sqrt r345831: powerpc: Allow emulating optional FPU instructions on CPUs with an FPU r349402: powerpc/booke: Handle misaligned floating point loads/stores as on AIM Modified: stable/12/sys/powerpc/include/trap.h stable/12/sys/powerpc/powerpc/trap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/include/trap.h ============================================================================== --- stable/12/sys/powerpc/include/trap.h Wed Jul 3 18:53:04 2019 (r349672) +++ stable/12/sys/powerpc/include/trap.h Wed Jul 3 19:01:41 2019 (r349673) @@ -127,7 +127,7 @@ /* Macros to extract register information */ #define EXC_ALI_RST(dsisr) ((dsisr >> 5) & 0x1f) /* source or target */ #define EXC_ALI_RA(dsisr) (dsisr & 0x1f) -#define EXC_ALI_SPE_REG(instr) ((instr >> 21) & 0x1f) +#define EXC_ALI_INST_RST(instr) ((instr >> 21) & 0x1f) /* * SRR1 bits for program exception traps. These identify what caused Modified: stable/12/sys/powerpc/powerpc/trap.c ============================================================================== --- stable/12/sys/powerpc/powerpc/trap.c Wed Jul 3 18:53:04 2019 (r349672) +++ stable/12/sys/powerpc/powerpc/trap.c Wed Jul 3 19:01:41 2019 (r349673) @@ -832,7 +832,7 @@ static int fix_unaligned(struct thread *td, struct trapframe *frame) { struct thread *fputhread; -#ifdef __SPE__ +#ifdef BOOKE uint32_t inst; #endif int indicator, reg; @@ -843,7 +843,7 @@ fix_unaligned(struct thread *td, struct trapframe *fra if (indicator & ESR_SPE) { if (copyin((void *)frame->srr0, &inst, sizeof(inst)) != 0) return (-1); - reg = EXC_ALI_SPE_REG(inst); + reg = EXC_ALI_INST_RST(inst); fpr = (double *)td->td_pcb->pcb_vec.vr[reg]; fputhread = PCPU_GET(vecthread); @@ -873,12 +873,22 @@ fix_unaligned(struct thread *td, struct trapframe *fra return (0); } #else +#ifdef BOOKE + indicator = (frame->cpu.booke.esr & ESR_ST) ? EXC_ALI_STFD : EXC_ALI_LFD; +#else indicator = EXC_ALI_OPCODE_INDICATOR(frame->cpu.aim.dsisr); +#endif switch (indicator) { case EXC_ALI_LFD: case EXC_ALI_STFD: +#ifdef BOOKE + if (copyin((void *)frame->srr0, &inst, sizeof(inst)) != 0) + return (-1); + reg = EXC_ALI_INST_RST(inst); +#else reg = EXC_ALI_RST(frame->cpu.aim.dsisr); +#endif fpr = &td->td_pcb->pcb_fpu.fpr[reg].fpr; fputhread = PCPU_GET(fputhread); From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:07:43 2019 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 93D6415DDB73; Wed, 3 Jul 2019 19:07:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3919A8B1AC; Wed, 3 Jul 2019 19:07:43 +0000 (UTC) (envelope-from jhibbits@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 0EFBE18043; Wed, 3 Jul 2019 19:07:43 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63J7gq5052517; Wed, 3 Jul 2019 19:07:42 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63J7gKB052515; Wed, 3 Jul 2019 19:07:42 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907031907.x63J7gKB052515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 3 Jul 2019 19:07: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: r349674 - stable/12/sys/powerpc/cpufreq X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/powerpc/cpufreq X-SVN-Commit-Revision: 349674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3919A8B1AC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 19:07:43 -0000 Author: jhibbits Date: Wed Jul 3 19:07:42 2019 New Revision: 349674 URL: https://svnweb.freebsd.org/changeset/base/349674 Log: MFC r344915: powerpc: Fix cpufreq statement scoping The second statements on the lines are not guarded by the `if' condition. This triggers a warning with newer gcc. It's relatively harmless given the usage, but incorrect. Instead, wrap the statements so they're properly guarded. Modified: stable/12/sys/powerpc/cpufreq/dfs.c stable/12/sys/powerpc/cpufreq/pcr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/cpufreq/dfs.c ============================================================================== --- stable/12/sys/powerpc/cpufreq/dfs.c Wed Jul 3 19:01:41 2019 (r349673) +++ stable/12/sys/powerpc/cpufreq/dfs.c Wed Jul 3 19:07:42 2019 (r349674) @@ -157,8 +157,10 @@ dfs_settings(device_t dev, struct cf_setting *sets, in sets[0].freq = 10000; sets[0].dev = dev; sets[1].freq = 5000; sets[1].dev = dev; - if (sc->dfs4) - sets[2].freq = 2500; sets[2].dev = dev; + if (sc->dfs4) { + sets[2].freq = 2500; + sets[2].dev = dev; + } *count = states; return (0); Modified: stable/12/sys/powerpc/cpufreq/pcr.c ============================================================================== --- stable/12/sys/powerpc/cpufreq/pcr.c Wed Jul 3 19:01:41 2019 (r349673) +++ stable/12/sys/powerpc/cpufreq/pcr.c Wed Jul 3 19:07:42 2019 (r349674) @@ -251,8 +251,10 @@ pcr_settings(device_t dev, struct cf_setting *sets, in sets[0].freq = 10000; sets[0].dev = dev; sets[1].freq = 5000; sets[1].dev = dev; - if (sc->nmodes > 2) - sets[2].freq = 2500; sets[2].dev = dev; + if (sc->nmodes > 2) { + sets[2].freq = 2500; + sets[2].dev = dev; + } *count = sc->nmodes; return (0); From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:21:04 2019 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 6F65315DE03F; Wed, 3 Jul 2019 19:21:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 117FE8B9DC; Wed, 3 Jul 2019 19:21:04 +0000 (UTC) (envelope-from jhibbits@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 E1C5618228; Wed, 3 Jul 2019 19:21:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63JL3qd059748; Wed, 3 Jul 2019 19:21:03 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JL3YB059747; Wed, 3 Jul 2019 19:21:03 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907031921.x63JL3YB059747@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 3 Jul 2019 19:21: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: r349675 - stable/12/sys/cddl/dev/dtrace/powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/cddl/dev/dtrace/powerpc X-SVN-Commit-Revision: 349675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 117FE8B9DC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 19:21:04 -0000 Author: jhibbits Date: Wed Jul 3 19:21:03 2019 New Revision: 349675 URL: https://svnweb.freebsd.org/changeset/base/349675 Log: MFC r346173,r347943 r346173: powerpc/dtrace: Fix dtrace powerpc asm, and simplify stack walking r347943: powerpc/dtrace: Actually fix stack traces Modified: stable/12/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S stable/12/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S ============================================================================== --- stable/12/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Wed Jul 3 19:07:42 2019 (r349674) +++ stable/12/sys/cddl/dev/dtrace/powerpc/dtrace_asm.S Wed Jul 3 19:21:03 2019 (r349675) @@ -148,14 +148,19 @@ dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_ volatile uint16_t *flags) */ ASENTRY_NOPROF(dtrace_copystr) - addme %r7,%r3 - addme %r8,%r4 + subi %r7,%r3,1 + subi %r8,%r4,1 1: lbzu %r3,1(%r7) stbu %r3,1(%r8) - addme %r5,%r5 + subi %r5,%r5,1 +#ifdef __powerpc64__ + cmpldi %r5,0 +#else + cmplwi %r5,0 +#endif beq 2f - or %r3,%r3,%r3 + cmplwi %r3,0 beq 2f andi. %r0,%r5,0x0fff beq 2f @@ -174,3 +179,13 @@ ASENTRY_NOPROF(dtrace_caller) li %r3, -1 blr END(dtrace_caller) + +/* +greg_t +dtrace_getfp(void) +*/ +ASENTRY_NOPROF(dtrace_getfp) + mr %r3,%r31 + blr +END(dtrace_getfp) + Modified: stable/12/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c ============================================================================== --- stable/12/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Wed Jul 3 19:07:42 2019 (r349674) +++ stable/12/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c Wed Jul 3 19:21:03 2019 (r349675) @@ -61,8 +61,10 @@ #define FRAME_OFFSET 8 #endif -#define INKERNEL(x) ((x) <= VM_MAX_KERNEL_ADDRESS && \ - (x) >= VM_MIN_KERNEL_ADDRESS) +#define INKERNEL(x) (((x) <= VM_MAX_KERNEL_ADDRESS && \ + (x) >= VM_MIN_KERNEL_ADDRESS) || \ + (PMAP_HAS_DMAP && (x) >= DMAP_BASE_ADDRESS && \ + (x) <= DMAP_MAX_ADDRESS)) static __inline int dtrace_sp_inkernel(uintptr_t sp) @@ -70,6 +72,9 @@ dtrace_sp_inkernel(uintptr_t sp) struct trapframe *frame; vm_offset_t callpc; + /* Not within the kernel, or not aligned. */ + if (!INKERNEL(sp) || (sp & 0xf) != 0) + return (0); #ifdef __powerpc64__ callpc = *(vm_offset_t *)(sp + RETURN_OFFSET64); #else @@ -84,8 +89,6 @@ dtrace_sp_inkernel(uintptr_t sp) */ if (callpc + OFFSET == (vm_offset_t) &trapexit || callpc + OFFSET == (vm_offset_t) &asttrapexit) { - if (sp == 0) - return (0); frame = (struct trapframe *)(sp + FRAME_OFFSET); return ((frame->srr1 & PSL_PR) == 0); @@ -94,11 +97,10 @@ dtrace_sp_inkernel(uintptr_t sp) return (1); } -static __inline uintptr_t -dtrace_next_sp(uintptr_t sp) +static __inline void +dtrace_next_sp_pc(uintptr_t sp, uintptr_t *nsp, uintptr_t *pc) { vm_offset_t callpc; - uintptr_t *r1; struct trapframe *frame; #ifdef __powerpc64__ @@ -115,47 +117,20 @@ dtrace_next_sp(uintptr_t sp) callpc + OFFSET == (vm_offset_t) &asttrapexit)) { /* Access the trap frame */ frame = (struct trapframe *)(sp + FRAME_OFFSET); - r1 = (uintptr_t *)frame->fixreg[1]; - if (r1 == NULL) - return (0); - return (*r1); - } - return (*(uintptr_t*)sp); -} - -static __inline uintptr_t -dtrace_get_pc(uintptr_t sp) -{ - struct trapframe *frame; - vm_offset_t callpc; - -#ifdef __powerpc64__ - callpc = *(vm_offset_t *)(sp + RETURN_OFFSET64); -#else - callpc = *(vm_offset_t *)(sp + RETURN_OFFSET); -#endif - - /* - * trapexit() and asttrapexit() are sentinels - * for kernel stack tracing. - */ - if ((callpc + OFFSET == (vm_offset_t) &trapexit || - callpc + OFFSET == (vm_offset_t) &asttrapexit)) { - /* Access the trap frame */ - frame = (struct trapframe *)(sp + FRAME_OFFSET); - return (frame->srr0); + if (nsp != NULL) + *nsp = frame->fixreg[1]; + if (pc != NULL) + *pc = frame->srr0; + return; } - return (callpc); + if (nsp != NULL) + *nsp = *(uintptr_t *)sp; + if (pc != NULL) + *pc = callpc; } -greg_t -dtrace_getfp(void) -{ - return (greg_t)__builtin_frame_address(0); -} - void dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, uint32_t *intrpc) @@ -171,7 +146,7 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in aframes++; - sp = dtrace_getfp(); + sp = (uintptr_t)__builtin_frame_address(0); while (depth < pcstack_limit) { if (sp <= osp) @@ -179,7 +154,8 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in if (!dtrace_sp_inkernel(sp)) break; - callpc = dtrace_get_pc(sp); + osp = sp; + dtrace_next_sp_pc(osp, &sp, &callpc); if (aframes > 0) { aframes--; @@ -190,9 +166,6 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in else { pcstack[depth++] = callpc; } - - osp = sp; - sp = dtrace_next_sp(sp); } for (; depth < pcstack_limit; depth++) { @@ -443,7 +416,7 @@ uint64_t dtrace_getarg(int arg, int aframes) { uintptr_t val; - uintptr_t *fp = (uintptr_t *)dtrace_getfp(); + uintptr_t *fp = (uintptr_t *)__builtin_frame_address(0); uintptr_t *stack; int i; @@ -457,8 +430,8 @@ dtrace_getarg(int arg, int aframes) fp = (uintptr_t *)*fp; /* - * On ppc32 AIM, and booke, trapexit() is the immediately following - * label. On ppc64 AIM trapexit() follows a nop. + * On ppc32 trapexit() is the immediately following label. On + * ppc64 AIM trapexit() follows a nop. */ #ifdef __powerpc64__ if ((long)(fp[2]) + 4 == (long)trapexit) { @@ -531,9 +504,7 @@ dtrace_getstackdepth(int aframes) vm_offset_t callpc; osp = PAGE_SIZE; - aframes++; - sp = dtrace_getfp(); - depth++; + sp = (uintptr_t)__builtin_frame_address(0); for(;;) { if (sp <= osp) break; @@ -541,17 +512,14 @@ dtrace_getstackdepth(int aframes) if (!dtrace_sp_inkernel(sp)) break; - if (aframes == 0) - depth++; - else - aframes--; + depth++; osp = sp; - sp = dtrace_next_sp(sp); + dtrace_next_sp_pc(sp, &sp, NULL); } if (depth < aframes) return (0); - return (depth); + return (depth - aframes); } ulong_t From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:22:26 2019 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 9513315DE263; Wed, 3 Jul 2019 19:22: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B83B8BC2A; Wed, 3 Jul 2019 19:22:26 +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 1C7B718393; Wed, 3 Jul 2019 19:22:26 +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 x63JMPaB062874; Wed, 3 Jul 2019 19:22:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JMP8P062873; Wed, 3 Jul 2019 19:22:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907031922.x63JMP8P062873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Jul 2019 19:22:25 +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: r349676 - stable/12/lib/libc/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libc/gen X-SVN-Commit-Revision: 349676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B83B8BC2A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 19:22:26 -0000 Author: kib Date: Wed Jul 3 19:22:25 2019 New Revision: 349676 URL: https://svnweb.freebsd.org/changeset/base/349676 Log: MFC r349297: Remove redundand 'else' and 'return'. Modified: stable/12/lib/libc/gen/libc_dlopen.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/libc_dlopen.c ============================================================================== --- stable/12/lib/libc/gen/libc_dlopen.c Wed Jul 3 19:21:03 2019 (r349675) +++ stable/12/lib/libc/gen/libc_dlopen.c Wed Jul 3 19:22:25 2019 (r349676) @@ -48,8 +48,8 @@ libc_dlopen(const char *path, int mode) if (__libc_restricted_mode) { _rtld_error("Service unavailable -- libc in restricted mode"); return (NULL); - } else - return (dlopen(path, mode)); + } + return (dlopen(path, mode)); } void @@ -57,6 +57,5 @@ __FreeBSD_libc_enter_restricted_mode(void) { __libc_restricted_mode = 1; - return; } From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:24:52 2019 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 AD43615DE5BA; Wed, 3 Jul 2019 19:24:52 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E2998C14B; Wed, 3 Jul 2019 19:24:52 +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 0D14A183A3; Wed, 3 Jul 2019 19:24:52 +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 x63JOphj063138; Wed, 3 Jul 2019 19:24:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JOp9H063134; Wed, 3 Jul 2019 19:24:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907031924.x63JOp9H063134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Jul 2019 19:24: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: r349679 - in stable/12/lib: libc/gen libc/include libthr/thread X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/lib: libc/gen libc/include libthr/thread X-SVN-Commit-Revision: 349679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E2998C14B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 19:24:52 -0000 Author: kib Date: Wed Jul 3 19:24:50 2019 New Revision: 349679 URL: https://svnweb.freebsd.org/changeset/base/349679 Log: MFC r349299: Add libc stub for pthread_getthreadid_np(3). PR: 238650 Modified: stable/12/lib/libc/gen/Symbol.map stable/12/lib/libc/gen/_pthread_stubs.c stable/12/lib/libc/include/libc_private.h stable/12/lib/libthr/thread/thr_init.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/gen/Symbol.map ============================================================================== --- stable/12/lib/libc/gen/Symbol.map Wed Jul 3 19:23:20 2019 (r349678) +++ stable/12/lib/libc/gen/Symbol.map Wed Jul 3 19:24:50 2019 (r349679) @@ -338,6 +338,7 @@ FBSD_1.2 { getutxid; getutxline; getutxuser; + pthread_getthreadid_np; pututxline; sem_close; sem_destroy; Modified: stable/12/lib/libc/gen/_pthread_stubs.c ============================================================================== --- stable/12/lib/libc/gen/_pthread_stubs.c Wed Jul 3 19:23:20 2019 (r349678) +++ stable/12/lib/libc/gen/_pthread_stubs.c Wed Jul 3 19:24:50 2019 (r349679) @@ -130,6 +130,7 @@ pthread_func_entry_t __thr_jtable[PJT_MAX] = { {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEX_CONSISTENT */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_GETROBUST */ {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_MUTEXATTR_SETROBUST */ + {PJT_DUAL_ENTRY(stub_zero)}, /* PJT_GETTHREADID_NP */ }; /* @@ -248,6 +249,7 @@ STUB_FUNC1(pthread_rwlock_trywrlock, PJT_RWLOCK_TRYWRL STUB_FUNC1(pthread_rwlock_unlock, PJT_RWLOCK_UNLOCK, int, void *) STUB_FUNC1(pthread_rwlock_wrlock, PJT_RWLOCK_WRLOCK, int, void *) STUB_FUNC(pthread_self, PJT_SELF, pthread_t) +STUB_FUNC(pthread_getthreadid_np, PJT_GETTHREADID_NP, int) STUB_FUNC2(pthread_setspecific, PJT_SETSPECIFIC, int, pthread_key_t, void *) STUB_FUNC3(pthread_sigmask, PJT_SIGMASK, int, int, void *, void *) STUB_FUNC3(pthread_atfork, PJT_ATFORK, int, void *, void *, void*) Modified: stable/12/lib/libc/include/libc_private.h ============================================================================== --- stable/12/lib/libc/include/libc_private.h Wed Jul 3 19:23:20 2019 (r349678) +++ stable/12/lib/libc/include/libc_private.h Wed Jul 3 19:24:50 2019 (r349679) @@ -176,6 +176,7 @@ typedef enum { PJT_MUTEX_CONSISTENT, PJT_MUTEXATTR_GETROBUST, PJT_MUTEXATTR_SETROBUST, + PJT_GETTHREADID_NP, PJT_MAX } pjt_index_t; Modified: stable/12/lib/libthr/thread/thr_init.c ============================================================================== --- stable/12/lib/libthr/thread/thr_init.c Wed Jul 3 19:23:20 2019 (r349678) +++ stable/12/lib/libthr/thread/thr_init.c Wed Jul 3 19:24:50 2019 (r349679) @@ -272,6 +272,7 @@ static pthread_func_t jmp_table[][2] = { {DUAL_ENTRY(_pthread_mutex_consistent)},/* PJT_MUTEX_CONSISTENT */ {DUAL_ENTRY(_pthread_mutexattr_getrobust)},/* PJT_MUTEXATTR_GETROBUST */ {DUAL_ENTRY(_pthread_mutexattr_setrobust)},/* PJT_MUTEXATTR_SETROBUST */ + {DUAL_ENTRY(_pthread_getthreadid_np)}, /* PJT_GETTHREADID_NP */ }; static int init_once = 0; From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:25:59 2019 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 CAF4C15DE63D; Wed, 3 Jul 2019 19:25:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65E0F8C28F; Wed, 3 Jul 2019 19:25:58 +0000 (UTC) (envelope-from jhibbits@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 426CD183A5; Wed, 3 Jul 2019 19:25:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63JPwcU063272; Wed, 3 Jul 2019 19:25:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JPwQU063271; Wed, 3 Jul 2019 19:25:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907031925.x63JPwQU063271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 3 Jul 2019 19:25: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: r349680 - stable/12/sys/powerpc/booke X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/powerpc/booke X-SVN-Commit-Revision: 349680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65E0F8C28F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 19:25:59 -0000 Author: jhibbits Date: Wed Jul 3 19:25:57 2019 New Revision: 349680 URL: https://svnweb.freebsd.org/changeset/base/349680 Log: MFC r347167,r348079 Book-E pmap r347167: powerpc/booke: Use #ifdef __powerpc64__ instead of hw_direct_map in places r348079: powerpc/booke: Use wrtee instead of msr to restore EE bit Modified: stable/12/sys/powerpc/booke/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/booke/pmap.c ============================================================================== --- stable/12/sys/powerpc/booke/pmap.c Wed Jul 3 19:24:50 2019 (r349679) +++ stable/12/sys/powerpc/booke/pmap.c Wed Jul 3 19:25:57 2019 (r349680) @@ -2973,19 +2973,19 @@ mmu_booke_zero_page_area(mmu_t mmu, vm_page_t m, int o /* XXX KASSERT off and size are within a single page? */ - if (hw_direct_map) { - va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - bzero((caddr_t)va + off, size); - } else { - mtx_lock(&zero_page_mutex); - va = zero_page_va; +#ifdef __powerpc64__ + va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); + bzero((caddr_t)va + off, size); +#else + mtx_lock(&zero_page_mutex); + va = zero_page_va; - mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); - bzero((caddr_t)va + off, size); - mmu_booke_kremove(mmu, va); + mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); + bzero((caddr_t)va + off, size); + mmu_booke_kremove(mmu, va); - mtx_unlock(&zero_page_mutex); - } + mtx_unlock(&zero_page_mutex); +#endif } /* @@ -2996,23 +2996,24 @@ mmu_booke_zero_page(mmu_t mmu, vm_page_t m) { vm_offset_t off, va; - if (hw_direct_map) { - va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - } else { - va = zero_page_va; - mtx_lock(&zero_page_mutex); +#ifdef __powerpc64__ + va = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m)); - mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); - } + for (off = 0; off < PAGE_SIZE; off += cacheline_size) + __asm __volatile("dcbz 0,%0" :: "r"(va + off)); +#else + va = zero_page_va; + mtx_lock(&zero_page_mutex); + mmu_booke_kenter(mmu, va, VM_PAGE_TO_PHYS(m)); + for (off = 0; off < PAGE_SIZE; off += cacheline_size) __asm __volatile("dcbz 0,%0" :: "r"(va + off)); - if (!hw_direct_map) { - mmu_booke_kremove(mmu, va); + mmu_booke_kremove(mmu, va); - mtx_unlock(&zero_page_mutex); - } + mtx_unlock(&zero_page_mutex); +#endif } /* @@ -3025,23 +3026,23 @@ mmu_booke_copy_page(mmu_t mmu, vm_page_t sm, vm_page_t { vm_offset_t sva, dva; +#ifdef __powerpc64__ + sva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(sm)); + dva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dm)); + memcpy((caddr_t)dva, (caddr_t)sva, PAGE_SIZE); +#else + mtx_lock(©_page_mutex); + mmu_booke_kenter(mmu, sva, VM_PAGE_TO_PHYS(sm)); + mmu_booke_kenter(mmu, dva, VM_PAGE_TO_PHYS(dm)); sva = copy_page_src_va; dva = copy_page_dst_va; - if (hw_direct_map) { - sva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(sm)); - dva = PHYS_TO_DMAP(VM_PAGE_TO_PHYS(dm)); - } else { - mtx_lock(©_page_mutex); - mmu_booke_kenter(mmu, sva, VM_PAGE_TO_PHYS(sm)); - mmu_booke_kenter(mmu, dva, VM_PAGE_TO_PHYS(dm)); - } memcpy((caddr_t)dva, (caddr_t)sva, PAGE_SIZE); - if (!hw_direct_map) { - mmu_booke_kremove(mmu, dva); - mmu_booke_kremove(mmu, sva); - mtx_unlock(©_page_mutex); - } + + mmu_booke_kremove(mmu, dva); + mmu_booke_kremove(mmu, sva); + mtx_unlock(©_page_mutex); +#endif } static inline void @@ -3052,39 +3053,55 @@ mmu_booke_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offs vm_offset_t a_pg_offset, b_pg_offset; int cnt; - if (hw_direct_map) { - a_cp = (caddr_t)((uintptr_t)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*ma)) + - a_offset); - b_cp = (caddr_t)((uintptr_t)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(*mb)) + - b_offset); - bcopy(a_cp, b_cp, xfersize); - } else { - mtx_lock(©_page_mutex); - while (xfersize > 0) { - a_pg_offset = a_offset & PAGE_MASK; - cnt = min(xfersize, PAGE_SIZE - a_pg_offset); - mmu_booke_kenter(mmu, copy_page_src_va, - VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT])); - a_cp = (char *)copy_page_src_va + a_pg_offset; - b_pg_offset = b_offset & PAGE_MASK; - cnt = min(cnt, PAGE_SIZE - b_pg_offset); - mmu_booke_kenter(mmu, copy_page_dst_va, - VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT])); - b_cp = (char *)copy_page_dst_va + b_pg_offset; - bcopy(a_cp, b_cp, cnt); - mmu_booke_kremove(mmu, copy_page_dst_va); - mmu_booke_kremove(mmu, copy_page_src_va); - a_offset += cnt; - b_offset += cnt; - xfersize -= cnt; - } - mtx_unlock(©_page_mutex); +#ifdef __powerpc64__ + vm_page_t pa, pb; + + while (xfersize > 0) { + a_pg_offset = a_offset & PAGE_MASK; + pa = ma[a_offset >> PAGE_SHIFT]; + b_pg_offset = b_offset & PAGE_MASK; + pb = mb[b_offset >> PAGE_SHIFT]; + cnt = min(xfersize, PAGE_SIZE - a_pg_offset); + cnt = min(cnt, PAGE_SIZE - b_pg_offset); + a_cp = (caddr_t)((uintptr_t)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pa)) + + a_pg_offset); + b_cp = (caddr_t)((uintptr_t)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(pb)) + + b_pg_offset); + bcopy(a_cp, b_cp, cnt); + a_offset += cnt; + b_offset += cnt; + xfersize -= cnt; } +#else + mtx_lock(©_page_mutex); + while (xfersize > 0) { + a_pg_offset = a_offset & PAGE_MASK; + cnt = min(xfersize, PAGE_SIZE - a_pg_offset); + mmu_booke_kenter(mmu, copy_page_src_va, + VM_PAGE_TO_PHYS(ma[a_offset >> PAGE_SHIFT])); + a_cp = (char *)copy_page_src_va + a_pg_offset; + b_pg_offset = b_offset & PAGE_MASK; + cnt = min(cnt, PAGE_SIZE - b_pg_offset); + mmu_booke_kenter(mmu, copy_page_dst_va, + VM_PAGE_TO_PHYS(mb[b_offset >> PAGE_SHIFT])); + b_cp = (char *)copy_page_dst_va + b_pg_offset; + bcopy(a_cp, b_cp, cnt); + mmu_booke_kremove(mmu, copy_page_dst_va); + mmu_booke_kremove(mmu, copy_page_src_va); + a_offset += cnt; + b_offset += cnt; + xfersize -= cnt; + } + mtx_unlock(©_page_mutex); +#endif } static vm_offset_t mmu_booke_quick_enter_page(mmu_t mmu, vm_page_t m) { +#ifdef __powerpc64__ + return (PHYS_TO_DMAP(VM_PAGE_TO_PHYS(m))); +#else vm_paddr_t paddr; vm_offset_t qaddr; uint32_t flags; @@ -3092,9 +3109,6 @@ mmu_booke_quick_enter_page(mmu_t mmu, vm_page_t m) paddr = VM_PAGE_TO_PHYS(m); - if (hw_direct_map) - return (PHYS_TO_DMAP(paddr)); - flags = PTE_SR | PTE_SW | PTE_SX | PTE_WIRED | PTE_VALID; flags |= tlb_calc_wimg(paddr, pmap_page_get_memattr(m)) << PTE_MAS2_SHIFT; flags |= PTE_PS_4KB; @@ -3121,16 +3135,15 @@ mmu_booke_quick_enter_page(mmu_t mmu, vm_page_t m) __syncicache((void *)qaddr, PAGE_SIZE); return (qaddr); +#endif } static void mmu_booke_quick_remove_page(mmu_t mmu, vm_offset_t addr) { +#ifndef __powerpc64__ pte_t *pte; - if (hw_direct_map) - return; - pte = pte_find(mmu, kernel_pmap, addr); KASSERT(PCPU_GET(qmap_addr) == addr, @@ -3140,6 +3153,7 @@ mmu_booke_quick_remove_page(mmu_t mmu, vm_offset_t add *pte = 0; critical_exit(); +#endif } /* @@ -3890,7 +3904,7 @@ tlb1_read_entry(tlb_entry_t *entry, unsigned int slot) entry->mas7 = 0; break; } - mtmsr(msr); + __asm __volatile("wrtee %0" :: "r"(msr)); entry->virt = entry->mas2 & MAS2_EPN_MASK; entry->phys = ((vm_paddr_t)(entry->mas7 & MAS7_RPN) << 32) | @@ -3965,7 +3979,7 @@ tlb1_write_entry(tlb_entry_t *e, unsigned int idx) msr = mfmsr(); __asm __volatile("wrteei 0"); tlb1_write_entry_int(&args); - mtmsr(msr); + __asm __volatile("wrtee %0" :: "r"(msr)); } } @@ -4364,7 +4378,7 @@ tid_flush(tlbtid_t tid) mtspr(SPR_MAS6, tid << MAS6_SPID0_SHIFT); /* tlbilxpid */ __asm __volatile("isync; .long 0x7c000024; isync; msync"); - mtmsr(msr); + __asm __volatile("wrtee %0" :: "r"(msr)); return; } @@ -4389,7 +4403,7 @@ tid_flush(tlbtid_t tid) mtspr(SPR_MAS1, mas1); __asm __volatile("isync; tlbwe; isync; msync"); } - mtmsr(msr); + __asm __volatile("wrtee %0" :: "r"(msr)); } #ifdef DDB From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:27:35 2019 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 C6A2115DE72B; Wed, 3 Jul 2019 19:27:35 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D01F8C419; Wed, 3 Jul 2019 19:27:35 +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 46502183A6; Wed, 3 Jul 2019 19:27:35 +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 x63JRZ0i063405; Wed, 3 Jul 2019 19:27:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JRZ1n063404; Wed, 3 Jul 2019 19:27:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907031927.x63JRZ1n063404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Jul 2019 19:27:35 +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: r349681 - 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: 349681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6D01F8C419 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 19:27:36 -0000 Author: kib Date: Wed Jul 3 19:27:34 2019 New Revision: 349681 URL: https://svnweb.freebsd.org/changeset/base/349681 Log: MFC r349427: amd64 pmap: Fix pkru handling in pmap_remove(). Modified: stable/12/sys/amd64/amd64/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/pmap.c ============================================================================== --- stable/12/sys/amd64/amd64/pmap.c Wed Jul 3 19:25:57 2019 (r349680) +++ stable/12/sys/amd64/amd64/pmap.c Wed Jul 3 19:27:34 2019 (r349681) @@ -4533,6 +4533,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t pmap_delayed_invl_started(); PMAP_LOCK(pmap); + pmap_pkru_on_remove(pmap, sva, eva); /* * special handling of removing one page. a very @@ -4626,7 +4627,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t out: if (anyvalid) pmap_invalidate_all(pmap); - pmap_pkru_on_remove(pmap, sva, eva); PMAP_UNLOCK(pmap); pmap_delayed_invl_finished(); vm_page_free_pages_toq(&free, true); From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:28:48 2019 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 ADEE415DE7B0; Wed, 3 Jul 2019 19:28: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 524878C581; Wed, 3 Jul 2019 19:28: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 010CE183A7; Wed, 3 Jul 2019 19:28: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 x63JSlG2063512; Wed, 3 Jul 2019 19:28:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JSlZf063511; Wed, 3 Jul 2019 19:28:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907031928.x63JSlZf063511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Jul 2019 19:28: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: r349682 - stable/12/lib/libc/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/lib/libc/sys X-SVN-Commit-Revision: 349682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 524878C581 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 19:28:48 -0000 Author: kib Date: Wed Jul 3 19:28:47 2019 New Revision: 349682 URL: https://svnweb.freebsd.org/changeset/base/349682 Log: MFC r349511: Typo. Modified: stable/12/lib/libc/sys/procctl.2 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/procctl.2 ============================================================================== --- stable/12/lib/libc/sys/procctl.2 Wed Jul 3 19:27:34 2019 (r349681) +++ stable/12/lib/libc/sys/procctl.2 Wed Jul 3 19:28:47 2019 (r349682) @@ -91,7 +91,7 @@ The image flag and set-uid might prevent ASLR enableme .It Dv PROC_ASLR_FORCE_DISABLE Request that ASLR is disabled after execution. Same notes as for -.Dv PROC_ASKR_FORCE_ENABLE +.Dv PROC_ASLR_FORCE_ENABLE apply. .It Dv PROC_ASLR_NOFORCE Use system-wide configured policy for ASLR. From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:29:54 2019 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 9DDAC15DE84A; Wed, 3 Jul 2019 19:29:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 432C78C6EC; Wed, 3 Jul 2019 19:29:54 +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 19DB2183A8; Wed, 3 Jul 2019 19:29:54 +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 x63JTrEm063612; Wed, 3 Jul 2019 19:29:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JTr1T063611; Wed, 3 Jul 2019 19:29:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907031929.x63JTr1T063611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Jul 2019 19:29: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: r349683 - stable/12/usr.bin/proccontrol X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/usr.bin/proccontrol X-SVN-Commit-Revision: 349683 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 432C78C6EC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 19:29:54 -0000 Author: kib Date: Wed Jul 3 19:29:53 2019 New Revision: 349683 URL: https://svnweb.freebsd.org/changeset/base/349683 Log: MFC r349512: Mention proccontrol(1) -m kpti. Modified: stable/12/usr.bin/proccontrol/proccontrol.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/proccontrol/proccontrol.1 ============================================================================== --- stable/12/usr.bin/proccontrol/proccontrol.1 Wed Jul 3 19:28:47 2019 (r349682) +++ stable/12/usr.bin/proccontrol/proccontrol.1 Wed Jul 3 19:29:53 2019 (r349683) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2019 +.Dd June 28, 2019 .Dt PROCCONTROL 1 .Os .Sh NAME @@ -66,6 +66,8 @@ Note that process is only allowed to enable tracing fo not for any other process. .It Ar trapcap Controls the signalling of capability mode access violations. +.It Ar kpti +Controls the KPTI enable, AMD64 only. .El .Pp The From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:31:12 2019 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 D4C7615DE93E; Wed, 3 Jul 2019 19:31:12 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78CCF8CACE; Wed, 3 Jul 2019 19:31: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 55275184EE; Wed, 3 Jul 2019 19:31: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 x63JVCXg065411; Wed, 3 Jul 2019 19:31:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JVC8P065409; Wed, 3 Jul 2019 19:31:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907031931.x63JVC8P065409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Jul 2019 19:31: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: r349684 - 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: 349684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 78CCF8CACE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 19:31:13 -0000 Author: kib Date: Wed Jul 3 19:31:11 2019 New Revision: 349684 URL: https://svnweb.freebsd.org/changeset/base/349684 Log: MFC r349519: Style. Modified: stable/12/sys/kern/kern_umtx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_umtx.c ============================================================================== --- stable/12/sys/kern/kern_umtx.c Wed Jul 3 19:29:53 2019 (r349683) +++ stable/12/sys/kern/kern_umtx.c Wed Jul 3 19:31:11 2019 (r349684) @@ -2624,7 +2624,8 @@ do_cv_broadcast(struct thread *td, struct ucond *cv) } static int -do_rw_rdlock(struct thread *td, struct urwlock *rwlock, long fflag, struct _umtx_time *timeout) +do_rw_rdlock(struct thread *td, struct urwlock *rwlock, long fflag, + struct _umtx_time *timeout) { struct abs_timeout timo; struct umtx_q *uq; From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:32:27 2019 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 67D3A15DEA39; Wed, 3 Jul 2019 19:32:27 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 099438CE04; Wed, 3 Jul 2019 19:32:27 +0000 (UTC) (envelope-from jhibbits@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 DB4B018550; Wed, 3 Jul 2019 19:32:26 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63JWQqC068562; Wed, 3 Jul 2019 19:32:26 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JWQN9068558; Wed, 3 Jul 2019 19:32:26 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907031932.x63JWQN9068558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 3 Jul 2019 19:32: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: r349686 - in stable/12/sys/powerpc: aim include powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in stable/12/sys/powerpc: aim include powerpc X-SVN-Commit-Revision: 349686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 099438CE04 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 19:32:27 -0000 Author: jhibbits Date: Wed Jul 3 19:32:25 2019 New Revision: 349686 URL: https://svnweb.freebsd.org/changeset/base/349686 Log: MFC r346777: powerpc: Add POWER8NVL definition The POWER8NVL (POWER8 NVLink) architecturally behaves identically to the POWER8, with a different PVR identifier. Mark it as such, so it shows up appropriately to the user. Reported by: Alexey Kardashevskiy Modified: stable/12/sys/powerpc/aim/aim_machdep.c stable/12/sys/powerpc/aim/mp_cpudep.c stable/12/sys/powerpc/include/spr.h stable/12/sys/powerpc/powerpc/cpu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/aim/aim_machdep.c ============================================================================== --- stable/12/sys/powerpc/aim/aim_machdep.c Wed Jul 3 19:31:47 2019 (r349685) +++ stable/12/sys/powerpc/aim/aim_machdep.c Wed Jul 3 19:32:25 2019 (r349686) @@ -213,6 +213,7 @@ aim_early_init(vm_offset_t fdt, vm_offset_t toc, vm_of case IBMPOWER7PLUS: case IBMPOWER8: case IBMPOWER8E: + case IBMPOWER8NVL: case IBMPOWER9: /* XXX: get from ibm,slb-size in device tree */ n_slbs = 32; Modified: stable/12/sys/powerpc/aim/mp_cpudep.c ============================================================================== --- stable/12/sys/powerpc/aim/mp_cpudep.c Wed Jul 3 19:31:47 2019 (r349685) +++ stable/12/sys/powerpc/aim/mp_cpudep.c Wed Jul 3 19:32:25 2019 (r349686) @@ -89,6 +89,7 @@ cpudep_ap_early_bootstrap(void) break; case IBMPOWER8: case IBMPOWER8E: + case IBMPOWER8NVL: case IBMPOWER9: #ifdef __powerpc64__ if (mfmsr() & PSL_HV) { @@ -398,6 +399,7 @@ cpudep_ap_setup() case IBMPOWER7PLUS: case IBMPOWER8: case IBMPOWER8E: + case IBMPOWER8NVL: case IBMPOWER9: #ifdef __powerpc64__ if (mfmsr() & PSL_HV) { Modified: stable/12/sys/powerpc/include/spr.h ============================================================================== --- stable/12/sys/powerpc/include/spr.h Wed Jul 3 19:31:47 2019 (r349685) +++ stable/12/sys/powerpc/include/spr.h Wed Jul 3 19:32:25 2019 (r349686) @@ -188,6 +188,7 @@ #define IBMPOWERPCA2 0x0049 #define IBMPOWER7PLUS 0x004a #define IBMPOWER8E 0x004b +#define IBMPOWER8NVL 0x004c #define IBMPOWER8 0x004d #define IBMPOWER9 0x004e #define MPC860 0x0050 Modified: stable/12/sys/powerpc/powerpc/cpu.c ============================================================================== --- stable/12/sys/powerpc/powerpc/cpu.c Wed Jul 3 19:31:47 2019 (r349685) +++ stable/12/sys/powerpc/powerpc/cpu.c Wed Jul 3 19:32:25 2019 (r349686) @@ -171,6 +171,13 @@ static const struct cputab models[] = { PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HTM | PPC_FEATURE2_DSCR | PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | PPC_FEATURE2_HAS_VEC_CRYPTO | PPC_FEATURE2_HTM_NOSC, cpu_powerx_setup }, + { "IBM POWER8NVL", IBMPOWER8NVL, REVFMT_MAJMIN, + PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | + PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | PPC_FEATURE_ARCH_2_05 | + PPC_FEATURE_ARCH_2_06 | PPC_FEATURE_HAS_VSX | PPC_FEATURE_TRUE_LE, + PPC_FEATURE2_ARCH_2_07 | PPC_FEATURE2_HTM | PPC_FEATURE2_DSCR | + PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | PPC_FEATURE2_HAS_VEC_CRYPTO | + PPC_FEATURE2_HTM_NOSC, cpu_powerx_setup }, { "IBM POWER8", IBMPOWER8, REVFMT_MAJMIN, PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC | PPC_FEATURE_HAS_FPU | PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | PPC_FEATURE_ARCH_2_05 | @@ -666,6 +673,7 @@ cpu_powerx_setup(int cpuid, uint16_t vers) switch (vers) { case IBMPOWER8: case IBMPOWER8E: + case IBMPOWER8NVL: cpu_idle_hook = cpu_idle_powerx; mtspr(SPR_LPCR, mfspr(SPR_LPCR) | LPCR_PECE_WAKESET); isync(); From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:34:19 2019 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 E066E15DEC1D; Wed, 3 Jul 2019 19:34:18 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84EB48CFA0; Wed, 3 Jul 2019 19:34: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 55EF818558; Wed, 3 Jul 2019 19:34: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 x63JYIP7068728; Wed, 3 Jul 2019 19:34:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JYIRh068727; Wed, 3 Jul 2019 19:34:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907031934.x63JYIRh068727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Jul 2019 19:34: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: r349687 - 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: 349687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84EB48CFA0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 19:34:19 -0000 Author: kib Date: Wed Jul 3 19:34:17 2019 New Revision: 349687 URL: https://svnweb.freebsd.org/changeset/base/349687 Log: MFC r349320, r349324: coredump: avoid writing to core files not owned by the effective user. PR: 68905 admbugs: 358 Modified: stable/12/sys/kern/kern_sig.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_sig.c ============================================================================== --- stable/12/sys/kern/kern_sig.c Wed Jul 3 19:32:25 2019 (r349686) +++ stable/12/sys/kern/kern_sig.c Wed Jul 3 19:34:17 2019 (r349687) @@ -3400,10 +3400,16 @@ corefile_open_last(struct thread *td, char *name, int } if (oldvp != NULL) { - if (nextvp == NULL) - nextvp = oldvp; - else + if (nextvp == NULL) { + if ((td->td_proc->p_flag & P_SUGID) != 0) { + error = EFAULT; + vnode_close_locked(td, oldvp); + } else { + nextvp = oldvp; + } + } else { vnode_close_locked(td, oldvp); + } } if (error != 0) { if (nextvp != NULL) @@ -3523,6 +3529,8 @@ corefile_open(const char *comm, uid_t uid, pid_t pid, oflags = VN_OPEN_NOAUDIT | VN_OPEN_NAMECACHE | (capmode_coredump ? VN_OPEN_NOCAPCHECK : 0); flags = O_CREAT | FWRITE | O_NOFOLLOW; + if ((td->td_proc->p_flag & P_SUGID) != 0) + flags |= O_EXCL; NDINIT(&nd, LOOKUP, NOFOLLOW, UIO_SYSSPACE, name, td); error = vn_open_cred(&nd, &flags, cmode, oflags, td->td_ucred, @@ -3599,10 +3607,11 @@ coredump(struct thread *td) /* * Don't dump to non-regular files or files with links. - * Do not dump into system files. + * Do not dump into system files. Effective user must own the corefile. */ if (vp->v_type != VREG || VOP_GETATTR(vp, &vattr, cred) != 0 || - vattr.va_nlink != 1 || (vp->v_vflag & VV_SYSTEM) != 0) { + vattr.va_nlink != 1 || (vp->v_vflag & VV_SYSTEM) != 0 || + vattr.va_uid != cred->cr_uid) { VOP_UNLOCK(vp, 0); error = EFAULT; goto out; From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:50:23 2019 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 6BB2415DF2AA; Wed, 3 Jul 2019 19:50:23 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 103FD8DCA1; Wed, 3 Jul 2019 19:50:23 +0000 (UTC) (envelope-from vangyzen@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 D8DB51872C; Wed, 3 Jul 2019 19:50:22 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63JoMfW074680; Wed, 3 Jul 2019 19:50:22 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JoMsV074679; Wed, 3 Jul 2019 19:50:22 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201907031950.x63JoMsV074679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 3 Jul 2019 19:50:22 +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: r349690 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 349690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 103FD8DCA1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 19:50:23 -0000 Author: vangyzen Date: Wed Jul 3 19:50:22 2019 New Revision: 349690 URL: https://svnweb.freebsd.org/changeset/base/349690 Log: MFC r349278 bhyve: Fix vtscsi maximum segment config The seg_max value reported to the guest should be two less than the host's maximum, in order to leave room for the request and the response. This is analogous to r347033 for virtio_block. We hit the "too many segments to enqueue" assertion on OneFS because we increase MAXPHYS to 256 KB. Reviewed by: bryanv Discussed with: cem jhb rgrimes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20529 Modified: stable/12/usr.sbin/bhyve/pci_virtio_scsi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_virtio_scsi.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_virtio_scsi.c Wed Jul 3 19:46:05 2019 (r349689) +++ stable/12/usr.sbin/bhyve/pci_virtio_scsi.c Wed Jul 3 19:50:22 2019 (r349690) @@ -309,7 +309,8 @@ pci_vtscsi_reset(void *vsc) /* initialize config structure */ sc->vss_config = (struct pci_vtscsi_config){ .num_queues = VTSCSI_REQUESTQ, - .seg_max = VTSCSI_MAXSEG, + /* Leave room for the request and the response. */ + .seg_max = VTSCSI_MAXSEG - 2, .max_sectors = 2, .cmd_per_lun = 1, .event_info_size = sizeof(struct pci_vtscsi_event), From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:52:25 2019 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 9A56115DF49F; Wed, 3 Jul 2019 19:52:25 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D8558E05E; Wed, 3 Jul 2019 19:52:25 +0000 (UTC) (envelope-from vangyzen@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 2BBEF188BD; Wed, 3 Jul 2019 19:52:25 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63JqPpV079881; Wed, 3 Jul 2019 19:52:25 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JqPPi079880; Wed, 3 Jul 2019 19:52:25 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201907031952.x63JqPPi079880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 3 Jul 2019 19:52:25 +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: r349691 - stable/12/sys/dev/virtio/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: stable/12/sys/dev/virtio/scsi X-SVN-Commit-Revision: 349691 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3D8558E05E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 19:52:25 -0000 Author: vangyzen Date: Wed Jul 3 19:52:24 2019 New Revision: 349691 URL: https://svnweb.freebsd.org/changeset/base/349691 Log: MFC r349285 VirtIO SCSI: validate seg_max on attach Until head r349278 (stable/12 r349690), bhyve presented a seg_max to the guest that was too large. Detect this case and clamp it to the virtqueue size. Otherwise, we would fail the "too many segments to enqueue" assertion in virtqueue_enqueue(). I hit this by running a guest with a MAXPHYS of 256 KB. Reviewed by: bryanv cem Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D20703 Modified: stable/12/sys/dev/virtio/scsi/virtio_scsi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/virtio/scsi/virtio_scsi.c ============================================================================== --- stable/12/sys/dev/virtio/scsi/virtio_scsi.c Wed Jul 3 19:50:22 2019 (r349690) +++ stable/12/sys/dev/virtio/scsi/virtio_scsi.c Wed Jul 3 19:52:24 2019 (r349691) @@ -81,6 +81,7 @@ static void vtscsi_read_config(struct vtscsi_softc *, struct virtio_scsi_config *); static int vtscsi_maximum_segments(struct vtscsi_softc *, int); static int vtscsi_alloc_virtqueues(struct vtscsi_softc *); +static void vtscsi_check_sizes(struct vtscsi_softc *); static void vtscsi_write_device_config(struct vtscsi_softc *); static int vtscsi_reinit(struct vtscsi_softc *); @@ -314,6 +315,8 @@ vtscsi_attach(device_t dev) goto fail; } + vtscsi_check_sizes(sc); + error = vtscsi_init_event_vq(sc); if (error) { device_printf(dev, "cannot populate the eventvq\n"); @@ -478,6 +481,26 @@ vtscsi_alloc_virtqueues(struct vtscsi_softc *sc) "%s request", device_get_nameunit(dev)); return (virtio_alloc_virtqueues(dev, 0, nvqs, vq_info)); +} + +static void +vtscsi_check_sizes(struct vtscsi_softc *sc) +{ + int rqsize; + + if ((sc->vtscsi_flags & VTSCSI_FLAG_INDIRECT) == 0) { + /* + * Ensure the assertions in virtqueue_enqueue(), + * even if the hypervisor reports a bad seg_max. + */ + rqsize = virtqueue_size(sc->vtscsi_request_vq); + if (sc->vtscsi_max_nsegs > rqsize) { + device_printf(sc->vtscsi_dev, + "clamping seg_max (%d %d)\n", sc->vtscsi_max_nsegs, + rqsize); + sc->vtscsi_max_nsegs = rqsize; + } + } } static void From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:54:39 2019 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 E505315DF55E; Wed, 3 Jul 2019 19:54:38 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87A498E25A; Wed, 3 Jul 2019 19:54:38 +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 6D1DB188C9; Wed, 3 Jul 2019 19:54:38 +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 x63JscJT080047; Wed, 3 Jul 2019 19:54:38 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63Jsc7F080046; Wed, 3 Jul 2019 19:54:38 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907031954.x63Jsc7F080046@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 3 Jul 2019 19:54: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: r349692 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 349692 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 87A498E25A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 19:54:39 -0000 Author: vmaffione Date: Wed Jul 3 19:54:37 2019 New Revision: 349692 URL: https://svnweb.freebsd.org/changeset/base/349692 Log: MFC r348834 bhyve: vtnet: simplify thread synchronization On vtnet device reset it is necessary to wait for threads to stop TX and RX processing. However, the rx_in_progress variable (used for to wait for RX processing to stop) is actually useless, and can be removed. Acquiring and releasing the RX lock is enough to synchronize correctly. Moreover, it is possible to reset the device while holding both TX and RX locks, so that the "resetting" variable becomes unnecessary for the RX thread, and can be protected by the TX lock (instead of being volatile). Reviewed by: jhb, markj Differential Revision: https://reviews.freebsd.org/D20543 Modified: stable/12/usr.sbin/bhyve/pci_virtio_net.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_virtio_net.c Wed Jul 3 19:52:24 2019 (r349691) +++ stable/12/usr.sbin/bhyve/pci_virtio_net.c Wed Jul 3 19:54:37 2019 (r349692) @@ -147,14 +147,13 @@ struct pci_vtnet_softc { struct nm_desc *vsc_nmd; int vsc_rx_ready; - volatile int resetting; /* set and checked outside lock */ + int resetting; /* protected by tx_mtx */ uint64_t vsc_features; /* negotiated features */ struct virtio_net_config vsc_config; pthread_mutex_t rx_mtx; - int rx_in_progress; int rx_vhdrlen; int rx_merge; /* merged rx bufs in use */ @@ -186,62 +185,39 @@ static struct virtio_consts vtnet_vi_consts = { VTNET_S_HOSTCAPS, /* our capabilities */ }; -/* - * If the transmit thread is active then stall until it is done. - */ static void -pci_vtnet_txwait(struct pci_vtnet_softc *sc) +pci_vtnet_reset(void *vsc) { + struct pci_vtnet_softc *sc = vsc; + DPRINTF(("vtnet: device reset requested !\n")); + + /* Acquire the RX lock to block RX processing. */ + pthread_mutex_lock(&sc->rx_mtx); + + /* Set sc->resetting and give a chance to the TX thread to stop. */ pthread_mutex_lock(&sc->tx_mtx); + sc->resetting = 1; while (sc->tx_in_progress) { pthread_mutex_unlock(&sc->tx_mtx); usleep(10000); pthread_mutex_lock(&sc->tx_mtx); } - pthread_mutex_unlock(&sc->tx_mtx); -} -/* - * If the receive thread is active then stall until it is done. - */ -static void -pci_vtnet_rxwait(struct pci_vtnet_softc *sc) -{ - - pthread_mutex_lock(&sc->rx_mtx); - while (sc->rx_in_progress) { - pthread_mutex_unlock(&sc->rx_mtx); - usleep(10000); - pthread_mutex_lock(&sc->rx_mtx); - } - pthread_mutex_unlock(&sc->rx_mtx); -} - -static void -pci_vtnet_reset(void *vsc) -{ - struct pci_vtnet_softc *sc = vsc; - - DPRINTF(("vtnet: device reset requested !\n")); - - sc->resetting = 1; - - /* - * Wait for the transmit and receive threads to finish their - * processing. - */ - pci_vtnet_txwait(sc); - pci_vtnet_rxwait(sc); - sc->vsc_rx_ready = 0; sc->rx_merge = 1; sc->rx_vhdrlen = sizeof(struct virtio_net_rxhdr); - /* now reset rings, MSI-X vectors, and negotiated capabilities */ + /* + * Now reset rings, MSI-X vectors, and negotiated capabilities. + * Do that with the TX lock held, since we need to reset + * sc->resetting. + */ vi_reset_dev(&sc->vsc_vs); sc->resetting = 0; + pthread_mutex_unlock(&sc->tx_mtx); + pthread_mutex_unlock(&sc->rx_mtx); } /* @@ -315,9 +291,9 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc *sc) /* * But, will be called when the rx ring hasn't yet - * been set up or the guest is resetting the device. + * been set up. */ - if (!sc->vsc_rx_ready || sc->resetting) { + if (!sc->vsc_rx_ready) { /* * Drop the packet and try later. */ @@ -512,9 +488,9 @@ pci_vtnet_netmap_rx(struct pci_vtnet_softc *sc) /* * But, will be called when the rx ring hasn't yet - * been set up or the guest is resetting the device. + * been set up. */ - if (!sc->vsc_rx_ready || sc->resetting) { + if (!sc->vsc_rx_ready) { /* * Drop the packet and try later. */ @@ -591,9 +567,7 @@ pci_vtnet_rx_callback(int fd, enum ev_type type, void struct pci_vtnet_softc *sc = param; pthread_mutex_lock(&sc->rx_mtx); - sc->rx_in_progress = 1; sc->pci_vtnet_rx(sc); - sc->rx_in_progress = 0; pthread_mutex_unlock(&sc->rx_mtx); } @@ -918,7 +892,6 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * sc->rx_merge = 1; sc->rx_vhdrlen = sizeof(struct virtio_net_rxhdr); - sc->rx_in_progress = 0; pthread_mutex_init(&sc->rx_mtx, NULL); /* From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:56:07 2019 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 6E2EA15DF692; Wed, 3 Jul 2019 19:56:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13E008E519; Wed, 3 Jul 2019 19:56:07 +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 D3AB3188CB; Wed, 3 Jul 2019 19:56:06 +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 x63Ju6U2080254; Wed, 3 Jul 2019 19:56:06 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63Ju5g7080248; Wed, 3 Jul 2019 19:56:05 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907031956.x63Ju5g7080248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 3 Jul 2019 19:56: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: r349694 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 349694 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 13E008E519 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 19:56:07 -0000 Author: vmaffione Date: Wed Jul 3 19:56:05 2019 New Revision: 349694 URL: https://svnweb.freebsd.org/changeset/base/349694 Log: MFC r348929 bhyve: virtio: introduce vq_kick_enable() and vq_kick_disable() The VirtIO standard supports two schemes for notification suppression: a notification enable bit and a more sophisticated one (event_idx) that also supports delayed notifications. Currently bhyve fully supports only the first scheme. This patch hides the notification suppression internals by means of two inline routines, vq_kick_enable() and vq_kick_disable(), and makes the code more readable. Moreover, further improve readability by replacing the call to mb() with a call to atomic_thread_fence_seq_cst(), which is already used in virtio.c Reviewed by: pmooney_pfmooney.com, bryanv Differential Revision: https://reviews.freebsd.org/D20581 Modified: stable/12/usr.sbin/bhyve/pci_virtio_console.c stable/12/usr.sbin/bhyve/pci_virtio_net.c stable/12/usr.sbin/bhyve/pci_virtio_scsi.c stable/12/usr.sbin/bhyve/virtio.c stable/12/usr.sbin/bhyve/virtio.h Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_virtio_console.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_virtio_console.c Wed Jul 3 19:54:56 2019 (r349693) +++ stable/12/usr.sbin/bhyve/pci_virtio_console.c Wed Jul 3 19:56:05 2019 (r349694) @@ -604,7 +604,7 @@ pci_vtcon_notify_rx(void *vsc, struct vqueue_info *vq) if (!port->vsp_rx_ready) { port->vsp_rx_ready = 1; - vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; + vq_kick_disable(vq); } } Modified: stable/12/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_virtio_net.c Wed Jul 3 19:54:56 2019 (r349693) +++ stable/12/usr.sbin/bhyve/pci_virtio_net.c Wed Jul 3 19:56:05 2019 (r349694) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #ifndef NETMAP_WITH_LIBS #define NETMAP_WITH_LIBS @@ -582,7 +581,7 @@ pci_vtnet_ping_rxq(void *vsc, struct vqueue_info *vq) */ if (sc->vsc_rx_ready == 0) { sc->vsc_rx_ready = 1; - vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; + vq_kick_disable(vq); } } @@ -628,7 +627,7 @@ pci_vtnet_ping_txq(void *vsc, struct vqueue_info *vq) /* Signal the tx thread for processing */ pthread_mutex_lock(&sc->tx_mtx); - vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; + vq_kick_disable(vq); if (sc->tx_in_progress == 0) pthread_cond_signal(&sc->tx_cond); pthread_mutex_unlock(&sc->tx_mtx); @@ -657,8 +656,7 @@ pci_vtnet_tx_thread(void *param) for (;;) { /* note - tx mutex is locked here */ while (sc->resetting || !vq_has_descs(vq)) { - vq->vq_used->vu_flags &= ~VRING_USED_F_NO_NOTIFY; - mb(); + vq_kick_enable(vq); if (!sc->resetting && vq_has_descs(vq)) break; @@ -666,7 +664,7 @@ pci_vtnet_tx_thread(void *param) error = pthread_cond_wait(&sc->tx_cond, &sc->tx_mtx); assert(error == 0); } - vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; + vq_kick_disable(vq); sc->tx_in_progress = 1; pthread_mutex_unlock(&sc->tx_mtx); Modified: stable/12/usr.sbin/bhyve/pci_virtio_scsi.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_virtio_scsi.c Wed Jul 3 19:54:56 2019 (r349693) +++ stable/12/usr.sbin/bhyve/pci_virtio_scsi.c Wed Jul 3 19:56:05 2019 (r349694) @@ -582,7 +582,7 @@ static void pci_vtscsi_eventq_notify(void *vsc, struct vqueue_info *vq) { - vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; + vq_kick_disable(vq); } static void Modified: stable/12/usr.sbin/bhyve/virtio.c ============================================================================== --- stable/12/usr.sbin/bhyve/virtio.c Wed Jul 3 19:54:56 2019 (r349693) +++ stable/12/usr.sbin/bhyve/virtio.c Wed Jul 3 19:56:05 2019 (r349694) @@ -428,7 +428,8 @@ vq_relchain(struct vqueue_info *vq, uint16_t idx, uint /* * Ensure the used descriptor is visible before updating the index. - * This is necessary on ISAs with memory ordering less strict than x86. + * This is necessary on ISAs with memory ordering less strict than x86 + * (and even on x86 to act as a compiler barrier). */ atomic_thread_fence_rel(); vuh->vu_idx = uidx; Modified: stable/12/usr.sbin/bhyve/virtio.h ============================================================================== --- stable/12/usr.sbin/bhyve/virtio.h Wed Jul 3 19:54:56 2019 (r349693) +++ stable/12/usr.sbin/bhyve/virtio.h Wed Jul 3 19:56:05 2019 (r349694) @@ -31,6 +31,8 @@ #ifndef _VIRTIO_H_ #define _VIRTIO_H_ +#include + /* * These are derived from several virtio specifications. * @@ -445,6 +447,26 @@ vq_interrupt(struct virtio_softc *vs, struct vqueue_in pci_lintr_assert(vs->vs_pi); VS_UNLOCK(vs); } +} + +static inline void +vq_kick_enable(struct vqueue_info *vq) +{ + + vq->vq_used->vu_flags &= ~VRING_USED_F_NO_NOTIFY; + /* + * Full memory barrier to make sure the store to vu_flags + * happens before the load from va_idx, which results from + * a subsequent call to vq_has_descs(). + */ + atomic_thread_fence_seq_cst(); +} + +static inline void +vq_kick_disable(struct vqueue_info *vq) +{ + + vq->vq_used->vu_flags |= VRING_USED_F_NO_NOTIFY; } struct iovec; From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:57:25 2019 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 62EB315DF75D; Wed, 3 Jul 2019 19:57:25 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 055AD8E6A8; Wed, 3 Jul 2019 19:57:25 +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 E33C1188CE; Wed, 3 Jul 2019 19:57:24 +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 x63JvOn5080403; Wed, 3 Jul 2019 19:57:24 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63JvOkR080399; Wed, 3 Jul 2019 19:57:24 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907031957.x63JvOkR080399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 3 Jul 2019 19:57: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: r349695 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 349695 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 055AD8E6A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 19:57:25 -0000 Author: vmaffione Date: Wed Jul 3 19:57:23 2019 New Revision: 349695 URL: https://svnweb.freebsd.org/changeset/base/349695 Log: MFC r349019 bhyve: move common code to net_utils.c Both virtio_net and e82545 network frontends have code to validate and generate MAC addresses. These functionalities are replicated in the two files, so we move them in a separate compilation unit. Reviewed by: rgrimes, bryanv, imp, kevans Differential Revision: https://reviews.freebsd.org/D20626 Added: stable/12/usr.sbin/bhyve/net_utils.c - copied unchanged from r349019, head/usr.sbin/bhyve/net_utils.c stable/12/usr.sbin/bhyve/net_utils.h - copied unchanged from r349019, head/usr.sbin/bhyve/net_utils.h Modified: stable/12/usr.sbin/bhyve/Makefile stable/12/usr.sbin/bhyve/pci_e82545.c stable/12/usr.sbin/bhyve/pci_virtio_net.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/Makefile ============================================================================== --- stable/12/usr.sbin/bhyve/Makefile Wed Jul 3 19:56:05 2019 (r349694) +++ stable/12/usr.sbin/bhyve/Makefile Wed Jul 3 19:57:23 2019 (r349695) @@ -32,6 +32,7 @@ SRCS= \ mem.c \ mevent.c \ mptbl.c \ + net_utils.c \ pci_ahci.c \ pci_e82545.c \ pci_emul.c \ Copied: stable/12/usr.sbin/bhyve/net_utils.c (from r349019, head/usr.sbin/bhyve/net_utils.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/bhyve/net_utils.c Wed Jul 3 19:57:23 2019 (r349695, copy of r349019, head/usr.sbin/bhyve/net_utils.c) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 2011 NetApp, Inc. + * + * 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 "net_utils.h" +#include "bhyverun.h" +#include +#include +#include +#include +#include + +int +net_parsemac(char *mac_str, uint8_t *mac_addr) +{ + struct ether_addr *ea; + char *tmpstr; + char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 }; + + tmpstr = strsep(&mac_str,"="); + + if ((mac_str != NULL) && (!strcmp(tmpstr,"mac"))) { + ea = ether_aton(mac_str); + + if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || + memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { + fprintf(stderr, "Invalid MAC %s\n", mac_str); + return (EINVAL); + } else + memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); + } + + return (0); +} + +void +net_genmac(struct pci_devinst *pi, uint8_t *macaddr) +{ + /* + * The default MAC address is the standard NetApp OUI of 00-a0-98, + * followed by an MD5 of the PCI slot/func number and dev name + */ + MD5_CTX mdctx; + unsigned char digest[16]; + char nstr[80]; + + snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, + pi->pi_func, vmname); + + MD5Init(&mdctx); + MD5Update(&mdctx, nstr, (unsigned int)strlen(nstr)); + MD5Final(digest, &mdctx); + + macaddr[0] = 0x00; + macaddr[1] = 0xa0; + macaddr[2] = 0x98; + macaddr[3] = digest[0]; + macaddr[4] = digest[1]; + macaddr[5] = digest[2]; +} Copied: stable/12/usr.sbin/bhyve/net_utils.h (from r349019, head/usr.sbin/bhyve/net_utils.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/bhyve/net_utils.h Wed Jul 3 19:57:23 2019 (r349695, copy of r349019, head/usr.sbin/bhyve/net_utils.h) @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2019 Vincenzo Maffione + * + * 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$ + */ + +#ifndef _NET_UTILS_H_ +#define _NET_UTILS_H_ + +#include +#include "pci_emul.h" + +void net_genmac(struct pci_devinst *pi, uint8_t *macaddr); +int net_parsemac(char *mac_str, uint8_t *mac_addr); + +#endif /* _NET_UTILS_H_ */ Modified: stable/12/usr.sbin/bhyve/pci_e82545.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_e82545.c Wed Jul 3 19:56:05 2019 (r349694) +++ stable/12/usr.sbin/bhyve/pci_e82545.c Wed Jul 3 19:57:23 2019 (r349695) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include "bhyverun.h" #include "pci_emul.h" #include "mevent.h" +#include "net_utils.h" /* Hardware/register definitions XXX: move some to common code. */ #define E82545_VENDOR_ID_INTEL 0x8086 @@ -2256,38 +2257,16 @@ e82545_open_tap(struct e82545_softc *sc, char *opts) } static int -e82545_parsemac(char *mac_str, uint8_t *mac_addr) -{ - struct ether_addr *ea; - char *tmpstr; - char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 }; - - tmpstr = strsep(&mac_str,"="); - if ((mac_str != NULL) && (!strcmp(tmpstr,"mac"))) { - ea = ether_aton(mac_str); - if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || - memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { - fprintf(stderr, "Invalid MAC %s\n", mac_str); - return (1); - } else - memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); - } - return (0); -} - -static int e82545_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) { - DPRINTF("Loading with options: %s\r\n", opts); - - MD5_CTX mdctx; - unsigned char digest[16]; char nstr[80]; struct e82545_softc *sc; char *devname; char *vtopts; int mac_provided; + DPRINTF("Loading with options: %s\r\n", opts); + /* Setup our softc */ sc = calloc(1, sizeof(*sc)); @@ -2337,7 +2316,7 @@ e82545_init(struct vmctx *ctx, struct pci_devinst *pi, (void) strsep(&vtopts, ","); if (vtopts != NULL) { - err = e82545_parsemac(vtopts, sc->esc_mac.octet); + err = net_parsemac(vtopts, sc->esc_mac.octet); if (err != 0) { free(devname); return (err); @@ -2352,24 +2331,8 @@ e82545_init(struct vmctx *ctx, struct pci_devinst *pi, free(devname); } - /* - * The default MAC address is the standard NetApp OUI of 00-a0-98, - * followed by an MD5 of the PCI slot/func number and dev name - */ if (!mac_provided) { - snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, - pi->pi_func, vmname); - - MD5Init(&mdctx); - MD5Update(&mdctx, nstr, strlen(nstr)); - MD5Final(digest, &mdctx); - - sc->esc_mac.octet[0] = 0x00; - sc->esc_mac.octet[1] = 0xa0; - sc->esc_mac.octet[2] = 0x98; - sc->esc_mac.octet[3] = digest[0]; - sc->esc_mac.octet[4] = digest[1]; - sc->esc_mac.octet[5] = digest[2]; + net_genmac(pi, sc->esc_mac.octet); } /* H/w initiated reset */ Modified: stable/12/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_virtio_net.c Wed Jul 3 19:56:05 2019 (r349694) +++ stable/12/usr.sbin/bhyve/pci_virtio_net.c Wed Jul 3 19:57:23 2019 (r349695) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include "pci_emul.h" #include "mevent.h" #include "virtio.h" +#include "net_utils.h" #define VTNET_RINGSZ 1024 @@ -695,29 +696,6 @@ pci_vtnet_ping_ctlq(void *vsc, struct vqueue_info *vq) } #endif -static int -pci_vtnet_parsemac(char *mac_str, uint8_t *mac_addr) -{ - struct ether_addr *ea; - char *tmpstr; - char zero_addr[ETHER_ADDR_LEN] = { 0, 0, 0, 0, 0, 0 }; - - tmpstr = strsep(&mac_str,"="); - - if ((mac_str != NULL) && (!strcmp(tmpstr,"mac"))) { - ea = ether_aton(mac_str); - - if (ea == NULL || ETHER_IS_MULTICAST(ea->octet) || - memcmp(ea->octet, zero_addr, ETHER_ADDR_LEN) == 0) { - fprintf(stderr, "Invalid MAC %s\n", mac_str); - return (EINVAL); - } else - memcpy(mac_addr, ea->octet, ETHER_ADDR_LEN); - } - - return (0); -} - static void pci_vtnet_tap_setup(struct pci_vtnet_softc *sc, char *devname) { @@ -792,9 +770,6 @@ pci_vtnet_netmap_setup(struct pci_vtnet_softc *sc, cha static int pci_vtnet_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts) { - MD5_CTX mdctx; - unsigned char digest[16]; - char nstr[80]; char tname[MAXCOMLEN + 1]; struct pci_vtnet_softc *sc; char *devname; @@ -831,7 +806,7 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * (void) strsep(&vtopts, ","); if (vtopts != NULL) { - err = pci_vtnet_parsemac(vtopts, sc->vsc_config.mac); + err = net_parsemac(vtopts, sc->vsc_config.mac); if (err != 0) { free(devname); return (err); @@ -848,24 +823,8 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_devinst * free(devname); } - /* - * The default MAC address is the standard NetApp OUI of 00-a0-98, - * followed by an MD5 of the PCI slot/func number and dev name - */ if (!mac_provided) { - snprintf(nstr, sizeof(nstr), "%d-%d-%s", pi->pi_slot, - pi->pi_func, vmname); - - MD5Init(&mdctx); - MD5Update(&mdctx, nstr, strlen(nstr)); - MD5Final(digest, &mdctx); - - sc->vsc_config.mac[0] = 0x00; - sc->vsc_config.mac[1] = 0xa0; - sc->vsc_config.mac[2] = 0x98; - sc->vsc_config.mac[3] = digest[0]; - sc->vsc_config.mac[4] = digest[1]; - sc->vsc_config.mac[5] = digest[2]; + net_genmac(pi, sc->vsc_config.mac); } /* initialize config space */ From owner-svn-src-stable-12@freebsd.org Wed Jul 3 19:59:49 2019 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 3CFCD15DF7F8; Wed, 3 Jul 2019 19:59:49 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D616A8E80B; Wed, 3 Jul 2019 19:59:48 +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 9D38F188CF; Wed, 3 Jul 2019 19:59:48 +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 x63Jxms6080576; Wed, 3 Jul 2019 19:59:48 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63Jxmxr080575; Wed, 3 Jul 2019 19:59:48 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201907031959.x63Jxmxr080575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Wed, 3 Jul 2019 19:59: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: r349696 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 349696 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D616A8E80B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 19:59:49 -0000 Author: vmaffione Date: Wed Jul 3 19:59:48 2019 New Revision: 349696 URL: https://svnweb.freebsd.org/changeset/base/349696 Log: MFC r349175 bhyve: vtnet: fix locking on receive The vsc_rx_ready and the RX virtqueue is protected by the rx_mtx lock. However, pci_vtnet_ping_rxq() (currently called only once after each device reset) accesses those without acquiring the lock. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D20609 Modified: stable/12/usr.sbin/bhyve/pci_virtio_net.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_virtio_net.c Wed Jul 3 19:57:23 2019 (r349695) +++ stable/12/usr.sbin/bhyve/pci_virtio_net.c Wed Jul 3 19:59:48 2019 (r349696) @@ -580,10 +580,12 @@ pci_vtnet_ping_rxq(void *vsc, struct vqueue_info *vq) /* * A qnotify means that the rx process can now begin */ + pthread_mutex_lock(&sc->rx_mtx); if (sc->vsc_rx_ready == 0) { sc->vsc_rx_ready = 1; vq_kick_disable(vq); } + pthread_mutex_unlock(&sc->rx_mtx); } static void From owner-svn-src-stable-12@freebsd.org Wed Jul 3 20:14:44 2019 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 6A01815DFE1C; Wed, 3 Jul 2019 20:14:44 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F9DE8F7A1; Wed, 3 Jul 2019 20:14:44 +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 DE5E118C52; Wed, 3 Jul 2019 20:14:43 +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 x63KEh0v091246; Wed, 3 Jul 2019 20:14:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63KEhrU091245; Wed, 3 Jul 2019 20:14:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907032014.x63KEhrU091245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 20:14: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: r349699 - stable/12/sys/fs/smbfs X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/fs/smbfs X-SVN-Commit-Revision: 349699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F9DE8F7A1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 20:14:44 -0000 Author: markj Date: Wed Jul 3 20:14:43 2019 New Revision: 349699 URL: https://svnweb.freebsd.org/changeset/base/349699 Log: MFC r349334: Remove a lingering use of splbio(). Modified: stable/12/sys/fs/smbfs/smbfs_io.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/smbfs/smbfs_io.c ============================================================================== --- stable/12/sys/fs/smbfs/smbfs_io.c Wed Jul 3 20:05:25 2019 (r349698) +++ stable/12/sys/fs/smbfs/smbfs_io.c Wed Jul 3 20:14:43 2019 (r349699) @@ -375,9 +375,6 @@ smbfs_doio(struct vnode *vp, struct buf *bp, struct uc */ if (error == EINTR || (!error && (bp->b_flags & B_NEEDCOMMIT))) { - int s; - - s = splbio(); bp->b_flags &= ~(B_INVAL|B_NOCACHE); if ((bp->b_flags & B_ASYNC) == 0) bp->b_flags |= B_EINTR; @@ -387,7 +384,6 @@ smbfs_doio(struct vnode *vp, struct buf *bp, struct uc } if ((bp->b_flags & B_ASYNC) == 0) bp->b_flags |= B_EINTR; - splx(s); } else { if (error) { bp->b_ioflags |= BIO_ERROR; From owner-svn-src-stable-12@freebsd.org Wed Jul 3 20:15:11 2019 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 DFEAE15DFE5A; Wed, 3 Jul 2019 20:15:10 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4589A8F8D1; Wed, 3 Jul 2019 20:15:10 +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 214F318C53; Wed, 3 Jul 2019 20:15:10 +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 x63KFAIp091319; Wed, 3 Jul 2019 20:15:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63KF9a5091318; Wed, 3 Jul 2019 20:15:09 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907032015.x63KF9a5091318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 20:15: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: r349700 - stable/12/sys/ufs/ffs X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/ufs/ffs X-SVN-Commit-Revision: 349700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4589A8F8D1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 20:15:11 -0000 Author: markj Date: Wed Jul 3 20:15:09 2019 New Revision: 349700 URL: https://svnweb.freebsd.org/changeset/base/349700 Log: MFC r349419: Remove references to splbio in ffs_softdep.c. Modified: stable/12/sys/ufs/ffs/ffs_softdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- stable/12/sys/ufs/ffs/ffs_softdep.c Wed Jul 3 20:14:43 2019 (r349699) +++ stable/12/sys/ufs/ffs/ffs_softdep.c Wed Jul 3 20:15:09 2019 (r349700) @@ -2098,7 +2098,6 @@ pagedep_find(pagedephd, ino, lbn, pagedeppp) * Look up a pagedep. Return 1 if found, 0 otherwise. * If not found, allocate if DEPALLOC flag is passed. * Found or allocated entry is returned in pagedeppp. - * This routine must be called with splbio interrupts blocked. */ static int pagedep_lookup(mp, bp, ino, lbn, flags, pagedeppp) @@ -2190,7 +2189,6 @@ inodedep_find(inodedephd, inum, inodedeppp) * Look up an inodedep. Return 1 if found, 0 if not found. * If not found, allocate if DEPALLOC flag is passed. * Found or allocated entry is returned in inodedeppp. - * This routine must be called with splbio interrupts blocked. */ static int inodedep_lookup(mp, inum, flags, inodedeppp) @@ -5466,7 +5464,6 @@ jnewblk_merge(new, old, wkhd) /* * Replace an old allocdirect dependency with a newer one. - * This routine must be called with splbio interrupts blocked. */ static void allocdirect_merge(adphead, newadp, oldadp) @@ -7519,7 +7516,6 @@ free_newblk(newblk) /* * Free a newdirblk. Clear the NEWBLOCK flag on its associated pagedep. - * This routine must be called with splbio interrupts blocked. */ static void free_newdirblk(newdirblk) @@ -7650,7 +7646,6 @@ softdep_freefile(pvp, ino, mode) /* * Check to see if an inode has never been written to disk. If * so free the inodedep and return success, otherwise return failure. - * This routine must be called with splbio interrupts blocked. * * If we still have a bitmap dependency, then the inode has never * been written to disk. Drop the dependency as it is no longer @@ -8882,8 +8877,7 @@ cancel_diradd(dap, dirrem, jremref, dotremref, dotdotr } /* - * Free a diradd dependency structure. This routine must be called - * with splbio interrupts blocked. + * Free a diradd dependency structure. */ static void free_diradd(dap, wkhd) @@ -11168,9 +11162,7 @@ softdep_disk_write_complete(bp) } /* - * Called from within softdep_disk_write_complete above. Note that - * this routine is always called from interrupt level with further - * splbio interrupts blocked. + * Called from within softdep_disk_write_complete above. */ static void handle_allocdirect_partdone(adp, wkhd) @@ -11182,6 +11174,7 @@ handle_allocdirect_partdone(adp, wkhd) struct inodedep *inodedep; long bsize; + LOCK_OWNED(VFSTOUFS(adp->ad_block.nb_list.wk_mp)); if ((adp->ad_state & ALLCOMPLETE) != ALLCOMPLETE) return; /* @@ -11788,7 +11781,6 @@ handle_written_indirdep(indirdep, bp, bpp, flags) /* * Process a diradd entry after its dependent inode has been written. - * This routine must be called with splbio interrupts blocked. */ static void diradd_inode_written(dap, inodedep) @@ -11796,6 +11788,7 @@ diradd_inode_written(dap, inodedep) struct inodedep *inodedep; { + LOCK_OWNED(VFSTOUFS(dap->da_list.wk_mp)); dap->da_state |= COMPLETE; complete_diradd(dap); WORKLIST_INSERT(&inodedep->id_pendinghd, &dap->da_list); @@ -12356,8 +12349,7 @@ retry: /* * Merge the a new inode dependency list (such as id_newinoupdt) into an - * old inode dependency list (such as id_inoupdt). This routine must be - * called with splbio interrupts blocked. + * old inode dependency list (such as id_inoupdt). */ static void merge_inode_lists(newlisthead, oldlisthead) @@ -12367,6 +12359,8 @@ merge_inode_lists(newlisthead, oldlisthead) struct allocdirect *listadp, *newadp; newadp = TAILQ_FIRST(newlisthead); + if (newadp != NULL) + LOCK_OWNED(VFSTOUFS(newadp->ad_block.nb_list.wk_mp)); for (listadp = TAILQ_FIRST(oldlisthead); listadp && newadp;) { if (listadp->ad_offset < newadp->ad_offset) { listadp = TAILQ_NEXT(listadp, ad_next); @@ -12861,7 +12855,6 @@ out: /* * Flush the dependencies associated with an inodedep. - * Called with splbio blocked. */ static int flush_inodedep_deps(vp, mp, ino) @@ -12926,7 +12919,6 @@ restart: /* * Flush an inode dependency list. - * Called with splbio blocked. */ static int flush_deplist(listhead, waitfor, errorp) @@ -13068,7 +13060,6 @@ flush_newblk_dep(vp, mp, lbn) /* * Eliminate a pagedep dependency by flushing out all its diradd dependencies. - * Called with splbio blocked. */ static int flush_pagedep_deps(pvp, mp, diraddhdp) From owner-svn-src-stable-12@freebsd.org Wed Jul 3 20:17:29 2019 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 44C0615DFF17; Wed, 3 Jul 2019 20:17:29 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E05F48FA52; Wed, 3 Jul 2019 20:17:28 +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 99C8718C54; Wed, 3 Jul 2019 20:17:28 +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 x63KHS9F091460; Wed, 3 Jul 2019 20:17:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63KHRpp091453; Wed, 3 Jul 2019 20:17:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907032017.x63KHRpp091453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 20:17: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: r349701 - in stable/12/sys: amd64/sgx dev/drm2/ttm vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: amd64/sgx dev/drm2/ttm vm X-SVN-Commit-Revision: 349701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E05F48FA52 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 20:17:29 -0000 Author: markj Date: Wed Jul 3 20:17:26 2019 New Revision: 349701 URL: https://svnweb.freebsd.org/changeset/base/349701 Log: MFC r349432: Add a return value to vm_page_remove(). Modified: stable/12/sys/amd64/sgx/sgx.c stable/12/sys/dev/drm2/ttm/ttm_bo_vm.c stable/12/sys/vm/device_pager.c stable/12/sys/vm/vm_fault.c stable/12/sys/vm/vm_object.c stable/12/sys/vm/vm_page.c stable/12/sys/vm/vm_page.h Modified: stable/12/sys/amd64/sgx/sgx.c ============================================================================== --- stable/12/sys/amd64/sgx/sgx.c Wed Jul 3 20:15:09 2019 (r349700) +++ stable/12/sys/amd64/sgx/sgx.c Wed Jul 3 20:17:26 2019 (r349701) @@ -358,7 +358,7 @@ sgx_page_remove(struct sgx_softc *sc, vm_page_t p) uint64_t offs; vm_page_lock(p); - vm_page_remove(p); + (void)vm_page_remove(p); vm_page_unlock(p); dprintf("%s: p->pidx %ld\n", __func__, p->pindex); Modified: stable/12/sys/dev/drm2/ttm/ttm_bo_vm.c ============================================================================== --- stable/12/sys/dev/drm2/ttm/ttm_bo_vm.c Wed Jul 3 20:15:09 2019 (r349700) +++ stable/12/sys/dev/drm2/ttm/ttm_bo_vm.c Wed Jul 3 20:17:26 2019 (r349701) @@ -115,7 +115,7 @@ ttm_bo_vm_fault(vm_object_t vm_obj, vm_ooffset_t offse vm_object_pip_add(vm_obj, 1); if (*mres != NULL) { vm_page_lock(*mres); - vm_page_remove(*mres); + (void)vm_page_remove(*mres); vm_page_unlock(*mres); } retry: Modified: stable/12/sys/vm/device_pager.c ============================================================================== --- stable/12/sys/vm/device_pager.c Wed Jul 3 20:15:09 2019 (r349700) +++ stable/12/sys/vm/device_pager.c Wed Jul 3 20:17:26 2019 (r349701) @@ -236,7 +236,7 @@ cdev_pager_free_page(vm_object_t object, vm_page_t m) KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("unmanaged %p", m)); pmap_remove_all(m); vm_page_lock(m); - vm_page_remove(m); + (void)vm_page_remove(m); vm_page_unlock(m); } else if (object->type == OBJT_DEVICE) dev_pager_free_page(object, m); Modified: stable/12/sys/vm/vm_fault.c ============================================================================== --- stable/12/sys/vm/vm_fault.c Wed Jul 3 20:15:09 2019 (r349700) +++ stable/12/sys/vm/vm_fault.c Wed Jul 3 20:17:26 2019 (r349701) @@ -1144,7 +1144,7 @@ readrest: fs.object == fs.first_object->backing_object) { vm_page_lock(fs.m); vm_page_dequeue(fs.m); - vm_page_remove(fs.m); + (void)vm_page_remove(fs.m); vm_page_unlock(fs.m); vm_page_lock(fs.first_m); vm_page_replace_checked(fs.m, fs.first_object, Modified: stable/12/sys/vm/vm_object.c ============================================================================== --- stable/12/sys/vm/vm_object.c Wed Jul 3 20:15:09 2019 (r349700) +++ stable/12/sys/vm/vm_object.c Wed Jul 3 20:17:26 2019 (r349701) @@ -1595,10 +1595,8 @@ vm_object_collapse_scan(vm_object_t object, int op) vm_page_lock(p); KASSERT(!pmap_page_is_mapped(p), ("freeing mapped page %p", p)); - if (!vm_page_wired(p)) + if (vm_page_remove(p)) vm_page_free(p); - else - vm_page_remove(p); vm_page_unlock(p); continue; } @@ -1639,10 +1637,8 @@ vm_object_collapse_scan(vm_object_t object, int op) vm_page_lock(p); KASSERT(!pmap_page_is_mapped(p), ("freeing mapped page %p", p)); - if (!vm_page_wired(p)) + if (vm_page_remove(p)) vm_page_free(p); - else - vm_page_remove(p); vm_page_unlock(p); continue; } Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Wed Jul 3 20:15:09 2019 (r349700) +++ stable/12/sys/vm/vm_page.c Wed Jul 3 20:17:26 2019 (r349701) @@ -1454,20 +1454,21 @@ vm_page_insert_radixdone(vm_page_t m, vm_object_t obje * vm_page_remove: * * Removes the specified page from its containing object, but does not - * invalidate any backing storage. + * invalidate any backing storage. Return true if the page may be safely + * freed and false otherwise. * * The object must be locked. The page must be locked if it is managed. */ -void +bool vm_page_remove(vm_page_t m) { vm_object_t object; vm_page_t mrem; + object = m->object; + if ((m->oflags & VPO_UNMANAGED) == 0) vm_page_assert_locked(m); - if ((object = m->object) == NULL) - return; VM_OBJECT_ASSERT_WLOCKED(object); if (vm_page_xbusied(m)) vm_page_xunbusy_maybelocked(m); @@ -1491,6 +1492,7 @@ vm_page_remove(vm_page_t m) vdrop(object->handle); m->object = NULL; + return (!vm_page_wired(m)); } /* @@ -1661,7 +1663,7 @@ vm_page_rename(vm_page_t m, vm_object_t new_object, vm */ m->pindex = opidx; vm_page_lock(m); - vm_page_remove(m); + (void)vm_page_remove(m); /* Return back to the new pindex to complete vm_page_insert(). */ m->pindex = new_pindex; @@ -3434,7 +3436,8 @@ vm_page_free_prep(vm_page_t m) if (vm_page_sbusied(m)) panic("vm_page_free_prep: freeing busy page %p", m); - vm_page_remove(m); + if (m->object != NULL) + (void)vm_page_remove(m); /* * If fictitious remove object association and Modified: stable/12/sys/vm/vm_page.h ============================================================================== --- stable/12/sys/vm/vm_page.h Wed Jul 3 20:15:09 2019 (r349700) +++ stable/12/sys/vm/vm_page.h Wed Jul 3 20:17:26 2019 (r349701) @@ -559,7 +559,7 @@ bool vm_page_reclaim_contig(int req, u_long npages, vm bool vm_page_reclaim_contig_domain(int domain, int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary); void vm_page_reference(vm_page_t m); -void vm_page_remove (vm_page_t); +bool vm_page_remove(vm_page_t); int vm_page_rename (vm_page_t, vm_object_t, vm_pindex_t); vm_page_t vm_page_replace(vm_page_t mnew, vm_object_t object, vm_pindex_t pindex); From owner-svn-src-stable-12@freebsd.org Wed Jul 3 20:18:06 2019 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 4144415DFF5F; Wed, 3 Jul 2019 20:18:06 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD49A8FB7A; Wed, 3 Jul 2019 20:18:05 +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 A08C218C55; Wed, 3 Jul 2019 20:18:05 +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 x63KI5es091526; Wed, 3 Jul 2019 20:18:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63KI5sY091525; Wed, 3 Jul 2019 20:18:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907032018.x63KI5sY091525@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 20:18: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: r349702 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 349702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD49A8FB7A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 20:18:06 -0000 Author: markj Date: Wed Jul 3 20:18:05 2019 New Revision: 349702 URL: https://svnweb.freebsd.org/changeset/base/349702 Log: Add mergeinfo missed in r349701. Modified: Directory Properties: stable/12/ (props changed) From owner-svn-src-stable-12@freebsd.org Wed Jul 3 20:18:50 2019 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 66AA115DFFCE; Wed, 3 Jul 2019 20:18: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0CAEF8FCAB; Wed, 3 Jul 2019 20:18:50 +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 DD36D18C56; Wed, 3 Jul 2019 20:18: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 x63KInuu091599; Wed, 3 Jul 2019 20:18:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63KInW3091598; Wed, 3 Jul 2019 20:18:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907032018.x63KInW3091598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 20:18: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: r349703 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 349703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0CAEF8FCAB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 20:18:50 -0000 Author: markj Date: Wed Jul 3 20:18:49 2019 New Revision: 349703 URL: https://svnweb.freebsd.org/changeset/base/349703 Log: MFC r349218: Group vm_page_activate()'s definition with other related functions. Modified: stable/12/sys/vm/vm_page.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_page.c ============================================================================== --- stable/12/sys/vm/vm_page.c Wed Jul 3 20:18:05 2019 (r349702) +++ stable/12/sys/vm/vm_page.c Wed Jul 3 20:18:49 2019 (r349703) @@ -3372,35 +3372,6 @@ vm_page_requeue(vm_page_t m) } /* - * vm_page_activate: - * - * Put the specified page on the active list (if appropriate). - * Ensure that act_count is at least ACT_INIT but do not otherwise - * mess with it. - * - * The page must be locked. - */ -void -vm_page_activate(vm_page_t m) -{ - - vm_page_assert_locked(m); - - if (vm_page_wired(m) || (m->oflags & VPO_UNMANAGED) != 0) - return; - if (vm_page_queue(m) == PQ_ACTIVE) { - if (m->act_count < ACT_INIT) - m->act_count = ACT_INIT; - return; - } - - vm_page_dequeue(m); - if (m->act_count < ACT_INIT) - m->act_count = ACT_INIT; - vm_page_enqueue(m, PQ_ACTIVE); -} - -/* * vm_page_free_prep: * * Prepares the given page to be put on the free list, @@ -3649,6 +3620,35 @@ vm_page_unwire_noq(vm_page_t m) return (true); } else return (false); +} + +/* + * vm_page_activate: + * + * Put the specified page on the active list (if appropriate). + * Ensure that act_count is at least ACT_INIT but do not otherwise + * mess with it. + * + * The page must be locked. + */ +void +vm_page_activate(vm_page_t m) +{ + + vm_page_assert_locked(m); + + if (vm_page_wired(m) || (m->oflags & VPO_UNMANAGED) != 0) + return; + if (vm_page_queue(m) == PQ_ACTIVE) { + if (m->act_count < ACT_INIT) + m->act_count = ACT_INIT; + return; + } + + vm_page_dequeue(m); + if (m->act_count < ACT_INIT) + m->act_count = ACT_INIT; + vm_page_enqueue(m, PQ_ACTIVE); } /* From owner-svn-src-stable-12@freebsd.org Wed Jul 3 20:52:08 2019 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 C9D6215E0CBB; Wed, 3 Jul 2019 20:52: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 644A66AAB4; Wed, 3 Jul 2019 20:52:08 +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 331B8192D8; Wed, 3 Jul 2019 20:52:08 +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 x63Kq8b3011539; Wed, 3 Jul 2019 20:52:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63Kq8PH011520; Wed, 3 Jul 2019 20:52:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907032052.x63Kq8PH011520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 20:52: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: r349705 - stable/12/contrib/elftoolchain/elfcopy X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 349705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 644A66AAB4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 20:52:09 -0000 Author: markj Date: Wed Jul 3 20:52:07 2019 New Revision: 349705 URL: https://svnweb.freebsd.org/changeset/base/349705 Log: MFC r349423 elfcopy: Provide a size hint when creating the section string table. Modified: stable/12/contrib/elftoolchain/elfcopy/sections.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/sections.c Wed Jul 3 20:22:36 2019 (r349704) +++ stable/12/contrib/elftoolchain/elfcopy/sections.c Wed Jul 3 20:52:07 2019 (r349705) @@ -1398,8 +1398,24 @@ update_shdr(struct elfcopy *ecp, int update_link) void init_shstrtab(struct elfcopy *ecp) { + Elf_Scn *shstrtab; + GElf_Shdr shdr; struct section *s; + size_t indx, sizehint; + if (elf_getshstrndx(ecp->ein, &indx) != 0) { + shstrtab = elf_getscn(ecp->ein, indx); + if (shstrtab == NULL) + errx(EXIT_FAILURE, "elf_getscn failed: %s", + elf_errmsg(-1)); + if (gelf_getshdr(shstrtab, &shdr) != &shdr) + errx(EXIT_FAILURE, "gelf_getshdr failed: %s", + elf_errmsg(-1)); + sizehint = shdr.sh_size; + } else { + sizehint = 0; + } + if ((ecp->shstrtab = calloc(1, sizeof(*ecp->shstrtab))) == NULL) err(EXIT_FAILURE, "calloc failed"); s = ecp->shstrtab; @@ -1410,7 +1426,7 @@ init_shstrtab(struct elfcopy *ecp) s->loadable = 0; s->type = SHT_STRTAB; s->vma = 0; - s->strtab = elftc_string_table_create(0); + s->strtab = elftc_string_table_create(sizehint); add_to_shstrtab(ecp, ""); add_to_shstrtab(ecp, ".symtab"); From owner-svn-src-stable-12@freebsd.org Wed Jul 3 20:53:06 2019 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 7061715E0D67; Wed, 3 Jul 2019 20:53:06 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12A706AD58; Wed, 3 Jul 2019 20:53:06 +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 E5A15192F7; Wed, 3 Jul 2019 20:53:05 +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 x63Kr5qv013179; Wed, 3 Jul 2019 20:53:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63Kr5x5013178; Wed, 3 Jul 2019 20:53:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907032053.x63Kr5x5013178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 20:53: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: r349707 - stable/12/contrib/elftoolchain/libelftc X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/libelftc X-SVN-Commit-Revision: 349707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 12A706AD58 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 20:53:06 -0000 Author: markj Date: Wed Jul 3 20:53:05 2019 New Revision: 349707 URL: https://svnweb.freebsd.org/changeset/base/349707 Log: MFC r349420 libelftc: Micro-optimize string table insertion. Modified: stable/12/contrib/elftoolchain/libelftc/elftc_string_table.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/libelftc/elftc_string_table.c ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc_string_table.c Wed Jul 3 20:52:10 2019 (r349706) +++ stable/12/contrib/elftoolchain/libelftc/elftc_string_table.c Wed Jul 3 20:53:05 2019 (r349707) @@ -119,7 +119,7 @@ elftc_string_table_add_to_pool(Elftc_String_Table *st, st->st_string_pool_size = newsize; } - strcpy(st->st_string_pool + stlen, string); + memcpy(st->st_string_pool + stlen, string, len); ELFTC_STRING_TABLE_UPDATE_LENGTH(st, stlen + len); return (stlen); From owner-svn-src-stable-12@freebsd.org Wed Jul 3 20:54:38 2019 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 03E3B15E0EDC; Wed, 3 Jul 2019 20:54:38 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C2F26B030; Wed, 3 Jul 2019 20:54:37 +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 8B2E7192FA; Wed, 3 Jul 2019 20:54:37 +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 x63KsbHR013291; Wed, 3 Jul 2019 20:54:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63KsaZn013285; Wed, 3 Jul 2019 20:54:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907032054.x63KsaZn013285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 20:54: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: r349708 - stable/12/contrib/elftoolchain/libelftc X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/libelftc X-SVN-Commit-Revision: 349708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9C2F26B030 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 20:54:38 -0000 Author: markj Date: Wed Jul 3 20:54:36 2019 New Revision: 349708 URL: https://svnweb.freebsd.org/changeset/base/349708 Log: MFC r349421: libelftc: Consistently use size_t for string table offsets and sizes. Modified: stable/12/contrib/elftoolchain/libelftc/elftc_string_table.c stable/12/contrib/elftoolchain/libelftc/elftc_string_table_create.3 stable/12/contrib/elftoolchain/libelftc/libelftc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/libelftc/elftc_string_table.c ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc_string_table.c Wed Jul 3 20:53:05 2019 (r349707) +++ stable/12/contrib/elftoolchain/libelftc/elftc_string_table.c Wed Jul 3 20:54:36 2019 (r349708) @@ -44,7 +44,7 @@ ELFTC_VCSID("$Id: elftc_string_table.c 2869 2013-01-06 #define ELFTC_STRING_TABLE_POOL_SIZE_INCREMENT (4*1024) struct _Elftc_String_Table_Entry { - int ste_idx; + ssize_t ste_idx; SLIST_ENTRY(_Elftc_String_Table_Entry) ste_next; }; @@ -64,9 +64,9 @@ struct _Elftc_String_Table_Entry { } while (0) struct _Elftc_String_Table { - unsigned int st_len; /* length and flags */ + size_t st_len; /* length and flags */ int st_nbuckets; - int st_string_pool_size; + size_t st_string_pool_size; char *st_string_pool; SLIST_HEAD(_Elftc_String_Table_Bucket, _Elftc_String_Table_Entry) st_buckets[]; @@ -86,7 +86,7 @@ elftc_string_table_find_hash_entry(Elftc_String_Table *rhashindex = hashindex; SLIST_FOREACH(ste, &st->st_buckets[hashindex], ste_next) { - s = st->st_string_pool + abs(ste->ste_idx); + s = st->st_string_pool + labs(ste->ste_idx); assert(s > st->st_string_pool && s < st->st_string_pool + st->st_string_pool_size); @@ -102,7 +102,7 @@ static int elftc_string_table_add_to_pool(Elftc_String_Table *st, const char *string) { char *newpool; - int len, newsize, stlen; + size_t len, newsize, stlen; len = strlen(string) + 1; /* length, including the trailing NUL */ stlen = ELFTC_STRING_TABLE_LENGTH(st); @@ -126,10 +126,10 @@ elftc_string_table_add_to_pool(Elftc_String_Table *st, } Elftc_String_Table * -elftc_string_table_create(int sizehint) +elftc_string_table_create(size_t sizehint) { - int n, nbuckets, tablesize; struct _Elftc_String_Table *st; + int n, nbuckets, tablesize; if (sizehint < ELFTC_STRING_TABLE_DEFAULT_SIZE) sizehint = ELFTC_STRING_TABLE_DEFAULT_SIZE; @@ -173,13 +173,13 @@ elftc_string_table_destroy(Elftc_String_Table *st) } Elftc_String_Table * -elftc_string_table_from_section(Elf_Scn *scn, int sizehint) +elftc_string_table_from_section(Elf_Scn *scn, size_t sizehint) { - int len; Elf_Data *d; GElf_Shdr sh; const char *s, *end; Elftc_String_Table *st; + size_t len; /* Verify the type of the section passed in. */ if (gelf_getshdr(scn, &sh) == NULL || @@ -235,7 +235,8 @@ elftc_string_table_image(Elftc_String_Table *st, size_ char *r, *s, *end; struct _Elftc_String_Table_Entry *ste; struct _Elftc_String_Table_Bucket *head; - int copied, hashindex, offset, length, newsize; + size_t copied, offset, length, newsize; + int hashindex; /* * For the common case of a string table has not seen @@ -303,8 +304,9 @@ elftc_string_table_image(Elftc_String_Table *st, size_ size_t elftc_string_table_insert(Elftc_String_Table *st, const char *string) { - int hashindex, idx; struct _Elftc_String_Table_Entry *ste; + ssize_t idx; + int hashindex; hashindex = 0; @@ -326,7 +328,7 @@ elftc_string_table_insert(Elftc_String_Table *st, cons idx = ste->ste_idx; if (idx < 0) /* Undelete. */ - ste->ste_idx = idx = (- idx); + ste->ste_idx = idx = -idx; return (idx); } @@ -334,8 +336,9 @@ elftc_string_table_insert(Elftc_String_Table *st, cons size_t elftc_string_table_lookup(Elftc_String_Table *st, const char *string) { - int hashindex, idx; struct _Elftc_String_Table_Entry *ste; + ssize_t idx; + int hashindex; ste = elftc_string_table_find_hash_entry(st, string, &hashindex); @@ -350,17 +353,17 @@ elftc_string_table_lookup(Elftc_String_Table *st, cons int elftc_string_table_remove(Elftc_String_Table *st, const char *string) { - int idx; struct _Elftc_String_Table_Entry *ste; + ssize_t idx; ste = elftc_string_table_find_hash_entry(st, string, NULL); if (ste == NULL || (idx = ste->ste_idx) < 0) return (ELFTC_FAILURE); - assert(idx > 0 && idx < (int) ELFTC_STRING_TABLE_LENGTH(st)); + assert(idx > 0 && (size_t)idx < ELFTC_STRING_TABLE_LENGTH(st)); - ste->ste_idx = (- idx); + ste->ste_idx = -idx; ELFTC_STRING_TABLE_SET_COMPACTION_FLAG(st); Modified: stable/12/contrib/elftoolchain/libelftc/elftc_string_table_create.3 ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Wed Jul 3 20:53:05 2019 (r349707) +++ stable/12/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Wed Jul 3 20:54:36 2019 (r349708) @@ -24,7 +24,7 @@ .\" .\" $Id: elftc_string_table_create.3 3645 2018-10-15 20:17:14Z jkoshy $ .\" -.Dd January 5, 2013 +.Dd June 19, 2019 .Dt ELFTC_STRING_TABLE_CREATE 3 .Os .Sh NAME @@ -40,11 +40,11 @@ .Sh SYNOPSIS .In libelftc.h .Ft "Elftc_String_Table *" -.Fn elftc_string_table_create "int sizehint" +.Fn elftc_string_table_create "size_t sizehint" .Ft int .Fn elftc_string_table_destroy "Elftc_String_Table *table" .Ft "Elftc_String_Table *" -.Fn elftc_string_table_from_section "Elf_Scn *scn" "int sizehint" +.Fn elftc_string_table_from_section "Elf_Scn *scn" "size_t sizehint" .Ft "const char *" .Fo elftc_string_table_image .Fa "Elftc_String_Table *table" Modified: stable/12/contrib/elftoolchain/libelftc/libelftc.h ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/libelftc.h Wed Jul 3 20:53:05 2019 (r349707) +++ stable/12/contrib/elftoolchain/libelftc/libelftc.h Wed Jul 3 20:54:36 2019 (r349708) @@ -77,10 +77,10 @@ int elftc_demangle(const char *_mangledname, char *_b size_t _bufsize, unsigned int _flags); const char *elftc_reloc_type_str(unsigned int mach, unsigned int type); int elftc_set_timestamps(const char *_filename, struct stat *_sb); -Elftc_String_Table *elftc_string_table_create(int _hint); +Elftc_String_Table *elftc_string_table_create(size_t _sizehint); void elftc_string_table_destroy(Elftc_String_Table *_table); Elftc_String_Table *elftc_string_table_from_section(Elf_Scn *_scn, - int _hint); + size_t _sizehint); const char *elftc_string_table_image(Elftc_String_Table *_table, size_t *_sz); size_t elftc_string_table_insert(Elftc_String_Table *_table, From owner-svn-src-stable-12@freebsd.org Wed Jul 3 20:54:53 2019 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 5054B15E0F2C; Wed, 3 Jul 2019 20:54:53 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E85656B133; Wed, 3 Jul 2019 20:54: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 C27E1192FC; Wed, 3 Jul 2019 20:54: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 x63KsqbH013346; Wed, 3 Jul 2019 20:54:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63KsqRn013345; Wed, 3 Jul 2019 20:54:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907032054.x63KsqRn013345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 20:54: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: r349709 - stable/12/contrib/elftoolchain/libelftc X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/libelftc X-SVN-Commit-Revision: 349709 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E85656B133 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 03 Jul 2019 20:54:53 -0000 Author: markj Date: Wed Jul 3 20:54:52 2019 New Revision: 349709 URL: https://svnweb.freebsd.org/changeset/base/349709 Log: MFC r349422: libelftc: Fix the documented prototype for elftc_string_table_destroy(). Modified: stable/12/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/libelftc/elftc_string_table_create.3 ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Wed Jul 3 20:54:36 2019 (r349708) +++ stable/12/contrib/elftoolchain/libelftc/elftc_string_table_create.3 Wed Jul 3 20:54:52 2019 (r349709) @@ -41,7 +41,7 @@ .In libelftc.h .Ft "Elftc_String_Table *" .Fn elftc_string_table_create "size_t sizehint" -.Ft int +.Ft void .Fn elftc_string_table_destroy "Elftc_String_Table *table" .Ft "Elftc_String_Table *" .Fn elftc_string_table_from_section "Elf_Scn *scn" "size_t sizehint" From owner-svn-src-stable-12@freebsd.org Wed Jul 3 20:55:09 2019 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 5BB5215E0F7B; Wed, 3 Jul 2019 20:55:09 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F24246B25D; Wed, 3 Jul 2019 20:55:08 +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 CA597192FD; Wed, 3 Jul 2019 20:55:08 +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 x63Kt8WJ013437; Wed, 3 Jul 2019 20:55:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63Kt8Ng013436; Wed, 3 Jul 2019 20:55:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907032055.x63Kt8Ng013436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Jul 2019 20:55: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: r349710 - stable/12/contrib/elftoolchain/libdwarf X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/libdwarf X-SVN-Commit-Revision: 349710 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F24246B25D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 20:55:09 -0000 Author: markj Date: Wed Jul 3 20:55:08 2019 New Revision: 349710 URL: https://svnweb.freebsd.org/changeset/base/349710 Log: MFC r349424: libdwarf: Use the cached strtab pointer when reading string attributes. Modified: stable/12/contrib/elftoolchain/libdwarf/libdwarf_attr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/libdwarf/libdwarf_attr.c ============================================================================== --- stable/12/contrib/elftoolchain/libdwarf/libdwarf_attr.c Wed Jul 3 20:54:52 2019 (r349709) +++ stable/12/contrib/elftoolchain/libdwarf/libdwarf_attr.c Wed Jul 3 20:55:08 2019 (r349710) @@ -100,7 +100,6 @@ _dwarf_attr_init(Dwarf_Debug dbg, Dwarf_Section *ds, u uint64_t form, int indirect, Dwarf_Error *error) { struct _Dwarf_Attribute atref; - Dwarf_Section *str; int ret; ret = DW_DLE_NONE; @@ -183,9 +182,7 @@ _dwarf_attr_init(Dwarf_Debug dbg, Dwarf_Section *ds, u break; case DW_FORM_strp: atref.u[0].u64 = dbg->read(ds->ds_data, offsetp, dwarf_size); - str = _dwarf_find_section(dbg, ".debug_str"); - assert(str != NULL); - atref.u[1].s = (char *) str->ds_data + atref.u[0].u64; + atref.u[1].s = _dwarf_strtab_get_table(dbg) + atref.u[0].u64; break; case DW_FORM_ref_sig8: atref.u[0].u64 = 8; From owner-svn-src-stable-12@freebsd.org Wed Jul 3 21:30:19 2019 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 BE17715E18A4; Wed, 3 Jul 2019 21:30:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64F4D6C556; Wed, 3 Jul 2019 21:30:19 +0000 (UTC) (envelope-from jhibbits@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 0F1A41981D; Wed, 3 Jul 2019 21:30:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x63LUIuw029325; Wed, 3 Jul 2019 21:30:18 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x63LUI8c029324; Wed, 3 Jul 2019 21:30:18 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907032130.x63LUI8c029324@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 3 Jul 2019 21:30: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: r349712 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 349712 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 64F4D6C556 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.949,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 03 Jul 2019 21:30:19 -0000 Author: jhibbits Date: Wed Jul 3 21:30:18 2019 New Revision: 349712 URL: https://svnweb.freebsd.org/changeset/base/349712 Log: MFC r348299 kern/CTF: link_elf_ctf_get() on big endian platforms Check the CTF magic number in big endian platforms. This lets DTrace FBT handle types correctly on these platforms. Modified: stable/12/sys/kern/kern_ctf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_ctf.c ============================================================================== --- stable/12/sys/kern/kern_ctf.c Wed Jul 3 21:05:40 2019 (r349711) +++ stable/12/sys/kern/kern_ctf.c Wed Jul 3 21:30:18 2019 (r349712) @@ -193,8 +193,12 @@ link_elf_ctf_get(linker_file_t lf, linker_ctf_t *lc) NOCRED, NULL, td)) != 0) goto out; - /* Check the CTF magic number. (XXX check for big endian!) */ + /* Check the CTF magic number. */ +#ifdef __LITTLE_ENDIAN__ if (ctf_hdr[0] != 0xf1 || ctf_hdr[1] != 0xcf) { +#else + if (ctf_hdr[0] != 0xcf || ctf_hdr[1] != 0xf1) { +#endif printf("%s(%d): module %s has invalid format\n", __func__, __LINE__, lf->pathname); error = EFTYPE; From owner-svn-src-stable-12@freebsd.org Thu Jul 4 03:04:43 2019 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 B579615E7C33; Thu, 4 Jul 2019 03:04:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B45A7633E; Thu, 4 Jul 2019 03:04:43 +0000 (UTC) (envelope-from cy@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 362121D0FE; Thu, 4 Jul 2019 03:04:43 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6434hi1008066; Thu, 4 Jul 2019 03:04:43 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6434giZ008064; Thu, 4 Jul 2019 03:04:42 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907040304.x6434giZ008064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 4 Jul 2019 03: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: r349715 - in stable: 11/sbin/ipf/ipmon 11/tools/build/mk 12/sbin/ipf/ipmon 12/tools/build/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/sbin/ipf/ipmon 11/tools/build/mk 12/sbin/ipf/ipmon 12/tools/build/mk X-SVN-Commit-Revision: 349715 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5B45A7633E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 04 Jul 2019 03:04:44 -0000 Author: cy Date: Thu Jul 4 03:04:41 2019 New Revision: 349715 URL: https://svnweb.freebsd.org/changeset/base/349715 Log: MFC r349449, r349452: Add the ipmon.5 man page and link ipmon.conf.5 to it. PR/238816 initially addressed updates to usage() however the PR has morphed into a shopping list of updates to usage() and man pages. PR: 238816 Modified: stable/12/sbin/ipf/ipmon/Makefile stable/12/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sbin/ipf/ipmon/Makefile stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/12/sbin/ipf/ipmon/Makefile ============================================================================== --- stable/12/sbin/ipf/ipmon/Makefile Thu Jul 4 02:51:34 2019 (r349714) +++ stable/12/sbin/ipf/ipmon/Makefile Thu Jul 4 03:04:41 2019 (r349715) @@ -3,7 +3,8 @@ PACKAGE= ipf PROG= ipmon SRCS= ${GENHDRS} ipmon.c ipmon_y.c ipmon_l.c -MAN= ipmon.8 +MAN= ipmon.5 ipmon.8 +MLINKS= ipmon.5 ipmon.conf.5 CFLAGS+= -DLOGFAC=LOG_LOCAL0 -I. Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Thu Jul 4 02:51:34 2019 (r349714) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Thu Jul 4 03:04:41 2019 (r349715) @@ -3338,6 +3338,8 @@ OLD_FILES+=usr/share/man/man5/ipf.5.gz OLD_FILES+=usr/share/man/man5/ipf.conf.5.gz OLD_FILES+=usr/share/man/man5/ipf6.conf.5.gz OLD_FILES+=usr/share/man/man5/ipfilter.5.gz +OLD_FILES+=usr/share/man/man8/ipmon.5.gz +OLD_FILES+=usr/share/man/man5/ipmon.conf.5.gz OLD_FILES+=usr/share/man/man5/ipnat.5.gz OLD_FILES+=usr/share/man/man5/ipnat.conf.5.gz OLD_FILES+=usr/share/man/man5/ippool.5.gz From owner-svn-src-stable-12@freebsd.org Thu Jul 4 03:08:15 2019 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 9897115E7E52; Thu, 4 Jul 2019 03:08:15 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E6BE766BA; Thu, 4 Jul 2019 03:08:15 +0000 (UTC) (envelope-from cy@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 1B5EA1D113; Thu, 4 Jul 2019 03:08:15 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6438EFJ008290; Thu, 4 Jul 2019 03:08:14 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6438Ebm008289; Thu, 4 Jul 2019 03:08:14 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907040308.x6438Ebm008289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Thu, 4 Jul 2019 03:08: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: r349716 - in stable: 11/contrib/ipfilter/tools 12/contrib/ipfilter/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/contrib/ipfilter/tools 12/contrib/ipfilter/tools X-SVN-Commit-Revision: 349716 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E6BE766BA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 04 Jul 2019 03:08:15 -0000 Author: cy Date: Thu Jul 4 03:08:14 2019 New Revision: 349716 URL: https://svnweb.freebsd.org/changeset/base/349716 Log: MFC r349450-349451: Update usage() to refect the current state of ipmon. PR: 238816 Modified: stable/12/contrib/ipfilter/tools/ipmon.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ipfilter/tools/ipmon.c Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/ipfilter/tools/ipmon.c ============================================================================== --- stable/12/contrib/ipfilter/tools/ipmon.c Thu Jul 4 03:04:41 2019 (r349715) +++ stable/12/contrib/ipfilter/tools/ipmon.c Thu Jul 4 03:08:14 2019 (r349716) @@ -1438,7 +1438,10 @@ printipflog: static void usage(prog) char *prog; { - fprintf(stderr, "%s: [-NFhstvxX] [-f ]\n", prog); + fprintf(stderr, "Usage: %s [ -abDFhnpstvxX ] [ -B ] [ -C ]\n" + "\t[ -f ] [ -L ] [ -N ]\n" + "\t[ -o [NSI] ] [ -O [NSI] ] [ -P ] [ -S ]\n" + "\t[ ]\n", prog); exit(1); } From owner-svn-src-stable-12@freebsd.org Thu Jul 4 07:29:23 2019 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 1A78915CB21A; Thu, 4 Jul 2019 07:29:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C187E84C01; Thu, 4 Jul 2019 07:29:22 +0000 (UTC) (envelope-from delphij@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 98AD11FC9A; Thu, 4 Jul 2019 07:29:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x647TMWV042513; Thu, 4 Jul 2019 07:29:22 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x647TIWe042494; Thu, 4 Jul 2019 07:29:18 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201907040729.x647TIWe042494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Jul 2019 07:29: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: r349717 - stable/12/contrib/bzip2 X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/contrib/bzip2 X-SVN-Commit-Revision: 349717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C187E84C01 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 04 Jul 2019 07:29:23 -0000 Author: delphij Date: Thu Jul 4 07:29:18 2019 New Revision: 349717 URL: https://svnweb.freebsd.org/changeset/base/349717 Log: MFC r349505: Upgrade to Bzip2 version 1.0.7. Modified: stable/12/contrib/bzip2/CHANGES stable/12/contrib/bzip2/LICENSE stable/12/contrib/bzip2/README stable/12/contrib/bzip2/README.COMPILATION.PROBLEMS stable/12/contrib/bzip2/blocksort.c stable/12/contrib/bzip2/bzip2.1 stable/12/contrib/bzip2/bzip2.c stable/12/contrib/bzip2/bzip2recover.c stable/12/contrib/bzip2/bzlib.c stable/12/contrib/bzip2/bzlib.h stable/12/contrib/bzip2/bzlib_private.h stable/12/contrib/bzip2/compress.c stable/12/contrib/bzip2/crctable.c stable/12/contrib/bzip2/decompress.c stable/12/contrib/bzip2/huffman.c stable/12/contrib/bzip2/randtable.c stable/12/contrib/bzip2/spewG.c stable/12/contrib/bzip2/unzcrash.c stable/12/contrib/bzip2/words2 Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/bzip2/CHANGES ============================================================================== --- stable/12/contrib/bzip2/CHANGES Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/CHANGES Thu Jul 4 07:29:18 2019 (r349717) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -325,3 +325,16 @@ Security fix only. Fixes CERT-FI 20469 as it applies Izdebski. * Make the documentation build on Ubuntu 10.04 + +1.0.7 (27 Jun 19) +~~~~~~~~~~~~~~~~~ + +* Fix undefined behavior in the macros SET_BH, CLEAR_BH, & ISSET_BH + +* bzip2: Fix return value when combining --test,-t and -q. + +* bzip2recover: Fix buffer overflow for large argv[0] + +* bzip2recover: Fix use after free issue with outFile (CVE-2016-3189) + +* Make sure nSelectors is not out of range (CVE-2019-12900) Modified: stable/12/contrib/bzip2/LICENSE ============================================================================== --- stable/12/contrib/bzip2/LICENSE Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/LICENSE Thu Jul 4 07:29:18 2019 (r349717) @@ -36,7 +36,7 @@ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUD NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -Julian Seward, jseward@bzip.org -bzip2/libbzip2 version 1.0.6 of 6 September 2010 +Julian Seward, jseward@acm.org +bzip2/libbzip2 version 1.0.7 of 27 June 2019 -------------------------------------------------------------------------- Modified: stable/12/contrib/bzip2/README ============================================================================== --- stable/12/contrib/bzip2/README Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/README Thu Jul 4 07:29:18 2019 (r349717) @@ -6,8 +6,8 @@ This version is fully compatible with the previous pub This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.6 of 6 September 2010 -Copyright (C) 1996-2010 Julian Seward +bzip2/libbzip2 version 1.0.7 of 27 June 2019 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in this file. @@ -73,7 +73,7 @@ HOW TO BUILD -- Windows 95, NT, DOS, Mac, etc. It's difficult for me to support compilation on all these platforms. My approach is to collect binaries for these platforms, and put them -on the master web site (http://www.bzip.org). Look there. However +on the master web site (https://sourceware.org/bzip2/). Look there. However (FWIW), bzip2-1.0.X is very standard ANSI C and should compile unmodified with MS Visual C. If you have difficulties building, you might want to read README.COMPILATION.PROBLEMS. @@ -161,43 +161,22 @@ WHAT'S NEW IN 0.9.5 ? * Many small improvements in file and flag handling. * A Y2K statement. -WHAT'S NEW IN 1.0.0 ? +WHAT'S NEW IN 1.0.x ? See the CHANGES file. -WHAT'S NEW IN 1.0.2 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.3 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.4 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.5 ? - - See the CHANGES file. - -WHAT'S NEW IN 1.0.6 ? - - See the CHANGES file. - - I hope you find bzip2 useful. Feel free to contact me at - jseward@bzip.org + jseward@acm.org if you have any suggestions or queries. Many people mailed me with comments, suggestions and patches after the releases of bzip-0.15, bzip-0.21, and bzip2 versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0, 1.0.1, 1.0.2 and 1.0.3, and the changes in bzip2 are largely a result of this feedback. I thank you for your comments. -bzip2's "home" is http://www.bzip.org/ +bzip2's "home" is https://sourceware.org/bzip2/ Julian Seward -jseward@bzip.org +jseward@acm.org Cambridge, UK. 18 July 1996 (version 0.15) @@ -213,3 +192,4 @@ Cambridge, UK. 20 December 2006 (bzip2, version 1.0.4) 10 December 2007 (bzip2, version 1.0.5) 6 Sept 2010 (bzip2, version 1.0.6) +27 June 2019 (bzip2, version 1.0.7) Modified: stable/12/contrib/bzip2/README.COMPILATION.PROBLEMS ============================================================================== --- stable/12/contrib/bzip2/README.COMPILATION.PROBLEMS Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/README.COMPILATION.PROBLEMS Thu Jul 4 07:29:18 2019 (r349717) @@ -2,8 +2,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. -bzip2/libbzip2 version 1.0.6 of 6 September 2010 -Copyright (C) 1996-2010 Julian Seward +bzip2/libbzip2 version 1.0.7 of 27 June 2019 +Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -12,7 +12,7 @@ This program is released under the terms of the licens in the file LICENSE. ------------------------------------------------------------------ -bzip2-1.0.6 should compile without problems on the vast majority of +bzip2 should compile without problems on the vast majority of platforms. Using the supplied Makefile, I've built and tested it myself for x86-linux and amd64-linux. With makefile.msc, Visual C++ 6.0 and nmake, you can build a native Win32 version too. Large file Modified: stable/12/contrib/bzip2/blocksort.c ============================================================================== --- stable/12/contrib/bzip2/blocksort.c Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/blocksort.c Thu Jul 4 07:29:18 2019 (r349717) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -202,9 +202,9 @@ void fallbackQSort3 ( UInt32* fmap, bhtab [ 0 .. 2+(nblock/32) ] destroyed */ -#define SET_BH(zz) bhtab[(zz) >> 5] |= (1 << ((zz) & 31)) -#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~(1 << ((zz) & 31)) -#define ISSET_BH(zz) (bhtab[(zz) >> 5] & (1 << ((zz) & 31))) +#define SET_BH(zz) bhtab[(zz) >> 5] |= ((UInt32)1 << ((zz) & 31)) +#define CLEAR_BH(zz) bhtab[(zz) >> 5] &= ~((UInt32)1 << ((zz) & 31)) +#define ISSET_BH(zz) (bhtab[(zz) >> 5] & ((UInt32)1 << ((zz) & 31))) #define WORD_BH(zz) bhtab[(zz) >> 5] #define UNALIGNED_BH(zz) ((zz) & 0x01f) Modified: stable/12/contrib/bzip2/bzip2.1 ============================================================================== --- stable/12/contrib/bzip2/bzip2.1 Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/bzip2.1 Thu Jul 4 07:29:18 2019 (r349717) @@ -1,6 +1,6 @@ .TH bzip2 1 .SH NAME -bzip2, bunzip2 \- a block-sorting file compressor, v1.0.6 +bzip2, bunzip2 \- a block-sorting file compressor, v1.0.7 .br bzcat \- decompresses files to stdout .br @@ -404,7 +404,7 @@ I/O error messages are not as helpful as they could be tries hard to detect I/O errors and exit cleanly, but the details of what the problem is sometimes seem rather misleading. -This manual page pertains to version 1.0.6 of +This manual page pertains to version 1.0.7 of .I bzip2. Compressed data created by this version is entirely forwards and backwards compatible with the previous public releases, versions @@ -426,9 +426,9 @@ with MaybeUInt64 set to be an unsigned 64-bit integer. .SH AUTHOR -Julian Seward, jsewardbzip.org. +Julian Seward, jseward@acm.org. -http://www.bzip.org +https://sourceware.org/bzip2/ The ideas embodied in .I bzip2 Modified: stable/12/contrib/bzip2/bzip2.c ============================================================================== --- stable/12/contrib/bzip2/bzip2.c Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/bzip2.c Thu Jul 4 07:29:18 2019 (r349717) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -554,7 +554,7 @@ static Bool testStream ( FILE *zStream ) { BZFILE* bzf = NULL; - Int32 bzerr, bzerr_dummy, ret, nread, streamNo, i; + Int32 bzerr, bzerr_dummy, ret, streamNo, i; UChar obuf[5000]; UChar unused[BZ_MAX_UNUSED]; Int32 nUnused; @@ -577,7 +577,7 @@ Bool testStream ( FILE *zStream ) streamNo++; while (bzerr == BZ_OK) { - nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); + BZ2_bzRead ( &bzerr, bzf, obuf, 5000 ); if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler; } if (bzerr != BZ_STREAM_END) goto errhandler; @@ -749,7 +749,7 @@ void panic ( const Char* s ) "\n%s: PANIC -- internal consistency error:\n" "\t%s\n" "\tThis is a BUG. Please report it to me at:\n" - "\tjseward@bzip.org\n", + "\tjseward@acm.org\n", progName, s ); showFileNames(); cleanUpAndFail( 3 ); @@ -829,7 +829,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n ) " The user's manual, Section 4.3, has more info on (1) and (2).\n" " \n" " If you suspect this is a bug in bzip2, or are unsure about (1)\n" - " or (2), feel free to report it to me at: jseward@bzip.org.\n" + " or (2), feel free to report it to me at: jseward@acm.org.\n" " Section 4.3 of the user's manual describes the info a useful\n" " bug report should have. If the manual is available on your\n" " system, please try and read it before mailing me. If you don't\n" @@ -852,7 +852,7 @@ void mySIGSEGVorSIGBUScatcher ( IntNative n ) " The user's manual, Section 4.3, has more info on (2) and (3).\n" " \n" " If you suspect this is a bug in bzip2, or are unsure about (2)\n" - " or (3), feel free to report it to me at: jseward@bzip.org.\n" + " or (3), feel free to report it to me at: jseward@acm.org.\n" " Section 4.3 of the user's manual describes the info a useful\n" " bug report should have. If the manual is available on your\n" " system, please try and read it before mailing me. If you don't\n" @@ -1609,7 +1609,7 @@ void license ( void ) " \n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms set out in the LICENSE file, which is included\n" - " in the bzip2-1.0.6 source distribution.\n" + " in the bzip2 source distribution.\n" " \n" " This program is distributed in the hope that it will be useful,\n" " but WITHOUT ANY WARRANTY; without even the implied warranty of\n" @@ -2005,12 +2005,14 @@ IntNative main ( IntNative argc, Char *argv[] ) testf ( aa->name ); } } - if (testFailsExist && noisy) { - fprintf ( stderr, - "\n" - "You can use the `bzip2recover' program to attempt to recover\n" - "data from undamaged sections of corrupted files.\n\n" - ); + if (testFailsExist) { + if (noisy) { + fprintf ( stderr, + "\n" + "You can use the `bzip2recover' program to attempt to recover\n" + "data from undamaged sections of corrupted files.\n\n" + ); + } setExit(2); exit(exitValue); } Modified: stable/12/contrib/bzip2/bzip2recover.c ============================================================================== --- stable/12/contrib/bzip2/bzip2recover.c Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/bzip2recover.c Thu Jul 4 07:29:18 2019 (r349717) @@ -7,8 +7,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -309,11 +309,12 @@ Int32 main ( Int32 argc, Char** argv ) UInt32 buffHi, buffLo, blockCRC; Char* p; - strcpy ( progName, argv[0] ); + strncpy ( progName, argv[0], BZ_MAX_FILENAME-1); + progName[BZ_MAX_FILENAME-1]='\0'; inFileName[0] = outFileName[0] = 0; fprintf ( stderr, - "bzip2recover 1.0.6: extracts blocks from damaged .bz2 files.\n" ); + "bzip2recover 1.0.7: extracts blocks from damaged .bz2 files.\n" ); if (argc != 2) { fprintf ( stderr, "%s: usage is `%s damaged_file_name'.\n", @@ -457,6 +458,7 @@ Int32 main ( Int32 argc, Char** argv ) bsPutUChar ( bsWr, 0x50 ); bsPutUChar ( bsWr, 0x90 ); bsPutUInt32 ( bsWr, blockCRC ); bsClose ( bsWr ); + outFile = NULL; } if (wrBlock >= rbCtr) break; wrBlock++; Modified: stable/12/contrib/bzip2/bzlib.c ============================================================================== --- stable/12/contrib/bzip2/bzlib.c Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/bzlib.c Thu Jul 4 07:29:18 2019 (r349717) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -47,7 +47,7 @@ void BZ2_bz__AssertH__fail ( int errcode ) fprintf(stderr, "\n\nbzip2/libbzip2: internal error number %d.\n" "This is a bug in bzip2/libbzip2, %s.\n" - "Please report it to me at: jseward@bzip.org. If this happened\n" + "Please report it to me at: jseward@acm.org. If this happened\n" "when you were using some program which uses libbzip2 as a\n" "component, you should also report this bug to the author(s)\n" "of that program. Please make an effort to report this bug;\n" Modified: stable/12/contrib/bzip2/bzlib.h ============================================================================== --- stable/12/contrib/bzip2/bzlib.h Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/bzlib.h Thu Jul 4 07:29:18 2019 (r349717) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/12/contrib/bzip2/bzlib_private.h ============================================================================== --- stable/12/contrib/bzip2/bzlib_private.h Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/bzlib_private.h Thu Jul 4 07:29:18 2019 (r349717) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -36,7 +36,7 @@ /*-- General stuff. --*/ -#define BZ_VERSION "1.0.6, 6-Sept-2010" +#define BZ_VERSION "1.0.7, 27-Jun-2019" typedef char Char; typedef unsigned char Bool; Modified: stable/12/contrib/bzip2/compress.c ============================================================================== --- stable/12/contrib/bzip2/compress.c Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/compress.c Thu Jul 4 07:29:18 2019 (r349717) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/12/contrib/bzip2/crctable.c ============================================================================== --- stable/12/contrib/bzip2/crctable.c Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/crctable.c Thu Jul 4 07:29:18 2019 (r349717) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/12/contrib/bzip2/decompress.c ============================================================================== --- stable/12/contrib/bzip2/decompress.c Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/decompress.c Thu Jul 4 07:29:18 2019 (r349717) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. @@ -285,9 +285,9 @@ Int32 BZ2_decompress ( DState* s ) /*--- Now the selectors ---*/ GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); - if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR); + if (nGroups < 2 || nGroups > BZ_N_GROUPS) RETURN(BZ_DATA_ERROR); GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); - if (nSelectors < 1) RETURN(BZ_DATA_ERROR); + if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR); for (i = 0; i < nSelectors; i++) { j = 0; while (True) { Modified: stable/12/contrib/bzip2/huffman.c ============================================================================== --- stable/12/contrib/bzip2/huffman.c Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/huffman.c Thu Jul 4 07:29:18 2019 (r349717) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/12/contrib/bzip2/randtable.c ============================================================================== --- stable/12/contrib/bzip2/randtable.c Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/randtable.c Thu Jul 4 07:29:18 2019 (r349717) @@ -8,8 +8,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/12/contrib/bzip2/spewG.c ============================================================================== --- stable/12/contrib/bzip2/spewG.c Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/spewG.c Thu Jul 4 07:29:18 2019 (r349717) @@ -13,8 +13,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/12/contrib/bzip2/unzcrash.c ============================================================================== --- stable/12/contrib/bzip2/unzcrash.c Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/unzcrash.c Thu Jul 4 07:29:18 2019 (r349717) @@ -17,8 +17,8 @@ This file is part of bzip2/libbzip2, a program and library for lossless, block-sorting data compression. - bzip2/libbzip2 version 1.0.6 of 6 September 2010 - Copyright (C) 1996-2010 Julian Seward + bzip2/libbzip2 version 1.0.7 of 27 June 2019 + Copyright (C) 1996-2010 Julian Seward Please read the WARNING, DISCLAIMER and PATENTS sections in the README file. Modified: stable/12/contrib/bzip2/words2 ============================================================================== --- stable/12/contrib/bzip2/words2 Thu Jul 4 03:08:14 2019 (r349716) +++ stable/12/contrib/bzip2/words2 Thu Jul 4 07:29:18 2019 (r349717) @@ -1,5 +1,5 @@ Checking test results. If any of the four "cmp"s which follow report any differences, something is wrong. If you can't easily -figure out what, please let me know (jseward@bzip.org). +figure out what, please let me know (jseward@acm.org). From owner-svn-src-stable-12@freebsd.org Thu Jul 4 10:16:45 2019 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 C229015CF945; Thu, 4 Jul 2019 10:16:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 637728A096; Thu, 4 Jul 2019 10:16:45 +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 3CE35218C9; Thu, 4 Jul 2019 10:16:45 +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 x64AGj7c031374; Thu, 4 Jul 2019 10:16:45 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x64AGjEm031373; Thu, 4 Jul 2019 10:16:45 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201907041016.x64AGjEm031373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Thu, 4 Jul 2019 10:16: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: r349721 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: tijl X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 349721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 637728A096 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 04 Jul 2019 10:16:45 -0000 Author: tijl Date: Thu Jul 4 10:16:44 2019 New Revision: 349721 URL: https://svnweb.freebsd.org/changeset/base/349721 Log: MFC r349548: Build lib32 libl. The library is built from usr.bin/lex/lib. It would be better to move this directory to lib/libl, but this requires more extensive changes to Makefile.inc1. This simple fix can be MFCed quickly. PR: 238874 Reviewed by: imp Modified: stable/12/Makefile.libcompat Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.libcompat ============================================================================== --- stable/12/Makefile.libcompat Thu Jul 4 08:40:10 2019 (r349720) +++ stable/12/Makefile.libcompat Thu Jul 4 10:16:44 2019 (r349721) @@ -136,6 +136,7 @@ LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR= _LC_LIBDIRS.yes= lib _LC_LIBDIRS.yes+= gnu/lib +_LC_LIBDIRS.yes+= usr.bin/lex/lib _LC_LIBDIRS.${MK_CDDL:tl}+= cddl/lib _LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib _LC_LIBDIRS.${MK_KERBEROS:tl}+= kerberos5/lib From owner-svn-src-stable-12@freebsd.org Thu Jul 4 12:40:39 2019 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 B737E15D4D5B; Thu, 4 Jul 2019 12:40:39 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 587C7906EF; Thu, 4 Jul 2019 12:40:39 +0000 (UTC) (envelope-from luporl@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 326A123073; Thu, 4 Jul 2019 12:40:39 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x64CedsA005636; Thu, 4 Jul 2019 12:40:39 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x64CedlO005635; Thu, 4 Jul 2019 12:40:39 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <201907041240.x64CedlO005635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Thu, 4 Jul 2019 12:40: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: r349724 - stable/12/stand/ofw/libofw X-SVN-Group: stable-12 X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: stable/12/stand/ofw/libofw X-SVN-Commit-Revision: 349724 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 587C7906EF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.947,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 04 Jul 2019 12:40:39 -0000 Author: luporl Date: Thu Jul 4 12:40:38 2019 New Revision: 349724 URL: https://svnweb.freebsd.org/changeset/base/349724 Log: MFC r349188 [PPC] Fix loader input with newer QEMU versions At least since version 4.0.0, QEMU became bug-compatible with PowerVM's vty, by inserting a \0 after every \r. As this confuses loader's interpreter and as a \0 coming from the console doesn't seem reasonable, it's now being filtered at OFW console input. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20676 Modified: stable/12/stand/ofw/libofw/ofw_console.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/ofw/libofw/ofw_console.c ============================================================================== --- stable/12/stand/ofw/libofw/ofw_console.c Thu Jul 4 12:31:24 2019 (r349723) +++ stable/12/stand/ofw/libofw/ofw_console.c Thu Jul 4 12:40:38 2019 (r349724) @@ -97,7 +97,11 @@ ofw_cons_getchar() return l; } - if (OF_read(stdin, &ch, 1) > 0) + /* At least since version 4.0.0, QEMU became bug-compatible + * with PowerVM's vty, by inserting a \0 after every \r. + * As this confuses loader's interpreter and as a \0 coming + * from the console doesn't seem reasonable, it's filtered here. */ + if (OF_read(stdin, &ch, 1) > 0 && ch != '\0') return (ch); return (-1); From owner-svn-src-stable-12@freebsd.org Thu Jul 4 13:20:33 2019 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 052A215D55D3; Thu, 4 Jul 2019 13:20:33 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99F1F91632; Thu, 4 Jul 2019 13:20:32 +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 6FCEA23703; Thu, 4 Jul 2019 13:20:32 +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 x64DKWUK026295; Thu, 4 Jul 2019 13:20:32 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x64DKWhu026294; Thu, 4 Jul 2019 13:20:32 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201907041320.x64DKWhu026294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Thu, 4 Jul 2019 13:20: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: r349725 - 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: 349725 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 99F1F91632 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 04 Jul 2019 13:20:33 -0000 Author: eugen Date: Thu Jul 4 13:20:32 2019 New Revision: 349725 URL: https://svnweb.freebsd.org/changeset/base/349725 Log: MFC r345970: network.subr: improve configuration of cloned gif(4) interfaces ifconfig(8) syntax allows to specify only single address_family, so we need additional invocation of ifconfig to support configuration of cloned gif interface that may use different address families for its internal and external addresses. Also, ifconfig(8) does not allow to omit "inet6" keyword for address family specifying IPv6 addresses as outer addresses of the interface. Also, address_family is not "parameter" and it has to go before parameters including "tunnel" keyword, so "ifconfig gif0 tunnel inet6 $oip1 $oip2" would be wrong syntax and only "ifconfig gif0 inet6 tunnel $oip1 $oip2" is right. With this change, the following works: gifconfig_gif0="inet6 2a00::1 2a01::1" ifconfig_gif0="inet 10.0.0.1 10.0.0.2 netmask 255.255.255.252" Modified: stable/12/libexec/rc/network.subr Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rc/network.subr ============================================================================== --- stable/12/libexec/rc/network.subr Thu Jul 4 12:40:38 2019 (r349724) +++ stable/12/libexec/rc/network.subr Thu Jul 4 13:20:32 2019 (r349725) @@ -1323,7 +1323,7 @@ wlan_down() # clone_up() { - local _list ifn ifopt _iflist _n tmpargs + local _list ifn ifopt _iflist _inet6 _n tmpargs _list= _iflist=$* @@ -1389,9 +1389,21 @@ clone_up() esac if [ $? -eq 0 ]; then _list="$_list $ifn" + tmpargs=$(get_if_var $ifn gifconfig_IF) + _inet6='' + case "$tmpargs" in + '') + ;; + inet6[[:space:]]*) + tmpargs=${tmpargs#inet6} + _inet6=inet6 + # FALLTHROUGH + ;& + *) + ${IFCONFIG_CMD} $ifn $_inet6 tunnel $tmpargs + ;; + esac fi - tmpargs=$(get_if_var $ifn gifconfig_IF) - eval ifconfig_${ifn}=\"\$ifconfig_${ifn} tunnel \$tmpargs\" done if [ -n "${_list# }" ]; then echo "Created clone interfaces: ${_list# }." From owner-svn-src-stable-12@freebsd.org Thu Jul 4 17:13:42 2019 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 62A3B15D9A97; Thu, 4 Jul 2019 17:13:42 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05BC4699CD; Thu, 4 Jul 2019 17:13:42 +0000 (UTC) (envelope-from mhorne@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 D469825F3A; Thu, 4 Jul 2019 17:13:41 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x64HDfVm052833; Thu, 4 Jul 2019 17:13:41 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x64HDfKJ052832; Thu, 4 Jul 2019 17:13:41 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201907041713.x64HDfKJ052832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Thu, 4 Jul 2019 17:13: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: r349734 - stable/12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/sys/sys X-SVN-Commit-Revision: 349734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05BC4699CD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 04 Jul 2019 17:13:42 -0000 Author: mhorne Date: Thu Jul 4 17:13:41 2019 New Revision: 349734 URL: https://svnweb.freebsd.org/changeset/base/349734 Log: MFC r349481: Add some missing RISC-V ELF defines Approved by: markj (implicit) Modified: stable/12/sys/sys/elf_common.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/sys/elf_common.h ============================================================================== --- stable/12/sys/sys/elf_common.h Thu Jul 4 15:42:02 2019 (r349733) +++ stable/12/sys/sys/elf_common.h Thu Jul 4 17:13:41 2019 (r349734) @@ -369,6 +369,15 @@ typedef struct { #define EF_PPC_RELOCATABLE 0x00010000 #define EF_PPC_RELOCATABLE_LIB 0x00008000 +#define EF_RISCV_RVC 0x00000001 +#define EF_RISCV_FLOAT_ABI_MASK 0x00000006 +#define EF_RISCV_FLOAT_ABI_SOFT 0x00000000 +#define EF_RISCV_FLOAT_ABI_SINGLE 0x000002 +#define EF_RISCV_FLOAT_ABI_DOUBLE 0x000004 +#define EF_RISCV_FLOAT_ABI_QUAD 0x00000006 +#define EF_RISCV_RVE 0x00000008 +#define EF_RISCV_TSO 0x00000010 + #define EF_SPARC_EXT_MASK 0x00ffff00 #define EF_SPARC_32PLUS 0x00000100 #define EF_SPARC_SUN_US1 0x00000200 @@ -1246,6 +1255,17 @@ typedef struct { #define R_RISCV_ALIGN 43 #define R_RISCV_RVC_BRANCH 44 #define R_RISCV_RVC_JUMP 45 +#define R_RISCV_RVC_LUI 46 +#define R_RISCV_GPREL_I 47 +#define R_RISCV_GPREL_S 48 +#define R_RISCV_TPREL_I 49 +#define R_RISCV_TPREL_S 50 +#define R_RISCV_RELAX 51 +#define R_RISCV_SUB6 52 +#define R_RISCV_SET6 53 +#define R_RISCV_SET8 54 +#define R_RISCV_SET16 55 +#define R_RISCV_SET32 56 #define R_SPARC_NONE 0 #define R_SPARC_8 1 From owner-svn-src-stable-12@freebsd.org Thu Jul 4 17:17:02 2019 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 9572D15D9C23; Thu, 4 Jul 2019 17:17:02 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D12DF69D2C; Thu, 4 Jul 2019 17:17:01 +0000 (UTC) (envelope-from mhorne@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 9DB3C25F3F; Thu, 4 Jul 2019 17:17:01 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x64HH1Rn053123; Thu, 4 Jul 2019 17:17:01 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x64HH1de053121; Thu, 4 Jul 2019 17:17:01 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201907041717.x64HH1de053121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Thu, 4 Jul 2019 17:17: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: r349736 - in stable/12/contrib/elftoolchain: common readelf X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in stable/12/contrib/elftoolchain: common readelf X-SVN-Commit-Revision: 349736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D12DF69D2C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 04 Jul 2019 17:17:02 -0000 Author: mhorne Date: Thu Jul 4 17:17:00 2019 New Revision: 349736 URL: https://svnweb.freebsd.org/changeset/base/349736 Log: MFC r349482,r349563: readelf: Add support for RISC-V specific e_flags Approved by: markj (mentor, implicit) Modified: stable/12/contrib/elftoolchain/common/elfdefinitions.h stable/12/contrib/elftoolchain/readelf/readelf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- stable/12/contrib/elftoolchain/common/elfdefinitions.h Thu Jul 4 17:15:36 2019 (r349735) +++ stable/12/contrib/elftoolchain/common/elfdefinitions.h Thu Jul 4 17:17:00 2019 (r349736) @@ -33,7 +33,7 @@ * See: http://www.sco.com/developers/gabi/latest/ch4.intro.html * - The May 1998 (version 1.5) draft of "The ELF-64 object format". * - Processor-specific ELF ABI definitions for sparc, i386, amd64, mips, - * ia64, and powerpc processors. + * ia64, powerpc, and RISC-V processors. * - The "Linkers and Libraries Guide", from Sun Microsystems. */ @@ -426,6 +426,22 @@ _ELF_DEFINE_EF(EF_PPC_RELOCATABLE, 0x00010000UL, \ "-mrelocatable flag") \ _ELF_DEFINE_EF(EF_PPC_RELOCATABLE_LIB, 0x00008000UL, \ "-mrelocatable-lib flag") \ +_ELF_DEFINE_EF(EF_RISCV_RVC, 0x00000001UL, \ + "Compressed instruction extension") \ +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_MASK, 0x00000006UL, \ + "Floating point ABI") \ +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_SOFT, 0x00000000UL, \ + "Software emulated floating point") \ +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_SINGLE, 0x00000002UL, \ + "Single precision floating point") \ +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_DOUBLE, 0x00000004UL, \ + "Double precision floating point") \ +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_QUAD, 0x00000006UL, \ + "Quad precision floating point") \ +_ELF_DEFINE_EF(EF_RISCV_RVE, 0x00000008UL, \ + "RV32E embedded ABI") \ +_ELF_DEFINE_EF(EF_RISCV_TSO, 0x00000010UL, \ + "RVTSO memory consistency model") \ _ELF_DEFINE_EF(EF_SPARC_EXT_MASK, 0x00ffff00UL, \ "Vendor Extension mask") \ _ELF_DEFINE_EF(EF_SPARC_32PLUS, 0x00000100UL, \ Modified: stable/12/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- stable/12/contrib/elftoolchain/readelf/readelf.c Thu Jul 4 17:15:36 2019 (r349735) +++ stable/12/contrib/elftoolchain/readelf/readelf.c Thu Jul 4 17:17:00 2019 (r349736) @@ -420,6 +420,13 @@ static struct eflags_desc powerpc_eflags_desc[] = { {0, NULL} }; +static struct eflags_desc riscv_eflags_desc[] = { + {EF_RISCV_RVC, "RVC"}, + {EF_RISCV_RVE, "RVE"}, + {EF_RISCV_TSO, "TSO"}, + {0, NULL} +}; + static struct eflags_desc sparc_eflags_desc[] = { {EF_SPARC_32PLUS, "v8+"}, {EF_SPARC_SUN_US1, "ultrasparcI"}, @@ -2279,6 +2286,23 @@ dump_eflags(struct readelf *re, uint64_t e_flags) case EM_PPC: case EM_PPC64: edesc = powerpc_eflags_desc; + break; + case EM_RISCV: + switch (e_flags & EF_RISCV_FLOAT_ABI_MASK) { + case EF_RISCV_FLOAT_ABI_SOFT: + printf(", soft-float ABI"); + break; + case EF_RISCV_FLOAT_ABI_SINGLE: + printf(", single-float ABI"); + break; + case EF_RISCV_FLOAT_ABI_DOUBLE: + printf(", double-float ABI"); + break; + case EF_RISCV_FLOAT_ABI_QUAD: + printf(", quad-float ABI"); + break; + } + edesc = riscv_eflags_desc; break; case EM_SPARC: case EM_SPARC32PLUS: From owner-svn-src-stable-12@freebsd.org Thu Jul 4 17:19:10 2019 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 0C51515D9D2B; Thu, 4 Jul 2019 17:19:10 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2E3B69EA4; Thu, 4 Jul 2019 17:19:09 +0000 (UTC) (envelope-from mhorne@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 7340925F40; Thu, 4 Jul 2019 17:19:09 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x64HJ9Un053260; Thu, 4 Jul 2019 17:19:09 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x64HJ9lw053259; Thu, 4 Jul 2019 17:19:09 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201907041719.x64HJ9lw053259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Thu, 4 Jul 2019 17:19: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: r349737 - stable/12/contrib/elftoolchain/libelftc X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/libelftc X-SVN-Commit-Revision: 349737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2E3B69EA4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 04 Jul 2019 17:19:10 -0000 Author: mhorne Date: Thu Jul 4 17:19:08 2019 New Revision: 349737 URL: https://svnweb.freebsd.org/changeset/base/349737 Log: MFC r349483: libelftc: add RISC-V bfd targets Approved by: markj (mentor, implicit) Modified: stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 stable/12/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Thu Jul 4 17:17:00 2019 (r349736) +++ stable/12/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Thu Jul 4 17:19:08 2019 (r349737) @@ -76,6 +76,9 @@ Known descriptor names and their properties include: .It Li elf32-powerpc Ta ELF Ta MSB Ta 32 .It Li elf32-powerpc-freebsd Ta ELF Ta MSB Ta 32 .It Li elf32-powerpcle Ta ELF Ta LSB Ta 32 +.It Li elf32-riscv Ta ELF Ta LSB Ta 32 +.It Li elf64-riscv Ta ELF Ta LSB Ta 64 +.It Li elf64-riscv-freebsd Ta ELF Ta LSB Ta 64 .It Li elf32-sh Ta ELF Ta MSB Ta 32 .It Li elf32-shl Ta ELF Ta LSB Ta 32 .It Li elf32-sh-nbsd Ta ELF Ta MSB Ta 32 Modified: stable/12/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c ============================================================================== --- stable/12/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Thu Jul 4 17:17:00 2019 (r349736) +++ stable/12/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Thu Jul 4 17:19:08 2019 (r349737) @@ -316,6 +316,31 @@ struct _Elftc_Bfd_Target _libelftc_targets[] = { }, { + .bt_name = "elf32-riscv", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2LSB, + .bt_elfclass = ELFCLASS32, + .bt_machine = EM_RISCV, + }, + + { + .bt_name = "elf64-riscv", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2LSB, + .bt_elfclass = ELFCLASS64, + .bt_machine = EM_RISCV, + }, + + { + .bt_name = "elf64-riscv-freebsd", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2MSB, + .bt_elfclass = ELFCLASS64, + .bt_machine = EM_RISCV, + .bt_osabi = ELFOSABI_FREEBSD, + }, + + { .bt_name = "elf64-sh64", .bt_type = ETF_ELF, .bt_byteorder = ELFDATA2MSB, From owner-svn-src-stable-12@freebsd.org Thu Jul 4 17:22:47 2019 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 3FF6A15D9F5B; Thu, 4 Jul 2019 17:22:47 +0000 (UTC) (envelope-from mhorne063@gmail.com) Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F5E36A2CE; Thu, 4 Jul 2019 17:22:46 +0000 (UTC) (envelope-from mhorne063@gmail.com) Received: by mail-ot1-x32c.google.com with SMTP id s20so6606689otp.4; Thu, 04 Jul 2019 10:22:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=o4E9Kic7oKDNGUO+2oyNLGgSLhGHanHUmtiPWvA8rEI=; b=kCk/OjsWu6sWo13uxx+Q67ES5jsKyysPBdsblSBxgMCGRXGedGcigkoCZY5Kpz81Ii 6jRX/5DkDtczjOmg3kBWAC5q9TwR/Q68pVp6R3x5ZoO1s4X+6D7+Apf8vmyZYDofXGJx +1QpCTD5nTkio50xWNoaeTMwtogo5yDRzF252LnvRXYxvWAaYioCtty+P107Ts4Ug9ge WZC9hcX5vlk6bLecmtoF5Gfcp+bNuw6kkHChXzZIL4cbXU9Ij4+j6iZzuxrd8C5X9WkR EcJwODutj69km6JCclO0QRb078ozNNnLNEd6g12y8MUIrLidixQ3TOfSYXxhBb9vc4Iq vR3Q== 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=o4E9Kic7oKDNGUO+2oyNLGgSLhGHanHUmtiPWvA8rEI=; b=qWQGSxjL1toOP03pgMhI3WbS68KEP9kMSV1xQB/2txmnrkL9vI9GZrUSTqC1VzQhHr eyEukCp9Q0rbV1A589nwDbxUAzmZNLzfD1Y+CG3vZTJABMeq/O7546blNAF3AmrHKh6e kg6MUHlUlLcgOc6ZndOoXxbvCz4v34ssP4LG/PJxXwrTSzCUcrUG15Y95h+YGo/gY0dS tnPMavGULMUJT/WMtowNuvMk/A9vgR10JZMQtTSvBmLe8dExI+kQdYdmsJ/CCO7iQ/v+ FuCtzFJ7OuYffRXmXY0LqW/VPUvXPq4nhrKPIcl8GV9HwoyCa/xLMCfoaFi1rtjHTujO VQaA== X-Gm-Message-State: APjAAAXuk+fQzLXvlzy8OqrRLmg2nQyKN8SCfZzwskxLU4yRa5Wdjkcd 0jdbm5ZJ9G0z8MbM3iY6koJYy9+2EvWiW08U+PM6eLNg X-Google-Smtp-Source: APXvYqwvhFz4LpOYp1vUViz1E2T1McHF5ht6qAstdMaKFLbGJeHla6zoNB9RIBc74zfCOJp/AWo52W3LkaY1XMpT6Cw= X-Received: by 2002:a05:6830:144e:: with SMTP id w14mr33005487otp.10.1562260965345; Thu, 04 Jul 2019 10:22:45 -0700 (PDT) MIME-Version: 1.0 References: <201907041717.x64HH1de053121@repo.freebsd.org> In-Reply-To: <201907041717.x64HH1de053121@repo.freebsd.org> From: Mitchell Horne Date: Thu, 4 Jul 2019 13:22:33 -0400 Message-ID: Subject: Re: svn commit: r349736 - in stable/12/contrib/elftoolchain: common readelf To: Mitchell Horne Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 8F5E36A2CE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 04 Jul 2019 17:22:47 -0000 On Thu, Jul 4, 2019 at 1:17 PM Mitchell Horne wrote: > > Author: mhorne > Date: Thu Jul 4 17:17:00 2019 > New Revision: 349736 > URL: https://svnweb.freebsd.org/changeset/base/349736 > > Log: > MFC r349482,r349563: Apologies, this should read r349482,r349562. The svn mergeinfo is correct however. > readelf: Add support for RISC-V specific e_flags > > Approved by: markj (mentor, implicit) > > Modified: > stable/12/contrib/elftoolchain/common/elfdefinitions.h > stable/12/contrib/elftoolchain/readelf/readelf.c > Directory Properties: > stable/12/ (props changed) > > Modified: stable/12/contrib/elftoolchain/common/elfdefinitions.h > ============================================================================== > --- stable/12/contrib/elftoolchain/common/elfdefinitions.h Thu Jul 4 17:15:36 2019 (r349735) > +++ stable/12/contrib/elftoolchain/common/elfdefinitions.h Thu Jul 4 17:17:00 2019 (r349736) > @@ -33,7 +33,7 @@ > * See: http://www.sco.com/developers/gabi/latest/ch4.intro.html > * - The May 1998 (version 1.5) draft of "The ELF-64 object format". > * - Processor-specific ELF ABI definitions for sparc, i386, amd64, mips, > - * ia64, and powerpc processors. > + * ia64, powerpc, and RISC-V processors. > * - The "Linkers and Libraries Guide", from Sun Microsystems. > */ > > @@ -426,6 +426,22 @@ _ELF_DEFINE_EF(EF_PPC_RELOCATABLE, 0x00010000UL, \ > "-mrelocatable flag") \ > _ELF_DEFINE_EF(EF_PPC_RELOCATABLE_LIB, 0x00008000UL, \ > "-mrelocatable-lib flag") \ > +_ELF_DEFINE_EF(EF_RISCV_RVC, 0x00000001UL, \ > + "Compressed instruction extension") \ > +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_MASK, 0x00000006UL, \ > + "Floating point ABI") \ > +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_SOFT, 0x00000000UL, \ > + "Software emulated floating point") \ > +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_SINGLE, 0x00000002UL, \ > + "Single precision floating point") \ > +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_DOUBLE, 0x00000004UL, \ > + "Double precision floating point") \ > +_ELF_DEFINE_EF(EF_RISCV_FLOAT_ABI_QUAD, 0x00000006UL, \ > + "Quad precision floating point") \ > +_ELF_DEFINE_EF(EF_RISCV_RVE, 0x00000008UL, \ > + "RV32E embedded ABI") \ > +_ELF_DEFINE_EF(EF_RISCV_TSO, 0x00000010UL, \ > + "RVTSO memory consistency model") \ > _ELF_DEFINE_EF(EF_SPARC_EXT_MASK, 0x00ffff00UL, \ > "Vendor Extension mask") \ > _ELF_DEFINE_EF(EF_SPARC_32PLUS, 0x00000100UL, \ > > Modified: stable/12/contrib/elftoolchain/readelf/readelf.c > ============================================================================== > --- stable/12/contrib/elftoolchain/readelf/readelf.c Thu Jul 4 17:15:36 2019 (r349735) > +++ stable/12/contrib/elftoolchain/readelf/readelf.c Thu Jul 4 17:17:00 2019 (r349736) > @@ -420,6 +420,13 @@ static struct eflags_desc powerpc_eflags_desc[] = { > {0, NULL} > }; > > +static struct eflags_desc riscv_eflags_desc[] = { > + {EF_RISCV_RVC, "RVC"}, > + {EF_RISCV_RVE, "RVE"}, > + {EF_RISCV_TSO, "TSO"}, > + {0, NULL} > +}; > + > static struct eflags_desc sparc_eflags_desc[] = { > {EF_SPARC_32PLUS, "v8+"}, > {EF_SPARC_SUN_US1, "ultrasparcI"}, > @@ -2279,6 +2286,23 @@ dump_eflags(struct readelf *re, uint64_t e_flags) > case EM_PPC: > case EM_PPC64: > edesc = powerpc_eflags_desc; > + break; > + case EM_RISCV: > + switch (e_flags & EF_RISCV_FLOAT_ABI_MASK) { > + case EF_RISCV_FLOAT_ABI_SOFT: > + printf(", soft-float ABI"); > + break; > + case EF_RISCV_FLOAT_ABI_SINGLE: > + printf(", single-float ABI"); > + break; > + case EF_RISCV_FLOAT_ABI_DOUBLE: > + printf(", double-float ABI"); > + break; > + case EF_RISCV_FLOAT_ABI_QUAD: > + printf(", quad-float ABI"); > + break; > + } > + edesc = riscv_eflags_desc; > break; > case EM_SPARC: > case EM_SPARC32PLUS: > From owner-svn-src-stable-12@freebsd.org Thu Jul 4 17:24:49 2019 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 3DCF015DA010; Thu, 4 Jul 2019 17:24:49 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4A0A6A4E0; Thu, 4 Jul 2019 17:24:48 +0000 (UTC) (envelope-from mhorne@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 AFB38260DF; Thu, 4 Jul 2019 17:24:48 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x64HOmrq058303; Thu, 4 Jul 2019 17:24:48 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x64HOmUc058302; Thu, 4 Jul 2019 17:24:48 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <201907041724.x64HOmUc058302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Thu, 4 Jul 2019 17:24: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: r349738 - stable/12/contrib/elftoolchain/readelf X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/readelf X-SVN-Commit-Revision: 349738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D4A0A6A4E0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 04 Jul 2019 17:24:49 -0000 Author: mhorne Date: Thu Jul 4 17:24:48 2019 New Revision: 349738 URL: https://svnweb.freebsd.org/changeset/base/349738 Log: MFC r349563: readelf: Add RISC-V DWARF register aliases Approved by: markj (mentor, implicit) Modified: stable/12/contrib/elftoolchain/readelf/readelf.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- stable/12/contrib/elftoolchain/readelf/readelf.c Thu Jul 4 17:19:08 2019 (r349737) +++ stable/12/contrib/elftoolchain/readelf/readelf.c Thu Jul 4 17:24:48 2019 (r349738) @@ -2066,6 +2066,74 @@ dwarf_reg(unsigned int mach, unsigned int reg) case 49: return "ldtr"; default: return (NULL); } + case EM_RISCV: + switch (reg) { + case 0: return "zero"; + case 1: return "ra"; + case 2: return "sp"; + case 3: return "gp"; + case 4: return "tp"; + case 5: return "t0"; + case 6: return "t1"; + case 7: return "t2"; + case 8: return "s0"; + case 9: return "s1"; + case 10: return "a0"; + case 11: return "a1"; + case 12: return "a2"; + case 13: return "a3"; + case 14: return "a4"; + case 15: return "a5"; + case 16: return "a6"; + case 17: return "a7"; + case 18: return "s2"; + case 19: return "s3"; + case 20: return "s4"; + case 21: return "s5"; + case 22: return "s6"; + case 23: return "s7"; + case 24: return "s8"; + case 25: return "s9"; + case 26: return "s10"; + case 27: return "s11"; + case 28: return "t3"; + case 29: return "t4"; + case 30: return "t5"; + case 31: return "t6"; + case 32: return "ft0"; + case 33: return "ft1"; + case 34: return "ft2"; + case 35: return "ft3"; + case 36: return "ft4"; + case 37: return "ft5"; + case 38: return "ft6"; + case 39: return "ft7"; + case 40: return "fs0"; + case 41: return "fs1"; + case 42: return "fa0"; + case 43: return "fa1"; + case 44: return "fa2"; + case 45: return "fa3"; + case 46: return "fa4"; + case 47: return "fa5"; + case 48: return "fa6"; + case 49: return "fa7"; + case 50: return "fs2"; + case 51: return "fs3"; + case 52: return "fs4"; + case 53: return "fs5"; + case 54: return "fs6"; + case 55: return "fs7"; + case 56: return "fs8"; + case 57: return "fs9"; + case 58: return "fs10"; + case 59: return "fs11"; + case 60: return "ft8"; + case 61: return "ft9"; + case 62: return "ft10"; + case 63: return "ft11"; + default: return (NULL); + } case EM_X86_64: switch (reg) { case 0: return "rax"; From owner-svn-src-stable-12@freebsd.org Thu Jul 4 19:02:04 2019 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 3AECD15DBDBE; Thu, 4 Jul 2019 19:02:04 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D46746DDD6; Thu, 4 Jul 2019 19:02:03 +0000 (UTC) (envelope-from jhibbits@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 ADB73270AB; Thu, 4 Jul 2019 19:02:03 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x64J23wf011070; Thu, 4 Jul 2019 19:02:03 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x64J23f3011067; Thu, 4 Jul 2019 19:02:03 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201907041902.x64J23f3011067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 4 Jul 2019 19:02: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: r349742 - stable/12/release/powerpc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/release/powerpc X-SVN-Commit-Revision: 349742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D46746DDD6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 04 Jul 2019 19:02:04 -0000 Author: jhibbits Date: Thu Jul 4 19:02:03 2019 New Revision: 349742 URL: https://svnweb.freebsd.org/changeset/base/349742 Log: MFC r347986: Update loader size on powerpc isos loader has grown to the point it's overflowing the existing 307200 bytes allocated to it in the HFS boot partition on the isos. Bump the space reservation up to 500k. Modified: stable/12/release/powerpc/generate-hfs.sh stable/12/release/powerpc/hfs-boot.bz2.uu Directory Properties: stable/12/ (props changed) Modified: stable/12/release/powerpc/generate-hfs.sh ============================================================================== --- stable/12/release/powerpc/generate-hfs.sh Thu Jul 4 18:28:49 2019 (r349741) +++ stable/12/release/powerpc/generate-hfs.sh Thu Jul 4 19:02:03 2019 (r349742) @@ -13,7 +13,7 @@ # $FreeBSD$ HFS_SIZE=400 #Size in 2048-byte blocks of the produced image -LOADER_SIZE=300k +LOADER_SIZE=500k # Generate 800K HFS image OUTPUT_FILE=hfs-boot Modified: stable/12/release/powerpc/hfs-boot.bz2.uu ============================================================================== --- stable/12/release/powerpc/hfs-boot.bz2.uu Thu Jul 4 18:28:49 2019 (r349741) +++ stable/12/release/powerpc/hfs-boot.bz2.uu Thu Jul 4 19:02:03 2019 (r349742) @@ -2,22 +2,22 @@ HFS boot filesystem created by generate-hfs.sh DO NOT EDIT $FreeBSD$ begin 644 hfs-boot.bz2 -M0EIH.3%!62936=#$Y.(``"___?_O_G)7!_Y]OW??5#]U_^!`0`,@1`!!``!@ -M(0!`3,`"L"4.2U"2(H9%/:*>TFDVU3RGZID'J&C3U,@T-&@`/1!H>IZC1D#( -M`D24TTRFC1D]*;$@!IZ@Q!IH-````#0&33":?J@<:&AH:`:`Q`T!D``&F@`: -M`9````PDI1J>0Q,H/1J&@```!D-`````T-``#SZHHR(+Y*Y9J*Z:4KK=T]W@ -M4RV\LG/;0XDPC7^`9DO3/3&*].462T,NO#AA9C,O\0!)^Q@@S6";2`!);?8(B6BR1(-7Q*8?>>HPQSBQE>M$A9K6FFW<:#6[D931J%U.F8*`0 -MD(,M80A(0;]K'X'SI]G(C)Y).AK_/0)D(2$$]JB$]]F').M4RF8O%[IHK[0O -MMQ?'>O[U8EM;>U",KY^*%FO9C05_435?.4*F[6AIL%&9C<9W&& -M[ZMP(TG!'*4Z>@6TM)0BS.D._O,WR9OJ728V48I;DD=8QGBE7J-&L^?=0JEF -MV2`B/)/D\)83IS@32(;!P,152U()0VGQH>2F$UC:M!D5`F#1W$\:KKDR[TQB -MN;N5B1;P!7:AG#1BP2%-Q$7I6QE,Y?NHIK_LR+HA]22HW0.8(^G4/X`Z@!Z6 -8#PQ(0))/`A(0.'VUG_\7D\*>4\HS2-`:`#0````>IH`>H!H-`$B23)H"8% +M!^DF@!ID`:-!H-``&@]3U-`#0]('``-!H:#0`:9!H9`TT``!D`&0&0`$DDIH +M-I-`]0#3U-!HT`'J-``````T-`:&(\F**;,&,E=GQ&[8L)7V[YZ^ZJR_.@4& +MU2XDPC+N!>EYZ/W&3#04SE<:P5525]GTO0!)[3!!B8)L`$@-R?/:TG2RBWBD +M0W-`28BS(@AF_JA3LX#"=D,6`8$FQH;$D(00T-/U)FN-$V.@D&`83,*F)5QB +M4FE2VQ0-(20@DF(-O(HKUH0H8CD,%=&+-^.M]B8!::Q1RF@RL&TP46*0U-B% +MB<50X!"$#S8DV:/)48JA*AC$4DI.CV$L!H)>35`M2ZH9QEA%Q`A30=L(-&8J4!RX`FT"S%(H51.1'GG@?L)8[-HK%K>HLXPST0\@K. +M.0JVBB]*R,L4EW?[61,+)QSE0`]`'!N]>P2IX`_7`^,`A"!])"$DG#MJ +,K_B[DBG"A(;3UI(( ` end From owner-svn-src-stable-12@freebsd.org Thu Jul 4 19:52:51 2019 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 B25B515DD063; Thu, 4 Jul 2019 19:52:51 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 538526FEB6; Thu, 4 Jul 2019 19:52:51 +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 43FAB27B43; Thu, 4 Jul 2019 19:52:51 +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 x64JqpFe039551; Thu, 4 Jul 2019 19:52:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x64JqpmI039550; Thu, 4 Jul 2019 19:52:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201907041952.x64JqpmI039550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 4 Jul 2019 19:52: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: r349749 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 349749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 538526FEB6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 04 Jul 2019 19:52:51 -0000 Author: emaste Date: Thu Jul 4 19:52:50 2019 New Revision: 349749 URL: https://svnweb.freebsd.org/changeset/base/349749 Log: MFC r349239, r349241: update vm_map_protect.9 Clarify that vm_map_protect cannot upgrade max_protection It's implied by the man page's RETURN VALUES section, but be explicit in the description that vm_map_protect can not set new protection bits that are already in each entry's max_protection. Clarify vm_map_protect max_protection downgrade As reported in review D20709 by brooks calling vm_map_protect to set a new max_protection value downgrades existing mappings if necessary (as opposed to returning an error). Sponsored by: The FreeBSD Foundation Modified: stable/12/share/man/man9/vm_map_protect.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/vm_map_protect.9 ============================================================================== --- stable/12/share/man/man9/vm_map_protect.9 Thu Jul 4 19:46:58 2019 (r349748) +++ stable/12/share/man/man9/vm_map_protect.9 Thu Jul 4 19:52:50 2019 (r349749) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2003 +.Dd June 20, 2019 .Dt VM_MAP_PROTECT 9 .Os .Sh NAME @@ -51,6 +51,11 @@ within the map .Fa map to .Fa new_prot . +The value specified by +.Fa new_prot +may not include any protection bits that are not set in +.Va max_protection +on every entry within the range. .Pp If .Fa set_max @@ -59,7 +64,12 @@ is TRUE, is treated as the new .Va max_protection setting for each underlying entry. -Otherwise, only the +Protection bits not included +.Fa new_prot +will be cleared from existing entries. +If +.Fa set_max +is FALSE only the .Va protection field is affected. .Pp From owner-svn-src-stable-12@freebsd.org Fri Jul 5 00:55:47 2019 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 7A90015E1B02; Fri, 5 Jul 2019 00:55:47 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B21277C79; Fri, 5 Jul 2019 00:55:47 +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 DCC7E2E72; Fri, 5 Jul 2019 00:55:46 +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 x650tkt3096245; Fri, 5 Jul 2019 00:55:46 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x650tk2J096244; Fri, 5 Jul 2019 00:55:46 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201907050055.x650tk2J096244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 5 Jul 2019 00:55: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: r349755 - stable/12/usr.sbin/mountd X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/usr.sbin/mountd X-SVN-Commit-Revision: 349755 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B21277C79 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.93)[-0.935,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 05 Jul 2019 00:55:47 -0000 Author: rmacklem Date: Fri Jul 5 00:55:46 2019 New Revision: 349755 URL: https://svnweb.freebsd.org/changeset/base/349755 Log: MFC: r348452 Replace a single linked list with a hash table of lists. mountd.c uses a single linked list of "struct exportlist" structures, where there is one of these for each exported file system on the NFS server. This list gets long if there are a large number of file systems exported and the list must be searched for each line in the exports file(s) when SIGHUP causes the exports file(s) to be reloaded. A simple benchmark that traverses SLIST() elements and compares two 32bit fields in the structure for equal (which is what the search is) appears to take a couple of nsec. So, for a server with 72000 exported file systems, this can take about 5sec during reload of the exports file(s). By replacing the single linked list with a hash table with a target of 10 elements per list, the time should be reduced to less than 1msec. Peter Errikson (who has a server with 72000+ exported file systems) ran a test program using 5 hashes to see how they worked. fnv_32_buf(fsid,..., 0) fnv_32_buf(fsid,..., FNV1_32_INIT) hash32_buf(fsid,..., 0) hash32_buf(fsid,..., HASHINIT) - plus simply using the low order bits of fsid.val[0]. The first three behaved about equally well, with the first one being slightly better than the others. It has an average variation of about 4.5% about the target list length and that is what this patch uses. Peter Errikson also tested this hash table version and found that the performance wasn't measurably improved by a larger hash table, so a load factor of 10 appears adequate. PR: 237860 Modified: stable/12/usr.sbin/mountd/mountd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/mountd/mountd.c ============================================================================== --- stable/12/usr.sbin/mountd/mountd.c Thu Jul 4 23:58:11 2019 (r349754) +++ stable/12/usr.sbin/mountd/mountd.c Fri Jul 5 00:55:46 2019 (r349755) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -234,7 +235,9 @@ static int xdr_fhs(XDR *, caddr_t); static int xdr_mlist(XDR *, caddr_t); static void terminate(int); -static struct exportlisthead exphead = SLIST_HEAD_INITIALIZER(&exphead); +#define EXPHASH(f) (fnv_32_buf((f), sizeof(fsid_t), 0) % exphashsize) +static struct exportlisthead *exphead = NULL; +static int exphashsize = 0; static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(&mlhead); static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; static char **exnames; @@ -1092,7 +1095,7 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) if (bad) ep = NULL; else - ep = ex_search(&fsb.f_fsid, &exphead); + ep = ex_search(&fsb.f_fsid, exphead); hostset = defset = 0; if (ep && (chk_host(ep->ex_defdir, saddr, &defset, &hostset, &numsecflavors, &secflavorsp) || @@ -1307,21 +1310,23 @@ xdr_explist_common(XDR *xdrsp, caddr_t cp __unused, in int false = 0; int putdef; sigset_t sighup_mask; + int i; sigemptyset(&sighup_mask); sigaddset(&sighup_mask, SIGHUP); sigprocmask(SIG_BLOCK, &sighup_mask, NULL); - SLIST_FOREACH(ep, &exphead, entries) { - putdef = 0; - if (put_exlist(ep->ex_dirl, xdrsp, ep->ex_defdir, - &putdef, brief)) - goto errout; - if (ep->ex_defdir && putdef == 0 && - put_exlist(ep->ex_defdir, xdrsp, (struct dirlist *)NULL, - &putdef, brief)) - goto errout; - } + for (i = 0; i < exphashsize; i++) + SLIST_FOREACH(ep, &exphead[i], entries) { + putdef = 0; + if (put_exlist(ep->ex_dirl, xdrsp, ep->ex_defdir, + &putdef, brief)) + goto errout; + if (ep->ex_defdir && putdef == 0 && + put_exlist(ep->ex_defdir, xdrsp, NULL, + &putdef, brief)) + goto errout; + } sigprocmask(SIG_UNBLOCK, &sighup_mask, NULL); if (!xdr_bool(xdrsp, &false)) return (0); @@ -1545,7 +1550,7 @@ get_exportlist_one(void) * See if this directory is already * in the list. */ - ep = ex_search(&fsb.f_fsid, &exphead); + ep = ex_search(&fsb.f_fsid, exphead); if (ep == (struct exportlist *)NULL) { ep = get_exp(); ep->ex_fs = fsb.f_fsid; @@ -1700,7 +1705,7 @@ get_exportlist_one(void) } dirhead = (struct dirlist *)NULL; if ((ep->ex_flag & EX_LINKED) == 0) { - insert_exports(ep, &exphead); + insert_exports(ep, exphead); ep->ex_flag |= EX_LINKED; } @@ -1739,7 +1744,8 @@ get_exportlist(void) /* * First, get rid of the old list */ - free_exports(&exphead); + if (exphead != NULL) + free_exports(exphead); /* * and the old V4 root dir. @@ -1762,6 +1768,21 @@ get_exportlist(void) */ num = getmntinfo(&mntbufp, MNT_NOWAIT); + /* Allocate hash tables, for first call. */ + if (exphead == NULL) { + /* Target an average linked list length of 10. */ + exphashsize = num / 10; + if (exphashsize < 1) + exphashsize = 1; + else if (exphashsize > 100000) + exphashsize = 100000; + exphead = malloc(exphashsize * sizeof(*exphead)); + if (exphead == NULL) + errx(1, "Can't malloc hash table"); + + for (i = 0; i < exphashsize; i++) + SLIST_INIT(&exphead[i]); + } if (num > 0) { build_iovec(&iov, &iovlen, "fstype", NULL, 0); build_iovec(&iov, &iovlen, "fspath", NULL, 0); @@ -1806,8 +1827,10 @@ get_exportlist(void) static void insert_exports(struct exportlist *ep, struct exportlisthead *exhp) { + uint32_t i; - SLIST_INSERT_HEAD(exhp, ep, entries); + i = EXPHASH(&ep->ex_fs); + SLIST_INSERT_HEAD(&exhp[i], ep, entries); } /* @@ -1817,12 +1840,15 @@ static void free_exports(struct exportlisthead *exhp) { struct exportlist *ep, *ep2; + int i; - SLIST_FOREACH_SAFE(ep, exhp, entries, ep2) { - SLIST_REMOVE(exhp, ep, exportlist, entries); - free_exp(ep); + for (i = 0; i < exphashsize; i++) { + SLIST_FOREACH_SAFE(ep, &exhp[i], entries, ep2) { + SLIST_REMOVE(&exhp[i], ep, exportlist, entries); + free_exp(ep); + } + SLIST_INIT(&exhp[i]); } - SLIST_INIT(exhp); } /* @@ -1962,8 +1988,10 @@ static struct exportlist * ex_search(fsid_t *fsid, struct exportlisthead *exhp) { struct exportlist *ep; + uint32_t i; - SLIST_FOREACH(ep, exhp, entries) { + i = EXPHASH(fsid); + SLIST_FOREACH(ep, &exhp[i], entries) { if (ep->ex_fs.val[0] == fsid->val[0] && ep->ex_fs.val[1] == fsid->val[1]) return (ep); From owner-svn-src-stable-12@freebsd.org Fri Jul 5 01:19:29 2019 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 5C1C815E2092; Fri, 5 Jul 2019 01:19:29 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3B0280521; Fri, 5 Jul 2019 01:19:28 +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 BE9C631B2; Fri, 5 Jul 2019 01:19:28 +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 x651JSis006826; Fri, 5 Jul 2019 01:19:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x651JSJX006825; Fri, 5 Jul 2019 01:19:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907050119.x651JSJX006825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 5 Jul 2019 01:19:28 +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: r349757 - 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: 349757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F3B0280521 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 05 Jul 2019 01:19:29 -0000 Author: kib Date: Fri Jul 5 01:19:28 2019 New Revision: 349757 URL: https://svnweb.freebsd.org/changeset/base/349757 Log: MFC r349611, r349614: Style. Modified: stable/12/sys/kern/kern_umtx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_umtx.c ============================================================================== --- stable/12/sys/kern/kern_umtx.c Fri Jul 5 01:04:58 2019 (r349756) +++ stable/12/sys/kern/kern_umtx.c Fri Jul 5 01:19:28 2019 (r349757) @@ -1059,7 +1059,6 @@ do_lock_normal(struct thread *td, struct umutex *m, ui if (owner == UMUTEX_RB_NOTRECOV) return (ENOTRECOVERABLE); - /* * Try the uncontested case. This should be * done in userland. @@ -2658,7 +2657,8 @@ do_rw_rdlock(struct thread *td, struct urwlock *rwlock /* try to lock it */ while (!(state & wrflags)) { - if (__predict_false(URWLOCK_READER_COUNT(state) == URWLOCK_MAX_READERS)) { + if (__predict_false(URWLOCK_READER_COUNT(state) == + URWLOCK_MAX_READERS)) { umtx_key_release(&uq->uq_key); return (EAGAIN); } @@ -2725,7 +2725,10 @@ do_rw_rdlock(struct thread *td, struct urwlock *rwlock } sleep: - /* contention bit is set, before sleeping, increase read waiter count */ + /* + * Contention bit is set, before sleeping, increase + * read waiter count. + */ rv = fueword32(&rwlock->rw_blocked_readers, &blocked_readers); if (rv == -1) { @@ -2829,7 +2832,8 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock umtx_key_release(&uq->uq_key); return (EFAULT); } - while (!(state & URWLOCK_WRITE_OWNER) && URWLOCK_READER_COUNT(state) == 0) { + while ((state & URWLOCK_WRITE_OWNER) == 0 && + URWLOCK_READER_COUNT(state) == 0) { rv = casueword32(&rwlock->rw_state, state, &oldstate, state | URWLOCK_WRITE_OWNER); if (rv == -1) { @@ -2865,8 +2869,8 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock umtxq_unlock(&uq->uq_key); /* - * re-read the state, in case it changed between the try-lock above - * and the check below + * Re-read the state, in case it changed between the + * try-lock above and the check below. */ rv = fueword32(&rwlock->rw_state, &state); if (rv == -1) @@ -2893,7 +2897,8 @@ do_rw_wrlock(struct thread *td, struct urwlock *rwlock break; } - if (!(state & URWLOCK_WRITE_OWNER) && URWLOCK_READER_COUNT(state) == 0) { + if ((state & URWLOCK_WRITE_OWNER) == 0 && + URWLOCK_READER_COUNT(state) == 0) { umtxq_unbusy_unlocked(&uq->uq_key); error = umtxq_check_susp(td); if (error != 0) @@ -2908,9 +2913,10 @@ sleep: error = EFAULT; break; } - suword32(&rwlock->rw_blocked_writers, blocked_writers+1); + suword32(&rwlock->rw_blocked_writers, blocked_writers + 1); - while ((state & URWLOCK_WRITE_OWNER) || URWLOCK_READER_COUNT(state) != 0) { + while ((state & URWLOCK_WRITE_OWNER) || + URWLOCK_READER_COUNT(state) != 0) { umtxq_lock(&uq->uq_key); umtxq_insert_queue(uq, UMTX_EXCLUSIVE_QUEUE); umtxq_unbusy(&uq->uq_key); From owner-svn-src-stable-12@freebsd.org Fri Jul 5 04:24:11 2019 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 476DB15E470A; Fri, 5 Jul 2019 04:24:11 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DEBF6849D7; Fri, 5 Jul 2019 04:24:10 +0000 (UTC) (envelope-from cy@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 B5AE35490; Fri, 5 Jul 2019 04:24:10 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x654OAbk005925; Fri, 5 Jul 2019 04:24:10 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x654OAku005924; Fri, 5 Jul 2019 04:24:10 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201907050424.x654OAku005924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 5 Jul 2019 04:24: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: r349759 - in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 10/contrib/ipfilter/man 11/contrib/ipfilter/man 12/contrib/ipfilter/man X-SVN-Commit-Revision: 349759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DEBF6849D7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 05 Jul 2019 04:24:11 -0000 Author: cy Date: Fri Jul 5 04:24:09 2019 New Revision: 349759 URL: https://svnweb.freebsd.org/changeset/base/349759 Log: MFC r349503-349504: Document the -B, binary logfile, and the -C config file options. Reference the ipmon.5 man page and ipmon.conf. PR: 238816 Modified: stable/12/contrib/ipfilter/man/ipmon.8 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ipfilter/man/ipmon.8 stable/11/contrib/ipfilter/man/ipmon.8 Directory Properties: stable/10/ (props changed) stable/11/ (props changed) Modified: stable/12/contrib/ipfilter/man/ipmon.8 ============================================================================== --- stable/12/contrib/ipfilter/man/ipmon.8 Fri Jul 5 01:22:16 2019 (r349758) +++ stable/12/contrib/ipfilter/man/ipmon.8 Fri Jul 5 04:24:09 2019 (r349759) @@ -7,6 +7,10 @@ ipmon \- monitors /dev/ipl for logged packets [ .B \-abBDFhnpstvxX ] [ +.B "\-B " +] [ +.B "\-C " +] [ .B "\-N " ] [ .B "\-L " @@ -92,6 +96,10 @@ Enable logging of the raw, unformatted binary data to \fI\fP file. This can be read, later, using \fBipmon\fP with the \fB-f\fP option. .TP +.B \-C +This option specifies a file to be used to specify optional extra actions +when it sees specific log entries from the kernel. +.TP .B \-D Cause ipmon to turn itself into a daemon. Using subshells or backgrounding of ipmon is not required to turn it into an orphan so it can run indefinitely. @@ -178,9 +186,11 @@ recorded data. .br /dev/ipstate .br +/etc/ipmon.conf +.br /etc/services .SH SEE ALSO -ipl(4), ipf(8), ipfstat(8), ipnat(8) +ipl(4), ipmon(5), ipf(8), ipfstat(8), ipnat(8) .SH BUGS .PP If you find any, please send email to me at darrenr@pobox.com From owner-svn-src-stable-12@freebsd.org Fri Jul 5 10:31:39 2019 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 B7A7C15EA1F5; Fri, 5 Jul 2019 10:31:39 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64CCC8FF0D; Fri, 5 Jul 2019 10:31:39 +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 168FE9181; Fri, 5 Jul 2019 10:31:39 +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 x65AVdfp097274; Fri, 5 Jul 2019 10:31:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x65AVc0V097267; Fri, 5 Jul 2019 10:31:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201907051031.x65AVc0V097267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Jul 2019 10:31: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: r349762 - in stable/12/sys: net netinet netinet6 netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys: net netinet netinet6 netpfil/pf X-SVN-Commit-Revision: 349762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 64CCC8FF0D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 05 Jul 2019 10:31:40 -0000 Author: hselasky Date: Fri Jul 5 10:31:37 2019 New Revision: 349762 URL: https://svnweb.freebsd.org/changeset/base/349762 Log: MFC r349369: Convert all IPv4 and IPv6 multicast memberships into using a STAILQ instead of a linear array. The multicast memberships for the inpcb structure are protected by a non-sleepable lock, INP_WLOCK(), which needs to be dropped when calling the underlying possibly sleeping if_ioctl() method. When using a linear array to keep track of multicast memberships, the computed memory location of the multicast filter may suddenly change, due to concurrent insertion or removal of elements in the linear array. This in turn leads to various invalid memory access issues and kernel panics. To avoid this problem, put all multicast memberships on a STAILQ based list. Then the memory location of the IPv4 and IPv6 multicast filters become fixed during their lifetime and use after free and memory leak issues are easier to track, for example by: vmstat -m | grep multi All list manipulation has been factored into inline functions including some macros, to easily allow for a future hash-list implementation, if needed. This patch has been tested by pho@ . Differential Revision: https://reviews.freebsd.org/D20080 Reviewed by: markj @ Sponsored by: Mellanox Technologies Modified: stable/12/sys/net/if_vxlan.c stable/12/sys/netinet/in.h stable/12/sys/netinet/in_mcast.c stable/12/sys/netinet/in_pcb.c stable/12/sys/netinet/in_var.h stable/12/sys/netinet/ip_carp.c stable/12/sys/netinet/ip_mroute.c stable/12/sys/netinet/ip_var.h stable/12/sys/netinet6/in6.h stable/12/sys/netinet6/in6_ifattach.c stable/12/sys/netinet6/in6_mcast.c stable/12/sys/netinet6/in6_pcb.c stable/12/sys/netinet6/in6_var.h stable/12/sys/netinet6/ip6_var.h stable/12/sys/netpfil/pf/if_pfsync.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_vxlan.c ============================================================================== --- stable/12/sys/net/if_vxlan.c Fri Jul 5 06:53:12 2019 (r349761) +++ stable/12/sys/net/if_vxlan.c Fri Jul 5 10:31:37 2019 (r349762) @@ -1134,7 +1134,7 @@ vxlan_socket_mc_join_group(struct vxlan_socket *vso, * If we really need to, we can of course look in the INP's * membership list: * sotoinpcb(vso->vxlso_sock)->inp_moptions-> - * imo_membership[]->inm_ifp + * imo_head[]->imf_inm->inm_ifp * similarly to imo_match_group(). */ source->in4.sin_addr = local->in4.sin_addr; Modified: stable/12/sys/netinet/in.h ============================================================================== --- stable/12/sys/netinet/in.h Fri Jul 5 06:53:12 2019 (r349761) +++ stable/12/sys/netinet/in.h Fri Jul 5 10:31:37 2019 (r349762) @@ -505,13 +505,9 @@ __END_DECLS #define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ /* - * The imo_membership vector for each socket is now dynamically allocated at - * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized - * according to a power-of-two increment. + * Limit for IPv4 multicast memberships */ -#define IP_MIN_MEMBERSHIPS 31 #define IP_MAX_MEMBERSHIPS 4095 -#define IP_MAX_SOURCE_FILTER 1024 /* XXX to be unused */ /* * Default resource limits for IPv4 multicast source filtering. Modified: stable/12/sys/netinet/in_mcast.c ============================================================================== --- stable/12/sys/netinet/in_mcast.c Fri Jul 5 06:53:12 2019 (r349761) +++ stable/12/sys/netinet/in_mcast.c Fri Jul 5 10:31:37 2019 (r349762) @@ -94,7 +94,9 @@ static MALLOC_DEFINE(M_IPMSOURCE, "ip_msource", /* * Locking: - * - Lock order is: Giant, INP_WLOCK, IN_MULTI_LIST_LOCK, IGMP_LOCK, IF_ADDR_LOCK. + * + * - Lock order is: Giant, IN_MULTI_LOCK, INP_WLOCK, + * IN_MULTI_LIST_LOCK, IGMP_LOCK, IF_ADDR_LOCK. * - The IF_ADDR_LOCK is implicitly taken by inm_lookup() earlier, however * it can be taken by code in net/if.c also. * - ip_moptions and in_mfilter are covered by the INP_WLOCK. @@ -144,12 +146,11 @@ static int imf_prune(struct in_mfilter *, const struct static void imf_purge(struct in_mfilter *); static void imf_rollback(struct in_mfilter *); static void imf_reap(struct in_mfilter *); -static int imo_grow(struct ip_moptions *); -static size_t imo_match_group(const struct ip_moptions *, +static struct in_mfilter * + imo_match_group(const struct ip_moptions *, const struct ifnet *, const struct sockaddr *); static struct in_msource * - imo_match_source(const struct ip_moptions *, const size_t, - const struct sockaddr *); + imo_match_source(struct in_mfilter *, const struct sockaddr *); static void ims_merge(struct ip_msource *ims, const struct in_msource *lims, const int rollback); static int in_getmulti(struct ifnet *, const struct in_addr *, @@ -333,6 +334,26 @@ imf_init(struct in_mfilter *imf, const int st0, const imf->imf_st[1] = st1; } +struct in_mfilter * +ip_mfilter_alloc(const int mflags, const int st0, const int st1) +{ + struct in_mfilter *imf; + + imf = malloc(sizeof(*imf), M_INMFILTER, mflags); + if (imf != NULL) + imf_init(imf, st0, st1); + + return (imf); +} + +void +ip_mfilter_free(struct in_mfilter *imf) +{ + + imf_purge(imf); + free(imf, M_INMFILTER); +} + /* * Function for looking up an in_multi record for an IPv4 multicast address * on a given interface. ifp must be valid. If no record found, return NULL. @@ -378,89 +399,30 @@ inm_lookup(struct ifnet *ifp, const struct in_addr ina } /* - * Resize the ip_moptions vector to the next power-of-two minus 1. - * May be called with locks held; do not sleep. - */ -static int -imo_grow(struct ip_moptions *imo) -{ - struct in_multi **nmships; - struct in_multi **omships; - struct in_mfilter *nmfilters; - struct in_mfilter *omfilters; - size_t idx; - size_t newmax; - size_t oldmax; - - nmships = NULL; - nmfilters = NULL; - omships = imo->imo_membership; - omfilters = imo->imo_mfilters; - oldmax = imo->imo_max_memberships; - newmax = ((oldmax + 1) * 2) - 1; - - if (newmax <= IP_MAX_MEMBERSHIPS) { - nmships = (struct in_multi **)realloc(omships, - sizeof(struct in_multi *) * newmax, M_IPMOPTS, M_NOWAIT); - nmfilters = (struct in_mfilter *)realloc(omfilters, - sizeof(struct in_mfilter) * newmax, M_INMFILTER, M_NOWAIT); - if (nmships != NULL && nmfilters != NULL) { - /* Initialize newly allocated source filter heads. */ - for (idx = oldmax; idx < newmax; idx++) { - imf_init(&nmfilters[idx], MCAST_UNDEFINED, - MCAST_EXCLUDE); - } - imo->imo_max_memberships = newmax; - imo->imo_membership = nmships; - imo->imo_mfilters = nmfilters; - } - } - - if (nmships == NULL || nmfilters == NULL) { - if (nmships != NULL) - free(nmships, M_IPMOPTS); - if (nmfilters != NULL) - free(nmfilters, M_INMFILTER); - return (ETOOMANYREFS); - } - - return (0); -} - -/* * Find an IPv4 multicast group entry for this ip_moptions instance * which matches the specified group, and optionally an interface. * Return its index into the array, or -1 if not found. */ -static size_t +static struct in_mfilter * imo_match_group(const struct ip_moptions *imo, const struct ifnet *ifp, const struct sockaddr *group) { const struct sockaddr_in *gsin; - struct in_multi **pinm; - int idx; - int nmships; + struct in_mfilter *imf; + struct in_multi *inm; gsin = (const struct sockaddr_in *)group; - /* The imo_membership array may be lazy allocated. */ - if (imo->imo_membership == NULL || imo->imo_num_memberships == 0) - return (-1); - - nmships = imo->imo_num_memberships; - pinm = &imo->imo_membership[0]; - for (idx = 0; idx < nmships; idx++, pinm++) { - if (*pinm == NULL) + IP_MFILTER_FOREACH(imf, &imo->imo_head) { + inm = imf->imf_inm; + if (inm == NULL) continue; - if ((ifp == NULL || ((*pinm)->inm_ifp == ifp)) && - in_hosteq((*pinm)->inm_addr, gsin->sin_addr)) { + if ((ifp == NULL || (inm->inm_ifp == ifp)) && + in_hosteq(inm->inm_addr, gsin->sin_addr)) { break; } } - if (idx >= nmships) - idx = -1; - - return (idx); + return (imf); } /* @@ -471,23 +433,14 @@ imo_match_group(const struct ip_moptions *imo, const s * it exists, which may not be the desired behaviour. */ static struct in_msource * -imo_match_source(const struct ip_moptions *imo, const size_t gidx, - const struct sockaddr *src) +imo_match_source(struct in_mfilter *imf, const struct sockaddr *src) { struct ip_msource find; - struct in_mfilter *imf; struct ip_msource *ims; const sockunion_t *psa; KASSERT(src->sa_family == AF_INET, ("%s: !AF_INET", __func__)); - KASSERT(gidx != -1 && gidx < imo->imo_num_memberships, - ("%s: invalid index %d\n", __func__, (int)gidx)); - /* The imo_mfilters array may be lazy allocated. */ - if (imo->imo_mfilters == NULL) - return (NULL); - imf = &imo->imo_mfilters[gidx]; - /* Source trees are keyed in host byte order. */ psa = (const sockunion_t *)src; find.ims_haddr = ntohl(psa->sin.sin_addr.s_addr); @@ -506,14 +459,14 @@ int imo_multi_filter(const struct ip_moptions *imo, const struct ifnet *ifp, const struct sockaddr *group, const struct sockaddr *src) { - size_t gidx; + struct in_mfilter *imf; struct in_msource *ims; int mode; KASSERT(ifp != NULL, ("%s: null ifp", __func__)); - gidx = imo_match_group(imo, ifp, group); - if (gidx == -1) + imf = imo_match_group(imo, ifp, group); + if (imf == NULL) return (MCAST_NOTGMEMBER); /* @@ -525,8 +478,8 @@ imo_multi_filter(const struct ip_moptions *imo, const * NOTE: We are comparing group state here at IGMP t1 (now) * with socket-layer t0 (since last downcall). */ - mode = imo->imo_mfilters[gidx].imf_st[1]; - ims = imo_match_source(imo, gidx, src); + mode = imf->imf_st[1]; + ims = imo_match_source(imf, src); if ((ims == NULL && mode == MCAST_INCLUDE) || (ims != NULL && ims->imsl_st[0] != mode)) @@ -1451,7 +1404,6 @@ inp_block_unblock_source(struct inpcb *inp, struct soc struct ip_moptions *imo; struct in_msource *ims; struct in_multi *inm; - size_t idx; uint16_t fmode; int error, doblock; @@ -1530,21 +1482,19 @@ inp_block_unblock_source(struct inpcb *inp, struct soc if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) return (EINVAL); + IN_MULTI_LOCK(); + /* * Check if we are actually a member of this group. */ imo = inp_findmoptions(inp); - idx = imo_match_group(imo, ifp, &gsa->sa); - if (idx == -1 || imo->imo_mfilters == NULL) { + imf = imo_match_group(imo, ifp, &gsa->sa); + if (imf == NULL) { error = EADDRNOTAVAIL; goto out_inp_locked; } + inm = imf->imf_inm; - KASSERT(imo->imo_mfilters != NULL, - ("%s: imo_mfilters not allocated", __func__)); - imf = &imo->imo_mfilters[idx]; - inm = imo->imo_membership[idx]; - /* * Attempting to use the delta-based API on an * non exclusive-mode membership is an error. @@ -1561,7 +1511,7 @@ inp_block_unblock_source(struct inpcb *inp, struct soc * Asked to unblock, but nothing to unblock. * If adding a new block entry, allocate it. */ - ims = imo_match_source(imo, idx, &ssa->sa); + ims = imo_match_source(imf, &ssa->sa); if ((ims != NULL && doblock) || (ims == NULL && !doblock)) { CTR3(KTR_IGMPV3, "%s: source 0x%08x %spresent", __func__, ntohl(ssa->sin.sin_addr.s_addr), doblock ? "" : "not "); @@ -1592,14 +1542,13 @@ inp_block_unblock_source(struct inpcb *inp, struct soc /* * Begin state merge transaction at IGMP layer. */ - IN_MULTI_LOCK(); CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); IN_MULTI_LIST_LOCK(); error = inm_merge(inm, imf); if (error) { CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_in_multi_locked; + goto out_imf_rollback; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); @@ -1608,9 +1557,6 @@ inp_block_unblock_source(struct inpcb *inp, struct soc if (error) CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); -out_in_multi_locked: - - IN_MULTI_UNLOCK(); out_imf_rollback: if (error) imf_rollback(imf); @@ -1621,6 +1567,7 @@ out_imf_rollback: out_inp_locked: INP_WUNLOCK(inp); + IN_MULTI_UNLOCK(); return (error); } @@ -1635,9 +1582,6 @@ static struct ip_moptions * inp_findmoptions(struct inpcb *inp) { struct ip_moptions *imo; - struct in_multi **immp; - struct in_mfilter *imfp; - size_t idx; INP_WLOCK(inp); if (inp->inp_moptions != NULL) @@ -1646,29 +1590,16 @@ inp_findmoptions(struct inpcb *inp) INP_WUNLOCK(inp); imo = malloc(sizeof(*imo), M_IPMOPTS, M_WAITOK); - immp = malloc(sizeof(*immp) * IP_MIN_MEMBERSHIPS, M_IPMOPTS, - M_WAITOK | M_ZERO); - imfp = malloc(sizeof(struct in_mfilter) * IP_MIN_MEMBERSHIPS, - M_INMFILTER, M_WAITOK); imo->imo_multicast_ifp = NULL; imo->imo_multicast_addr.s_addr = INADDR_ANY; imo->imo_multicast_vif = -1; imo->imo_multicast_ttl = IP_DEFAULT_MULTICAST_TTL; imo->imo_multicast_loop = in_mcast_loop; - imo->imo_num_memberships = 0; - imo->imo_max_memberships = IP_MIN_MEMBERSHIPS; - imo->imo_membership = immp; + STAILQ_INIT(&imo->imo_head); - /* Initialize per-group source filters. */ - for (idx = 0; idx < IP_MIN_MEMBERSHIPS; idx++) - imf_init(&imfp[idx], MCAST_UNDEFINED, MCAST_EXCLUDE); - imo->imo_mfilters = imfp; - INP_WLOCK(inp); if (inp->inp_moptions != NULL) { - free(imfp, M_INMFILTER); - free(immp, M_IPMOPTS); free(imo, M_IPMOPTS); return (inp->inp_moptions); } @@ -1679,32 +1610,25 @@ inp_findmoptions(struct inpcb *inp) static void inp_gcmoptions(struct ip_moptions *imo) { - struct in_mfilter *imf; + struct in_mfilter *imf; struct in_multi *inm; struct ifnet *ifp; - size_t idx, nmships; - nmships = imo->imo_num_memberships; - for (idx = 0; idx < nmships; ++idx) { - imf = imo->imo_mfilters ? &imo->imo_mfilters[idx] : NULL; - if (imf) - imf_leave(imf); - inm = imo->imo_membership[idx]; - ifp = inm->inm_ifp; - if (ifp != NULL) { - CURVNET_SET(ifp->if_vnet); - (void)in_leavegroup(inm, imf); - CURVNET_RESTORE(); - } else { - (void)in_leavegroup(inm, imf); + while ((imf = ip_mfilter_first(&imo->imo_head)) != NULL) { + ip_mfilter_remove(&imo->imo_head, imf); + + imf_leave(imf); + if ((inm = imf->imf_inm) != NULL) { + if ((ifp = inm->inm_ifp) != NULL) { + CURVNET_SET(ifp->if_vnet); + (void)in_leavegroup(inm, imf); + CURVNET_RESTORE(); + } else { + (void)in_leavegroup(inm, imf); + } } - if (imf) - imf_purge(imf); + ip_mfilter_free(imf); } - - if (imo->imo_mfilters) - free(imo->imo_mfilters, M_INMFILTER); - free(imo->imo_membership, M_IPMOPTS); free(imo, M_IPMOPTS); } @@ -1740,7 +1664,7 @@ inp_get_source_filters(struct inpcb *inp, struct socko struct sockaddr_storage *ptss; struct sockaddr_storage *tss; int error; - size_t idx, nsrcs, ncsrcs; + size_t nsrcs, ncsrcs; INP_WLOCK_ASSERT(inp); @@ -1767,12 +1691,11 @@ inp_get_source_filters(struct inpcb *inp, struct socko * Lookup group on the socket. */ gsa = (sockunion_t *)&msfr.msfr_group; - idx = imo_match_group(imo, ifp, &gsa->sa); - if (idx == -1 || imo->imo_mfilters == NULL) { + imf = imo_match_group(imo, ifp, &gsa->sa); + if (imf == NULL) { INP_WUNLOCK(inp); return (EADDRNOTAVAIL); } - imf = &imo->imo_mfilters[idx]; /* * Ignore memberships which are in limbo. @@ -2030,14 +1953,11 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt struct ip_moptions *imo; struct in_multi *inm; struct in_msource *lims; - size_t idx; int error, is_new; ifp = NULL; - imf = NULL; lims = NULL; error = 0; - is_new = 0; memset(&gsr, 0, sizeof(struct group_source_req)); gsa = (sockunion_t *)&gsr.gsr_group; @@ -2145,13 +2065,25 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt if (ifp == NULL || (ifp->if_flags & IFF_MULTICAST) == 0) return (EADDRNOTAVAIL); + IN_MULTI_LOCK(); + + /* + * Find the membership in the membership list. + */ imo = inp_findmoptions(inp); - idx = imo_match_group(imo, ifp, &gsa->sa); - if (idx == -1) { + imf = imo_match_group(imo, ifp, &gsa->sa); + if (imf == NULL) { is_new = 1; + inm = NULL; + + if (ip_mfilter_count(&imo->imo_head) >= IP_MAX_MEMBERSHIPS) { + error = ENOMEM; + goto out_inp_locked; + } } else { - inm = imo->imo_membership[idx]; - imf = &imo->imo_mfilters[idx]; + is_new = 0; + inm = imf->imf_inm; + if (ssa->ss.ss_family != AF_UNSPEC) { /* * MCAST_JOIN_SOURCE_GROUP on an exclusive membership @@ -2178,7 +2110,7 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt * full-state SSM API with the delta-based API, * which is discouraged in the relevant RFCs. */ - lims = imo_match_source(imo, idx, &ssa->sa); + lims = imo_match_source(imf, &ssa->sa); if (lims != NULL /*&& lims->imsl_st[1] == MCAST_INCLUDE*/) { error = EADDRNOTAVAIL; @@ -2211,27 +2143,6 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt */ INP_WLOCK_ASSERT(inp); - if (is_new) { - if (imo->imo_num_memberships == imo->imo_max_memberships) { - error = imo_grow(imo); - if (error) - goto out_inp_locked; - } - /* - * Allocate the new slot upfront so we can deal with - * grafting the new source filter in same code path - * as for join-source on existing membership. - */ - idx = imo->imo_num_memberships; - imo->imo_membership[idx] = NULL; - imo->imo_num_memberships++; - KASSERT(imo->imo_mfilters != NULL, - ("%s: imf_mfilters vector was not allocated", __func__)); - imf = &imo->imo_mfilters[idx]; - KASSERT(RB_EMPTY(&imf->imf_sources), - ("%s: imf_sources not empty", __func__)); - } - /* * Graft new source into filter list for this inpcb's * membership of the group. The in_multi may not have @@ -2247,7 +2158,11 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt /* Membership starts in IN mode */ if (is_new) { CTR1(KTR_IGMPV3, "%s: new join w/source", __func__); - imf_init(imf, MCAST_UNDEFINED, MCAST_INCLUDE); + imf = ip_mfilter_alloc(M_NOWAIT, MCAST_UNDEFINED, MCAST_INCLUDE); + if (imf == NULL) { + error = ENOMEM; + goto out_inp_locked; + } } else { CTR2(KTR_IGMPV3, "%s: %s source", __func__, "allow"); } @@ -2256,34 +2171,41 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt CTR1(KTR_IGMPV3, "%s: merge imf state failed", __func__); error = ENOMEM; - goto out_imo_free; + goto out_inp_locked; } } else { /* No address specified; Membership starts in EX mode */ if (is_new) { CTR1(KTR_IGMPV3, "%s: new join w/o source", __func__); - imf_init(imf, MCAST_UNDEFINED, MCAST_EXCLUDE); + imf = ip_mfilter_alloc(M_NOWAIT, MCAST_UNDEFINED, MCAST_EXCLUDE); + if (imf == NULL) { + error = ENOMEM; + goto out_inp_locked; + } } } /* * Begin state merge transaction at IGMP layer. */ - in_pcbref(inp); - INP_WUNLOCK(inp); - IN_MULTI_LOCK(); - if (is_new) { + in_pcbref(inp); + INP_WUNLOCK(inp); + error = in_joingroup_locked(ifp, &gsa->sin.sin_addr, imf, - &inm); + &imf->imf_inm); + + INP_WLOCK(inp); + if (in_pcbrele_wlocked(inp)) { + error = ENXIO; + goto out_inp_unlocked; + } if (error) { CTR1(KTR_IGMPV3, "%s: in_joingroup_locked failed", __func__); - IN_MULTI_LIST_UNLOCK(); - goto out_imo_free; + goto out_inp_locked; } - inm_acquire(inm); - imo->imo_membership[idx] = inm; + inm_acquire(imf->imf_inm); } else { CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); IN_MULTI_LIST_LOCK(); @@ -2292,7 +2214,9 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_in_multi_locked; + imf_rollback(imf); + imf_reap(imf); + goto out_inp_locked; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); error = igmp_change_state(inm); @@ -2300,40 +2224,30 @@ inp_join_group(struct inpcb *inp, struct sockopt *sopt if (error) { CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); - goto out_in_multi_locked; + imf_rollback(imf); + imf_reap(imf); + goto out_inp_locked; } } + if (is_new) + ip_mfilter_insert(&imo->imo_head, imf); -out_in_multi_locked: + imf_commit(imf); + imf = NULL; +out_inp_locked: + INP_WUNLOCK(inp); +out_inp_unlocked: IN_MULTI_UNLOCK(); - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) - return (ENXIO); - if (error) { - imf_rollback(imf); - if (is_new) - imf_purge(imf); - else - imf_reap(imf); - } else { - imf_commit(imf); - } -out_imo_free: - if (error && is_new) { - inm = imo->imo_membership[idx]; - if (inm != NULL) { + if (is_new && imf) { + if (imf->imf_inm != NULL) { IN_MULTI_LIST_LOCK(); - inm_release_deferred(inm); + inm_release_deferred(imf->imf_inm); IN_MULTI_LIST_UNLOCK(); } - imo->imo_membership[idx] = NULL; - --imo->imo_num_memberships; + ip_mfilter_free(imf); } - -out_inp_locked: - INP_WUNLOCK(inp); return (error); } @@ -2352,12 +2266,12 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop struct ip_moptions *imo; struct in_msource *ims; struct in_multi *inm; - size_t idx; - int error, is_final; + int error; + bool is_final; ifp = NULL; error = 0; - is_final = 1; + is_final = true; memset(&gsr, 0, sizeof(struct group_source_req)); gsa = (sockunion_t *)&gsr.gsr_group; @@ -2457,20 +2371,21 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop if (!IN_MULTICAST(ntohl(gsa->sin.sin_addr.s_addr))) return (EINVAL); + IN_MULTI_LOCK(); + /* - * Find the membership in the membership array. + * Find the membership in the membership list. */ imo = inp_findmoptions(inp); - idx = imo_match_group(imo, ifp, &gsa->sa); - if (idx == -1) { + imf = imo_match_group(imo, ifp, &gsa->sa); + if (imf == NULL) { error = EADDRNOTAVAIL; goto out_inp_locked; } - inm = imo->imo_membership[idx]; - imf = &imo->imo_mfilters[idx]; + inm = imf->imf_inm; if (ssa->ss.ss_family != AF_UNSPEC) - is_final = 0; + is_final = false; /* * Begin state merge transaction at socket layer. @@ -2482,13 +2397,14 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop * MCAST_LEAVE_SOURCE_GROUP is only valid for inclusive memberships. */ if (is_final) { + ip_mfilter_remove(&imo->imo_head, imf); imf_leave(imf); } else { if (imf->imf_st[0] == MCAST_EXCLUDE) { error = EADDRNOTAVAIL; goto out_inp_locked; } - ims = imo_match_source(imo, idx, &ssa->sa); + ims = imo_match_source(imf, &ssa->sa); if (ims == NULL) { CTR3(KTR_IGMPV3, "%s: source 0x%08x %spresent", __func__, ntohl(ssa->sin.sin_addr.s_addr), "not "); @@ -2507,17 +2423,7 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop /* * Begin state merge transaction at IGMP layer. */ - in_pcbref(inp); - INP_WUNLOCK(inp); - IN_MULTI_LOCK(); - - if (is_final) { - /* - * Give up the multicast address record to which - * the membership points. - */ - (void)in_leavegroup_locked(inm, imf); - } else { + if (!is_final) { CTR1(KTR_IGMPV3, "%s: merge inm state", __func__); IN_MULTI_LIST_LOCK(); error = inm_merge(inm, imf); @@ -2525,7 +2431,9 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_in_multi_locked; + imf_rollback(imf); + imf_reap(imf); + goto out_inp_locked; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); @@ -2534,38 +2442,27 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop if (error) { CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); + imf_rollback(imf); + imf_reap(imf); + goto out_inp_locked; } } - -out_in_multi_locked: - - IN_MULTI_UNLOCK(); - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) - return (ENXIO); - - if (error) - imf_rollback(imf); - else - imf_commit(imf); - + imf_commit(imf); imf_reap(imf); - if (is_final) { - /* Remove the gap in the membership and filter array. */ - KASSERT(RB_EMPTY(&imf->imf_sources), - ("%s: imf_sources not empty", __func__)); - for (++idx; idx < imo->imo_num_memberships; ++idx) { - imo->imo_membership[idx - 1] = imo->imo_membership[idx]; - imo->imo_mfilters[idx - 1] = imo->imo_mfilters[idx]; - } - imf_init(&imo->imo_mfilters[idx - 1], MCAST_UNDEFINED, - MCAST_EXCLUDE); - imo->imo_num_memberships--; - } - out_inp_locked: INP_WUNLOCK(inp); + + if (is_final && imf) { + /* + * Give up the multicast address record to which + * the membership points. + */ + (void) in_leavegroup_locked(imf->imf_inm, imf); + ip_mfilter_free(imf); + } + + IN_MULTI_UNLOCK(); return (error); } @@ -2655,7 +2552,6 @@ inp_set_source_filters(struct inpcb *inp, struct socko struct in_mfilter *imf; struct ip_moptions *imo; struct in_multi *inm; - size_t idx; int error; error = sooptcopyin(sopt, &msfr, sizeof(struct __msfilterreq), @@ -2687,18 +2583,19 @@ inp_set_source_filters(struct inpcb *inp, struct socko if (ifp == NULL) return (EADDRNOTAVAIL); + IN_MULTI_LOCK(); + /* * Take the INP write lock. * Check if this socket is a member of this group. */ imo = inp_findmoptions(inp); - idx = imo_match_group(imo, ifp, &gsa->sa); - if (idx == -1 || imo->imo_mfilters == NULL) { + imf = imo_match_group(imo, ifp, &gsa->sa); + if (imf == NULL) { error = EADDRNOTAVAIL; goto out_inp_locked; } - inm = imo->imo_membership[idx]; - imf = &imo->imo_mfilters[idx]; + inm = imf->imf_inm; /* * Begin state merge transaction at socket layer. @@ -2775,7 +2672,6 @@ inp_set_source_filters(struct inpcb *inp, struct socko goto out_imf_rollback; INP_WLOCK_ASSERT(inp); - IN_MULTI_LOCK(); /* * Begin state merge transaction at IGMP layer. @@ -2786,7 +2682,7 @@ inp_set_source_filters(struct inpcb *inp, struct socko if (error) { CTR1(KTR_IGMPV3, "%s: failed to merge inm state", __func__); IN_MULTI_LIST_UNLOCK(); - goto out_in_multi_locked; + goto out_imf_rollback; } CTR1(KTR_IGMPV3, "%s: doing igmp downcall", __func__); @@ -2795,10 +2691,6 @@ inp_set_source_filters(struct inpcb *inp, struct socko if (error) CTR1(KTR_IGMPV3, "%s: failed igmp downcall", __func__); -out_in_multi_locked: - - IN_MULTI_UNLOCK(); - out_imf_rollback: if (error) imf_rollback(imf); @@ -2809,6 +2701,7 @@ out_imf_rollback: out_inp_locked: INP_WUNLOCK(inp); + IN_MULTI_UNLOCK(); return (error); } Modified: stable/12/sys/netinet/in_pcb.c ============================================================================== --- stable/12/sys/netinet/in_pcb.c Fri Jul 5 06:53:12 2019 (r349761) +++ stable/12/sys/netinet/in_pcb.c Fri Jul 5 10:31:37 2019 (r349762) @@ -86,6 +86,9 @@ __FBSDID("$FreeBSD$"); #if defined(INET) || defined(INET6) #include #include +#ifdef INET +#include +#endif #include #include #ifdef TCPHPTS @@ -93,16 +96,13 @@ __FBSDID("$FreeBSD$"); #endif #include #include -#endif -#ifdef INET -#include -#endif #ifdef INET6 #include #include #include #include #endif /* INET6 */ +#endif #include @@ -1777,8 +1777,9 @@ void in_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifnet *ifp) { struct inpcb *inp; + struct in_multi *inm; + struct in_mfilter *imf; struct ip_moptions *imo; - int i, gap; INP_INFO_WLOCK(pcbinfo); CK_LIST_FOREACH(inp, pcbinfo->ipi_listhead, inp_list) { @@ -1799,17 +1800,18 @@ in_pcbpurgeif0(struct inpcbinfo *pcbinfo, struct ifnet * * XXX This can all be deferred to an epoch_call */ - for (i = 0, gap = 0; i < imo->imo_num_memberships; - i++) { - if (imo->imo_membership[i]->inm_ifp == ifp) { - IN_MULTI_LOCK_ASSERT(); - in_leavegroup_locked(imo->imo_membership[i], NULL); - gap++; - } else if (gap != 0) - imo->imo_membership[i - gap] = - imo->imo_membership[i]; +restart: + IP_MFILTER_FOREACH(imf, &imo->imo_head) { + if ((inm = imf->imf_inm) == NULL) + continue; + if (inm->inm_ifp != ifp) + continue; + ip_mfilter_remove(&imo->imo_head, imf); + IN_MULTI_LOCK_ASSERT(); + in_leavegroup_locked(inm, NULL); + ip_mfilter_free(imf); + goto restart; } - imo->imo_num_memberships -= gap; } INP_WUNLOCK(inp); } Modified: stable/12/sys/netinet/in_var.h ============================================================================== --- stable/12/sys/netinet/in_var.h Fri Jul 5 06:53:12 2019 (r349761) +++ stable/12/sys/netinet/in_var.h Fri Jul 5 10:31:37 2019 (r349762) @@ -232,7 +232,59 @@ struct in_mfilter { struct ip_msource_tree imf_sources; /* source list for (S,G) */ u_long imf_nsrc; /* # of source entries */ uint8_t imf_st[2]; /* state before/at commit */ + struct in_multi *imf_inm; /* associated multicast address */ + STAILQ_ENTRY(in_mfilter) imf_entry; /* list entry */ }; + +/* + * Helper types and functions for IPv4 multicast filters. + */ +STAILQ_HEAD(ip_mfilter_head, in_mfilter); + +struct in_mfilter *ip_mfilter_alloc(int mflags, int st0, int st1); +void ip_mfilter_free(struct in_mfilter *); + +static inline void +ip_mfilter_init(struct ip_mfilter_head *head) +{ + + STAILQ_INIT(head); +} + +static inline struct in_mfilter * +ip_mfilter_first(const struct ip_mfilter_head *head) +{ + + return (STAILQ_FIRST(head)); +} + +static inline void +ip_mfilter_insert(struct ip_mfilter_head *head, struct in_mfilter *imf) +{ + + STAILQ_INSERT_TAIL(head, imf, imf_entry); +} + +static inline void +ip_mfilter_remove(struct ip_mfilter_head *head, struct in_mfilter *imf) +{ + + STAILQ_REMOVE(head, imf, in_mfilter, imf_entry); +} + +#define IP_MFILTER_FOREACH(imf, head) \ + STAILQ_FOREACH(imf, head, imf_entry) + +static inline size_t +ip_mfilter_count(struct ip_mfilter_head *head) +{ + struct in_mfilter *imf; + size_t num = 0; + + STAILQ_FOREACH(imf, head, imf_entry) + num++; + return (num); +} /* * IPv4 group descriptor. Modified: stable/12/sys/netinet/ip_carp.c ============================================================================== --- stable/12/sys/netinet/ip_carp.c Fri Jul 5 06:53:12 2019 (r349761) +++ stable/12/sys/netinet/ip_carp.c Fri Jul 5 10:31:37 2019 (r349762) @@ -1367,25 +1367,24 @@ carp_multicast_setup(struct carp_if *cif, sa_family_t case AF_INET: { struct ip_moptions *imo = &cif->cif_imo; + struct in_mfilter *imf; struct in_addr addr; - if (imo->imo_membership) + if (ip_mfilter_first(&imo->imo_head) != NULL) return (0); - imo->imo_membership = (struct in_multi **)malloc( - (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_CARP, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-12@freebsd.org Fri Jul 5 12:26:31 2019 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 B3E2315C9D3B; Fri, 5 Jul 2019 12:26:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FED96D7E7; Fri, 5 Jul 2019 12:26:31 +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 2BDCFA454; Fri, 5 Jul 2019 12:26:31 +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 x65CQV5U056370; Fri, 5 Jul 2019 12:26:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x65CQUev056366; Fri, 5 Jul 2019 12:26:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201907051226.x65CQUev056366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Jul 2019 12:26: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: r349763 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 349763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5FED96D7E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 05 Jul 2019 12:26:32 -0000 Author: hselasky Date: Fri Jul 5 12:26:30 2019 New Revision: 349763 URL: https://svnweb.freebsd.org/changeset/base/349763 Log: MFC r340404, r340415, r340417, r340419 and r340420: Synchronize epoch(9) code with -head to make merging new patches and features easier. The FreeBSD version has been bumped to force recompilation of external kernel modules. Sponsored by: Mellanox Technologies MFC r340404: Uninline epoch(9) entrance and exit. There is no proof that modern processors would benefit from avoiding a function call, but bloating code. In fact, clang created an uninlined real function for many object files in the network stack. - Move epoch_private.h into subr_epoch.c. Code copied exactly, avoiding any changes, including style(9). - Remove private copies of critical_enter/exit. Reviewed by: kib, jtl Differential Revision: https://reviews.freebsd.org/D17879 MFC r340415: The dualism between epoch_tracker and epoch_thread is fragile and unnecessary. So, expose CK types to kernel and use a single normal structure for epoch_tracker. Reviewed by: jtl, gallatin MFC r340417: With epoch not inlined, there is no point in using _lite KPI. While here, remove some unnecessary casts. MFC r340419: style(9), mostly adjusting overly long lines. MFC r340420: epoch(9) revert r340097 - no longer a need for multiple sections per cpu I spoke with Samy Bahra and recent changes to CK to make ck_epoch_call and ck_epoch_poll not modify the record have eliminated the need for this. Deleted: stable/12/sys/sys/epoch_private.h Modified: stable/12/sys/kern/genoffset.c stable/12/sys/kern/subr_epoch.c stable/12/sys/sys/epoch.h stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/genoffset.c ============================================================================== --- stable/12/sys/kern/genoffset.c Fri Jul 5 10:31:37 2019 (r349762) +++ stable/12/sys/kern/genoffset.c Fri Jul 5 12:26:30 2019 (r349763) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -OFFSYM(td_pre_epoch_prio, thread, u_char); OFFSYM(td_priority, thread, u_char); OFFSYM(td_epochnest, thread, u_char); OFFSYM(td_critnest, thread, u_int); Modified: stable/12/sys/kern/subr_epoch.c ============================================================================== --- stable/12/sys/kern/subr_epoch.c Fri Jul 5 10:31:37 2019 (r349762) +++ stable/12/sys/kern/subr_epoch.c Fri Jul 5 12:26:30 2019 (r349763) @@ -55,6 +55,27 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based reclamation"); +#ifdef __amd64__ +#define EPOCH_ALIGN CACHE_LINE_SIZE*2 +#else +#define EPOCH_ALIGN CACHE_LINE_SIZE +#endif + +TAILQ_HEAD (epoch_tdlist, epoch_tracker); +typedef struct epoch_record { + ck_epoch_record_t er_record; + volatile struct epoch_tdlist er_tdlist; + volatile uint32_t er_gen; + uint32_t er_cpuid; +} __aligned(EPOCH_ALIGN) *epoch_record_t; + +struct epoch { + struct ck_epoch e_epoch __aligned(EPOCH_ALIGN); + epoch_record_t e_pcpu_record; + int e_idx; + int e_flags; +}; + /* arbitrary --- needs benchmarking */ #define MAX_ADAPTIVE_SPIN 100 #define MAX_EPOCHS 64 @@ -119,11 +140,15 @@ epoch_init(void *arg __unused) epoch_call_count = counter_u64_alloc(M_WAITOK); epoch_call_task_count = counter_u64_alloc(M_WAITOK); - pcpu_zone_record = uma_zcreate("epoch_record pcpu", sizeof(struct epoch_record), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_PCPU); + pcpu_zone_record = uma_zcreate("epoch_record pcpu", + sizeof(struct epoch_record), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, UMA_ZONE_PCPU); CPU_FOREACH(cpu) { - GROUPTASK_INIT(DPCPU_ID_PTR(cpu, epoch_cb_task), 0, epoch_call_task, NULL); - taskqgroup_attach_cpu(qgroup_softirq, DPCPU_ID_PTR(cpu, epoch_cb_task), NULL, cpu, -1, "epoch call task"); + GROUPTASK_INIT(DPCPU_ID_PTR(cpu, epoch_cb_task), 0, + epoch_call_task, NULL); + taskqgroup_attach_cpu(qgroup_softirq, + DPCPU_ID_PTR(cpu, epoch_cb_task), NULL, cpu, -1, + "epoch call task"); } inited = 1; global_epoch = epoch_alloc(0); @@ -156,6 +181,15 @@ epoch_ctor(epoch_t epoch) } } +static void +epoch_adjust_prio(struct thread *td, u_char prio) +{ + + thread_lock(td); + sched_prio(td, prio); + thread_unlock(td); +} + epoch_t epoch_alloc(int flags) { @@ -191,45 +225,120 @@ epoch_free(epoch_t epoch) free(epoch, M_EPOCH); } +static epoch_record_t +epoch_currecord(epoch_t epoch) +{ + + return (zpcpu_get_cpu(epoch->e_pcpu_record, curcpu)); +} + +#define INIT_CHECK(epoch) \ + do { \ + if (__predict_false((epoch) == NULL)) \ + return; \ + } while (0) + void -epoch_enter_preempt_KBI(epoch_t epoch, epoch_tracker_t et) +epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et) { + struct epoch_record *er; + struct thread *td; - epoch_enter_preempt(epoch, et); + MPASS(cold || epoch != NULL); + INIT_CHECK(epoch); + MPASS(epoch->e_flags & EPOCH_PREEMPT); +#ifdef EPOCH_TRACKER_DEBUG + et->et_magic_pre = EPOCH_MAGIC0; + et->et_magic_post = EPOCH_MAGIC1; +#endif + td = curthread; + et->et_td = td; + td->td_epochnest++; + critical_enter(); + sched_pin(); + + td->td_pre_epoch_prio = td->td_priority; + er = epoch_currecord(epoch); + TAILQ_INSERT_TAIL(&er->er_tdlist, et, et_link); + ck_epoch_begin(&er->er_record, &et->et_section); + critical_exit(); } void -epoch_exit_preempt_KBI(epoch_t epoch, epoch_tracker_t et) +epoch_enter(epoch_t epoch) { + struct thread *td; + epoch_record_t er; - epoch_exit_preempt(epoch, et); + MPASS(cold || epoch != NULL); + INIT_CHECK(epoch); + td = curthread; + + td->td_epochnest++; + critical_enter(); + er = epoch_currecord(epoch); + ck_epoch_begin(&er->er_record, NULL); } void -epoch_enter_KBI(epoch_t epoch) +epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et) { + struct epoch_record *er; + struct thread *td; - epoch_enter(epoch); + INIT_CHECK(epoch); + td = curthread; + critical_enter(); + sched_unpin(); + MPASS(td->td_epochnest); + td->td_epochnest--; + er = epoch_currecord(epoch); + MPASS(epoch->e_flags & EPOCH_PREEMPT); + MPASS(et != NULL); + MPASS(et->et_td == td); +#ifdef EPOCH_TRACKER_DEBUG + MPASS(et->et_magic_pre == EPOCH_MAGIC0); + MPASS(et->et_magic_post == EPOCH_MAGIC1); + et->et_magic_pre = 0; + et->et_magic_post = 0; +#endif +#ifdef INVARIANTS + et->et_td = (void*)0xDEADBEEF; +#endif + ck_epoch_end(&er->er_record, &et->et_section); + TAILQ_REMOVE(&er->er_tdlist, et, et_link); + er->er_gen++; + if (__predict_false(td->td_pre_epoch_prio != td->td_priority)) + epoch_adjust_prio(td, td->td_pre_epoch_prio); + critical_exit(); } void -epoch_exit_KBI(epoch_t epoch) +epoch_exit(epoch_t epoch) { + struct thread *td; + epoch_record_t er; - epoch_exit(epoch); + INIT_CHECK(epoch); + td = curthread; + MPASS(td->td_epochnest); + td->td_epochnest--; + er = epoch_currecord(epoch); + ck_epoch_end(&er->er_record, NULL); + critical_exit(); } /* - * epoch_block_handler_preempt is a callback from the ck code when another thread is - * currently in an epoch section. + * epoch_block_handler_preempt() is a callback from the CK code when another + * thread is currently in an epoch section. */ static void -epoch_block_handler_preempt(struct ck_epoch *global __unused, ck_epoch_record_t *cr, - void *arg __unused) +epoch_block_handler_preempt(struct ck_epoch *global __unused, + ck_epoch_record_t *cr, void *arg __unused) { epoch_record_t record; struct thread *td, *owner, *curwaittd; - struct epoch_thread *tdwait; + struct epoch_tracker *tdwait; struct turnstile *ts; struct lock_object *lock; int spincount, gen; @@ -317,25 +426,27 @@ epoch_block_handler_preempt(struct ck_epoch *global __ if (TD_IS_INHIBITED(curwaittd) && TD_ON_LOCK(curwaittd) && ((ts = curwaittd->td_blocked) != NULL)) { /* - * We unlock td to allow turnstile_wait to reacquire the - * the thread lock. Before unlocking it we enter a critical - * section to prevent preemption after we reenable interrupts - * by dropping the thread lock in order to prevent curwaittd - * from getting to run. + * We unlock td to allow turnstile_wait to reacquire + * the thread lock. Before unlocking it we enter a + * critical section to prevent preemption after we + * reenable interrupts by dropping the thread lock in + * order to prevent curwaittd from getting to run. */ critical_enter(); thread_unlock(td); owner = turnstile_lock(ts, &lock); /* - * The owner pointer indicates that the lock succeeded. Only - * in case we hold the lock and the turnstile we locked is still - * the one that curwaittd is blocked on can we continue. Otherwise - * The turnstile pointer has been changed out from underneath - * us, as in the case where the lock holder has signalled curwaittd, + * The owner pointer indicates that the lock succeeded. + * Only in case we hold the lock and the turnstile we + * locked is still the one that curwaittd is blocked on + * can we continue. Otherwise the turnstile pointer has + * been changed out from underneath us, as in the case + * where the lock holder has signalled curwaittd, * and we need to continue. */ if (owner != NULL && ts == curwaittd->td_blocked) { - MPASS(TD_IS_INHIBITED(curwaittd) && TD_ON_LOCK(curwaittd)); + MPASS(TD_IS_INHIBITED(curwaittd) && + TD_ON_LOCK(curwaittd)); critical_exit(); turnstile_wait(ts, owner, curwaittd->td_tsqueue); counter_u64_add(turnstile_count, 1); @@ -385,9 +496,8 @@ epoch_wait_preempt(epoch_t epoch) if ((epoch->e_flags & EPOCH_LOCKED) == 0) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "epoch_wait() can be long running"); - KASSERT(!in_epoch(epoch), - ("epoch_wait_preempt() called in the middle " - "of an epoch section of the same epoch")); + KASSERT(!in_epoch(epoch), ("epoch_wait_preempt() called in the middle " + "of an epoch section of the same epoch")); #endif thread_lock(td); DROP_GIANT(); @@ -400,7 +510,8 @@ epoch_wait_preempt(epoch_t epoch) td->td_pinned = 0; sched_bind(td, old_cpu); - ck_epoch_synchronize_wait(&epoch->e_epoch, epoch_block_handler_preempt, NULL); + ck_epoch_synchronize_wait(&epoch->e_epoch, epoch_block_handler_preempt, + NULL); /* restore CPU binding, if any */ if (was_bound != 0) { @@ -501,7 +612,7 @@ epoch_call_task(void *arg __unused) head = ck_stack_batch_pop_npsc(&cb_stack); for (cursor = head; cursor != NULL; cursor = next) { struct ck_epoch_entry *entry = - ck_epoch_entry_container(cursor); + ck_epoch_entry_container(cursor); next = CK_STACK_NEXT(cursor); entry->function(entry); @@ -511,7 +622,7 @@ epoch_call_task(void *arg __unused) int in_epoch_verbose(epoch_t epoch, int dump_onfail) { - struct epoch_thread *tdwait; + struct epoch_tracker *tdwait; struct thread *td; epoch_record_t er; @@ -544,12 +655,4 @@ int in_epoch(epoch_t epoch) { return (in_epoch_verbose(epoch, 0)); -} - -void -epoch_adjust_prio(struct thread *td, u_char prio) -{ - thread_lock(td); - sched_prio(td, prio); - thread_unlock(td); } Modified: stable/12/sys/sys/epoch.h ============================================================================== --- stable/12/sys/sys/epoch.h Fri Jul 5 10:31:37 2019 (r349762) +++ stable/12/sys/sys/epoch.h Fri Jul 5 12:26:30 2019 (r349763) @@ -29,10 +29,17 @@ #ifndef _SYS_EPOCH_H_ #define _SYS_EPOCH_H_ + +struct epoch_context { + void *data[2]; +} __aligned(sizeof(void *)); + +typedef struct epoch_context *epoch_context_t; + #ifdef _KERNEL #include #include -#endif +#include struct epoch; typedef struct epoch *epoch_t; @@ -43,22 +50,19 @@ typedef struct epoch *epoch_t; extern epoch_t global_epoch; extern epoch_t global_epoch_preempt; -struct epoch_context { - void *data[2]; -} __aligned(sizeof(void *)); - -typedef struct epoch_context *epoch_context_t; - - struct epoch_tracker { - void *datap[3]; -#ifdef EPOCH_TRACKER_DEBUG - int datai[5]; -#else - int datai[1]; +#ifdef EPOCH_TRACKER_DEBUG +#define EPOCH_MAGIC0 0xFADECAFEF00DD00D +#define EPOCH_MAGIC1 0xBADDBABEDEEDFEED + uint64_t et_magic_pre; #endif + TAILQ_ENTRY(epoch_tracker) et_link; + struct thread *et_td; + ck_epoch_section_t et_section; +#ifdef EPOCH_TRACKER_DEBUG + uint64_t et_magic_post; +#endif } __aligned(sizeof(void *)); - typedef struct epoch_tracker *epoch_tracker_t; epoch_t epoch_alloc(int flags); @@ -68,26 +72,15 @@ void epoch_wait_preempt(epoch_t epoch); void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); int in_epoch(epoch_t epoch); int in_epoch_verbose(epoch_t epoch, int dump_onfail); -#ifdef _KERNEL DPCPU_DECLARE(int, epoch_cb_count); DPCPU_DECLARE(struct grouptask, epoch_cb_task); #define EPOCH_MAGIC0 0xFADECAFEF00DD00D #define EPOCH_MAGIC1 0xBADDBABEDEEDFEED -void epoch_enter_preempt_KBI(epoch_t epoch, epoch_tracker_t et); -void epoch_exit_preempt_KBI(epoch_t epoch, epoch_tracker_t et); -void epoch_enter_KBI(epoch_t epoch); -void epoch_exit_KBI(epoch_t epoch); +void epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et); +void epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et); +void epoch_enter(epoch_t epoch); +void epoch_exit(epoch_t epoch); - -#if defined(KLD_MODULE) && !defined(KLD_TIED) -#define epoch_enter_preempt(e, t) epoch_enter_preempt_KBI((e), (t)) -#define epoch_exit_preempt(e, t) epoch_exit_preempt_KBI((e), (t)) -#define epoch_enter(e) epoch_enter_KBI((e)) -#define epoch_exit(e) epoch_exit_KBI((e)) -#else -#include -#endif /* KLD_MODULE */ - -#endif /* _KERNEL */ -#endif +#endif /* _KERNEL */ +#endif /* _SYS_EPOCH_H_ */ Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Fri Jul 5 10:31:37 2019 (r349762) +++ stable/12/sys/sys/param.h Fri Jul 5 12:26:30 2019 (r349763) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200512 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200513 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-12@freebsd.org Fri Jul 5 12:33:33 2019 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 41FC615C9F9E; Fri, 5 Jul 2019 12:33:33 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D73346DD01; Fri, 5 Jul 2019 12:33:32 +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 AF3CFA5F4; Fri, 5 Jul 2019 12:33:32 +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 x65CXWo6061499; Fri, 5 Jul 2019 12:33:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x65CXVdB061495; Fri, 5 Jul 2019 12:33:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201907051233.x65CXVdB061495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Jul 2019 12:33: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: r349764 - in stable/12: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12: share/man/man9 sys/kern sys/sys X-SVN-Commit-Revision: 349764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D73346DD01 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.952,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 05 Jul 2019 12:33:33 -0000 Author: hselasky Date: Fri Jul 5 12:33:31 2019 New Revision: 349764 URL: https://svnweb.freebsd.org/changeset/base/349764 Log: MFC r349506: Implement API for draining EPOCH(9) callbacks. The epoch_drain_callbacks() function is used to drain all pending callbacks which have been invoked by prior epoch_call() function calls on the same epoch. This function is useful when there are shared memory structure(s) referred to by the epoch callback(s) which are not refcounted and are rarely freed. The typical place for calling this function is right before freeing or invalidating the shared resource(s) used by the epoch callback(s). This function can sleep and is not optimized for performance. Differential Revision: https://reviews.freebsd.org/D20109 Sponsored by: Mellanox Technologies Modified: stable/12/share/man/man9/Makefile stable/12/share/man/man9/epoch.9 stable/12/sys/kern/subr_epoch.c stable/12/sys/sys/epoch.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/Makefile ============================================================================== --- stable/12/share/man/man9/Makefile Fri Jul 5 12:26:30 2019 (r349763) +++ stable/12/share/man/man9/Makefile Fri Jul 5 12:33:31 2019 (r349764) @@ -941,6 +941,15 @@ MLINKS+=drbr.9 drbr_free.9 \ MLINKS+=DRIVER_MODULE.9 DRIVER_MODULE_ORDERED.9 \ DRIVER_MODULE.9 EARLY_DRIVER_MODULE.9 \ DRIVER_MODULE.9 EARLY_DRIVER_MODULE_ORDERED.9 +MLINKS+=epoch.9 epoch_context.9 \ + epoch.9 epoch_alloc.9 \ + epoch.9 epoch_free.9 \ + epoch.9 epoch_enter.9 \ + epoch.9 epoch_exit.9 \ + epoch.9 epoch_wait.9 \ + epoch.9 epoch_call.9 \ + epoch.9 epoch_drain_callbacks.9 \ + epoch.9 in_epoch.9 MLINKS+=EVENTHANDLER.9 EVENTHANDLER_DECLARE.9 \ EVENTHANDLER.9 EVENTHANDLER_DEFINE.9 \ EVENTHANDLER.9 EVENTHANDLER_DEREGISTER.9 \ Modified: stable/12/share/man/man9/epoch.9 ============================================================================== --- stable/12/share/man/man9/epoch.9 Fri Jul 5 12:26:30 2019 (r349763) +++ stable/12/share/man/man9/epoch.9 Fri Jul 5 12:33:31 2019 (r349764) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 25, 2018 +.Dd June 28, 2019 .Dt EPOCH 9 .Os .Sh NAME @@ -38,6 +38,7 @@ .Nm epoch_exit , .Nm epoch_wait , .Nm epoch_call , +.Nm epoch_drain_callbacks , .Nm in_epoch , .Nd kernel epoch based reclamation .Sh SYNOPSIS @@ -60,6 +61,8 @@ .Fn epoch_wait_preempt "epoch_t epoch" .Ft void .Fn epoch_call "epoch_t epoch" "epoch_context_t ctx" "void (*callback) (epoch_context_t)" +.Ft void +.Fn epoch_drain_callbacks "epoch_t epoch" .Ft int .Fn in_epoch "epoch_t epoch" .Sh DESCRIPTION @@ -120,6 +123,18 @@ routines must be used and the caller can no longer mod in place. An item to be modified must be handled with copy on write and frees must be deferred until after a grace period has elapsed. +.Pp +The +.Fn epoch_drain_callbacks +function is used to drain all pending callbacks which have been invoked by prior +.Fn epoch_call +function calls on the same epoch. +This function is useful when there are shared memory structure(s) +referred to by the epoch callback(s) which are not refcounted and are +rarely freed. +The typical place for calling this function is right before freeing or +invalidating the shared resource(s) used by the epoch callback(s). +This function can sleep and is not optimized for performance. .Sh RETURN VALUES .Fn in_epoch curepoch will return 1 if curthread is in curepoch, 0 otherwise. Modified: stable/12/sys/kern/subr_epoch.c ============================================================================== --- stable/12/sys/kern/subr_epoch.c Fri Jul 5 12:26:30 2019 (r349763) +++ stable/12/sys/kern/subr_epoch.c Fri Jul 5 12:33:31 2019 (r349764) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -64,6 +65,8 @@ static MALLOC_DEFINE(M_EPOCH, "epoch", "epoch based re TAILQ_HEAD (epoch_tdlist, epoch_tracker); typedef struct epoch_record { ck_epoch_record_t er_record; + struct epoch_context er_drain_ctx; + struct epoch *er_parent; volatile struct epoch_tdlist er_tdlist; volatile uint32_t er_gen; uint32_t er_cpuid; @@ -74,6 +77,9 @@ struct epoch { epoch_record_t e_pcpu_record; int e_idx; int e_flags; + struct sx e_drain_sx; + struct mtx e_drain_mtx; + volatile int e_drain_count; }; /* arbitrary --- needs benchmarking */ @@ -178,6 +184,7 @@ epoch_ctor(epoch_t epoch) ck_epoch_register(&epoch->e_epoch, &er->er_record, NULL); TAILQ_INIT((struct threadlist *)(uintptr_t)&er->er_tdlist); er->er_cpuid = cpu; + er->er_parent = epoch; } } @@ -203,6 +210,8 @@ epoch_alloc(int flags) MPASS(epoch_count < MAX_EPOCHS - 2); epoch->e_flags = flags; epoch->e_idx = epoch_count; + sx_init(&epoch->e_drain_sx, "epoch-drain-sx"); + mtx_init(&epoch->e_drain_mtx, "epoch-drain-mtx", NULL, MTX_DEF); allepochs[epoch_count++] = epoch; return (epoch); } @@ -210,18 +219,13 @@ epoch_alloc(int flags) void epoch_free(epoch_t epoch) { -#ifdef INVARIANTS - struct epoch_record *er; - int cpu; - CPU_FOREACH(cpu) { - er = zpcpu_get_cpu(epoch->e_pcpu_record, cpu); - MPASS(TAILQ_EMPTY(&er->er_tdlist)); - } -#endif + epoch_drain_callbacks(epoch); allepochs[epoch->e_idx] = NULL; epoch_wait(global_epoch); uma_zfree_pcpu(pcpu_zone_record, epoch->e_pcpu_record); + mtx_destroy(&epoch->e_drain_mtx); + sx_destroy(&epoch->e_drain_sx); free(epoch, M_EPOCH); } @@ -655,4 +659,81 @@ int in_epoch(epoch_t epoch) { return (in_epoch_verbose(epoch, 0)); +} + +static void +epoch_drain_cb(struct epoch_context *ctx) +{ + struct epoch *epoch = + __containerof(ctx, struct epoch_record, er_drain_ctx)->er_parent; + + if (atomic_fetchadd_int(&epoch->e_drain_count, -1) == 1) { + mtx_lock(&epoch->e_drain_mtx); + wakeup(epoch); + mtx_unlock(&epoch->e_drain_mtx); + } +} + +void +epoch_drain_callbacks(epoch_t epoch) +{ + epoch_record_t er; + struct thread *td; + int was_bound; + int old_pinned; + int old_cpu; + int cpu; + + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "epoch_drain_callbacks() may sleep!"); + + /* too early in boot to have epoch set up */ + if (__predict_false(epoch == NULL)) + return; +#if !defined(EARLY_AP_STARTUP) + if (__predict_false(inited < 2)) + return; +#endif + DROP_GIANT(); + + sx_xlock(&epoch->e_drain_sx); + mtx_lock(&epoch->e_drain_mtx); + + td = curthread; + thread_lock(td); + old_cpu = PCPU_GET(cpuid); + old_pinned = td->td_pinned; + was_bound = sched_is_bound(td); + sched_unbind(td); + td->td_pinned = 0; + + CPU_FOREACH(cpu) + epoch->e_drain_count++; + CPU_FOREACH(cpu) { + er = zpcpu_get_cpu(epoch->e_pcpu_record, cpu); + sched_bind(td, cpu); + epoch_call(epoch, &er->er_drain_ctx, &epoch_drain_cb); + } + + /* restore CPU binding, if any */ + if (was_bound != 0) { + sched_bind(td, old_cpu); + } else { + /* get thread back to initial CPU, if any */ + if (old_pinned != 0) + sched_bind(td, old_cpu); + sched_unbind(td); + } + /* restore pinned after bind */ + td->td_pinned = old_pinned; + + thread_unlock(td); + + while (epoch->e_drain_count != 0) + msleep(epoch, &epoch->e_drain_mtx, PZERO, "EDRAIN", 0); + + mtx_unlock(&epoch->e_drain_mtx); + sx_xunlock(&epoch->e_drain_sx); + + PICKUP_GIANT(); } Modified: stable/12/sys/sys/epoch.h ============================================================================== --- stable/12/sys/sys/epoch.h Fri Jul 5 12:26:30 2019 (r349763) +++ stable/12/sys/sys/epoch.h Fri Jul 5 12:33:31 2019 (r349764) @@ -69,6 +69,7 @@ epoch_t epoch_alloc(int flags); void epoch_free(epoch_t epoch); void epoch_wait(epoch_t epoch); void epoch_wait_preempt(epoch_t epoch); +void epoch_drain_callbacks(epoch_t epoch); void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); int in_epoch(epoch_t epoch); int in_epoch_verbose(epoch_t epoch, int dump_onfail); From owner-svn-src-stable-12@freebsd.org Fri Jul 5 12:35:50 2019 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 0D30015CA055; Fri, 5 Jul 2019 12:35:50 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A97386DE92; Fri, 5 Jul 2019 12:35:49 +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 82C76A5F6; Fri, 5 Jul 2019 12:35:49 +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 x65CZndN061654; Fri, 5 Jul 2019 12:35:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x65CZnaj061653; Fri, 5 Jul 2019 12:35:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201907051235.x65CZnaj061653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Jul 2019 12:35: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: r349765 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 349765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A97386DE92 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.950,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 05 Jul 2019 12:35:50 -0000 Author: hselasky Date: Fri Jul 5 12:35:49 2019 New Revision: 349765 URL: https://svnweb.freebsd.org/changeset/base/349765 Log: MFC r349507: Need to wait for epoch callbacks to complete before detaching a network interface. This particularly manifests itself when an INP has multicast options attached during a network interface detach. Then the IPv4 and IPv6 leave group call which results from freeing the multicast address, may access a freed ifnet structure. These are the steps to reproduce: service mdnsd onestart # installed from ports ifconfig epair create ifconfig epair0a 0/24 up ifconfig epair0a destroy Tested by: pho @ Sponsored by: Mellanox Technologies 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 Fri Jul 5 12:33:31 2019 (r349764) +++ stable/12/sys/net/if.c Fri Jul 5 12:35:49 2019 (r349765) @@ -1100,6 +1100,15 @@ if_detach_internal(struct ifnet *ifp, int vmove, struc curvnet->vnet_ifcnt--; #endif epoch_wait_preempt(net_epoch_preempt); + + /* + * Ensure all pending EPOCH(9) callbacks have been executed. This + * fixes issues about late destruction of multicast options + * which lead to leave group calls, which in turn access the + * belonging ifnet structure: + */ + epoch_drain_callbacks(net_epoch_preempt); + /* * In any case (destroy or vmove) detach us from the groups * and remove/wait for pending events on the taskq. From owner-svn-src-stable-12@freebsd.org Fri Jul 5 15:49:22 2019 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 2EF3415CE50E; Fri, 5 Jul 2019 15:49:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C8A4875686; Fri, 5 Jul 2019 15:49:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-4.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 3BF571F096; Fri, 5 Jul 2019 15:49:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r349763 - in stable/12/sys: kern sys To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201907051226.x65CQUev056366@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <97b7657c-53b9-f3d2-f31a-5e56343da71d@FreeBSD.org> Date: Fri, 5 Jul 2019 08:49:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <201907051226.x65CQUev056366@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: C8A4875686 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.81 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.81)[-0.809,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] 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, 05 Jul 2019 15:49:22 -0000 On 7/5/19 5:26 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Fri Jul 5 12:26:30 2019 > New Revision: 349763 > URL: https://svnweb.freebsd.org/changeset/base/349763 > > Log: > MFC r340404, r340415, r340417, r340419 and r340420: > Synchronize epoch(9) code with -head to make merging new patches > and features easier. > The FreeBSD version has been bumped to force recompilation of > external kernel modules. > > Sponsored by: Mellanox Technologies > > MFC r340404: > Uninline epoch(9) entrance and exit. There is no proof that modern > processors would benefit from avoiding a function call, but bloating > code. In fact, clang created an uninlined real function for many > object files in the network stack. > > - Move epoch_private.h into subr_epoch.c. Code copied exactly, avoiding > any changes, including style(9). > - Remove private copies of critical_enter/exit. > > Reviewed by: kib, jtl > Differential Revision: https://reviews.freebsd.org/D17879 > > MFC r340415: > The dualism between epoch_tracker and epoch_thread is fragile and > unnecessary. So, expose CK types to kernel and use a single normal > structure for epoch_tracker. > > Reviewed by: jtl, gallatin > > MFC r340417: > With epoch not inlined, there is no point in using _lite KPI. While here, > remove some unnecessary casts. > > MFC r340419: > style(9), mostly adjusting overly long lines. > > MFC r340420: > epoch(9) revert r340097 - no longer a need for multiple sections per cpu > > I spoke with Samy Bahra and recent changes to CK to make ck_epoch_call and > ck_epoch_poll not modify the record have eliminated the need for this. How does this not break the module KBI? You've removed epoch_*_KBI symbols used by existing modules, and you appear to have changed the size of the 'struct epoch_tracker' object that existing modules allocate on the stack and pass to functions in the kernel. Bumping __FreeBSD_version is not sufficient cover to break the KBI of widely used interfaces in stable (while we don't enforce KBI for all parts of the kernel, locking primitives is one of the things we can't break). > Modified: stable/12/sys/sys/epoch.h > ============================================================================== > --- stable/12/sys/sys/epoch.h Fri Jul 5 10:31:37 2019 (r349762) > +++ stable/12/sys/sys/epoch.h Fri Jul 5 12:26:30 2019 (r349763) > @@ -29,10 +29,17 @@ > > #ifndef _SYS_EPOCH_H_ > #define _SYS_EPOCH_H_ > + > +struct epoch_context { > + void *data[2]; > +} __aligned(sizeof(void *)); > + > +typedef struct epoch_context *epoch_context_t; > + > #ifdef _KERNEL > #include > #include > -#endif > +#include > > struct epoch; > typedef struct epoch *epoch_t; > @@ -43,22 +50,19 @@ typedef struct epoch *epoch_t; > extern epoch_t global_epoch; > extern epoch_t global_epoch_preempt; > > -struct epoch_context { > - void *data[2]; > -} __aligned(sizeof(void *)); > - > -typedef struct epoch_context *epoch_context_t; > - > - > struct epoch_tracker { > - void *datap[3]; > -#ifdef EPOCH_TRACKER_DEBUG > - int datai[5]; > -#else > - int datai[1]; > +#ifdef EPOCH_TRACKER_DEBUG > +#define EPOCH_MAGIC0 0xFADECAFEF00DD00D > +#define EPOCH_MAGIC1 0xBADDBABEDEEDFEED > + uint64_t et_magic_pre; > #endif > + TAILQ_ENTRY(epoch_tracker) et_link; > + struct thread *et_td; > + ck_epoch_section_t et_section; > +#ifdef EPOCH_TRACKER_DEBUG > + uint64_t et_magic_post; > +#endif > } __aligned(sizeof(void *)); > - > typedef struct epoch_tracker *epoch_tracker_t; > > epoch_t epoch_alloc(int flags); > @@ -68,26 +72,15 @@ void epoch_wait_preempt(epoch_t epoch); > void epoch_call(epoch_t epoch, epoch_context_t ctx, void (*callback) (epoch_context_t)); > int in_epoch(epoch_t epoch); > int in_epoch_verbose(epoch_t epoch, int dump_onfail); > -#ifdef _KERNEL > DPCPU_DECLARE(int, epoch_cb_count); > DPCPU_DECLARE(struct grouptask, epoch_cb_task); > #define EPOCH_MAGIC0 0xFADECAFEF00DD00D > #define EPOCH_MAGIC1 0xBADDBABEDEEDFEED > > -void epoch_enter_preempt_KBI(epoch_t epoch, epoch_tracker_t et); > -void epoch_exit_preempt_KBI(epoch_t epoch, epoch_tracker_t et); > -void epoch_enter_KBI(epoch_t epoch); > -void epoch_exit_KBI(epoch_t epoch); > +void epoch_enter_preempt(epoch_t epoch, epoch_tracker_t et); > +void epoch_exit_preempt(epoch_t epoch, epoch_tracker_t et); > +void epoch_enter(epoch_t epoch); > +void epoch_exit(epoch_t epoch); > > - > -#if defined(KLD_MODULE) && !defined(KLD_TIED) > -#define epoch_enter_preempt(e, t) epoch_enter_preempt_KBI((e), (t)) > -#define epoch_exit_preempt(e, t) epoch_exit_preempt_KBI((e), (t)) > -#define epoch_enter(e) epoch_enter_KBI((e)) > -#define epoch_exit(e) epoch_exit_KBI((e)) > -#else > -#include > -#endif /* KLD_MODULE */ > - > -#endif /* _KERNEL */ > -#endif > +#endif /* _KERNEL */ > +#endif /* _SYS_EPOCH_H_ */ > -- John Baldwin From owner-svn-src-stable-12@freebsd.org Fri Jul 5 16:43:43 2019 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 F2F8515CF895; Fri, 5 Jul 2019 16:43:42 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96EB4779F4; Fri, 5 Jul 2019 16:43:42 +0000 (UTC) (envelope-from philip@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 548E5D13F; Fri, 5 Jul 2019 16:43:42 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x65Ghg3m091747; Fri, 5 Jul 2019 16:43:42 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x65Ghgxs091746; Fri, 5 Jul 2019 16:43:42 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201907051643.x65Ghgxs091746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Fri, 5 Jul 2019 16: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: r349766 - stable/12/sys/dev/atkbdc X-SVN-Group: stable-12 X-SVN-Commit-Author: philip X-SVN-Commit-Paths: stable/12/sys/dev/atkbdc X-SVN-Commit-Revision: 349766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 96EB4779F4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 05 Jul 2019 16:43:43 -0000 Author: philip Date: Fri Jul 5 16:43:41 2019 New Revision: 349766 URL: https://svnweb.freebsd.org/changeset/base/349766 Log: MFC r349098: Add macOS-like three finger drag trackpad gesture to psm(4) Modified: stable/12/sys/dev/atkbdc/psm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/atkbdc/psm.c ============================================================================== --- stable/12/sys/dev/atkbdc/psm.c Fri Jul 5 12:35:49 2019 (r349765) +++ stable/12/sys/dev/atkbdc/psm.c Fri Jul 5 16:43:41 2019 (r349766) @@ -235,6 +235,7 @@ typedef struct synapticsinfo { int softbutton3_x; int max_x; int max_y; + int three_finger_drag; int natural_scroll; } synapticsinfo_t; @@ -571,6 +572,7 @@ enum { SYNAPTICS_SYSCTL_SOFTBUTTONS_Y = SYN_OFFSET(softbuttons_y), SYNAPTICS_SYSCTL_SOFTBUTTON2_X = SYN_OFFSET(softbutton2_x), SYNAPTICS_SYSCTL_SOFTBUTTON3_X = SYN_OFFSET(softbutton3_x), + SYNAPTICS_SYSCTL_THREE_FINGER_DRAG = SYN_OFFSET(three_finger_drag), SYNAPTICS_SYSCTL_NATURAL_SCROLL = SYN_OFFSET(natural_scroll), #define SYNAPTICS_SYSCTL_LAST SYNAPTICS_SYSCTL_NATURAL_SCROLL }; @@ -3784,6 +3786,7 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i int vscroll_hor_area, vscroll_ver_area; int two_finger_scroll; int max_x, max_y; + int three_finger_drag; /* Read sysctl. */ /* XXX Verify values? */ @@ -3798,7 +3801,7 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i two_finger_scroll = sc->syninfo.two_finger_scroll; max_x = sc->syninfo.max_x; max_y = sc->syninfo.max_y; - + three_finger_drag = sc->syninfo.three_finger_drag; /* Read current absolute position. */ x0 = f->x; y0 = f->y; @@ -3887,8 +3890,8 @@ psmgestures(struct psm_softc *sc, finger_t *fingers, i ~MOUSE_BUTTON1DOWN) | center_button; } - /* If in tap-hold, add the recorded button. */ - if (gest->in_taphold) + /* If in tap-hold or three fingers, add the recorded button. */ + if (gest->in_taphold || (nfingers == 3 && three_finger_drag)) ms->button |= gest->tap_button; /* @@ -5754,6 +5757,7 @@ synaptics_sysctl(SYSCTL_HANDLER_ARGS) return (EINVAL); break; case SYNAPTICS_SYSCTL_TOUCHPAD_OFF: + case SYNAPTICS_SYSCTL_THREE_FINGER_DRAG: case SYNAPTICS_SYSCTL_NATURAL_SCROLL: if (arg < 0 || arg > 1) return (EINVAL); @@ -6146,6 +6150,14 @@ synaptics_sysctl_create_tree(struct psm_softc *sc, con sc, SYNAPTICS_SYSCTL_TOUCHPAD_OFF, synaptics_sysctl, "I", "Turn off touchpad"); + + sc->syninfo.three_finger_drag = 0; + SYSCTL_ADD_PROC(&sc->syninfo.sysctl_ctx, + SYSCTL_CHILDREN(sc->syninfo.sysctl_tree), OID_AUTO, + "three_finger_drag", CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_ANYBODY, + sc, SYNAPTICS_SYSCTL_THREE_FINGER_DRAG, + synaptics_sysctl, "I", + "Enable dragging with three fingers"); /* hw.psm.synaptics.natural_scroll. */ sc->syninfo.natural_scroll = 0; From owner-svn-src-stable-12@freebsd.org Fri Jul 5 22:03:12 2019 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 53E7215D5F9B; Fri, 5 Jul 2019 22:03:12 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E32178BEFB; Fri, 5 Jul 2019 22:03:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.235]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 210442604A5; Sat, 6 Jul 2019 00:03:08 +0200 (CEST) Subject: Re: svn commit: r349763 - in stable/12/sys: kern sys To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201907051226.x65CQUev056366@repo.freebsd.org> <97b7657c-53b9-f3d2-f31a-5e56343da71d@FreeBSD.org> From: Hans Petter Selasky Message-ID: <1bd91e31-920c-8857-f900-f66fb99f95d3@selasky.org> Date: Sat, 6 Jul 2019 00:02:31 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <97b7657c-53b9-f3d2-f31a-5e56343da71d@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E32178BEFB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.942,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 05 Jul 2019 22:03:12 -0000 On 2019-07-05 17:49, John Baldwin wrote: > How does this not break the module KBI? You've removed epoch_*_KBI symbols used > by existing modules, and you appear to have changed the size of the > 'struct epoch_tracker' object that existing modules allocate on the stack and > pass to functions in the kernel. Bumping __FreeBSD_version is not sufficient > cover to break the KBI of widely used interfaces in stable (while we don't > enforce KBI for all parts of the kernel, locking primitives is one of the things > we can't break). Hi John, I'm aware there is a KPI breakage, but there is no API or functionality breakage. The epoch(9) API is a very new API and I don't expect it to be widely used for binary only modules. Do you have any examples otherwise? man 9 epoch clearly states: NOTES The epoch kernel programming interface is under development and is subject to change. epoch(9) is currently mostly used inside the kernel which has to be re-compiled. If you think it is really important that epoch(9) will stay KBI compliant I'll do the work to fix that. --HPS From owner-svn-src-stable-12@freebsd.org Fri Jul 5 22:21:03 2019 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 A477E15D670C; Fri, 5 Jul 2019 22:21:03 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 480248C913; Fri, 5 Jul 2019 22:21:03 +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 228FE1896C; Fri, 5 Jul 2019 22:21:03 +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 x65ML3Uh067506; Fri, 5 Jul 2019 22:21:03 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x65ML22o067505; Fri, 5 Jul 2019 22:21:03 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201907052221.x65ML22o067505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Fri, 5 Jul 2019 22:21: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: r349769 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 349769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 480248C913 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.91)[-0.911,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] 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, 05 Jul 2019 22:21:03 -0000 Author: zeising (doc,ports committer) Date: Fri Jul 5 22:21:02 2019 New Revision: 349769 URL: https://svnweb.freebsd.org/changeset/base/349769 Log: MFC r349607: pci(4): Use plural registers Original commit message: pci(4): Use plural configuration registers Change to use registers instead of register, as it is customary to use plural when talking about PCI registers. This was missed in r349150. Modified: stable/12/share/man/man4/pci.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/pci.4 ============================================================================== --- stable/12/share/man/man4/pci.4 Fri Jul 5 20:01:06 2019 (r349768) +++ stable/12/share/man/man4/pci.4 Fri Jul 5 22:21:02 2019 (r349769) @@ -290,7 +290,7 @@ This .Xr ioctl 2 reads the .Tn PCI -configuration register specified by the passed-in +configuration registers specified by the passed-in .Va pci_io structure. The From owner-svn-src-stable-12@freebsd.org Fri Jul 5 22:36:33 2019 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 DF19215D6A7A; Fri, 5 Jul 2019 22:36:32 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 84E6E8D3AC; Fri, 5 Jul 2019 22:36:32 +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 59F8318C9C; Fri, 5 Jul 2019 22:36:32 +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 x65MaWpK078238; Fri, 5 Jul 2019 22:36:32 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x65MaWQ3078236; Fri, 5 Jul 2019 22:36:32 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201907052236.x65MaWQ3078236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 5 Jul 2019 22:36: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: r349771 - stable/12/usr.sbin/mountd X-SVN-Group: stable-12 X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: stable/12/usr.sbin/mountd X-SVN-Commit-Revision: 349771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 84E6E8D3AC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.925,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 05 Jul 2019 22:36:33 -0000 Author: rmacklem Date: Fri Jul 5 22:36:31 2019 New Revision: 349771 URL: https://svnweb.freebsd.org/changeset/base/349771 Log: MFC: r348590, r348591 Modify mountd so that it incrementally updates the kernel exports upon a reload. Without this patch, mountd would delete/load all exports from the exports file(s) when it receives a SIGHUP. This works fine for small exports file(s), but can take several seconds to do when there are large numbers (10000+) of exported file systems. Most of this time is spent doing the system calls that delete/export each of these file systems. When the "-S" option has been specified (the default these days), the nfsd threads are suspended for several seconds while the reload is done. This patch changes mountd so that it only does system calls for file systems where the exports have been changed/added/deleted as compared to the exports done for the previous load/reload of the exports file(s). Basically, when SIGHUP is posted to mountd, it saves the exportlist structures from the previous load and creates a new set of structures from the current exports file(s). Then it compares the current with the previous and only does system calls for cases that have been changed/added/deleted. The nfsd threads do not need to be suspended until the comparison step is being done. This results in a suspension period of milliseconds for a server with 10000+ exported file systems. There is some code using a LOGDEBUG() macro that allow runtime debugging output via syslog(LOG_DEBUG,...) that can be enabled by creating a file called /var/log/mountd.debug. This code is expected to be replaced with code that uses dtrace by cy@ in the near future, once issues w.r.t. dtrace in stable/12 have been resolved. The patch should not change the usage of the exports file(s), but improves the performance of reloading large exports file(s) where there are only a small number of changes done to the file(s). PR: 237860 Modified: stable/12/usr.sbin/mountd/mountd.c stable/12/usr.sbin/mountd/pathnames.h Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/mountd/mountd.c ============================================================================== --- stable/12/usr.sbin/mountd/mountd.c Fri Jul 5 22:21:20 2019 (r349770) +++ stable/12/usr.sbin/mountd/mountd.c Fri Jul 5 22:36:31 2019 (r349771) @@ -120,6 +120,8 @@ struct exportlist { fsid_t ex_fs; char *ex_fsdir; char *ex_indexfile; + struct xucred ex_defanon; + int ex_defexflags; int ex_numsecflavors; int ex_secflavors[MAXSECFLAVORS]; int ex_defnumsecflavors; @@ -129,6 +131,9 @@ struct exportlist { }; /* ex_flag bits */ #define EX_LINKED 0x1 +#define EX_DONE 0x2 +#define EX_DEFSET 0x4 +#define EX_PUBLICFH 0x8 SLIST_HEAD(exportlisthead, exportlist); @@ -147,6 +152,9 @@ struct grouplist { int gr_type; union grouptypes gr_ptr; struct grouplist *gr_next; + struct xucred gr_anon; + int gr_exflags; + int gr_flag; int gr_numsecflavors; int gr_secflavors[MAXSECFLAVORS]; }; @@ -157,6 +165,9 @@ struct grouplist { #define GT_DEFAULT 0x3 #define GT_IGNORE 0x5 +/* Group flags */ +#define GR_FND 0x1 + struct hostlist { int ht_flag; /* Uses DP_xx bits */ struct grouplist *ht_grp; @@ -176,7 +187,8 @@ struct fhreturn { /* Global defs */ static char *add_expdir(struct dirlist **, char *, int); static void add_dlist(struct dirlist **, struct dirlist *, - struct grouplist *, int, struct exportlist *); + struct grouplist *, int, struct exportlist *, + struct xucred *, int); static void add_mlist(char *, char *); static int check_dirpath(char *); static int check_options(struct dirlist *); @@ -189,8 +201,9 @@ static void complete_service(struct netconfig *nconf, static void clearout_service(void); static void del_mlist(char *hostp, char *dirp); static struct dirlist *dirp_search(struct dirlist *, char *); +static int do_export_mount(struct exportlist *, struct statfs *); static int do_mount(struct exportlist *, struct grouplist *, int, - struct xucred *, char *, int, struct statfs *); + struct xucred *, char *, int, struct statfs *, int, int *); static int do_opt(char **, char **, struct exportlist *, struct grouplist *, int *, int *, struct xucred *); static struct exportlist *ex_search(fsid_t *, struct exportlisthead *); @@ -199,10 +212,16 @@ static void free_dir(struct dirlist *); static void free_exp(struct exportlist *); static void free_grp(struct grouplist *); static void free_host(struct hostlist *); -static void get_exportlist(void); +static void free_v4rootexp(void); +static void get_exportlist_one(int); +static void get_exportlist(int); static void insert_exports(struct exportlist *, struct exportlisthead *); static void free_exports(struct exportlisthead *); -static void read_exportfile(void); +static void read_exportfile(int); +static int compare_nmount_exportlist(struct iovec *, int, char *); +static int compare_export(struct exportlist *, struct exportlist *); +static int compare_cred(struct xucred *, struct xucred *); +static int compare_secflavor(int *, int *, int); static void delete_export(struct iovec *, int, struct statfs *, char *); static int get_host(char *, struct grouplist *, struct grouplist *); static struct hostlist *get_ht(void); @@ -212,7 +231,7 @@ static int get_net(char *, struct netmsk *, int); static void getexp_err(struct exportlist *, struct grouplist *, const char *); static struct grouplist *get_grp(void); static void hang_dirp(struct dirlist *, struct grouplist *, - struct exportlist *, int); + struct exportlist *, int, struct xucred *, int); static void huphandler(int sig); static int makemask(struct sockaddr_storage *ssp, int bitlen); static void mntsrv(struct svc_req *, SVCXPRT *); @@ -237,6 +256,7 @@ static void terminate(int); #define EXPHASH(f) (fnv_32_buf((f), sizeof(fsid_t), 0) % exphashsize) static struct exportlisthead *exphead = NULL; +static struct exportlisthead *oldexphead = NULL; static int exphashsize = 0; static SLIST_HEAD(, mountlist) mlhead = SLIST_HEAD_INITIALIZER(&mlhead); static char *exnames_default[2] = { _PATH_EXPORTS, NULL }; @@ -269,7 +289,9 @@ static int have_v6 = 1; static int v4root_phase = 0; static char v4root_dirpath[PATH_MAX + 1]; +static struct exportlist *v4root_ep = NULL; static int has_publicfh = 0; +static int has_set_publicfh = 0; static struct pidfh *pfh = NULL; /* Bits for opt_flags above */ @@ -293,6 +315,15 @@ static int debug = 0; #endif /* + * The LOGDEBUG() syslog() calls are always compiled into the daemon. + * To enable them, create a file at _PATH_MOUNTDDEBUG. This file can be empty. + * To disable the logging, just delete the file at _PATH_MOUNTDDEBUG. + */ +static int logdebug = 0; +#define LOGDEBUG(format, ...) \ + (logdebug ? syslog(LOG_DEBUG, format, ## __VA_ARGS__) : 0) + +/* * Similar to strsep(), but it allows for quoted strings * and escaped characters. * @@ -465,7 +496,7 @@ main(int argc, char **argv) openlog("mountd", LOG_PID, LOG_DAEMON); if (debug) warnx("getting export list"); - get_exportlist(); + get_exportlist(0); if (debug) warnx("getting mount list"); get_mountlist(); @@ -636,7 +667,7 @@ main(int argc, char **argv) /* Expand svc_run() here so that we can call get_exportlist(). */ for (;;) { if (got_sighup) { - get_exportlist(); + get_exportlist(1); got_sighup = 0; } readfds = svc_fdset; @@ -1426,10 +1457,10 @@ static FILE *exp_file; * Get the export list from one, currently open file */ static void -get_exportlist_one(void) +get_exportlist_one(int passno) { struct exportlist *ep; - struct grouplist *grp, *tgrp; + struct grouplist *grp, *tgrp, *savgrp; struct dirlist *dirhead; struct statfs fsb; struct xucred anon; @@ -1663,11 +1694,18 @@ get_exportlist_one(void) * Loop through hosts, pushing the exports into the kernel. * After loop, tgrp points to the start of the list and * grp points to the last entry in the list. + * Do not do the do_mount() for passno == 1, since the + * second pass will do it, as required. */ grp = tgrp; do { - if (do_mount(ep, grp, exflags, &anon, dirp, dirplen, - &fsb)) { + grp->gr_exflags = exflags; + grp->gr_anon = anon; + if (v4root_phase == 2 && passno == 0) + LOGDEBUG("do_mount v4root"); + if (passno == 0 && do_mount(ep, grp, exflags, &anon, + dirp, dirplen, &fsb, ep->ex_numsecflavors, + ep->ex_secflavors)) { getexp_err(ep, tgrp, NULL); goto nextline; } @@ -1678,9 +1716,32 @@ get_exportlist_one(void) */ if (v4root_phase > 0 && v4root_phase <= 2) { /* - * Since these structures aren't used by mountd, + * These structures are used for the reload, + * so save them for that case. Otherwise, just * free them up now. */ + if (passno == 1 && ep != NULL) { + savgrp = tgrp; + while (tgrp != NULL) { + /* + * Save the security flavors and exflags + * for this host set in the groups. + */ + tgrp->gr_numsecflavors = + ep->ex_numsecflavors; + if (ep->ex_numsecflavors > 0) + memcpy(tgrp->gr_secflavors, + ep->ex_secflavors, + sizeof(ep->ex_secflavors)); + tgrp = tgrp->gr_next; + } + if (v4root_ep == NULL) { + v4root_ep = ep; + ep = NULL; /* Don't free below. */ + } + grp->gr_next = v4root_ep->ex_grphead; + v4root_ep->ex_grphead = savgrp; + } if (ep != NULL) free_exp(ep); while (tgrp != NULL) { @@ -1695,12 +1756,12 @@ get_exportlist_one(void) * Success. Update the data structures. */ if (has_host) { - hang_dirp(dirhead, tgrp, ep, opt_flags); + hang_dirp(dirhead, tgrp, ep, opt_flags, &anon, exflags); grp->gr_next = ep->ex_grphead; ep->ex_grphead = tgrp; } else { hang_dirp(dirhead, (struct grouplist *)NULL, ep, - opt_flags); + opt_flags, &anon, exflags); free_grp(grp); } dirhead = (struct dirlist *)NULL; @@ -1722,7 +1783,7 @@ nextline: * Get the export list from all specified files */ static void -get_exportlist(void) +get_exportlist(int passno) { struct export_args export; struct iovec *iov; @@ -1731,70 +1792,130 @@ get_exportlist(void) int num, i; int iovlen; struct nfsex_args eargs; + FILE *debug_file; - if (suspend_nfsd != 0) - (void)nfssvc(NFSSVC_SUSPENDNFSD, NULL); + if ((debug_file = fopen(_PATH_MOUNTDDEBUG, "r")) != NULL) { + fclose(debug_file); + logdebug = 1; + } else + logdebug = 0; + LOGDEBUG("passno=%d", passno); v4root_dirpath[0] = '\0'; + free_v4rootexp(); + if (passno == 1) { + /* + * Save the current lists as old ones, so that the new lists + * can be compared with the old ones in the 2nd pass. + */ + for (i = 0; i < exphashsize; i++) { + SLIST_FIRST(&oldexphead[i]) = SLIST_FIRST(&exphead[i]); + SLIST_INIT(&exphead[i]); + } + + /* Note that the public fh has not yet been set. */ + has_set_publicfh = 0; + + /* Read the export file(s) and process them */ + read_exportfile(passno); + } else { + /* + * Just make the old lists empty. + * exphashsize == 0 for the first call, before oldexphead + * has been initialized-->loop won't be executed. + */ + for (i = 0; i < exphashsize; i++) + SLIST_INIT(&oldexphead[i]); + } + bzero(&export, sizeof(export)); export.ex_flags = MNT_DELEXPORT; iov = NULL; iovlen = 0; bzero(errmsg, sizeof(errmsg)); + if (suspend_nfsd != 0) + (void)nfssvc(NFSSVC_SUSPENDNFSD, NULL); /* - * First, get rid of the old list + * Delete the old V4 root dir. */ - if (exphead != NULL) - free_exports(exphead); - - /* - * and the old V4 root dir. - */ bzero(&eargs, sizeof (eargs)); eargs.export.ex_flags = MNT_DELEXPORT; if (nfssvc(NFSSVC_V4ROOTEXPORT, (caddr_t)&eargs) < 0 && errno != ENOENT) syslog(LOG_ERR, "Can't delete exports for V4:"); - /* - * and clear flag that notes if a public fh has been exported. - */ - has_publicfh = 0; + build_iovec(&iov, &iovlen, "fstype", NULL, 0); + build_iovec(&iov, &iovlen, "fspath", NULL, 0); + build_iovec(&iov, &iovlen, "from", NULL, 0); + build_iovec(&iov, &iovlen, "update", NULL, 0); + build_iovec(&iov, &iovlen, "export", &export, + sizeof(export)); + build_iovec(&iov, &iovlen, "errmsg", errmsg, + sizeof(errmsg)); /* - * And delete exports that are in the kernel for all local - * filesystems. - * XXX: Should know how to handle all local exportable filesystems. + * For passno == 1, compare the old and new lists updating the kernel + * exports for any cases that have changed. + * This call is doing the second pass through the lists. + * If it fails, fall back on the bulk reload. */ - num = getmntinfo(&mntbufp, MNT_NOWAIT); + if (passno == 1 && compare_nmount_exportlist(iov, iovlen, errmsg) == + 0) { + LOGDEBUG("compareok"); + /* Free up the old lists. */ + free_exports(oldexphead); + } else { + LOGDEBUG("doing passno=0"); + /* + * Clear flag that notes if a public fh has been exported. + * It is set by do_mount() if MNT_EXPUBLIC is set for the entry. + */ + has_publicfh = 0; - /* Allocate hash tables, for first call. */ - if (exphead == NULL) { - /* Target an average linked list length of 10. */ - exphashsize = num / 10; - if (exphashsize < 1) - exphashsize = 1; - else if (exphashsize > 100000) - exphashsize = 100000; - exphead = malloc(exphashsize * sizeof(*exphead)); - if (exphead == NULL) - errx(1, "Can't malloc hash table"); + /* exphead == NULL if not yet allocated (first call). */ + if (exphead != NULL) { + /* + * First, get rid of the old lists. + */ + free_exports(exphead); + free_exports(oldexphead); + } - for (i = 0; i < exphashsize; i++) - SLIST_INIT(&exphead[i]); - } - if (num > 0) { - build_iovec(&iov, &iovlen, "fstype", NULL, 0); - build_iovec(&iov, &iovlen, "fspath", NULL, 0); - build_iovec(&iov, &iovlen, "from", NULL, 0); - build_iovec(&iov, &iovlen, "update", NULL, 0); - build_iovec(&iov, &iovlen, "export", &export, sizeof(export)); - build_iovec(&iov, &iovlen, "errmsg", errmsg, sizeof(errmsg)); - } + /* + * And delete exports that are in the kernel for all local + * filesystems. + * XXX: Should know how to handle all local exportable + * filesystems. + */ + num = getmntinfo(&mntbufp, MNT_NOWAIT); - for (i = 0; i < num; i++) - delete_export(iov, iovlen, &mntbufp[i], errmsg); + /* Allocate hash tables, for first call. */ + if (exphead == NULL) { + /* Target an average linked list length of 10. */ + exphashsize = num / 10; + if (exphashsize < 1) + exphashsize = 1; + else if (exphashsize > 100000) + exphashsize = 100000; + exphead = malloc(exphashsize * sizeof(*exphead)); + oldexphead = malloc(exphashsize * sizeof(*oldexphead)); + if (exphead == NULL || oldexphead == NULL) + errx(1, "Can't malloc hash tables"); + for (i = 0; i < exphashsize; i++) { + SLIST_INIT(&exphead[i]); + SLIST_INIT(&oldexphead[i]); + } + } + + for (i = 0; i < num; i++) + delete_export(iov, iovlen, &mntbufp[i], errmsg); + + + /* Read the export file(s) and process them */ + read_exportfile(0); + } + if (iov != NULL) { /* Free strings allocated by strdup() in getmntopts.c */ free(iov[0].iov_base); /* fstype */ @@ -1809,16 +1930,17 @@ get_exportlist(void) iovlen = 0; } - read_exportfile(); - /* * If there was no public fh, clear any previous one set. */ - if (has_publicfh == 0) + if (has_publicfh == 0) { + LOGDEBUG("clear public fh"); (void) nfssvc(NFSSVC_NOPUBLICFH, NULL); + } /* Resume the nfsd. If they weren't suspended, this is harmless. */ (void)nfssvc(NFSSVC_RESUMENFSD, NULL); + LOGDEBUG("eo get_exportlist"); } /* @@ -1830,6 +1952,7 @@ insert_exports(struct exportlist *ep, struct exportlis uint32_t i; i = EXPHASH(&ep->ex_fs); + LOGDEBUG("fs=%s hash=%i", ep->ex_fsdir, i); SLIST_INSERT_HEAD(&exhp[i], ep, entries); } @@ -1855,7 +1978,7 @@ free_exports(struct exportlisthead *exhp) * Read the exports file(s) and call get_exportlist_one() for each line. */ static void -read_exportfile(void) +read_exportfile(int passno) { int done, i; @@ -1871,7 +1994,7 @@ read_exportfile(void) syslog(LOG_WARNING, "can't open %s", exnames[i]); continue; } - get_exportlist_one(); + get_exportlist_one(passno); fclose(exp_file); done++; } @@ -1882,6 +2005,244 @@ read_exportfile(void) } /* + * Compare the export lists against the old ones and do nmount() operations + * for any cases that have changed. This avoids doing nmount() for entries + * that have not changed. + * Return 0 upon success, 1 otherwise. + */ +static int +compare_nmount_exportlist(struct iovec *iov, int iovlen, char *errmsg) +{ + struct exportlist *ep, *oep; + struct grouplist *grp; + struct statfs fs, ofs; + int i, ret; + + /* + * Loop through the current list and look for an entry in the old + * list. + * If found, check to see if it the same. + * If it is not the same, delete and re-export. + * Then mark it done on the old list. + * else (not found) + * export it. + * Any entries left in the old list after processing must have their + * exports deleted. + */ + for (i = 0; i < exphashsize; i++) + SLIST_FOREACH(ep, &exphead[i], entries) { + LOGDEBUG("foreach ep=%s", ep->ex_fsdir); + oep = ex_search(&ep->ex_fs, oldexphead); + if (oep != NULL) { + /* + * Check the mount paths are the same. + * If not, return 1 so that the reload of the + * exports will be done in bulk, the + * passno == 0 way. + */ + LOGDEBUG("found old exp"); + if (strcmp(ep->ex_fsdir, oep->ex_fsdir) != 0) + return (1); + LOGDEBUG("same fsdir"); + /* + * Test to see if the entry is the same. + * If not the same delete exports and + * re-export. + */ + if (compare_export(ep, oep) != 0) { + /* + * Clear has_publicfh if if was set + * in the old exports, but only if it + * has not been set during processing of + * the exports for this pass, as + * indicated by has_set_publicfh. + */ + if (has_set_publicfh == 0 && + (oep->ex_flag & EX_PUBLICFH) != 0) + has_publicfh = 0; + + /* Delete and re-export. */ + if (statfs(ep->ex_fsdir, &fs) < 0) + return (1); + delete_export(iov, iovlen, &fs, errmsg); + ret = do_export_mount(ep, &fs); + if (ret != 0) + return (ret); + } + oep->ex_flag |= EX_DONE; + LOGDEBUG("exdone"); + } else { + LOGDEBUG("not found so export"); + /* Not found, so do export. */ + if (statfs(ep->ex_fsdir, &fs) < 0) + return (1); + ret = do_export_mount(ep, &fs); + if (ret != 0) + return (ret); + } + } + + /* Delete exports not done. */ + for (i = 0; i < exphashsize; i++) + SLIST_FOREACH(oep, &oldexphead[i], entries) { + if ((oep->ex_flag & EX_DONE) == 0) { + LOGDEBUG("not done delete=%s", oep->ex_fsdir); + if (statfs(oep->ex_fsdir, &ofs) >= 0 && + oep->ex_fs.val[0] == ofs.f_fsid.val[0] && + oep->ex_fs.val[1] == ofs.f_fsid.val[1]) { + LOGDEBUG("do delete"); + /* + * Clear has_publicfh if if was set + * in the old exports, but only if it + * has not been set during processing of + * the exports for this pass, as + * indicated by has_set_publicfh. + */ + if (has_set_publicfh == 0 && + (oep->ex_flag & EX_PUBLICFH) != 0) + has_publicfh = 0; + + delete_export(iov, iovlen, &ofs, + errmsg); + } + } + } + + /* Do the V4 root exports, as required. */ + grp = NULL; + if (v4root_ep != NULL) + grp = v4root_ep->ex_grphead; + v4root_phase = 2; + while (v4root_ep != NULL && grp != NULL) { + LOGDEBUG("v4root expath=%s", v4root_dirpath); + ret = do_mount(v4root_ep, grp, grp->gr_exflags, &grp->gr_anon, + v4root_dirpath, strlen(v4root_dirpath), &fs, + grp->gr_numsecflavors, grp->gr_secflavors); + if (ret != 0) { + v4root_phase = 0; + return (ret); + } + grp = grp->gr_next; + } + v4root_phase = 0; + free_v4rootexp(); + return (0); +} + +/* + * Compare old and current exportlist entries for the fsid and return 0 + * if they are the same, 1 otherwise. + */ +static int +compare_export(struct exportlist *ep, struct exportlist *oep) +{ + struct grouplist *grp, *ogrp; + + if (strcmp(ep->ex_fsdir, oep->ex_fsdir) != 0) + return (1); + if ((ep->ex_flag & EX_DEFSET) != (oep->ex_flag & EX_DEFSET)) + return (1); + if ((ep->ex_defdir != NULL && oep->ex_defdir == NULL) || + (ep->ex_defdir == NULL && oep->ex_defdir != NULL)) + return (1); + if (ep->ex_defdir != NULL && (ep->ex_defdir->dp_flag & DP_DEFSET) != + (oep->ex_defdir->dp_flag & DP_DEFSET)) + return (1); + if ((ep->ex_flag & EX_DEFSET) != 0 && (ep->ex_defnumsecflavors != + oep->ex_defnumsecflavors || ep->ex_defexflags != + oep->ex_defexflags || compare_cred(&ep->ex_defanon, + &oep->ex_defanon) != 0 || compare_secflavor(ep->ex_defsecflavors, + oep->ex_defsecflavors, ep->ex_defnumsecflavors) != 0)) + return (1); + + /* Now, check all the groups. */ + for (ogrp = oep->ex_grphead; ogrp != NULL; ogrp = ogrp->gr_next) + ogrp->gr_flag = 0; + for (grp = ep->ex_grphead; grp != NULL; grp = grp->gr_next) { + for (ogrp = oep->ex_grphead; ogrp != NULL; ogrp = + ogrp->gr_next) + if ((ogrp->gr_flag & GR_FND) == 0 && + grp->gr_numsecflavors == ogrp->gr_numsecflavors && + grp->gr_exflags == ogrp->gr_exflags && + compare_cred(&grp->gr_anon, &ogrp->gr_anon) == 0 && + compare_secflavor(grp->gr_secflavors, + ogrp->gr_secflavors, grp->gr_numsecflavors) == 0) + break; + if (ogrp != NULL) + ogrp->gr_flag |= GR_FND; + else + return (1); + } + for (ogrp = oep->ex_grphead; ogrp != NULL; ogrp = ogrp->gr_next) + if ((ogrp->gr_flag & GR_FND) == 0) + return (1); + return (0); +} + +/* + * This algorithm compares two arrays of "n" items. It returns 0 if they are + * the "same" and 1 otherwise. Although suboptimal, it is always safe to + * return 1, which makes compare_nmount_export() reload the exports entry. + * "same" refers to having the same set of values in the two arrays. + * The arrays are in no particular order and duplicates (multiple entries + * in an array with the same value) is allowed. + * The algorithm is inefficient, but the common case of indentical arrays is + * handled first and "n" is normally fairly small. + * Since the two functions need the same algorithm but for arrays of + * different types (gid_t vs int), this is done as a macro. + */ +#define COMPARE_ARRAYS(a1, a2, n) \ + do { \ + int fnd, fndarray[(n)], i, j; \ + /* Handle common case of identical arrays. */ \ + for (i = 0; i < (n); i++) \ + if ((a1)[i] != (a2)[i]) \ + break; \ + if (i == (n)) \ + return (0); \ + for (i = 0; i < (n); i++) \ + fndarray[i] = 0; \ + for (i = 0; i < (n); i++) { \ + fnd = 0; \ + for (j = 0; j < (n); j++) { \ + if ((a1)[i] == (a2)[j]) { \ + fndarray[j] = 1; \ + fnd = 1; \ + } \ + } \ + if (fnd == 0) \ + return (1); \ + } \ + for (i = 0; i < (n); i++) \ + if (fndarray[i] == 0) \ + return (1); \ + return (0); \ + } while (0) + +/* + * Compare to struct xucred's. Return 0 if the same and 1 otherwise. + */ +static int +compare_cred(struct xucred *cr0, struct xucred *cr1) +{ + + if (cr0->cr_uid != cr1->cr_uid || cr0->cr_ngroups != cr1->cr_ngroups) + return (1); + + COMPARE_ARRAYS(cr0->cr_groups, cr1->cr_groups, cr0->cr_ngroups); +} + +/* + * Compare two lists of security flavors. Return 0 if the same and 1 otherwise. + */ +static int +compare_secflavor(int *sec1, int *sec2, int nsec) +{ + + COMPARE_ARRAYS(sec1, sec2, nsec); +} + +/* * Delete an exports entry. */ static void @@ -2028,7 +2389,7 @@ add_expdir(struct dirlist **dpp, char *cp, int len) */ static void hang_dirp(struct dirlist *dp, struct grouplist *grp, struct exportlist *ep, - int flags) + int flags, struct xucred *anoncrp, int exflags) { struct hostlist *hp; struct dirlist *dp2; @@ -2039,12 +2400,15 @@ hang_dirp(struct dirlist *dp, struct grouplist *grp, s else ep->ex_defdir = dp; if (grp == (struct grouplist *)NULL) { + ep->ex_flag |= EX_DEFSET; ep->ex_defdir->dp_flag |= DP_DEFSET; /* Save the default security flavors list. */ ep->ex_defnumsecflavors = ep->ex_numsecflavors; if (ep->ex_numsecflavors > 0) memcpy(ep->ex_defsecflavors, ep->ex_secflavors, sizeof(ep->ex_secflavors)); + ep->ex_defanon = *anoncrp; + ep->ex_defexflags = exflags; } else while (grp) { hp = get_ht(); hp->ht_grp = grp; @@ -2064,7 +2428,8 @@ hang_dirp(struct dirlist *dp, struct grouplist *grp, s */ while (dp) { dp2 = dp->dp_left; - add_dlist(&ep->ex_dirl, dp, grp, flags, ep); + add_dlist(&ep->ex_dirl, dp, grp, flags, ep, anoncrp, + exflags); dp = dp2; } } @@ -2076,7 +2441,7 @@ hang_dirp(struct dirlist *dp, struct grouplist *grp, s */ static void add_dlist(struct dirlist **dpp, struct dirlist *newdp, struct grouplist *grp, - int flags, struct exportlist *ep) + int flags, struct exportlist *ep, struct xucred *anoncrp, int exflags) { struct dirlist *dp; struct hostlist *hp; @@ -2086,10 +2451,12 @@ add_dlist(struct dirlist **dpp, struct dirlist *newdp, if (dp) { cmp = strcmp(dp->dp_dirp, newdp->dp_dirp); if (cmp > 0) { - add_dlist(&dp->dp_left, newdp, grp, flags, ep); + add_dlist(&dp->dp_left, newdp, grp, flags, ep, anoncrp, + exflags); return; } else if (cmp < 0) { - add_dlist(&dp->dp_right, newdp, grp, flags, ep); + add_dlist(&dp->dp_right, newdp, grp, flags, ep, anoncrp, + exflags); return; } else free((caddr_t)newdp); @@ -2116,12 +2483,15 @@ add_dlist(struct dirlist **dpp, struct dirlist *newdp, grp = grp->gr_next; } while (grp); } else { + ep->ex_flag |= EX_DEFSET; dp->dp_flag |= DP_DEFSET; /* Save the default security flavors list. */ ep->ex_defnumsecflavors = ep->ex_numsecflavors; if (ep->ex_numsecflavors > 0) memcpy(ep->ex_defsecflavors, ep->ex_secflavors, sizeof(ep->ex_secflavors)); + ep->ex_defanon = *anoncrp; + ep->ex_defexflags = exflags; } } @@ -2487,6 +2857,19 @@ free_exp(struct exportlist *ep) } /* + * Free up the v4root exports. + */ +static void +free_v4rootexp(void) +{ + + if (v4root_ep != NULL) { + free_exp(v4root_ep); + v4root_ep = NULL; + } +} + +/* * Free hosts. */ static void @@ -2526,12 +2909,52 @@ out_of_mem(void) } /* + * Call do_mount() from the struct exportlist, for each case needed. + */ +static int +do_export_mount(struct exportlist *ep, struct statfs *fsp) +{ + struct grouplist *grp, defgrp; + int ret; + size_t dirlen; + + LOGDEBUG("do_export_mount=%s", ep->ex_fsdir); + dirlen = strlen(ep->ex_fsdir); + if ((ep->ex_flag & EX_DEFSET) != 0) { + defgrp.gr_type = GT_DEFAULT; + defgrp.gr_next = NULL; + /* We have an entry for all other hosts/nets. */ + LOGDEBUG("ex_defexflags=0x%x", ep->ex_defexflags); + ret = do_mount(ep, &defgrp, ep->ex_defexflags, &ep->ex_defanon, + ep->ex_fsdir, dirlen, fsp, ep->ex_defnumsecflavors, + ep->ex_defsecflavors); + if (ret != 0) + return (ret); + } + + /* Do a mount for each group. */ + grp = ep->ex_grphead; + while (grp != NULL) { + LOGDEBUG("do mount gr_type=0x%x gr_exflags=0x%x", + grp->gr_type, grp->gr_exflags); + ret = do_mount(ep, grp, grp->gr_exflags, &grp->gr_anon, + ep->ex_fsdir, dirlen, fsp, grp->gr_numsecflavors, + grp->gr_secflavors); + if (ret != 0) + return (ret); + grp = grp->gr_next; + } + return (0); +} + +/* * Do the nmount() syscall with the update flag to push the export info into * the kernel. */ static int do_mount(struct exportlist *ep, struct grouplist *grp, int exflags, - struct xucred *anoncrp, char *dirp, int dirplen, struct statfs *fsb) + struct xucred *anoncrp, char *dirp, int dirplen, struct statfs *fsb, + int numsecflavors, int *secflavors) { struct statfs fsb1; struct addrinfo *ai; @@ -2557,14 +2980,16 @@ do_mount(struct exportlist *ep, struct grouplist *grp, bzero(errmsg, sizeof(errmsg)); eap->ex_flags = exflags; eap->ex_anon = *anoncrp; + LOGDEBUG("do_mount exflags=0x%x", exflags); eap->ex_indexfile = ep->ex_indexfile; if (grp->gr_type == GT_HOST) ai = grp->gr_ptr.gt_addrinfo; else ai = NULL; - eap->ex_numsecflavors = ep->ex_numsecflavors; + eap->ex_numsecflavors = numsecflavors; + LOGDEBUG("do_mount numsec=%d", numsecflavors); for (i = 0; i < eap->ex_numsecflavors; i++) - eap->ex_secflavors[i] = ep->ex_secflavors[i]; + eap->ex_secflavors[i] = secflavors[i]; if (eap->ex_numsecflavors == 0) { eap->ex_numsecflavors = 1; eap->ex_secflavors[0] = AUTH_SYS; @@ -2728,8 +3153,11 @@ do_mount(struct exportlist *ep, struct grouplist *grp, else if (nfssvc(NFSSVC_PUBLICFH, (caddr_t)&fh) < 0) syslog(LOG_ERR, "Can't set public fh for %s", public_name); - else + else { has_publicfh = 1; + has_set_publicfh = 1; + ep->ex_flag |= EX_PUBLICFH; + } } skip: if (ai != NULL) Modified: stable/12/usr.sbin/mountd/pathnames.h ============================================================================== --- stable/12/usr.sbin/mountd/pathnames.h Fri Jul 5 22:21:20 2019 (r349770) +++ stable/12/usr.sbin/mountd/pathnames.h Fri Jul 5 22:36:31 2019 (r349771) @@ -36,3 +36,4 @@ #define _PATH_EXPORTS "/etc/exports" #define _PATH_RMOUNTLIST "/var/db/mountdtab" #define _PATH_MOUNTDPID "/var/run/mountd.pid" +#define _PATH_MOUNTDDEBUG "/var/log/mountd.debug" From owner-svn-src-stable-12@freebsd.org Sat Jul 6 00:59:13 2019 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 ECAC915D8F45; Sat, 6 Jul 2019 00:59:12 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B3526B1FE; Sat, 6 Jul 2019 00:59:12 +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 468E31A41C; Sat, 6 Jul 2019 00:59: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 x660xCj8051986; Sat, 6 Jul 2019 00:59:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x660xC16051985; Sat, 6 Jul 2019 00:59:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907060059.x660xC16051985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 6 Jul 2019 00:59: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: r349773 - 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: 349773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B3526B1FE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 06 Jul 2019 00:59:13 -0000 Author: markj Date: Sat Jul 6 00:59:11 2019 New Revision: 349773 URL: https://svnweb.freebsd.org/changeset/base/349773 Log: MFC r349546: Fix mutual exclusion in pipe_direct_write(). Modified: stable/12/sys/kern/sys_pipe.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sys_pipe.c ============================================================================== --- stable/12/sys/kern/sys_pipe.c Fri Jul 5 22:48:31 2019 (r349772) +++ stable/12/sys/kern/sys_pipe.c Sat Jul 6 00:59:11 2019 (r349773) @@ -726,7 +726,7 @@ pipe_read(struct file *fp, struct uio *uio, struct ucr rpipe->pipe_map.pos += size; rpipe->pipe_map.cnt -= size; if (rpipe->pipe_map.cnt == 0) { - rpipe->pipe_state &= ~(PIPE_DIRECTW|PIPE_WANTW); + rpipe->pipe_state &= ~PIPE_WANTW; wakeup(rpipe); } #endif @@ -857,13 +857,17 @@ pipe_build_write_buffer(struct pipe *wpipe, struct uio } /* - * unmap and unwire the process buffer + * Unwire the process buffer. */ static void pipe_destroy_write_buffer(struct pipe *wpipe) { PIPE_LOCK_ASSERT(wpipe, MA_OWNED); + KASSERT((wpipe->pipe_state & PIPE_DIRECTW) != 0, + ("%s: PIPE_DIRECTW not set on %p", __func__, wpipe)); + + wpipe->pipe_state &= ~PIPE_DIRECTW; vm_page_unhold_pages(wpipe->pipe_map.ms, wpipe->pipe_map.npages); wpipe->pipe_map.npages = 0; } @@ -882,13 +886,15 @@ pipe_clone_write_buffer(struct pipe *wpipe) int pos; PIPE_LOCK_ASSERT(wpipe, MA_OWNED); + KASSERT((wpipe->pipe_state & PIPE_DIRECTW) != 0, + ("%s: PIPE_DIRECTW not set on %p", __func__, wpipe)); + size = wpipe->pipe_map.cnt; pos = wpipe->pipe_map.pos; wpipe->pipe_buffer.in = size; wpipe->pipe_buffer.out = 0; wpipe->pipe_buffer.cnt = size; - wpipe->pipe_state &= ~PIPE_DIRECTW; PIPE_UNLOCK(wpipe); iov.iov_base = wpipe->pipe_buffer.buffer; @@ -927,7 +933,7 @@ retry: pipeunlock(wpipe); goto error1; } - while (wpipe->pipe_state & PIPE_DIRECTW) { + if (wpipe->pipe_state & PIPE_DIRECTW) { if (wpipe->pipe_state & PIPE_WANTR) { wpipe->pipe_state &= ~PIPE_WANTR; wakeup(wpipe); @@ -970,8 +976,7 @@ retry: goto error1; } - error = 0; - while (!error && (wpipe->pipe_state & PIPE_DIRECTW)) { + while (wpipe->pipe_map.cnt != 0) { if (wpipe->pipe_state & PIPE_EOF) { pipe_destroy_write_buffer(wpipe); pipeselwakeup(wpipe); @@ -989,20 +994,19 @@ retry: error = msleep(wpipe, PIPE_MTX(wpipe), PRIBIO | PCATCH, "pipdwt", 0); pipelock(wpipe, 0); + if (error != 0) + break; } if (wpipe->pipe_state & PIPE_EOF) error = EPIPE; - if (wpipe->pipe_state & PIPE_DIRECTW) { - /* - * this bit of trickery substitutes a kernel buffer for - * the process that might be going away. - */ + if (error == EINTR || error == ERESTART) pipe_clone_write_buffer(wpipe); - } else { + else pipe_destroy_write_buffer(wpipe); - } pipeunlock(wpipe); + KASSERT((wpipe->pipe_state & PIPE_DIRECTW) == 0, + ("pipe %p leaked PIPE_DIRECTW", wpipe)); return (error); error1: From owner-svn-src-stable-12@freebsd.org Sat Jul 6 01:00:12 2019 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 415A215D9001; Sat, 6 Jul 2019 01:00:12 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC3DD6B462; Sat, 6 Jul 2019 01:00:11 +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 959751A422; Sat, 6 Jul 2019 01:00:11 +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 x6610BTq052172; Sat, 6 Jul 2019 01:00:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6610Bfd052171; Sat, 6 Jul 2019 01:00:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201907060100.x6610Bfd052171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 6 Jul 2019 01:00: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: r349775 - 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: 349775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BC3DD6B462 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.945,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 06 Jul 2019 01:00:12 -0000 Author: markj Date: Sat Jul 6 01:00:11 2019 New Revision: 349775 URL: https://svnweb.freebsd.org/changeset/base/349775 Log: MFC r349547: Use a consistent snapshot of the fd's rights in fget_mmap(). Modified: stable/12/sys/kern/kern_descrip.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_descrip.c ============================================================================== --- stable/12/sys/kern/kern_descrip.c Sat Jul 6 00:59:46 2019 (r349774) +++ stable/12/sys/kern/kern_descrip.c Sat Jul 6 01:00:11 2019 (r349775) @@ -2776,6 +2776,7 @@ fget_mmap(struct thread *td, int fd, cap_rights_t *rig if (maxprotp != NULL) *maxprotp = VM_PROT_ALL; #else + cap_rights_t fdrights; struct filedesc *fdp = td->td_proc->p_fd; seq_t seq; @@ -2784,15 +2785,18 @@ fget_mmap(struct thread *td, int fd, cap_rights_t *rig error = _fget(td, fd, fpp, 0, rightsp, &seq); if (error != 0) return (error); - /* - * If requested, convert capability rights to access flags. - */ if (maxprotp != NULL) - *maxprotp = cap_rights_to_vmprot(cap_rights(fdp, fd)); + fdrights = *cap_rights(fdp, fd); if (!fd_modified(fdp, fd, seq)) break; fdrop(*fpp, td); } + + /* + * If requested, convert capability rights to access flags. + */ + if (maxprotp != NULL) + *maxprotp = cap_rights_to_vmprot(&fdrights); #endif return (error); } From owner-svn-src-stable-12@freebsd.org Sat Jul 6 16:19:05 2019 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 1701115CBDF9; Sat, 6 Jul 2019 16:19:05 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9FB76B626; Sat, 6 Jul 2019 16:19:04 +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 7752823EE6; Sat, 6 Jul 2019 16:19:04 +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 x66GJ4Ro036266; Sat, 6 Jul 2019 16:19:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x66GJ4D2036265; Sat, 6 Jul 2019 16:19:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201907061619.x66GJ4D2036265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 6 Jul 2019 16:19:04 +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: r349792 - stable/12/sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/vm X-SVN-Commit-Revision: 349792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A9FB76B626 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.91)[-0.908,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 06 Jul 2019 16:19:05 -0000 Author: kib Date: Sat Jul 6 16:19:04 2019 New Revision: 349792 URL: https://svnweb.freebsd.org/changeset/base/349792 Log: MFC r349608: Use traditional 'p' local to designate td->td_proc in kern_mmap. Modified: stable/12/sys/vm/vm_mmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/vm/vm_mmap.c ============================================================================== --- stable/12/sys/vm/vm_mmap.c Sat Jul 6 15:55:16 2019 (r349791) +++ stable/12/sys/vm/vm_mmap.c Sat Jul 6 16:19:04 2019 (r349792) @@ -187,13 +187,15 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s { struct vmspace *vms; struct file *fp; + struct proc *p; vm_offset_t addr; vm_size_t pageoff; vm_prot_t cap_maxprot; int align, error; cap_rights_t rights; - vms = td->td_proc->p_vmspace; + p = td->td_proc; + vms = p->p_vmspace; fp = NULL; AUDIT_ARG_FD(fd); addr = addr0; @@ -213,7 +215,7 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s * pos. */ if (!SV_CURPROC_FLAG(SV_AOUT)) { - if ((size == 0 && curproc->p_osrel >= P_OSREL_MAP_ANON) || + if ((size == 0 && p->p_osrel >= P_OSREL_MAP_ANON) || ((flags & MAP_ANON) != 0 && (fd != -1 || pos != 0))) return (EINVAL); } else { @@ -356,7 +358,7 @@ kern_mmap(struct thread *td, uintptr_t addr0, size_t s if (error != 0) goto done; if ((flags & (MAP_SHARED | MAP_PRIVATE)) == 0 && - td->td_proc->p_osrel >= P_OSREL_MAP_FSTRICT) { + p->p_osrel >= P_OSREL_MAP_FSTRICT) { error = EINVAL; goto done; }