]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoMFC: r366004
Jung-uk Kim [Fri, 25 Sep 2020 21:58:43 +0000 (21:58 +0000)]
MFC: r366004

Merge OpenSSL 1.1.1h.

3 years agoMFC 365013: Suppress -Wempty-body warnings in GCC 6.x and later.
John Baldwin [Fri, 25 Sep 2020 21:18:43 +0000 (21:18 +0000)]
MFC 365013: Suppress -Wempty-body warnings in GCC 6.x and later.

libc++ in LLVM 11 uses an empty else clause in
include/c++/v1/__thread_support which triggers this warning.

3 years agoMFC of 365992
Kirk McKusick [Fri, 25 Sep 2020 17:14:35 +0000 (17:14 +0000)]
MFC of 365992

Update check-hash when doing large filesystem expansions.

Sponsored by: Netflix

3 years agoMFC r365879, r365976:
Mark Johnston [Fri, 25 Sep 2020 13:59:50 +0000 (13:59 +0000)]
MFC r365879, r365976:
Assert we are not traversing through superpages in the arm64 pmap.

3 years agoMFC r365889:
Mark Johnston [Fri, 25 Sep 2020 13:53:32 +0000 (13:53 +0000)]
MFC r365889:
Install library symlinks atomically.

PR: 233769

3 years agoMFC r366005:
Mark Johnston [Fri, 25 Sep 2020 13:24:29 +0000 (13:24 +0000)]
MFC r366005:
udf: Validate the full file entry length

PR: 248613

3 years agoMFC r365880:
Konstantin Belousov [Fri, 25 Sep 2020 12:54:42 +0000 (12:54 +0000)]
MFC r365880:
Add pargs, penv, pwdx commands and aliases to procstat(1).

3 years agoMFC r365547: Add -z "TOS" option to ping6, to test DSCP/ECN values
Richard Scheffenegger [Fri, 25 Sep 2020 10:57:11 +0000 (10:57 +0000)]
MFC r365547: Add -z "TOS" option to ping6, to test DSCP/ECN values

ping has the option to add the (deprecated) TOS byte
using the -z option. Adding the same option, with the
same (deprecated) Traffic Class Byte (nowadays actually
DSCP and ECN fields) to ping6 to validate proper QoS
processing in network switches.

Reviewed by: tuexen
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26384

3 years agoMFC r365546: cc_mod: remove unused CCF_DELACK definition
Richard Scheffenegger [Fri, 25 Sep 2020 10:49:26 +0000 (10:49 +0000)]
MFC r365546: cc_mod: remove unused CCF_DELACK definition

During the DCTCP improvements, use of CCF_DELACK was
removed. This change is just to rename the unused flag
bit to prevent use of it, without also re-implementing
the tcp_input and tcp_output interfaces.

No functional change.

Reviewed by: chengc_netapp.com,tuexen
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D26181

3 years agoMFC r366011
Vincenzo Maffione [Thu, 24 Sep 2020 20:01:31 +0000 (20:01 +0000)]
MFC r366011

libnetmap: fix cast from uint64_t to void*

We use uintptr_t as an intermediate cast to avoid compiler
warnings on 32 bit architectures.

Reported by:    adrian

3 years agoMFC: r365895
Rick Macklem [Thu, 24 Sep 2020 15:34:47 +0000 (15:34 +0000)]
MFC: r365895
Fix a LOR between the NFS server and server side krpc.

Recent testing of the NFS-over-TLS code found a LOR between the mutex lock
used for sessions and the sleep lock used for server side krpc socket
structures in nfsrv_checksequence().  This was fixed by r365789.
A similar bug exists in nfsrv_bindconnsess(), where SVC_RELEASE() is called
while mutexes are held.
This patch applies a fix similar to r365789, moving the SVC_RELEASE() call
down to after the mutexes are released.

This patch fixes the problem by moving the SVC_RELEASE() call in
nfsrv_bindconnsess() down a few lines to below where the mutexes are released.

3 years agoMFC r364721-r364722
Cy Schubert [Wed, 23 Sep 2020 22:36:38 +0000 (22:36 +0000)]
MFC r364721-r364722

r364721:
MFV 364468:

Update unbound 1.10.1 --> 1.11.0.

r364722:
Update unbound version number.

3 years agoMFC 365278: Don't assume objects in program sections have a size of a pointer.
John Baldwin [Wed, 23 Sep 2020 21:57:29 +0000 (21:57 +0000)]
MFC 365278: Don't assume objects in program sections have a size of a pointer.

The size of the object at 'addr' is unknown and might be smaller than
the size of a pointer (e.g. some x86 instructions are smaller than a
pointer).  Instead, just check that the address is in the bounds of
the program header.

3 years agoMFC r365858: man(9): Some markup fixes
Gordon Bergling [Wed, 23 Sep 2020 19:40:03 +0000 (19:40 +0000)]
MFC r365858: man(9): Some markup fixes

- whitespace at end of input line
- skipping paragraph macro: Pp after Sh

3 years agoMFC r365815, r365826:
Konstantin Belousov [Wed, 23 Sep 2020 17:26:53 +0000 (17:26 +0000)]
MFC r365815, r365826:
Add check_pgrp_jobc() calls into process exit path.

3 years agoMFC r365814:
Konstantin Belousov [Wed, 23 Sep 2020 17:25:04 +0000 (17:25 +0000)]
MFC r365814:
Fix fixjobc+orhpanage.

3 years agoMFC r365813:
Konstantin Belousov [Wed, 23 Sep 2020 17:20:04 +0000 (17:20 +0000)]
MFC r365813:
Assert that P_TREE_GRPEXITED is set only once.

3 years agoMFC r365812:
Konstantin Belousov [Wed, 23 Sep 2020 17:12:59 +0000 (17:12 +0000)]
MFC r365812:
proc_realparent: if p_oppid does not match pid of the current parent
for non-orphaned process, return reaper instead of init.

3 years agoMFC r365811:
Konstantin Belousov [Wed, 23 Sep 2020 17:11:06 +0000 (17:11 +0000)]
MFC r365811:
Improve ddb 'show pgrpdump' command.

3 years agoMFC r364720:
Cy Schubert [Wed, 23 Sep 2020 14:36:38 +0000 (14:36 +0000)]
MFC r364720:

Update sqlite to 3.33.0 (3330000).

Release announcement at https://www.sqlite.org/releaselog/3_33_0.html.

3 years agoMFC r347996, r348024, r348031, r348042 (by ngie)
Li-Wen Hsu [Wed, 23 Sep 2020 12:11:14 +0000 (12:11 +0000)]
MFC r347996, r348024, r348031, r348042 (by ngie)

r347996:
Replace uses of `foo.(de|en)code('hex')` with `binascii.(un)?hexlify(foo)`

Python 3 no longer doesn't support encoding/decoding hexadecimal numbers using
the `str.format` method. The backwards compatible new method (using the
binascii module/methods) is a comparable means of converting to/from
hexadecimal format.

In short, the functional change is the following:
* `foo.decode('hex')` -> `binascii.unhexlify(foo)`
* `foo.encode('hex')` -> `binascii.hexlify(foo)`

While here, move the dpkt import in `cryptodev.py` down per PEP8, so it comes
after the standard library provided imports.

PR: 237403

r348024:
Followup to r347996

Replace uses of `foo.encode("hex")` with `binascii.hexlify(foo)` for forwards
compatibility between python 2.x and python 3.

PR: 237403

r348031:
Squash deprecation warning related to array.array(..).tostring()

In version 3.2+, `array.array(..).tostring()` was renamed to
`array.array(..).tobytes()`. Conditionally call `array.array(..).tobytes()` if
the python version is 3.2+.

PR: 237403

r348042:
Fix encoding issues with python 3

In python 3, the default encoding was switched from ascii character sets to
unicode character sets in order to support internationalization by default.
Some interfaces, like ioctls and packets, however, specify data in terms of
non-unicode encodings formats, either in host endian (`fcntl.ioctl`) or
network endian (`dpkt`) byte order/format.

This change alters assumptions made by previous code where it was all
data objects were assumed to be basestrings, when they should have been
treated as byte arrays. In order to achieve this the following are done:
* str objects with encodings needing to be encoded as ascii byte arrays are
  done so via `.encode("ascii")`. In order for this to work on python 3 in a
  type agnostic way (as it anecdotally varied depending on the caller), call
  `.encode("ascii")` only on str objects with python 3 to cast them to ascii
  byte arrays in a helper function name `str_to_ascii(..)`.
* `dpkt.Packet` objects needing to be passed in to `fcntl.ioctl(..)` are done
  so by casting them to byte arrays via `bytes()`, which calls
  `dpkt.Packet__str__` under the covers and does the necessary str to byte array
  conversion needed for the `dpkt` APIs and `struct` module.

In order to accomodate this change, apply the necessary typecasting for the
byte array literal in order to search `fop.name` for nul bytes.

This resolves all remaining python 2.x and python 3.x compatibility issues on
amd64. More work needs to be done for the tests to function with i386, in
general (this is a legacy issue).

PR: 237403
Tested with: python 2.7.16 (amd64), python 3.6.8 (amd64)

3 years agoMFC r365444:
Li-Wen Hsu [Wed, 23 Sep 2020 09:58:48 +0000 (09:58 +0000)]
MFC r365444:

Add support to BELKIN B2B128 USB3 Ethernet Adapter to axge(4)

Github PR: https://github.com/freebsd/freebsd/pull/439
Submitted by: https://github.com/jdpc86

3 years agoMFC: r365789
Rick Macklem [Wed, 23 Sep 2020 01:49:50 +0000 (01:49 +0000)]
MFC: r365789
Fix a LOR between the NFS server and server side krpc.

Recent testing of the NFS-over-TLS code found a LOR between the mutex lock
used for sessions and the sleep lock used for server side krpc socket
structures.
The code in nfsrv_checksequence() would call SVC_RELEASE() with the mutex
held.  Normally this is ok, since all that happens is SVC_RELEASE()
decrements a reference count.  However, if the socket has just been shut
down, SVC_RELEASE() drops the reference count to 0 and acquires a sleep
lock during destruction of the server side krpc structure.

This patch fixes the problem by moving the SVC_RELEASE() call in
nfsrv_checksequence() down a few lines to below where the mutex is released.

3 years agoMFC r365696: Spawn the DHCPv6 client in EC2 instances via rtsold.
Colin Percival [Tue, 22 Sep 2020 23:13:29 +0000 (23:13 +0000)]
MFC r365696: Spawn the DHCPv6 client in EC2 instances via rtsold.

3 years agoMFC r365061
Vincenzo Maffione [Tue, 22 Sep 2020 21:43:43 +0000 (21:43 +0000)]
MFC r365061

iflib: leave only 1 receive descriptor unused

The pidx argument of isc_rxd_flush() indicates which is the last valid
receive descriptor to be used by the NIC. However, current code has
multiple issues:
  - Intel drivers write pidx to their RDT register, which means that
    NICs will only use the descriptors up to pidx-1 (modulo ring size N),
    and won't actually use the one pointed by pidx. This does not break
    reception, but it is anyway confusing and suboptimal (the NIC will
    actually see only N-2 descriptors as available, rather than N-1).
    Other drivers (if_vmx, if_bnxt, if_mgb) adhere to this semantic.
  - The semantic used by Intel (RDT is one descriptor past the last
    valid one) is used by most (if not all) NICs, and it is also used
    on the TX side (also in iflib). Since iflib is not currently
    using this semantic for RX, it must decrement fl->ifl_pidx
    (modulo N) before calling isc_rxd_flush(), and then the
    per-driver callback implementation must increment the index
    again (to match the real semantic). This is confusing and suboptimal.
  - The iflib refill function is also called at initialization.
    However, in case the ring size is smaller than 128 (e.g. if_mgb),
    the refill function will actually prepare all the receive
    descriptors (N), without leaving one unused, as most of NICs assume
    (e.g. to avoid RDT to overrun RDH). I can speculate that the code
    looks like this right now because this issue showed up during
    testing (e.g. with if_mgb), and it was easy to workaround by
    decrementing pidx before isc_rxd_flush().

The goal of this change is to simplify the code (removing a bunch
of instructions from the RX fast path), and to make the semantic of
isc_rxd_flush() consistent across drivers. To achieve this, we:
  - change the semantics of the pidx argument to the usual one (that
    is the index one past the last valid one), so that both iflib and
    drivers avoid the decrement/increment dance.
  - fix the initialization code to prepare at most N-1 descriptors.

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

3 years agoMFC r364936, r365023
Vincenzo Maffione [Tue, 22 Sep 2020 21:16:03 +0000 (21:16 +0000)]
MFC r364936, r365023

lib: add libnetmap

This changeset introduces the new libnetmap library for writing
netmap applications.
Before libnetmap, applications could either use the kernel API
directly (e.g. NIOCREGIF/NIOCCTRL) or the simple header-only-library
netmap_user.h (e.g. nm_open(), nm_close(), nm_mmap() etc.)

The new library offers more functionalities than netmap_user.h:
  - Support for complex netmap options, such as external memory
    allocators or per-buffer offsets. This opens the way to future
    extensions.
  - More flexibility in the netmap port bind options, such as
    non-numeric names for pipes, or the ability to specify the netmap
    allocator that must be used for a given port.
  - Automatic tracking of the netmap memory regions in use across the
    open ports.

At the moment there is no man page, but the libnetmap.h header file
 has in-depth documentation.

Reviewed by:    hrs
Differential Revision:  https://reviews.freebsd.org/D26171

3 years agoMFC r346623 (by ngie):
Li-Wen Hsu [Tue, 22 Sep 2020 20:04:57 +0000 (20:04 +0000)]
MFC r346623 (by ngie):

Chase PEP-3110

Replace `except Environment, e:` with `except Environment as e` for
compatibility between python 2.x and python 3.x.

While here, fix a bad indentation change from r346620 by reindenting the code
properly.

Sponsored by: The FreeBSD Foundation

3 years agoRevert r361645. The current quarterly ports branch contains ebsnvme-id,
Colin Percival [Tue, 22 Sep 2020 18:18:57 +0000 (18:18 +0000)]
Revert r361645.  The current quarterly ports branch contains ebsnvme-id,
so packages are now available for all architectures.

(Direct commit to stable/12 since r361645 never happened in HEAD.)

3 years agoMFC r365853: domainset(9): Some markup fixes
Gordon Bergling [Tue, 22 Sep 2020 17:30:53 +0000 (17:30 +0000)]
MFC r365853: domainset(9): Some markup fixes

- new sentence, new line
- whitespace at end of input line

3 years agoMFC r365854: VOP_INACTIVE(9): Remove trailing whitespace
Gordon Bergling [Tue, 22 Sep 2020 17:29:44 +0000 (17:29 +0000)]
MFC r365854: VOP_INACTIVE(9): Remove trailing whitespace

3 years agoMFC r365857: pwmbus(9): some markup fixes
Gordon Bergling [Tue, 22 Sep 2020 17:28:32 +0000 (17:28 +0000)]
MFC r365857: pwmbus(9): some markup fixes

- whitespace at end of input line

3 years agoMFC r365729:
Ian Lepore [Tue, 22 Sep 2020 14:59:05 +0000 (14:59 +0000)]
MFC r365729:

Add product ID strings for a couple Microchip usb hubs.  Also, update the
vendor ID string to say just "Microchip Technology" -- the buyout of
Standard Microsystems happened in 2012 and the SMC/SMSC names are pretty
much retired at this point.

PR: 241406

3 years agoMFC r365304, r365459
Mitchell Horne [Tue, 22 Sep 2020 14:15:06 +0000 (14:15 +0000)]
MFC r365304, r365459

r365304:
arm64: update the set of HWCAP definitions

r365459:
arm64: fix incorrect HWCAP definitions

Sponsored by: The FreeBSD Foundation

3 years agoMFC r365749:
Mark Johnston [Tue, 22 Sep 2020 12:14:46 +0000 (12:14 +0000)]
MFC r365749:
Fix some posixshmcontrol nits.

3 years agoMFC r365829, r365837, r365852: certctl rehash upon install/distribute
Kyle Evans [Tue, 22 Sep 2020 02:14:55 +0000 (02:14 +0000)]
MFC r365829, r365837, r365852: certctl rehash upon install/distribute

r365829:
installworld: run `certctl rehash` after installation completes

This was originally introduced back in r360833, and subsequently reverted
because it was broken for -DNO_ROOT builds and it may not have been the
correct place for it.

While debatably this may still not be 'the correct place,' it's much cleaner
than scattering rehashes all throughout the tree. brooks has fixed the issue
with -DNO_ROOT by properly writing to the METALOG in r361397.

Do note that this is different than what was originally committed; brooks
had revisions in D24932 that made it actually use the revised unprivileged
mode and write to METALOG, along with being a little more friendly to
foreign crossbuilds and just using the certctl in-tree.

With this change, I believe we should now have a populated /etc/ssl/certs in
the VM images.

r365837:
Promote the installworld `certctl rehash` to distributeworld

Contrary to my belief, installworld is not sufficient for getting certs
installed into VM images. Promote the rehash to both installworld and
distributeworld (notably: not stageworld) and rehash the base distdir so we
end up with /etc/ssl/certs populated in the base dist archive. A future
commit will remove the rehash from bsdinstall, which doesn't really need to
happen if they're installed into base.txz.

While here, fix a minor typo: s/CERTCLTFLAGS/CERTCTLFLAGS/

r365852:
Revert r361257: bsdinstall: do a `certctl rehash` upon installation [...]

As of r365829, any given base distribution set will now include the /etc/ssl
symlinks that this rehash would've otherwise installed. This extra step is
no longer required.

3 years agoMFC r365896: caroot: update base store
Kyle Evans [Tue, 22 Sep 2020 01:58:18 +0000 (01:58 +0000)]
MFC r365896: caroot: update base store

Count:
- Two (2) removed
- Three (3) added

3 years agoMFC r365774 and r365776
Eric Joyner [Mon, 21 Sep 2020 22:52:57 +0000 (22:52 +0000)]
MFC r365774 and r365776

These two commits fix issues in em(4)/igb(4):
- Fix define and includes with RSS option enabled
- Properly retain promisc flag in init

PR: 249191, 248869
MFC after: 1 day

3 years agoMark sysctls added in r365689 as MPSAFE.
Mark Johnston [Mon, 21 Sep 2020 22:22:06 +0000 (22:22 +0000)]
Mark sysctls added in r365689 as MPSAFE.

This is a direct commit to stable/12.

Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D26507

3 years agoMFC of 365700
Kirk McKusick [Mon, 21 Sep 2020 19:25:41 +0000 (19:25 +0000)]
MFC of 365700

Switch to more appropriate libufs interfaces in newfs.

Sponsored by: Netflix

3 years agoMFC r364932:
Hans Petter Selasky [Mon, 21 Sep 2020 18:27:44 +0000 (18:27 +0000)]
MFC r364932:
Allow slow USB devices to be given more time to return their USB descriptors,
like Logitech HD Pro Webcam C920.

PR: 248926
Sponsored by: Mellanox Technologies

3 years agoMFC r365238:
Hans Petter Selasky [Mon, 21 Sep 2020 18:24:28 +0000 (18:24 +0000)]
MFC r365238:
Assert that cc_exec_drain(cc, direct) is NULL before assigning a new value.

Suggested by: markj@
Tested by: callout_test
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r365237:
Hans Petter Selasky [Mon, 21 Sep 2020 18:21:59 +0000 (18:21 +0000)]
MFC r365237:
Micro optimise _callout_stop_safe() by removing dead code.

The CS_DRAIN flag cannot be set at the same time like the async-drain function
pointer is set. These are orthogonal features. Assert this at the beginning
of the function.

Before:
        if (flags & CS_DRAIN) {
                /* FALLTHROUGH */
        } else if (xxx) {
                return yyy;
        }
        if (drain) {
                zzz = drain;
        }
After:
        if (flags & CS_DRAIN) {
                /* FALLTHROUGH */
        } else if (xxx) {
                return yyy;
        } else {
                if (drain) {
                        zzz = drain;
                }
        }

Reviewed by: markj@
Tested by: callout_test
Differential Revision: https://reviews.freebsd.org/D26285
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r365719:
Hans Petter Selasky [Mon, 21 Sep 2020 18:18:53 +0000 (18:18 +0000)]
MFC r365719:
Poll statistics more frequently in mlx5en(4).

This makes traffic steering algorithms more accurate.

Submitted by: gallatin @
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoMFC r363887 (by manu), r365395: allwinner: clk: Fix nm clock calculation
Andriy Gapon [Mon, 21 Sep 2020 09:50:57 +0000 (09:50 +0000)]
MFC r363887 (by manu), r365395: allwinner: clk: Fix nm clock calculation

r363887:
Use the right factor when finding the best frequency and compare the
absolute value of the result.
Submitted by: kibab

r365395:
aw_clk_nm: fix incorrect use of abs()
abs() takes a (signed) int as input.
Instead, it was used with unsigned 64-bit integers.
So, add and use a new helper function to calculate a difference between
two uint64_t-s.

3 years agoMFC r365861 and r365872.
Navdeep Parhar [Mon, 21 Sep 2020 08:16:42 +0000 (08:16 +0000)]
MFC r365861 and r365872.

r365861:
cxgbe(4): Update T4/5/6 firmwares to 1.25.0.0.

r365872:
cxgbe(4): add the firmware binaries instead of the empty files that were added
in r365861.

Obtained from: Chelsio Communications
Sponsored by: Chelsio Communications

3 years agoMFC: r365703
Rick Macklem [Mon, 21 Sep 2020 00:50:32 +0000 (00:50 +0000)]
MFC: r365703
Fix a case where the NFSv4.0 server might crash if delegations are enabled.

asomers@ reported a crash on an NFSv4.0 server with a backtrace of:
kdb_backtrace
vpanic
panic
nfsrv_docallback
nfsrv_checkgetattr
nfsrvd_getattr
nfsrvd_dorpc
nfssvc_program
svc_run_internal
svc_thread_start
fork_exit
fork_trampoline
where the panic message was "docallb", which indicates that a callback
was attempted when the ClientID is unconfirmed.
This would not normally occur, but it is possible to have an unconfirmed
ClientID structure with delegation structure(s) chained off it if the
client were to issue a SetClientID with the same "id" but different
"verifier" after acquiring delegations on the previously confirmed ClientID.

The bug appears to be that nfsrv_checkgetattr() failed to check for
this uncommon case of an unconfirmed ClientID with a delegation structure
that no longer refers to a delegation the client knows about.

This patch adds a check for this case, handling it as if no delegation
exists, which is the case when the above occurs.
Although difficult to reproduce, this change should avoid the panic().

PR: 249127

3 years agoMFC r365841:
Mark Johnston [Sun, 20 Sep 2020 16:49:48 +0000 (16:49 +0000)]
MFC r365841:
Increase the default vm.max_user_wired value.

3 years agoMFC r365863:
Konstantin Belousov [Sun, 20 Sep 2020 09:47:28 +0000 (09:47 +0000)]
MFC r365863:
State kgssapi dependency on xdr.

PR: 249378

3 years agoMFC r365830: make it possible recovering broken GPT after some LBAs cut off
Eugene Grosbein [Sun, 20 Sep 2020 05:23:16 +0000 (05:23 +0000)]
MFC r365830: make it possible recovering broken GPT after some LBAs cut off

If pre-formatted device has GPT and a partition covering
last available LBAs and the device is attached using
a bridge reducing amount of LBAs, then it could be not enough
forcing GEOM to use primary GPT. Also, we should make it possible
to recover GPT and this requires either deleting or resizing the partition.

This change enables "gpart delete" and "gpart resize" commands
on corrupted GPT with following "gpart recover".

It still does not allow modifying corrupted GPT without
preliminary setting sysctl kern.geom.part.check_integrity=0

Reported by: Alex Korchmar

3 years agoMFC r361361, r365791
Baptiste Daroussin [Sat, 19 Sep 2020 20:17:08 +0000 (20:17 +0000)]
MFC r361361, r365791

r361361:
Update pciids to 2020.05.22

r365791:
Update to 2020.08.19

3 years agoMFC r361688-r361690, r365041
Baptiste Daroussin [Sat, 19 Sep 2020 20:15:51 +0000 (20:15 +0000)]
MFC r361688-r361690, r365041

r361688:
Restore compatibility with GNU diff regarding --label

Various options to "diff(1)" show filenames, and traditionally make use of the
"--label" parameter, if set.

Restore this behaviour in BSD diff.

While here add a regression test

PR:  244533
Submitted by: Jamie Landeg-Jones <jamie@catflap.org>

r361689:
diff: restore compatibility with GNU diff regarding -N option

When -N is used the missing files are treated as empty.

PR:  233402
Submitted by: Fehmi Noyan Isi <fnoyanisi@yahoo.com>
Reported by: Roman Neuhauser <roman@sigpipe.cz>
Differential Revision: D25081

r361690:
Document long version of -b option

PR:  234195
Submitted by: Fehmi Noyan Isi <fnoyanisi@yahoo.com>
Reported by: Andras Farkas <deepbluemistake@gmail.com>

r365041:
diff: always properly kill pr(1)

When diff is invoked with -l it will spawn the pr(1) program.
In some circumpstances the pr(1) was not properly killed when diff program
exits.

Submitted by: Bret Ketchum
Differential Revision: https://reviews.freebsd.org/D26232

3 years agoMFC r360775:
Baptiste Daroussin [Sat, 19 Sep 2020 20:06:30 +0000 (20:06 +0000)]
MFC r360775:

Fix indentation of the Kitty entry

3 years agoMFC r365391, r365415
Alan Somers [Sat, 19 Sep 2020 19:48:15 +0000 (19:48 +0000)]
MFC r365391, r365415

r365391:
nsswitch.conf(5): recommend placing cache after files

When cache precedes files, and nscd is configured to allow negative caching,
commands like "pw groupadd" can fail. The sequence of events looks like:

1. A command like pkg(8) looks up the group, and finds it absent.
2. pkg invokes pw(8) to add the group
3. pkg queries the group, but nscd says it doesn't exist, since it has a
   negative cache entry for that group.

See also: https://lists.freebsd.org/pipermail/freebsd-current/2012-January/031595.html

Reviewed by: bcr (manpages)
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D26184

r365415:
nsswitch.conf.5: style fixes

Fix some whitespace, and remove the .Tn macro

Reported by: mandoc, igor
Reviewed by: bcr (manpages)
Differential Revision: https://reviews.freebsd.org/D26345

3 years agoMFC r363361:
Alan Somers [Sat, 19 Sep 2020 18:25:52 +0000 (18:25 +0000)]
MFC r363361:

tests/sys/opencrypto: use python3

python2 will be EOL soon

Reviewed by: lwhsu, jmg
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D25682

3 years agoMFC r365809:
Konstantin Belousov [Sat, 19 Sep 2020 18:02:55 +0000 (18:02 +0000)]
MFC r365809:
Style.

3 years agoMFC r365756: certctl: fix unprivileged mode
Kyle Evans [Fri, 18 Sep 2020 22:24:51 +0000 (22:24 +0000)]
MFC r365756: certctl: fix unprivileged mode

The first issue was lack of quoting around INSTALLFLAGS, which set it
incorrectly and produced an error on -M.

The second issue was that we weren't actually doing the install in
unprivileged mode, making it effectively useless. This was designed to pass
through the proper metalog/unpriv flags to install(1), so just let it
happen.

3 years agoMFC r360219:
Konstantin Belousov [Thu, 17 Sep 2020 22:27:07 +0000 (22:27 +0000)]
MFC r360219:
Make nfslockd depend on xdr.

PR: 249378

3 years agoUpdate naming of per-dataset counters introduced in r365689
Allan Jude [Thu, 17 Sep 2020 21:51:05 +0000 (21:51 +0000)]
Update naming of per-dataset counters introduced in r365689

Upstream OpenZFS is changing the structure of the sysctl mibs to avoid
having a / in the element name. Chase this change here to avoid introducing
a new sysctl that will change named between 12.2 and 13.0

MFC-with: 365689
Relnotes: yes (fix example)
Sponsored by: Klara Inc.

3 years agoMFC r365646, r365720:
Glen Barber [Thu, 17 Sep 2020 16:09:38 +0000 (16:09 +0000)]
MFC r365646, r365720:
 r365646:
  Enclose BRANCH_OVERRIDE in quotes in order to fix an issue with
  freebsd-update(8) builds, where BRANCH is suffixed with -p0 for
  builds.

 r365720 (gordon):
  Partially revert r346018 and use the if/then construct instead of
  shell.

Sponsored by: Rubicon Communications, LLC (netgate.com)

3 years agoMFC r365631: Only set WARNS if not defined
Kyle Evans [Wed, 16 Sep 2020 23:17:15 +0000 (23:17 +0000)]
MFC r365631: Only set WARNS if not defined

This would allow interested parties to do experimental runs with an
environment set appropriately to raise all the warnings throughout the
build; e.g. env WARNS=6 NO_WERROR=yes buildworld.

Not currently touching the numerous instances in ^/tools.

3 years agoMFC r365493-r365494, r365600, r365602, r365637: various WARNS fixes
Kyle Evans [Wed, 16 Sep 2020 23:14:22 +0000 (23:14 +0000)]
MFC r365493-r365494, r365600, r365602, r365637: various WARNS fixes

r365493:
libc/resolv: attempt to fix the test under WARNS=6

In a side-change that I'm working on to start defaulting src builds to
WARNS=6 where WARNS isn't otherwise specified, GCC6 (and clang, to a lesser
extent) pointed out a number of issues with the resolv tests:

- Global method variable that gets shadowed in run_tests()
- Signed/unsigned comparison between i in run_tests() and hosts->sl_cur

The shadowed variable looks like it might actually be bogus as written, as
we pass it to RUN_TESTS -> run_tests, but other parts use the global method
instead. This change is mainly geared towards correcting that by removing
the global and plumbing the method through from run_tests -> run into the
new thread.

For the signed/unsigned comparison, there's no compelling reason to not just
switch i/nthreads/nhosts to size_t.

The review also included a change to the load() function that was better
addressed by jhb in r365302.

r365494:
libc tests: dynthr_mod: fix some WARNS issues

This is being addressed as part of a side-patch I'm working on that builds
all the things with WARNS=6, instead of relying on it being supplied in just
shallow parts of the build with higher-level Makefile.inc.

Provide a prototype for mod_main and annotate the thread function argument
as unused.

r365600:
MFV r365599: import fix for a libexecinfo warning at higher WARNS

v1.17 of this file included a fix that I just submitted upstream to fix a
warning about prevent_inline with external linkage not having been
previously declared.

r365602:
librt: tests: fix minor issues with higher WARNS

got_sigalrm is a global with external linkage and must therefore have a
previous extern declaration. There's no reason to maintain the status quo
there, so just make it static.

The result var is unused.

This part of the test has not been upstreamed, presumably because it exists
solely for sem_clockwait_np. We should perhaps consider moving it into its
own test file outside of ^/contrib/netbsd-tests, but this can happen later.

r365637:
MFV r365636: libarchive: import fix for WARNS=6 builds in testing bits

Two more cases of explicitly marking globals for internal linkage where they
need not be shared. Committed upstream as of a38e62314a1f.

3 years agoMFC 365276: Compute the correct size of the string to move forward.
John Baldwin [Wed, 16 Sep 2020 22:55:27 +0000 (22:55 +0000)]
MFC 365276: Compute the correct size of the string to move forward.

Previously this was counting the amount of spare room at the start of
the buffer that the string needed to move forward and passing that as
the number of bytes to copy to memmove rather than the length of the
string to be copied.

In the strfmon test in the test suite this caused the memmove to
overflow the allocated buffer by one byte which CHERI caught.

3 years agoMFC outstanding crunchgen work: r350152, r364166, r364174, r364234,
Kyle Evans [Wed, 16 Sep 2020 22:36:03 +0000 (22:36 +0000)]
MFC outstanding crunchgen work: r350152, r364166, r364174, r364234,
r364646-r364647, r365605, r365705

r350152:
Remove obsolete RELEASE_CRUNCH

Remove documentation of RELEASE_CRUNCH here. It's obsolete and no longer a
good example.

r364166:
Fix crunchgen usage of mkstemp()

On Glibc systems mkstemp can only be used once with the same template
string since it will be modified in-place and no longer contain any 'X'
chars. It is fine to reuse the same file here but we need to be explicit and
use open() instead of mkstemp() on the second use.

While touching this file also avoid a hardcoded /bin/pwd since that may not
work when building on non-FreeBSD systems.

r364174:
Use env pwd instead of pwd in crunchgen.c

In r364166 I changed /bin/pwd to pwd, but pwd can be shell builtin that
may not correctly return a real path. To ensure that all symlinks are
resolved use `env pwd -P` instead (the -P flag is part of POSIX so
should be supported everywhere).

r364234:
crunchgen: use pwd -P without env

The -P flag is required by POSIX so we don't have to care whether pwd is
a shell builtin or not. This also allows removing pwd from the list of
bootstrap tools since all shells we care about for building have a
builtin pwd command. This effectively reverts r364190.

r364646:
Re-indent crunched_main.c in preparation for D25998

r364647:
Correctly determine the real executable in crunched binaries

This should fix cases like su setting argv[0] to _su for /bin/sh.
Previously cheribsdbox (a crunched tool we use in CheriBSD to reduce the
size of our minimal disk images to allow loading them onto FPGAs without
waiting forever for the transfer) would complain about _su not being
compiled in, but now that we also look at AT_EXECPATH it correctly
invokes the sh tool.

Note: we use use AT_EXECPATH instead of the KERN_PROC_PATHNAME sysctl to get
the crunchgen binary name since it seems like KERN_PROC_PATHNAME just
returns the last cached path for a given hardlink.
When using `su`, instead of invoking /bin/csh this would invoke the last
used hardlink to cheribsdbox. This caused weird test failures when running
tests due to `id` being executed instead of `echo`:

$ id  # id is a hardlink to /bin/cheribsdbox
$ su postgres -c 'echo 1' # su is also a hardlink
uid=1001(postgres) gid=1001(postgres) groups=1001(postgres)

r365605:
crunchgen(8): fix crunched application build with WARNS=6

This was revealed by the rescue build with a patch I'm working on to default
WARNS=6 everywhere. The issues resolved were:

- Missing prototype for _crunched_${ident}_stub in the *_stub.c generated
  bits
- Missing prototype for crunched_main
- Incomplete prototype for _crunched_${ident}_stub in the generated parts of
  crunched_main
- Literal strings in the stub table must drop const qualifier, unless we
  const'ify name
- f field in struct stub didn't have a proper prototype

Most of these issues are minor formalities and easily addressed.

I note that if my patch to eventually raise WARNS for the rescue build
lands, we'll need to bump the __FreeBSD_version requirement for
bootstrapping crunchgen and wipe out the rescue .OBJDIR if it's stale, which
we should be able to detect pretty easily from a couple of the issues that
have been fixed here.

r365705:
__FreeBSD_version bump for r365605 (crunchgen producing WARNS-clean)

The change in D26397 will need a __FreeBSD_version to base off of for
bootstrapping crunchgen, to avoid avoidable build failures just because the
host has an outdated crunchgen.

3 years agoConnect new ZFS source file to the kernel build
Allan Jude [Wed, 16 Sep 2020 20:58:24 +0000 (20:58 +0000)]
Connect new ZFS source file to the kernel build

This was missed in r365689

This causes compile issues when building ZFS into the kernel

PR: 249311
MFC-with: r365689
Sponsored by: Klara Inc.

3 years agoMFC r365515:
Konstantin Belousov [Wed, 16 Sep 2020 15:48:32 +0000 (15:48 +0000)]
MFC r365515:
Move MAP_32BIT_MAX_ADDR definition to sys/mman.h.

3 years agoMFC r365516:
Konstantin Belousov [Wed, 16 Sep 2020 15:45:35 +0000 (15:45 +0000)]
MFC r365516:
Add vm_map_find_aligned(9).

3 years agoMFC r365513:
Konstantin Belousov [Wed, 16 Sep 2020 15:42:58 +0000 (15:42 +0000)]
MFC r365513:
Prepare to handle non-trivial errors from vm_map_delete().

3 years agoMFC r365488:
Konstantin Belousov [Wed, 16 Sep 2020 15:38:22 +0000 (15:38 +0000)]
MFC r365488:
Allow consumer to customize physical pager.

3 years agoMFC r365486:
Konstantin Belousov [Wed, 16 Sep 2020 14:20:45 +0000 (14:20 +0000)]
MFC r365486:
Add kern_mmap_racct_check(), a helper to verify limits in vm_mmap*().

3 years agoMFC r365485:
Konstantin Belousov [Wed, 16 Sep 2020 14:16:09 +0000 (14:16 +0000)]
MFC r365485:
Convert allocations of the phys pager to vm_pager_allocate().

3 years agoMFC r365484:
Konstantin Belousov [Wed, 16 Sep 2020 14:14:26 +0000 (14:14 +0000)]
MFC r365484:
Add interruptible variant of vm_wait(9), vm_wait_intr(9).

3 years agoAdd a mem(4) ioctl stub for sparc64.
Mark Johnston [Wed, 16 Sep 2020 14:12:57 +0000 (14:12 +0000)]
Add a mem(4) ioctl stub for sparc64.

This is a direct commit to stable/12.

Reported by: Jenkins

3 years agoMFC r365265:
Mark Johnston [Wed, 16 Sep 2020 13:46:58 +0000 (13:46 +0000)]
MFC r365265:
Add the MEM_EXTRACT_PADDR ioctl to /dev/mem.

3 years agoMFC r365502:
Mark Johnston [Wed, 16 Sep 2020 13:45:53 +0000 (13:45 +0000)]
MFC r365502:
ggate: Fix ggated/ggatec debug print of offsets.

3 years agoMFC r365510:
Konstantin Belousov [Wed, 16 Sep 2020 07:53:15 +0000 (07:53 +0000)]
MFC r365510:
uipc_shm.c: Move comment where it belongs.

3 years agoMFC r365775: bhyve: do not permit write access to VMCB / VMCS
Ed Maste [Tue, 15 Sep 2020 21:28:47 +0000 (21:28 +0000)]
MFC r365775: bhyve: do not permit write access to VMCB / VMCS

Reported by: Patrick Mooney
Submitted by: jhb
Security: CVE-2020-24718

3 years agoMFC r365771:
Mark Johnston [Tue, 15 Sep 2020 20:55:13 +0000 (20:55 +0000)]
MFC r365771:
ftpd: Exit during authentication if an error occurs after chroot().

admbug: 969
Security: CVE-2020-7468

3 years agoMFC r365766:
Konstantin Belousov [Tue, 15 Sep 2020 20:25:30 +0000 (20:25 +0000)]
MFC r365766:
bhyve: intercept AMD SVM instructions.

CVE: CVE-2020-7467

3 years agoMFC r365458: sort(1): Remove duplicate option check
Gordon Bergling [Tue, 15 Sep 2020 09:27:01 +0000 (09:27 +0000)]
MFC r365458: sort(1): Remove duplicate option check

Reviewed by: lwhsu, emaste
Approved by: emaste
Obtained from: DragonFlyBSD
Differential Revision: https://reviews.freebsd.org/D23892

3 years agoMFC r365449:
Andrey V. Elsukov [Tue, 15 Sep 2020 08:52:36 +0000 (08:52 +0000)]
MFC r365449:
  Add a few features to rcorder:

  o Enhance dependency loop logging: print full chain instead of the
    last link competing the loop;
  o Add -g option to generate dependency graph suitable for GraphViz
    visualization, loops and other graph generation issues are highlighted
    automatically;
  o Add -p option that enables grouping items that can be processed in
    parallel.

  Submitted by: Boris Lytochkin <lytboris at gmail>
  Differential Revision: https://reviews.freebsd.org/D25389

3 years agoMFC r365606:
Li-Wen Hsu [Tue, 15 Sep 2020 06:14:00 +0000 (06:14 +0000)]
MFC r365606:

urndis(4): Add support of Inseego/Novatel Wireless MiFi 8800/8000

PR: 245152
Submitted by: rootless@gmail.com
Reviewed by: hselasky

3 years agoMFC r365447: mmc_da: universally use uint8_t for the partition index
Andriy Gapon [Tue, 15 Sep 2020 05:51:03 +0000 (05:51 +0000)]
MFC r365447: mmc_da: universally use uint8_t for the partition index

3 years agoMFC r365445: mmc_da: make sure that part_index is not used uninitialized in sddastart
Andriy Gapon [Tue, 15 Sep 2020 05:48:55 +0000 (05:48 +0000)]
MFC r365445: mmc_da: make sure that part_index is not used uninitialized in sddastart

3 years agoMFC r365446: mmc_da: fix a typo and a too long line
Andriy Gapon [Tue, 15 Sep 2020 05:46:51 +0000 (05:46 +0000)]
MFC r365446: mmc_da: fix a typo and a too long line

3 years agoice: MFC commits for update to 0.26.16
Eric Joyner [Mon, 14 Sep 2020 21:33:11 +0000 (21:33 +0000)]
ice: MFC commits for update to 0.26.16

These include r365332, r365550, and r365617, which update
both the ice_ddp package and the ice(4) driver itself.

Relnotes: yes
Sponsored by: Intel Corporation

3 years agoMFC r365623: Don't clear reserved bits per RealTek
John-Mark Gurney [Mon, 14 Sep 2020 19:39:43 +0000 (19:39 +0000)]
MFC r365623: Don't clear reserved bits per RealTek

3 years agoMFC r365437:
Mark Johnston [Mon, 14 Sep 2020 12:22:19 +0000 (12:22 +0000)]
MFC r365437:
vm_object_split(): Handle orig_object type changes.

3 years agoMFC r365433:
Konstantin Belousov [Mon, 14 Sep 2020 11:01:46 +0000 (11:01 +0000)]
MFC r365433:
imgact_elf.c: unify check for phdr fitting into the first page.

3 years agoMFC r365432:
Konstantin Belousov [Mon, 14 Sep 2020 10:49:38 +0000 (10:49 +0000)]
MFC r365432:
rtld: pass argc/argv/env to dso inits.

PR: 249162

3 years agoMFC r365422: ntp: whitespace and typo fix in conf file
Ed Maste [Mon, 14 Sep 2020 01:20:57 +0000 (01:20 +0000)]
MFC r365422: ntp: whitespace and typo fix in conf file

PR: 248942
Submitted by: Jose Luis Duran (whitespace), igor (typo)

3 years agoMFOpenZFS: Introduce read/write kstats per dataset
Allan Jude [Sun, 13 Sep 2020 16:28:25 +0000 (16:28 +0000)]
MFOpenZFS: Introduce read/write kstats per dataset

The following patch introduces a few statistics on reads and writes
grouped by dataset. These statistics are implemented as kstats
(backed by aggregate sums for performance) and can be retrieved by
using the dataset objset ID number. The motivation for this change is
to provide some preliminary analytics on dataset usage/performance.

Reviewed-by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
openzfs/zfs@a448a2557ec4938ed6944c7766fe0b8e6e5f6456

Also contains parts of:
MFOpenZFS: Connect dataset_kstats for FreeBSD

Example output:
kstat.zfs/mypool.dataset.objset-0x10b.nread: 150528
kstat.zfs/mypool.dataset.objset-0x10b.reads: 48
kstat.zfs/mypool.dataset.objset-0x10b.nwritten: 134217728
kstat.zfs/mypool.dataset.objset-0x10b.writes: 1024
kstat.zfs/mypool.dataset.objset-0x10b.dataset_name: mypool/datasetname

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed by: Sean Eric Fagan <sef@ixsystems.com>
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Allan Jude <allan@klarasystems.com>
openzfs/zfs@4547fc4e071ceb1818b3a46c3035b923e06e5390

This is a direct commit to stable/12 because they do not exist in
illumos upstream ZFS and needed to be heavily modified to work in
stable/12

Relnotes: yes
Sponsored by: Klara Inc.

3 years agoMFC r365506 getlogin_r: fix the type of len
Kyle Evans [Sun, 13 Sep 2020 01:44:31 +0000 (01:44 +0000)]
MFC r365506 getlogin_r: fix the type of len

getlogin_r is specified by POSIX to to take a size_t len, not int. Fix our
version to do the same, bump the symbol version due to ABI change and
provide compat.

This was reported to break compilation of Ruby 2.8.

Some discussion about the necessity of the ABI compat did take place in the
review. While many 64-bit platforms would likely be passing it in a 64-bit
register and zero-extended and thus, not notice ABI breakage, some do
sign-extend (e.g. mips).

PR: 247102

3 years agoMFC r365500: certctl: fix hashed link generation with duplicate subjects
Kyle Evans [Sun, 13 Sep 2020 01:09:22 +0000 (01:09 +0000)]
MFC r365500: certctl: fix hashed link generation with duplicate subjects

Currently, certctl rehash will just keep clobbering .0 rather than
incrementing the suffix upon encountering a duplicate. Do this, and do it
for blacklisted certs as well.

This also improves the situation with the blacklist to be a little less
flakey, comparing cert fingerprints for all certs with a matching subject
hash in the blacklist to determine if the cert we're looking at can be
installed.

Future work needs to completely revamp the blacklist to align more with how
it's described in PR 246614. In particular, /etc/ssl/blacklisted should go
away to avoid potential confusion -- OpenSSL will not read it, it's
basically certctl internal.

PR: 246614

3 years agoFollow-up r365662 (MFC of r365371 and r365373) by also removing the
Dimitry Andric [Sat, 12 Sep 2020 20:20:55 +0000 (20:20 +0000)]
Follow-up r365662 (MFC of r365371 and r365373) by also removing the
header hack from jemalloc_FreeBSD.h, which rendered any make.conf
MALLOC_PRODUCTION or src.conf WITH/WITHOUT_MALLOC_PRODUCTION irrelevant.

Direct commit to stable/{11,12} as this does not apply to head.

Noticed by: kevans

3 years agoFollow-up r365662 (MFC of r365371 and r365373) by correctly setting
Dimitry Andric [Sat, 12 Sep 2020 19:40:04 +0000 (19:40 +0000)]
Follow-up r365662 (MFC of r365371 and r365373) by correctly setting
WITH_MALLOC_PRODUCTION for stable branches. Also add a note to UPDATING,
to inform users about the new setting.

Direct commit to stable/{11,12} as this does not apply to head.

Noticed by: imp, Ronald Klop <ronald-lists@klop.ws>

3 years agoMFC r365477: geom_part: extend kern.geom.part.check_integrity to work on GPT
Eugene Grosbein [Sat, 12 Sep 2020 18:40:39 +0000 (18:40 +0000)]
MFC r365477: geom_part: extend kern.geom.part.check_integrity to work on GPT

In short, this change allows accessing partition and recovering secondary
GPT in case it is unaccessible but primary table is fine.

Reported by: Alex Korchmar

3 years agoMFC r365371:
Dimitry Andric [Sat, 12 Sep 2020 16:50:04 +0000 (16:50 +0000)]
MFC r365371:

Turn MALLOC_PRODUCTION into a regular src.conf(5) option

For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has
been used to turn off potentially expensive debug checks and statistics
gathering in the implementation of malloc(3).

It seems more consistent to turn this into a regular src.conf(5) option,
e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then
be toggled similar to any other source build option, and turned on or
off by default for e.g. stable branches.

Reviewed by: imp, #manpages
Differential Revision: https://reviews.freebsd.org/D26337

MFC r365373:

Follow-up r365371 by removing sentences which indicate the state of the
MK_MALLOC_PRODUCTION option on -CURRENT.

Also, for the sake of backwards compatibility, support the old way of
enabling 'production malloc', e.g. by adding a define in make.conf(5).

3 years agoMFC r364753:
Dimitry Andric [Sat, 12 Sep 2020 16:33:05 +0000 (16:33 +0000)]
MFC r364753:

Add atomic and bswap functions to libcompiler_rt

There have been several mentions on our mailing lists about missing
atomic functions in our system libraries (e.g. __atomic_load_8 and
friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too.

To address this, add implementations for the functions from compiler-rt
to the system compiler support libraries, e.g. libcompiler_rt.a and and
libgcc_s.so.

This also needs a small fixup in compiler-rt's atomic.c, to ensure that
32-bit mips can build correctly.

Bump __FreeBSD_version to make it easier for port maintainers to detect
when these functions were added.

Differential Revision: https://reviews.freebsd.org/D26159

MFC r364782:

After r364753, there should be no need to suppress -Watomic-alignment
warnings anymore for compiler-rt's atomic.c. This occurred because the
IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this
caused the compiler to emit a runtime call to __atomic_is_lock_free(),
and that triggers the warning.

MFC r365509:

Follow-up r364753 by enabling compiler-rt's atomic implementation only
for clang, as it uses clang specific builtins, and does not compile
correctly with gcc. Note that gcc packages usually come with their own
libatomic, providing these primitives.

MFC r365588:

Follow-up r364753 by only using arm's stdatomic.c implementation, as it
already covers the functions in compiler-rt's atomic.c, leading to
conflicts when linking.

PR: 230888

3 years agoMFC r365457:
Kristof Provost [Sat, 12 Sep 2020 12:45:31 +0000 (12:45 +0000)]
MFC r365457:

net: mitigate vnet / epair cleanup races

There's a race where dying vnets move their interfaces back to their original
vnet, and if_epair cleanup (where deleting one interface also deletes the other
end of the epair). This is commonly triggered by the pf tests, but also by
cleanup of vnet jails.

As we've not yet been able to fix the root cause of the issue work around the
panic by not dereferencing a NULL softc in epair_qflush() and by not
re-attaching DYING interfaces.

This isn't a full fix, but makes a very common panic far less likely.

PR: 244703, 238870

3 years agoMFC r365369:
Konstantin Belousov [Sat, 12 Sep 2020 09:46:14 +0000 (09:46 +0000)]
MFC r365369:
rtld: do not refuse to relocate objects without dynamic symtabs.

PR: 249121