]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFC: r359631
Yoshihiro Takahashi [Sat, 11 Apr 2020 07:31:16 +0000 (07:31 +0000)]
MFC: r359631

Remove extra spaces for the load average of machines that are down.

PR: 245296
Submitted by: martin _at_ lispworks.com

4 years agoMFC r359501: deadlkres: include thread name in panic messages
Jason A. Harmening [Sat, 11 Apr 2020 05:12:38 +0000 (05:12 +0000)]
MFC r359501: deadlkres: include thread name in panic messages

4 years agoMFC r359585, r359587
Oleksandr Tymoshenko [Fri, 10 Apr 2020 22:18:13 +0000 (22:18 +0000)]
MFC r359585, r359587

r359585:
Fix calculation of the recurring weekdays

Both the result of the first_dayofweek_of_year and the target
weekday are zero-based (0 fo sunday) while the target month-day
or year-day is 1-based. Adjust logic accordingly.

Also add testcase for this PR to the kyua test suite

PR: 201062
Submitted by: Richard Narron <comet.berkeley@gmail.com>

r359587:
Remove hardcoded US Election Day from calendar.usholiday

calendar(1) syntax is not capable of representing the rules for the
US Election Day. The hardcoded date was set in r15066 in 1996 and
hasn't changed since then.

PR: 173389
Reported by: Steve Ames <steve@energistic.com>

4 years agoveloader use vectx API for kernel and modules
Simon J. Gerraty [Fri, 10 Apr 2020 05:13:15 +0000 (05:13 +0000)]
veloader use vectx API for kernel and modules

The vectx API, computes the hash for verifying a file as it is read.
This avoids the overhead of reading files twice - once to verify, then
again to load.

For doing an install via loader, avoiding the need to rewind
large files is critical.

This API is only used for modules, kernel and mdimage as these are the
biggest files read by the loader.
The reduction in boot time depends on how expensive the I/O is
on any given platform.  On a fast VM we see 6% improvement.

For install via loader the first file to be verified is likely to be the
kernel, so some of the prep work (finding manifest etc) done by
verify_file() needs to be factored so it can be reused for
vectx_open().

For missing or unrecognized fingerprint entries, we fail
in vectx_open() unless verifying is disabled.

Otherwise fingerprint check happens in vectx_close() and
since this API is only used for files which must be verified
(VE_MUST) we panic if we get an incorrect hash.

MFC of r358811

Reviewed by: imp,tsoome
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org//D23827

4 years agoMFC r359596:
Mark Johnston [Fri, 10 Apr 2020 01:37:00 +0000 (01:37 +0000)]
MFC r359596:
xargs: Fix exit status expression when a child process fails to exec.

PR: 244327

4 years agoMFC r359595:
Mark Johnston [Fri, 10 Apr 2020 01:23:06 +0000 (01:23 +0000)]
MFC r359595:
geom_journal: Only stop the switcher process if one was started.

PR: 243196

4 years agoMFC r359680: mail/gprof/tip: tap with the ugly stick
Kyle Evans [Fri, 10 Apr 2020 00:27:19 +0000 (00:27 +0000)]
MFC r359680: mail/gprof/tip: tap with the ugly stick

The ugly stick here is this bit in the respective headers:

#ifndef EXTERN
#define EXTERN extern
#endif

with a follow-up #define EXTERN in a single .c file to push all of their
definitions into one spot. A pass should be made over these three later to
push these definitions into the correct files instead, but this will suffice
for now and at a more leisurely pace.

4 years agoMFC r359689: config(8): "fix" a couple of buffer overflows
Kyle Evans [Fri, 10 Apr 2020 00:25:14 +0000 (00:25 +0000)]
MFC r359689: config(8): "fix" a couple of buffer overflows

Recently added/changed lines in various kernel configs have caused some
buffer overflows that went undetected. These were detected with a config
built using -fno-common as these line buffers smashed one of our arrays,
then further triaged with ASAN.

Double the sizes; this is really not a great fix, but addresses the
immediate need until someone rewrites config. While here, add some bounds
checking so that we don't need to detect this by random bus errors or other
weird failures.

4 years agoMFC r359688: stand: -fno-common fixes for !x86 loaders
Kyle Evans [Fri, 10 Apr 2020 00:23:34 +0000 (00:23 +0000)]
MFC r359688: stand: -fno-common fixes for !x86 loaders

- beriloader: archsw is declared extern and defined elsewhere
- ofwloader: ofw_elf{,64} are defined in elf_freebsd.c and
  ppc64_elf_freebsd.c respectively
- ubldr: syscall_ptr is defined in start.S for whichever ubldr platform is
  building

-fno-common will become the default in GCC10/LLVM11.

4 years agogas: mark dwarf2_loc_mark_labels as extern
Kyle Evans [Thu, 9 Apr 2020 20:49:01 +0000 (20:49 +0000)]
gas: mark dwarf2_loc_mark_labels as extern

Compiling with -fno-common complains as this header's included in multiple
compilation units. In fact, the proper definition of dwarf2_loc_mark_labels
already exists in dwarf2dbg.c, so simply mark this declaration with extern.

4 years agoMFC -fno-common fixes: r359389, r359394, r359397-r359399, r359403-r359404,
Kyle Evans [Thu, 9 Apr 2020 20:35:35 +0000 (20:35 +0000)]
MFC -fno-common fixes: r359389, r359394, r359397-r359399, r359403-r359404,
r359406, r359413-r359416, r359424-r359425, r359427, r359432-r359433,
r359443, r359675-r359678

Note: this is not necessarily a complete fix to get these programs to build
with -fno-common applied; further work may be needed in this branch.

r359389:
config(8): fixes for -fno-common

Move this handful of definitions into main.c, properly declare these as
extern in config.h. This fixes the config(8) build with -fno-common.

Unexplained in my previous commit to gas, -fno-common will become the
default in GCC10 and LLVM11, so it's worth addressing these in advance.

r359394:
MFV r359393: tcsh: import 6974bc35a5cd

This removes an extra variable definition that causes the -fno-common build
to fail, which will be a new default in GCC10/LLVM11.

r359397:
zfs: fix -fno-common issues

A similar (or identical?) fix has already landed in OpenZFS.

-fno-common will become the default in GCC10/LLVM11.

r359398:
sh: remove duplicate el definition

el is declared extern in myhistedit.h and defined in histedit.c. Remove the
duplicate definition in input.c to appease the -fno-common build.

-fno-common will become the default in GCC10/LLVM11.

r359399:
telnet: remove some duplicate definitions, mark terminaltype extern

Most of these were already properly declared and defined elsewhere, this is
effectively just a minor cleanup that fixes the -fno-common build.

-fno-common will become the default in GCC10/LLVM11.

r359403:
Revert 359399: telnet -fno-common bits

There was a large misfire from my local diff that I need to investigate, and
this version committed did not build.

r359404:
Re-apply r359399: telnet -fno-common fix

line and auth_level's redefinitions are just extraneous

telnetd will #define extern and then include ext.h to allocate storage for
all of these extern'd vars; however, two of them are actually defined in
libtelnet instead. Instead of doing an #ifdef extern dance around those
function pointers, just add an EXTERN macro to make it easier to
differentiate by sight which ones will get allocated in globals.c and which
ones are defined elsewhere.

r359406:
telnet: kill off remaining duplicate definition

r359413:
ipfilter: remove duplicate definition of 'thishost'

thishost is already defined in lib/initparse.c; no need for this one. This
fixes the ipfilter build with -fno-common.

-fno-common will become the default in GCC10/LLVM11.

r359414:
iscontrol: move definition of vflag/iscsidev to iscontrol.c

Mark the declaration extern as these are used elsewhere; this fixes the
build with -fno-common.

r359415:
userboot: mark host_fsops as extern

This is already defined elsewhere; mark this declaration extern to the fix
the -fno-common build.

r359416:
systat: remove redundant definition of kd

kd is already properly declared in extern.h and defined in main.c, rendering
this definition useless. This fixes the -fno-common build.

r359424:
openssh: -fno-common fix from upstream f47d72ddad

This is currently staged in vendor/ as part of the 8.0p1 import, which isn't
quite ready to land. Given that this is a simple one-line fix, apply it now
as the fallout will be pretty minimal.

-fno-common will become the default in GCC10/LLVM11.

r359425:
locate: fix -fno-common build

Just a single variable declaration to extern and define elsewhere here,
myctype.

-fno-common will become a default in GCC10/LLVM11.

r359427:
fsck_ffs/fsdb: fix -fno-common build

This one is also a small list:

- 3x duplicate definition (ufs2_zino, returntosingle, nflag)
- 5x 'needs extern', 3/5 of which are referenced in fsdb

-fno-common will become the default in GCC10/LLVM11.

r359432:
gdb: compile with -fcommon explicitly

As described in the comment, gdb relies on some of the linker magic that
happens with -fcommon. I suspect the life expectancy of gdb-in-base is low
enough that this isn't worth spending much time addressing, especially given
the vintage. Hit it with the -fcommon hammer so that it continues to just
work.

r359433:
bmake: fix -fno-common build

debug was declared extern, but debug_file was not; correct this and define
debug_file in main.c (as debug is) to fix the -fno-common build.

-fno-common will become the default with GCC10/LLVM11.

r359443:
MFV r359442: bmake: import -fno-common fix build back from upstream

sjg@ committed the local patch previously committed upstream; pull it in to
vendor/ to ease any potential stress of future imports.

r359675:
kqueue tests: fix -fno-common build

vnode_fd and kqfd are both shared among multiple CU; define them exactly
once.

In the case of vnode_fd, it was simply the declaration that needed
correction.

-fno-common will become the default in GCC10/LLVM11.

r359676:
ntpd: fix build with -fno-common

Only a small nit here: psl should be declared extern and defined exactly
once.

-fno-common will become the default in GCC10/LLVM11.

r359677:
yp*: fix -fno-common build

This is mostly two problems spread out far and wide:
- ypldap_process should be declared properly
- debug is defined differently in many programs

For the latter, just extern it and define it everywhere that actually needs
it. This mostly works out nicely for ^/libexec/ypxfr, which can remove the
assignment at the beginning of main in favor of defining it properly.

-fno-common will become the default in GCC10/LLVM11.

r359678:
indent: fix the -fno-common build

Spread the globals far and wide, hopefully to the files that make the most
sense.

-fno-common will become the default in GCC10/LLVM11.

4 years agoMFC r359562:
David Bright [Thu, 9 Apr 2020 18:17:07 +0000 (18:17 +0000)]
MFC r359562:

Fix various Coverity-detected errors in nvmecontrol

This fixes several Coverity-detected errors in nvmecontrol. While in
here, a couple additional errors with shift/mask confusion that were
not diagnosed by Coverity are also fixed.

CIDs addressed: 104029910403001403972140397314039851403988,
1403990140437414044271404469140451014045341418118

CID 1403657 (resource leak of shared library handle) was marked
"intentional" in the Coverity scan database.

Sponsored by: Dell EMC Isilon

4 years agoMFC (effectively) r359645: src.conf(5): re-roll after LLVM_ASSERTIONS
Kyle Evans [Thu, 9 Apr 2020 16:24:57 +0000 (16:24 +0000)]
MFC (effectively) r359645: src.conf(5): re-roll after LLVM_ASSERTIONS

On stable/12, this ends up including just a couple other things that
src.conf(5) hadn't been regenerated for.

4 years agoMFV r359401: OpenBSM: import ee79d73e8df5: auditreduce: add a zone filter
Kyle Evans [Thu, 9 Apr 2020 16:02:20 +0000 (16:02 +0000)]
MFV r359401: OpenBSM: import ee79d73e8df5: auditreduce: add a zone filter

This allows one to select audit records that match a -z zone glob.

4 years agoMFC r359644: llvm: add a build knob for enabling assertions
Kyle Evans [Thu, 9 Apr 2020 15:58:06 +0000 (15:58 +0000)]
MFC r359644: llvm: add a build knob for enabling assertions

For head/, this will remain eternally default-on to maintain the status quo.
For stable/ branches, it should be flipped to default-off to maintain the
status quo.

There's value in being able to flip it one way or the other easily on head
or stable branches, whether you want to gain some performance back on head/
(for machines there's little chance you'll actually hit an assertion) or
potentially diagnose a problem with the version of llvm on an older branch.

Currently, stable branches get the CFLAGS+= -ndebug line uncommented; going
forward, they will instead have the default of LLVM_ASSERTIONS flipped.

[MFC note: that last comment just happened for these two branches]

4 years agoMFC r359327,359328:
Andrey V. Elsukov [Thu, 9 Apr 2020 07:11:59 +0000 (07:11 +0000)]
MFC r359327,359328:
  Add property-based filters for syslogd.

  Property-based filters allow substring and regular expressions
  (see re_format(7)) matching against various message attributes.
  Filter specification starts with '#:' or ':' followed by three
  comma-separated fields property, operator, "value". Value must be
  double-quoted. A double quote and backslash must be escaped by a
  backslash.

  Following properties are supported as test value:
  o msg - body of the message received;
  o programname - program name sent the message;
  o hostname - hostname of message's originator;
  o source - an alias for hostname.

  Supported operators:
  o contains - true if filter value is found as a substring of property;
  o isequal - true if filter value is equal to property;
  o startswith - true if property starts with filter value;
  o regex - true if property matches basic regular expression defined
      in filter value;
  o ereregex - true if property matches extended regular expression
      defined in filter value;

  Operator may be prefixed by '!' to invert compare logic or by
  'icase_' to make comparison function case insensitive.

  Submitted by: Boris N. Lytochkin <lytboris at gmail com>
  Relnotes: yes
  Differential Revision: https://reviews.freebsd.org/D23468

4 years agoRevert MFC of 359612 due to reported problems.
Kirk McKusick [Thu, 9 Apr 2020 06:32:51 +0000 (06:32 +0000)]
Revert MFC of 359612 due to reported problems.

4 years agoveloader use vectx API for kernel and modules
Simon J. Gerraty [Thu, 9 Apr 2020 04:50:19 +0000 (04:50 +0000)]
veloader use vectx API for kernel and modules

The vectx API, computes the hash for verifying a file as it is read.
This avoids the overhead of reading files twice - once to verify, then
again to load.

For doing an install via loader, avoiding the need to rewind
large files is critical.

This API is only used for modules, kernel and mdimage as these are the
biggest files read by the loader.
The reduction in boot time depends on how expensive the I/O is
on any given platform.  On a fast VM we see 6% improvement.

For install via loader the first file to be verified is likely to be the
kernel, so some of the prep work (finding manifest etc) done by
verify_file() needs to be factored so it can be reused for
vectx_open().

For missing or unrecognized fingerprint entries, we fail
in vectx_open() unless verifying is disabled.

Otherwise fingerprint check happens in vectx_close() and
since this API is only used for files which must be verified
(VE_MUST) we panic if we get an incorrect hash.

Fix pkgfs stat so it satisfies libsecureboot

We need a valid st_dev, st_ino and st_mtime
to correctly track which files have been verified
and to update our notion of time.

ve_utc_set(): ignore utc if it would jump our current time
by more than VE_UTC_MAX_JUMP (20 years).

Allow testing of install command via userboot.
Need to fix its stat implementation too.

bhyveload also needs stat fixed - due to change to userboot.h

Call ve_error_get() from vectx_close() when hash is wrong.

Track the names of files we have hashed into pcr

For the purposes of measured boot, it is important
to be able to reproduce the hash reflected in
loader.ve.pcr
so loader.ve.hashed provides a list of names in the order they
were added.

Avoid unused vars when VE_ECDSA_HASH_AGAIN undefined

MFC of r358744 r358767 r359307 r355962

Reviewed by: imp,tsoome,emaste
Sponsored by: Juniper Networks
Differential Revision: https://reviews.freebsd.org//D23827 https://reviews.freebsd.org//D24027

4 years agoMFC r359303
Ryan Moeller [Wed, 8 Apr 2020 06:06:13 +0000 (06:06 +0000)]
MFC r359303

MFOpenZFS: ZVOLs should not be allowed to have children

zfs create, receive and rename can bypass this hierarchy rule. Update
both userland and kernel module to prevent this issue and use pyzfs
unit tests to exercise the ioctls directly.

Note: this commit slightly changes zfs_ioc_create() ABI. This allow to
differentiate a generic error (EINVAL) from the specific case where we
tried to create a dataset below a ZVOL (ZFS_ERR_WRONG_PARENT).

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Matt Ahrens <mahrens@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tom Caputi <tcaputi@datto.com>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Approved by:    mav (mentor)
openzfs/zfs@d8d418ff0cc90776182534bce10b01e9487b63e4

4 years agoMFC r349729:
Bryan Drewery [Tue, 7 Apr 2020 19:44:37 +0000 (19:44 +0000)]
MFC r349729:

  Consider *clean targets as non-build targets as well.

4 years agoMFC r353771:
Bryan Drewery [Tue, 7 Apr 2020 19:40:11 +0000 (19:40 +0000)]
MFC r353771:

  Fix spelling of DPSRCS.

4 years agoMFC r357353:
Bryan Drewery [Tue, 7 Apr 2020 19:39:08 +0000 (19:39 +0000)]
MFC r357353:

  make all is needed to generate .depend.*

4 years agoMFC r359289:
Mitchell Horne [Tue, 7 Apr 2020 18:41:52 +0000 (18:41 +0000)]
MFC r359289:

Makefile.inc1: override MACHINE for native-xtools

4 years agoMFC r357053 by markj: ng_nat: Pass IPv6 packets through.
Eugene Grosbein [Tue, 7 Apr 2020 17:49:36 +0000 (17:49 +0000)]
MFC r357053 by markj: ng_nat: Pass IPv6 packets through.

ng_nat implements NAT for IPv4 traffic only.  When connected to an
ng_ether node it erroneously handled IPv6 packets as well.

This change is not sufficient: ng_nat does not do any validation of IP
packets in this mode, even though they have not yet passed through
ip_input().

PR: 243096
Reported by: Robert James Hernandez <rob@sarcasticadmin.com>
Reviewed by: julian
Differential Revision: https://reviews.freebsd.org/D23080

4 years agoMFC r356943,356944: Correct "service ipfw status" for INET6-only systems.
Eugene Grosbein [Tue, 7 Apr 2020 16:52:45 +0000 (16:52 +0000)]
MFC r356943,356944: Correct "service ipfw status" for INET6-only systems.

4 years agoMFC r342168,357786: Allow ng_nat to be attached to a ethernet interface
Eugene Grosbein [Tue, 7 Apr 2020 16:44:14 +0000 (16:44 +0000)]
MFC r342168,357786: Allow ng_nat to be attached to a ethernet interface

Allow ng_nat to be attached to a ethernet interface directly via ng_ether(4)
or the likes. Add new control message types: setdlt and getdlt to switch
from default DLT_RAW (no encapsulation) to DLT_EN10MB (ethernet).

Submitted by: sobomax
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D18535
Relnotes: yes

4 years agoMFC r357092,357787: Add support for RFC 6598/Carrier Grade NAT subnets
Eugene Grosbein [Tue, 7 Apr 2020 16:27:58 +0000 (16:27 +0000)]
MFC r357092,357787: Add support for RFC 6598/Carrier Grade NAT subnets
to libalias and ipfw.

In libalias, a new flag PKT_ALIAS_UNREGISTERED_RFC6598 is added.
This is like PKT_ALIAS_UNREGISTERED_ONLY, but also is RFC 6598 aware.
Also, we add a new NAT option to ipfw called unreg_cgn, which is like
unreg_only, but also is RFC 6598-aware.  The reason for the new
flags/options is to avoid breaking existing networks, especially those
which rely on RFC 6598 as an external address.

Submitted by: Neel Chauhan <neel AT neelc DOT org>
Reviewed by: melifaro, rgrimes, Lutz Donnerhacke
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D22877
Differential Revision: https://reviews.freebsd.org/D23448

4 years agoMFC r359277:
Mark Johnston [Tue, 7 Apr 2020 16:15:53 +0000 (16:15 +0000)]
MFC r359277:
Add regression tests for newsyslog.conf's p flag.

4 years agoMFC r359276:
Mark Johnston [Tue, 7 Apr 2020 16:15:35 +0000 (16:15 +0000)]
MFC r359276:
newsyslog: Fix stack corruption when initializing a zipwork structure.

4 years agoMFC of 359612
Kirk McKusick [Mon, 6 Apr 2020 22:12:42 +0000 (22:12 +0000)]
MFC of 359612

Use proper boolean expressions for soft update macros.

Sponsored by: Netflix

4 years agoMFC r359468:
Konstantin Belousov [Mon, 6 Apr 2020 18:52:40 +0000 (18:52 +0000)]
MFC r359468:
kern_sendfile.c: add specific malloc type.

4 years agoMFC r359466:
Konstantin Belousov [Mon, 6 Apr 2020 18:48:55 +0000 (18:48 +0000)]
MFC r359466:
VOP_GETPAGES_ASYNC(): consistently call iodone() callback in case of error.

4 years agoMFC r359464:
Konstantin Belousov [Mon, 6 Apr 2020 18:47:15 +0000 (18:47 +0000)]
MFC r359464:
buffer pager: skip bogus pages.

PR: 244713

4 years agoMFC r359463:
Konstantin Belousov [Mon, 6 Apr 2020 18:45:05 +0000 (18:45 +0000)]
MFC r359463:
kern_sendfile.c style: order headers alphabetically.

4 years agoMFC r359437:
Mark Johnston [Mon, 6 Apr 2020 14:58:24 +0000 (14:58 +0000)]
MFC r359437:
Fix accounting of hwpmc's thread descriptor freelist.

4 years agoMFC r359594, r359597:
Mark Johnston [Mon, 6 Apr 2020 14:56:19 +0000 (14:56 +0000)]
MFC r359594, r359597:
Fix the description of the -m flag in top.1.

PR: 244153

4 years agoMFC r359452:
Hans Petter Selasky [Mon, 6 Apr 2020 07:07:27 +0000 (07:07 +0000)]
MFC r359452:
Fine grain locking inside the cuse(3) kernel module.

Implement one mutex per cuse(3) server instance which also cover the
clients belonging to the given server instance.

This should significantly reduce the mutex congestion inside the
cuse(3) kernel module when multiple servers are in use.

Sponsored by: Mellanox Technologies

4 years agoMFC r359271:
Andrey V. Elsukov [Mon, 6 Apr 2020 06:34:45 +0000 (06:34 +0000)]
MFC r359271:
  Use IP_FW_NAT44_DESTROY opcode for IP_FW3 socket option to destroy
  NAT instance.

  The NAT44 group of opcodes for IP_FW3 socket option is modern way
  to control NAT instances and this method can be used in future to
  switch from numeric to named NAT instances, like was done for ipfw
  tables.
  The IP_FW_NAT_DEL opcode is the last remnant of old ipfw_ctl control
  plane that doesn't support versioned operations. This interface will
  be retired soon.

4 years agoMFC r359453, r359455
Kyle Evans [Mon, 6 Apr 2020 04:06:15 +0000 (04:06 +0000)]
MFC r359453, r359455

r359453:
flua: enable readline bits, courtesy of libedit

This is a nicer experience when attempting to run ad-hoc lua bits in the
flua REPL.

r359455:
flua: follow-up to r359453, don't bother with libedit in bootstrap

The bootstrap flua should not be used for REPL-like activities; exclude it
to save the dependency on libedit and not waste time with it.

PR: 245121

4 years agoDisable use of bswapxx with GCC.
Xin LI [Sun, 5 Apr 2020 04:01:11 +0000 (04:01 +0000)]
Disable use of bswapxx with GCC.

4 years agoWorkaround for GCC.
Xin LI [Sun, 5 Apr 2020 03:26:40 +0000 (03:26 +0000)]
Workaround for GCC.

4 years agoMFC r357716: Use humanize_number to format available and bad space size
Xin LI [Sun, 5 Apr 2020 02:45:54 +0000 (02:45 +0000)]
MFC r357716: Use humanize_number to format available and bad space size

4 years agoMFC r357757: MFV r357712: file 5.38.
Xin LI [Sun, 5 Apr 2020 02:27:49 +0000 (02:27 +0000)]
MFC r357757: MFV r357712: file 5.38.

4 years agoMFC r357609: MFV r357608: Limit memory usage in xz(1) instead of in tuklib.
Xin LI [Sun, 5 Apr 2020 02:08:17 +0000 (02:08 +0000)]
MFC r357609: MFV r357608: Limit memory usage in xz(1) instead of in tuklib.

4 years agoMFC r359201: MFV r359197: xz 5.2.5.
Xin LI [Sun, 5 Apr 2020 01:53:35 +0000 (01:53 +0000)]
MFC r359201: MFV r359197: xz 5.2.5.

Relnotes: yes

4 years agoFix the Linux truncate64 debug print after r359605.
Mark Johnston [Sat, 4 Apr 2020 17:08:58 +0000 (17:08 +0000)]
Fix the Linux truncate64 debug print after r359605.

Note, the debug code is not present in head, it was removed in r347538.
This is a direct commit to stable/12.

Reported by: Jenkins

4 years agoMFC r359489
Vincenzo Maffione [Fri, 3 Apr 2020 18:55:22 +0000 (18:55 +0000)]
MFC r359489

valectl: fix typo in man page

Submitted by:   Jose Luis Duran
MFC after:      3 days

4 years agoMFC: r359486
Jung-uk Kim [Fri, 3 Apr 2020 17:08:47 +0000 (17:08 +0000)]
MFC: r359486

Merge OpenSSL 1.1.1f.

PR: 245073

4 years agoMFC r356945, r356946:
Mark Johnston [Fri, 3 Apr 2020 16:31:45 +0000 (16:31 +0000)]
MFC r356945, r356946:
Fix 64-bit syscall argument fetching in 32-bit Linux syscall handlers.

PR: 243155

4 years agoMFC r355754, r355807 (trasz):
Mark Johnston [Fri, 3 Apr 2020 16:28:39 +0000 (16:28 +0000)]
MFC r355754, r355807 (trasz):
Add sync_file_range(2) implementation to linux(4).

4 years agoMFC r355752, r355753 (by trasz):
Mark Johnston [Fri, 3 Apr 2020 16:11:39 +0000 (16:11 +0000)]
MFC r355752, r355753 (by trasz):
Fix definitions for linuxulator's sync_file_range(2).

4 years agoMFC r359171:
Mark Johnston [Fri, 3 Apr 2020 13:26:38 +0000 (13:26 +0000)]
MFC r359171:
Simplify uipc_detach() slightly.

4 years agoMFC r359170:
Mark Johnston [Fri, 3 Apr 2020 13:25:53 +0000 (13:25 +0000)]
MFC r359170:
Remove UNP_NASCENT, reverting r303855.

4 years agoMFC r359239, r359241 setkey
Baptiste Daroussin [Fri, 3 Apr 2020 05:11:16 +0000 (05:11 +0000)]
MFC r359239, r359241 setkey

r359239:
Revove useless linking to yacc

r359241:
Remove the link to libl which only contains a stub function
on yywrap, if the flex is told yywrap is not in use, then this linkage becomes
unnecessary

4 years agoMFC r359232:
Baptiste Daroussin [Fri, 3 Apr 2020 05:08:06 +0000 (05:08 +0000)]
MFC r359232:

pw: do not removed home directories if not owned

When deleting a user, if its home directory does not belong to it, it should
not be removed. This is the promise that the manpage makes, the tool should
ensure that it respects that promise.

Add a regression test about it

PR:  244967
Submitted by: Eric Hanneken <eric@erichanneken.com>

4 years agoMFC r359371
Ryan Moeller [Fri, 3 Apr 2020 01:31:48 +0000 (01:31 +0000)]
MFC r359371

loader: Fully reset terminal settings, not just colors

Reviewed by:    kevans, tsoome
Approved by:    mav (mentor)

4 years agoMFC r359183:
Mark Johnston [Fri, 3 Apr 2020 00:32:48 +0000 (00:32 +0000)]
MFC r359183:
Fix uselocale(3) to not leak a reference to the old locale.

PR: 239520

4 years agoMFC r359130:
Kristof Provost [Thu, 2 Apr 2020 18:32:44 +0000 (18:32 +0000)]
MFC r359130:

pfctl: improve rule load times with thousands of interfaces

r343287 / D18759 introduced ifa_add_groups_to_map() which is now run by
ifa_load/ifa_lookup/host_if. When loading an anchor or ruleset via pfctl that
does NOT contain ifnames as hosts, host() still ends up iterating all
interfaces twice, grabbing SIOCGIFGROUP ioctl twice for each. This adds an
unnecessary amount of time on systems with thousands or tens of thousands of
interfaces.

Prioritize the IPv4/6 check over the interface name lookup, which skips loading
the iftab and iterating all interfaces when the configuration does not contain
interface names.

Submitted by: Nick Rogers
Sponsored by: RG Nets

4 years agoMFC r359006: muge: enable RXCSUM as it now works
Ed Maste [Thu, 2 Apr 2020 16:48:46 +0000 (16:48 +0000)]
MFC r359006: muge: enable RXCSUM as it now works

4 years agoMFC r359132:
Mark Johnston [Thu, 2 Apr 2020 15:37:40 +0000 (15:37 +0000)]
MFC r359132:
Enter a write sequence when updating rights.

4 years agoMFC r359133:
Mark Johnston [Thu, 2 Apr 2020 15:32:09 +0000 (15:32 +0000)]
MFC r359133:
kern_dup(): Call filecaps_free_prep() in a write section.

4 years agoMFC r359154:
Mark Johnston [Thu, 2 Apr 2020 15:30:51 +0000 (15:30 +0000)]
MFC r359154:
Fix synchronization in the IPV6_2292PKTOPTIONS set handler.

4 years agoMFC r359330:
Mark Johnston [Thu, 2 Apr 2020 15:30:30 +0000 (15:30 +0000)]
MFC r359330:
Remove unused SYSINIT macros for capability rights.

4 years agoMFC r359439:
Hans Petter Selasky [Thu, 2 Apr 2020 07:40:57 +0000 (07:40 +0000)]
MFC r359439:
Evaluate modifier keys before the regular keys, so that if a modifier
key is pressed at the same time as a regular key, that means key with
modifier is output. Some automated USB keyboards like Yubikeys need this.

This fixes a regression issue after r357861.

Reported by: Adam McDougall <mcdouga9@egr.msu.edu>
PR: 224592
PR: 233884
Sponsored by: Mellanox Technologies

4 years agoMFC r359331:
Mark Johnston [Thu, 2 Apr 2020 03:35:05 +0000 (03:35 +0000)]
MFC r359331:
Simplify td_ucred handling in newnfs_connect().

4 years agoMFC r359112: MFOpenZFS: make zil max block size tunable
Alexander Motin [Thu, 2 Apr 2020 00:30:01 +0000 (00:30 +0000)]
MFC r359112: MFOpenZFS: make zil max block size tunable

We've observed that on some highly fragmented pools, most metaslab
allocations are small (~2-8KB), but there are some large, 128K
allocations.  The large allocations are for ZIL blocks.  If there is a
lot of fragmentation, the large allocations can be hard to satisfy.

The most common impact of this is that we need to check (and thus load)
lots of metaslabs from the ZIL allocation code path, causing sync writes
to wait for metaslabs to load, which can take a second or more.  In the
worst case, we may not be able to satisfy the allocation, in which case
the ZIL will resort to txg_wait_synced() to ensure the change is on
disk.

To provide a workaround for this, this change adds a tunable that can
reduce the size of ZIL blocks.

External-issue: DLPX-61719
Reviewed-by: George Wilson <george.wilson@delphix.com>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #8865
openzfs/zfs@b8738257c2607c73c731ce8e0fd73282b266d6ef

4 years agoMFC r359110: Add missing STAILQ_INIT() in ciss_disable_adapter().
Alexander Motin [Thu, 2 Apr 2020 00:28:26 +0000 (00:28 +0000)]
MFC r359110: Add missing STAILQ_INIT() in ciss_disable_adapter().

I think it should fix reported panic after "ADAPTER HEARTBEAT FAILED".

4 years agoMFC r359111:
Konstantin Belousov [Wed, 1 Apr 2020 22:23:34 +0000 (22:23 +0000)]
MFC r359111:
Add file for static compilation of mlx5.

4 years agoMFC r359106:
Konstantin Belousov [Wed, 1 Apr 2020 19:46:31 +0000 (19:46 +0000)]
MFC r359106:
mlx5_core: lower the severity of message noting that no SR-IOV cap is present.

4 years agoMFC r359105:
Konstantin Belousov [Wed, 1 Apr 2020 19:45:27 +0000 (19:45 +0000)]
MFC r359105:
mlx5: Route NIC_VPORT_CHANGE events to eswitch code.

4 years agoMFC r359104:
Konstantin Belousov [Wed, 1 Apr 2020 19:44:03 +0000 (19:44 +0000)]
MFC r359104:
mlx5: Read number of VF ports from the SR-IOV cap.

4 years agoMFC r359103:
Konstantin Belousov [Wed, 1 Apr 2020 19:42:50 +0000 (19:42 +0000)]
MFC r359103:
mlx5: Use eswitch interface to configure VFs steering.

4 years agoMFC r359102:
Konstantin Belousov [Wed, 1 Apr 2020 19:41:26 +0000 (19:41 +0000)]
MFC r359102:
mlx5: Add 'follow' vport state, relevant for VFs.

4 years agoMFC r359101:
Konstantin Belousov [Wed, 1 Apr 2020 19:40:14 +0000 (19:40 +0000)]
MFC r359101:
mlx5: Integrate eswitch and mpfs management code.

4 years agoMFC r359100:
Konstantin Belousov [Wed, 1 Apr 2020 19:38:46 +0000 (19:38 +0000)]
MFC r359100:
mlx5: Restore eswitch management code from attic.

4 years agoMFC r359098:
Konstantin Belousov [Wed, 1 Apr 2020 19:37:23 +0000 (19:37 +0000)]
MFC r359098:
mlx5: Basic PCIe side of SR-IOV support.

4 years agoMFC r359094:
Konstantin Belousov [Wed, 1 Apr 2020 19:06:26 +0000 (19:06 +0000)]
MFC r359094:
mlx5_core: add sysctls to report device capabilities.

4 years agoMFC r359096, r359165 (by imp):
Konstantin Belousov [Wed, 1 Apr 2020 17:13:43 +0000 (17:13 +0000)]
MFC r359096, r359165 (by imp):
linuxkpi: Add infrastructure to pass FreeBSD IOV method calls into
pci_driver methods.

4 years agoMFC r359095:
Konstantin Belousov [Wed, 1 Apr 2020 17:08:55 +0000 (17:08 +0000)]
MFC r359095:
Add pci_iov_if.h header as a dependency for Linuxkpi consumers.

MFC note: this is not a true merge of r359095, but an adaptation of the
committed bit from r359378, which was MFC r359185.  The functional part
of the change should be same.

4 years agoMFC r359093:
Konstantin Belousov [Wed, 1 Apr 2020 16:01:03 +0000 (16:01 +0000)]
MFC r359093:
Do not spuriously re-enable disabled io_apic pin on EOI for some configurations.

4 years agoMFC r359092:
Konstantin Belousov [Wed, 1 Apr 2020 15:59:26 +0000 (15:59 +0000)]
MFC r359092:
Stop (trying to) renumber io apics.

4 years agoMFC r359090:
Konstantin Belousov [Wed, 1 Apr 2020 15:57:14 +0000 (15:57 +0000)]
MFC r359090:
Widen the stored io_apic_id to 8 bits.

4 years agoMFC 359071:
Mateusz Piotrowski [Wed, 1 Apr 2020 07:28:31 +0000 (07:28 +0000)]
MFC 359071:

Document that posixshmcontrol first appeared in 12.1

Also while here, I am addressing some linting issues.

PR: 243132
Submitted by: Noah Altunian <nbaltunian gmail com>
Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D24112

4 years agoMFC r359396:
Konstantin Belousov [Tue, 31 Mar 2020 15:26:56 +0000 (15:26 +0000)]
MFC r359396:
hdaa: remove verbosity from the normal driver operations.

4 years agoMFC r359278:
Mark Johnston [Tue, 31 Mar 2020 01:18:00 +0000 (01:18 +0000)]
MFC r359278:
newsyslog: Add fallthrough comments to appease Coverity.

4 years agoMFC r343758 (mmacy): Fix deterministic builds by sorting input...
Ed Maste [Mon, 30 Mar 2020 22:07:11 +0000 (22:07 +0000)]
MFC r343758 (mmacy): Fix deterministic builds by sorting input...

...to fts in jevents

4 years agoMFC r339880 (arichardson): Fix get_maxfds() in jevents
Ed Maste [Mon, 30 Mar 2020 22:02:27 +0000 (22:02 +0000)]
MFC r339880 (arichardson): Fix get_maxfds() in jevents

If RLIM_INFINITY == -1ULL (such as on macOS) the min() call will result
in a value of less than 1 being returned. This causes nftw() to fail
with EINVAL.

While touching this file also fix includes to work on Linux/macOS and don't
declare snprintf since it may have different attributes in the system
headers there.

4 years agoMFC r359368:
Brooks Davis [Mon, 30 Mar 2020 17:07:05 +0000 (17:07 +0000)]
MFC r359368:

Create and use a tests group for the tests user.

No user (except nobody) should be a member of the nobody group.

Reported by: rgrimes
Reviewed by: rgrimes
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24199

4 years agoMFC r358818:
Vladimir Kondratyev [Sun, 29 Mar 2020 23:38:55 +0000 (23:38 +0000)]
MFC r358818:

acpi: Fix stalled value returned by acpi_get_device() after device deletion

Newbus device reference attached to ACPI handle is not cleared when newbus
device is deleted with devctl(8) delete command. Fix that with calling of
AcpiDetachData() from "child_deleted" bus method like acpi_pci driver does.

MFC r358819:

acpi: Export functions required by upcoming acpi_iicbus driver.

MFC r358820:

iicbus(4): Add support for ACPI-based children enumeration

When iicbus is attached as child of Designware I2C controller it scans all
ACPI nodes for "I2C Serial Bus Connection Resource Descriptor" described
in section 19.6.57 of ACPI specs.
If such a descriptor is found, I2C child is added to iicbus, it's I2C
address, IRQ resource and ACPI handle are added to ivars. Existing
ACPI bus-hosted child is deleted afterwards.

The driver also installs so called "I2C address space handler" which is
disabled by default as nontested.
Set hw.iicbus.enable_acpi_space_handler loader tunable to 1 to enable it.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D22901

4 years agoMFC 359299:
Mateusz Piotrowski [Sat, 28 Mar 2020 08:15:18 +0000 (08:15 +0000)]
MFC 359299:

Fix formatting

Previously, the whole "jail_* variables" string would be stylized
as a variable. This is incorrect.

4 years agoMFC r359185:
Konstantin Belousov [Fri, 27 Mar 2020 20:06:40 +0000 (20:06 +0000)]
MFC r359185:
Introduce LINUXKPI_GENSRCS.

For MFC, pci_iov_if.h is excluded from the list.  It will be readded
when linuxkpi support for SRIOV is merged.

Sponsored by: Mellanox Technologies

4 years agoMFC r358314: style.9: update C99 commentary
Ed Maste [Fri, 27 Mar 2020 19:08:10 +0000 (19:08 +0000)]
MFC r358314: style.9: update C99 commentary

Make style.9 read as a current statement of C99 preferences, rather than a
description of ongoing changes to our preferred style.  Alsu use the short
form "ISO C99" on the 2nd and later instances rather than repeating the
unwieldy `ISO/IEC 9899:1999 ("ISO C99")` each time.

4 years agoMFC r359172-r359176:
Mark Johnston [Fri, 27 Mar 2020 17:06:24 +0000 (17:06 +0000)]
MFC r359172-r359176:
elftoolchain coverity fixes

4 years agoMFC r359184:
Mark Johnston [Fri, 27 Mar 2020 17:04:46 +0000 (17:04 +0000)]
MFC r359184:
Lock the socket in soo_stat().

4 years agoMFC r359285:
Justin Hibbits [Fri, 27 Mar 2020 15:26:30 +0000 (15:26 +0000)]
MFC r359285:

ichwd: Add Atom C3000 watchdog ID.

Sponsored by:   Juniper Networks, Inc

4 years agoMFC r359279:
Justin Hibbits [Fri, 27 Mar 2020 15:20:19 +0000 (15:20 +0000)]
MFC r359279:

ismt: Fix ISMT_DESC_ADDR_RW macro, slave addresses are already left-shifted

Reverts r293369.  The macro was orginally correct, since our SMBus
framework, unlike i2c, already requires addresses to be 8-bit, LSB-cleared.

Sponsored by:   Juniper Networks, Inc

4 years agoMFC r358959: Increase buffer in mprsas_log_command() from 192 to 224 bytes.
Alexander Motin [Fri, 27 Mar 2020 13:29:24 +0000 (13:29 +0000)]
MFC r358959: Increase buffer in mprsas_log_command() from 192 to 224 bytes.

192 bytes are not enough to print long commands, such as ATA COMMAND PASS
THROUGH(16), that makes debug output difficult to read.

4 years agoMFC 358954:
Mateusz Piotrowski [Fri, 27 Mar 2020 09:57:27 +0000 (09:57 +0000)]
MFC 358954:

CMSG_DATA.3: Fix formatting of printf escape sequences

Escape sequences like "\n" have to be escaped twice in examples in our
mdoc(7)-based manual pages in order to be displayed properly. The problem
is that otherwise they are interpreted by mdoc(7), which results in:

    printf("parent: received '%s'0, buf);

being shown to the user instead of:

    printf("parent: received '%s'\n", buf);

Approved by: bcr (mentor)
Differential Revision: https://reviews.freebsd.org/D24056

4 years agoMFC 359340:
Mateusz Piotrowski [Fri, 27 Mar 2020 09:55:08 +0000 (09:55 +0000)]
MFC 359340:

Do not use macros in -width

They do not expand.

4 years agoMFC r359159:
Navdeep Parhar [Fri, 27 Mar 2020 03:58:00 +0000 (03:58 +0000)]
MFC r359159:

cxgbe(4): Split sge_nm_rxq into three cachelines.

This reduces the lines bouncing around between the driver rx ithread and
the netmap rxsync thread.  There is no net change in the size of the
struct (it continues to waste a lot of space).

This kind of split was originally proposed in D17869 by Marc De La
Gueronniere @ Verisign, Inc.

Sponsored by: Chelsio Communications