]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoMFC r356356, r356358, r356422: replace gcclibs' libssp
Kyle Evans [Thu, 16 Jan 2020 03:38:06 +0000 (03:38 +0000)]
MFC r356356, r356358, r356422: replace gcclibs' libssp

r356356:
Provide libssp based on libc

For libssp.so, rebuild stack_protector.c with FORTIFY_SOURCE stubs that just
abort built into it.

For libssp_nonshared.a, steal stack_protector_compat.c from
^/lib/libc/secure and massage it to maintain that __stack_chk_fail_local
is a hidden symbol.

libssp is now built unconditionally regardless of {WITH,WITHOUT}_SSP in the
build environment, and the gcclibs version has been disconnected from the
build in favor of this one.

r356358:
libssp: fix FORTIFY_SOURCE stub declarations

The LSB 4.1 that I referenced omitted the varargs, and I failed to catch it.
The __vsnprintf_chk error was from just downright misreading the page. GCC6
caught all of these, but I had only tested GCC4.2.

r356422:
Update libssp paths in various Makefile.depend* files

I've been advised that the model that uses these are fairly resilient, but
we do know the proper path to use (or remove, in the case of ^/targets/...),
so go ahead and update them to reflect that.

4 years agoMFC r356688, r356694: tap(4) manpage improvements
Kyle Evans [Thu, 16 Jan 2020 03:16:08 +0000 (03:16 +0000)]
MFC r356688, r356694: tap(4) manpage improvements

r356688:
Install tap(4) manpage as vmnet(4) as well

If one comes across a vmnet interface, this is a useful pointer to have
towards what it actually is if they're otherwise unfamiliar.

r356694:
tap(4): also note that we drop configured addresses

This provides a specific pointer for users of tap(4) to understand why their
interfaces are losing their addresses, and specifically how to workaround
this if they need different behavior.

This manpage received a .Dd bump earlier today in r35688, so no bump occurs
this time.

4 years agoMFC r356649: regulator: small enhancements to regulator_shutdown
Kyle Evans [Thu, 16 Jan 2020 03:14:01 +0000 (03:14 +0000)]
MFC r356649: regulator: small enhancements to regulator_shutdown

Highlights:

- Exit early if we're not disabling unused regulators; there's no need to
  take the regulator topology lock and re-evaluate this every iteration, as
  it's not going to change.
- Don't emit a notice that we're shutting down a regulator if it's not
  enabled, to reduce noise.
- Mention the outcome of the shutdown, to aide debugging and easily let
  developer/user collect list of regulators we actually shutdown to
  determine problematic one.

4 years agoMFC r356538: stand/fdt: Scale blob size better as overlays apply
Kyle Evans [Thu, 16 Jan 2020 03:11:25 +0000 (03:11 +0000)]
MFC r356538: stand/fdt: Scale blob size better as overlays apply

Currently, our overlay blob will grow to include the size of the complete
overlay blob we're applying. This doesn't scale very well with a lot of
overlays- they tend to include a lot of overhead, and they will generally
only add a fraction of their total size to the blob they're being applied
to.

To combat this, pack the blob as we apply new overlays and keep track of how
many overlays we've applied. Only ubldr has any fixups to be applied after
overlays, so we only need to re-pad the blob in ubldr. Presumably the
allocation won't fail since we just did a lot worse in trying to apply
overlays and succeeded.

I have no intention of removing the padding in make_dtb.sh. There might be
an argument to be had over whether it should be configurable, since ubldr
*is* the only loader that actually has fixups to be applied and we can do
this at runtime, but I'm not too concerned about this.

This diff has been sitting in Phabricator for a year and a half, but I've
decided to flush it as it does make sure that we're scaling the blob
appropriately and leave room at the end for fixups in case of some freak
circumstance where applying overlays leaves us with a blob of insufficient
size.

4 years agoMFC r356685, r356686:
Glen Barber [Thu, 16 Jan 2020 01:13:32 +0000 (01:13 +0000)]
MFC r356685, r356686:
 r356685:
  Ensure the TYPE, BRANCH, and REVISION variables are set in
  cloudware targets when OSRELEASE is overridden. [1]

 r356686:
  Fix a typo.

PR: 243287 [1]
Sponsored by: Rubicon Communications, LLC (netgate.com)

4 years agoMFC r356569:
Mark Johnston [Thu, 16 Jan 2020 00:26:53 +0000 (00:26 +0000)]
MFC r356569:
libc: Fix a few bugs in the xlocale collation code.

PR: 243195

4 years agoMFC r345681: Skip test if feature security_capabilities is not available
Ed Maste [Wed, 15 Jan 2020 21:05:43 +0000 (21:05 +0000)]
MFC r345681: Skip test if feature security_capabilities is not available

PR: 236863
Sponsored by: The FreeBSD Foundation

4 years agoMFC r355258: Bhyve AMD IOMMU log the last timeout command.
Anish Gupta [Wed, 15 Jan 2020 02:31:03 +0000 (02:31 +0000)]
MFC r355258: Bhyve AMD IOMMU log the last timeout command.
Differential Revision: https://reviews.freebsd.org/D22566

4 years agoMFC r356628: Require FAT to occupy at least one sector.
Xin LI [Tue, 14 Jan 2020 06:28:07 +0000 (06:28 +0000)]
MFC r356628: Require FAT to occupy at least one sector.

4 years agoMFC r356445:
Mark Johnston [Tue, 14 Jan 2020 02:44:24 +0000 (02:44 +0000)]
MFC r356445:
Decrease logging severity when adding a device or reading config table.

PR: 243056

4 years agoMFC r356476:
Mark Johnston [Tue, 14 Jan 2020 02:41:52 +0000 (02:41 +0000)]
MFC r356476:
libjail: Handle an error from reallocarray() when trimming the buffer.

PR: 243106

4 years agoMFC r356240: Relax locking of carp_forus().
Alexander Motin [Tue, 14 Jan 2020 00:50:30 +0000 (00:50 +0000)]
MFC r356240: Relax locking of carp_forus().

This fixes deadlock between CARP and bridge.  Bridge calls this function
taking CARP lock while holding bridge lock.  Same time CARP tries to send
its announcements via the bridge while holding CARP lock.

Use of CARP_LOCK() here does not solve anything, since sc_addr is constant
while race on sc_state is harmless and use of the lock does not close it.

4 years agoRegen src.conf.5
Bryan Drewery [Mon, 13 Jan 2020 19:34:15 +0000 (19:34 +0000)]
Regen src.conf.5

4 years agoMFC r355379,r355381:
Bryan Drewery [Mon, 13 Jan 2020 19:30:18 +0000 (19:30 +0000)]
MFC r355379,r355381:

  r355379:
    Run make in parallel.
  r355381:
    Use full path to sysctl(8) since /sbin is not in PATH.

4 years agoMFC r355588:
Bryan Drewery [Mon, 13 Jan 2020 19:22:52 +0000 (19:22 +0000)]
MFC r355588:

  Fix WITHOUT_CLANG build.

PR: 240507

4 years agoMFC r356617: camdd: initialize devs earlier
Kyle Evans [Mon, 13 Jan 2020 18:22:51 +0000 (18:22 +0000)]
MFC r356617: camdd: initialize devs earlier

GCC9 points out that devs may be used initialized after the bailout label;
in-fact, if num_io_opts != 2 then it is. Move the initialization up a little
bit.

4 years agoMFC r356614: tests: fusefs: silence remaining unsigned/signed warnings
Kyle Evans [Mon, 13 Jan 2020 18:20:04 +0000 (18:20 +0000)]
MFC r356614: tests: fusefs: silence remaining unsigned/signed warnings

External GCC turns these into errors; cast to long to silence them.

4 years agoMFC r356601-r356602: inetd fixes for WITHOUT_* knobs
Kyle Evans [Mon, 13 Jan 2020 18:18:24 +0000 (18:18 +0000)]
MFC r356601-r356602: inetd fixes for WITHOUT_* knobs

r356601:
inetd: free WITHOUT_INET6_SUPPORT build of warnings

If inetd is compiled without inet6 support, we need to error out on
rpc+inet6 services rather than attempting to call into rpc bits with an
uninitialized netid.

v4bind is only used with INET6 support, so move it under the proper #ifdefs
with v6bind.

Reported by: Pavel Timofeev <timp87 gmail com>

r356602:
inetd: two more nits

Use __COPYRIGHT for copyright to simply either embed it via .ident or have
it properly marked __unused

Move an ipsec reference to IPSEC

4 years agoMFC r356600: a10_ahci: grab the target-supply regulator and enable it
Kyle Evans [Mon, 13 Jan 2020 18:16:57 +0000 (18:16 +0000)]
MFC r356600: a10_ahci: grab the target-supply regulator and enable it

This regulator is marked regulator-boot-on, but it will get shutdown if it's
not actually used/enabled by a driver. This should fix sata on the
cubieboard{1,2}.

4 years agoMFC r356409:
Hans Petter Selasky [Mon, 13 Jan 2020 11:27:30 +0000 (11:27 +0000)]
MFC r356409:
Add own counter for cancelled USB transfers.
Do not count these as errors.

Bump the freebsd version to force recompilation of external modules.

Sponsored by: Mellanox Technologies

4 years agoMFC r350078
Sean Bruno [Sun, 12 Jan 2020 20:19:00 +0000 (20:19 +0000)]
MFC r350078
Add the ability to accept the default pin widget configuration to help
with various laptops using hdaa(4) sound devices.  We don't seem to know
the "correct" configurations for these devices and the defaults are far
superiour, e.g. they work if you don't nuke the default configs.

4 years agoMFC r356187:
Mark Johnston [Sun, 12 Jan 2020 20:12:34 +0000 (20:12 +0000)]
MFC r356187:
Add libdtrace support for arm64 USDT probes.

4 years agoMFC r356564: dwc_otg: fix fdt attachment for newer bcm2708-usb nodes
Kyle Evans [Sun, 12 Jan 2020 04:05:18 +0000 (04:05 +0000)]
MFC r356564: dwc_otg: fix fdt attachment for newer bcm2708-usb nodes

The newer versions of RPi FDT flipped the order of the interrupts
specification and added an 'interrupt-names' property for driver aide in
finding the correct interrupt, rather than assuming the positions. Use it if
it's available, or fallback to the old method if there is no interrupt-names
property with a usb value.

This has been tested with both old RPi3B FDT and new RPi3B FDT, USB again
works on the latter.

4 years agoMFC r356562: bcm2835_vcbus: hide 'checking root' messages under bootverbose
Kyle Evans [Sun, 12 Jan 2020 04:02:53 +0000 (04:02 +0000)]
MFC r356562: bcm2835_vcbus: hide 'checking root' messages under bootverbose

4 years agoMFC r356539: md(4): improve documentation of preloading
Kyle Evans [Sun, 12 Jan 2020 04:00:58 +0000 (04:00 +0000)]
MFC r356539: md(4): improve documentation of preloading

It's not immediately clear by what mechanism loader(8) will be loading the
preloaded file. Specifically name-drop loader.conf(5) with a pointer to the
module loading section and a description of what the 'name' should look
like, because that certainly isn't clear from the loader.conf(5) standpoint.

The default loader.conf already has a pointer to md(4) where it appears and
the reference to loader.conf in the new version of this manpage should make
it more clear that this is where one should look for information.

4 years agoMFC r356359-r356360: kern_mmap: add fpcheck invariant for linux_mmap
Kyle Evans [Sat, 11 Jan 2020 15:06:06 +0000 (15:06 +0000)]
MFC r356359-r356360: kern_mmap: add fpcheck invariant for linux_mmap

r356359:
kern_mmap: add a variant that allows caller to inspect fp

Linux mmap rejects mmap() on a write-only file with EACCES.
linux_mmap_common currently does a fun dance to grab the fp associated with
the passed in fd, validates it, then drops the reference and calls into
kern_mmap(). Doing so is perhaps both fragile and premature; there's still
plenty of chance for the request to get rejected with a more appropriate
error, and it's prone to a race where the file we ultimately mmap has
changed after it drops its referenced.

This change alleviates the need to do this by providing a kern_mmap variant
that allows the caller to inspect the fp just before calling into the fileop
layer. The callback takes flags, prot, and maxprot as one could imagine
scenarios where any of these, in conjunction with the file itself, may
influence a caller's decision.

The file type check in the linux compat layer has been removed; EINVAL is
seemingly not an appropriate response to the file not being a vnode or
device. The fileop layer will reject the operation with ENODEV if it's not
supported, which more closely matches the common linux description of
mmap(2) return values.

If we discover that we're allowing an mmap() on a file type that Linux
normally wouldn't, we should restrict those explicitly.

r356360:
kern_mmap: restore character deleted in transit

4 years agoMFC r356355: ssp: knock out some trivial warnings that come up with WARNS=6
Kyle Evans [Sat, 11 Jan 2020 03:15:12 +0000 (03:15 +0000)]
MFC r356355: ssp: knock out some trivial warnings that come up with WARNS=6

A future commit will rebuild this as part of libssp. The exact warnings are
fairly trivially fixed:
- No previous declaration for __stack_chk_guard
- idx is the wrong type, nitems yields a size_t
- Casting away volatile on the tmp_stack_chk_guard directly is a no-no.

4 years agoMFC 346398 (by thj):
Bjoern A. Zeeb [Sat, 11 Jan 2020 01:56:57 +0000 (01:56 +0000)]
MFC 346398 (by thj):

  Add stat counter for ipv6 atomic fragments

  Add a stat counter to track ipv6 atomic fragments. Atomic fragments can be
  generated in response to invalid path MTU values, but are also a potential
  attack vector and considered harmful (see RFC6946 and RFC8021).

  While here add tracking of the atomic fragment counter to netstat and systat.

This should fix failing CI tests merged from head as
Resported by: lwhsu

4 years agoMFC r355449,355466:
Bjoern A. Zeeb [Sat, 11 Jan 2020 00:11:29 +0000 (00:11 +0000)]
MFC r355449,355466:

  carp: replace caddr_t with char *

  Change the remaining caddr_t usages to char * following the removal
  of the KAME macros

  No functional change.

4 years agoMFC r354857:
Bjoern A. Zeeb [Sat, 11 Jan 2020 00:08:16 +0000 (00:08 +0000)]
MFC r354857:

Reduce the vnet_set module size of ip_mroute to allow loading as a module.

  With VIMAGE kernels modules get special treatment as they need
  to also keep the original values and make copies for each instance.
  For that a few pages of vnet modspace are provided and the
  kernel-linker and the VNET framework know how to deal with things.
  When the modspace is (almost) full, other modules which would
  overflow the modspace cannot be loaded and kldload will fail.

  ip_mroute uses a lot of variable space, mostly be four big arrays:
  set_vnet 0000000000000510 vnet_entry_multicast_register_if
  set_vnet 0000000000000700 vnet_entry_viftable
  set_vnet 0000000000002000 vnet_entry_bw_meter_timers
  set_vnet 0000000000002800 vnet_entry_bw_upcalls

  Dynamically malloc the three big ones for each instance we need
  and free them again on vnet teardown (the 4th is an ifnet).
  That way they only need module space for a single pointer and
  allow a lot more modules using virtualized variables to be loaded
  on a VNET kernel.

  PR: 206583

4 years agoMFC r354726,354755:
Bjoern A. Zeeb [Fri, 10 Jan 2020 23:52:36 +0000 (23:52 +0000)]
MFC r354726,354755:

  if_llatbl: cleanup
  if_llatbl: change htable_unlink_entry() to early exist if no work to do

  No functional change.

4 years agoMFC r354462,354643,354680,354731,354748-354750,354757,354831-354832,
Bjoern A. Zeeb [Fri, 10 Jan 2020 23:46:12 +0000 (23:46 +0000)]
MFC r354462,354643,354680,354731,354748-354750,354757,354831-354832,
    354861-354863,354865,355254,355450,355452

  netinet*: variable cleanup
  netinet*: update *mp to pass the proper value back
  nd6 defrouter: consolidate nd_defrouter manipulations in nd6_rtr.c
    (excluding some changes to keep public KPI)
  nd6: simplify code
  netinet6: Remove PULLDOWN_TESTs.
  netinet*: replace IP6_EXTHDR_GET()
  IP6_EXTHDR_CHECK(): remove the last instances
  nd6_rtr: consollidation and more consistent naming
  ipv6 tests: Add a simple ping6 test as well.
  icmpv6: Fix mbuf change in mld
  nd6_rtr: re-sort functions
  nd6: make nd6_timer_ch static
  nd6: sysctl
  in6: move include
  Fix m_pullup() problem after removing PULLDOWN_TESTs and KAME EXT* macros.
    (IP6_EXTHDR* macros are preserved in stable).
  ip6_input: remove redundant v4mapped check
  Update comment.

PR: 240135

4 years agoMFC r354542:
Bjoern A. Zeeb [Fri, 10 Jan 2020 22:10:01 +0000 (22:10 +0000)]
MFC r354542:

  frag6: properly handle atomic fragments according to RFCs.

  RFC 8200 says:
   "If the fragment is a whole datagram (that is, both the Fragment
           Offset field and the M flag are zero), then it does not need
           any further reassembly and should be processed as a fully
           reassembled packet (i.e., updating Next Header, adjust Payload
           Length, removing the Fragment header, etc.).  .."

  That means we should remove the fragment header and make all the adjustments
  rather than just skipping over the fragment header.  The difference should
  be noticeable in that a properly handled atomic fragment triggering an ICMPv6
  message at an upper layer (e.g. dest unreach, unreachable port) will not
  include the fragment header.

  Update the test cases to also test for an unfragmentable part.  That is
  needed so that the next header is properly updated (not just lengths).

4 years agoMFC r356309: ixl: prevent non-privileged access to NVM update interface
Eric Joyner [Fri, 10 Jan 2020 18:31:59 +0000 (18:31 +0000)]
MFC r356309: ixl: prevent non-privileged access to NVM update interface

Sponsored by: Intel Corporation

4 years agoMFC r356310: iflib: Prevent watchdog from resetting idle queues
Eric Joyner [Fri, 10 Jan 2020 18:29:05 +0000 (18:29 +0000)]
MFC r356310: iflib: Prevent watchdog from resetting idle queues

Sponsored by: Intel Corporation

4 years agoMFC r356327-r356328: mips: csu: fix compilation w/ LLVM
Kyle Evans [Fri, 10 Jan 2020 03:46:58 +0000 (03:46 +0000)]
MFC r356327-r356328: mips: csu: fix compilation w/ LLVM

r356327:
mips: csu: fix compilation w/ LLVM

GCC issues the warning, but with LLVM it is fatal- no matching .cprestore
with .cpload. Reserve some place on the stack and and add the proper
.cprestore to pair it with.

nop added in the !o32 branch to fill out delay slot instruction, just in
case.

r356328:
mips !o32: fix csu build

4 years agoMFC r356279: libbe(3): promote dependent clones when destroying a BE
Kyle Evans [Fri, 10 Jan 2020 03:37:52 +0000 (03:37 +0000)]
MFC r356279: libbe(3): promote dependent clones when destroying a BE

When removing a boot environment iterate over the dependents and process the
snapshots by grabbing any clones. Promote the clones we found and then
remove the target environment.

This fixes the ability to destroy a boot environment when it has been used
to spawn one or more other boot environments.

PR: 242592

4 years agoMFC r356214: Avoid few memory accesses in g_disk_done().
Alexander Motin [Fri, 10 Jan 2020 00:53:20 +0000 (00:53 +0000)]
MFC r356214: Avoid few memory accesses in g_disk_done().

4 years agoMFC r356181: Fix GEOM_VIRSTOR orphanization.
Alexander Motin [Fri, 10 Jan 2020 00:47:37 +0000 (00:47 +0000)]
MFC r356181: Fix GEOM_VIRSTOR orphanization.

Previous code closed and destroyed consumer even with I/O in progress.
This patch postpones the destruction till the last close.

4 years agoMFC r356178: Fix GEOM_MOUNTVER orphanization.
Alexander Motin [Fri, 10 Jan 2020 00:46:33 +0000 (00:46 +0000)]
MFC r356178: Fix GEOM_MOUNTVER orphanization.

Previous code closed and detached consumer even with I/O still in progress.
This patch adds locking and request counting to postpone the close till
the last of running requests completes.

4 years agoMFC r356162, r356182: Fix GEOM_SHSEC orphanization.
Alexander Motin [Fri, 10 Jan 2020 00:45:27 +0000 (00:45 +0000)]
MFC r356162, r356182: Fix GEOM_SHSEC orphanization.

Previous code closed and destroyed consumer even with I/O in progress.
This patch postpones the destruction till the last close, identical to
GEOM_STRIPE, since they seem to have common origin.

4 years agoMFC r356151: Fix GEOM_GATE orphanization.
Alexander Motin [Fri, 10 Jan 2020 00:43:40 +0000 (00:43 +0000)]
MFC r356151: Fix GEOM_GATE orphanization.

Previous code closed and destroyed direct read consumer even with I/O still
in progress.  This patch adds locking and request counting to postpone the
close till the last of running requests completes.

4 years agoMFC r356138: Fix GEOM_UZIP orphanization.
Alexander Motin [Fri, 10 Jan 2020 00:42:39 +0000 (00:42 +0000)]
MFC r356138: Fix GEOM_UZIP orphanization.

Previous code destroyed softc even with provider still open, that resulted
in panic under load.  This change postpones the free till the final close,
when we know for sure there will be no more I/O requests.

4 years agoMFC r356108:
Alexander Motin [Fri, 10 Jan 2020 00:41:15 +0000 (00:41 +0000)]
MFC r356108:

4 years agoMFC r356442:
Mark Johnston [Fri, 10 Jan 2020 00:39:44 +0000 (00:39 +0000)]
MFC r356442:
Consistently use pmap_t instead of struct pmap *.

4 years agoMFC r353440:
Glen Barber [Thu, 9 Jan 2020 21:50:15 +0000 (21:50 +0000)]
MFC r353440:
 Increase the default VMSIZE for raw, qcow2, vhd, and vmdk virtual
 machine images due to 'filesystem full' failures.

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

4 years agoMFC r356570:
Toomas Soome [Thu, 9 Jan 2020 21:37:50 +0000 (21:37 +0000)]
MFC r356570:
loader: bioscd probe can get sector size 0

With buggy BIOS, it may happen we get sector size reported 0 for cd, and then
the default 512 is used, which is quite wrong.

PR: 238749

4 years agoMFC r355566:
Navdeep Parhar [Thu, 9 Jan 2020 20:45:01 +0000 (20:45 +0000)]
MFC r355566:

cxgbe/iw_cxgbe: Support 64b length in the memory registration routines.

Submitted by: bharat @ chelsio
Sponsored by: Chelsio Communications

4 years agoMFC r356317 (by arrowd):
Baptiste Daroussin [Thu, 9 Jan 2020 19:56:25 +0000 (19:56 +0000)]
MFC r356317 (by arrowd):

mount_smbfs: Issue a warning when .nsmbrc section name contains lowercase characters.

PR:  231656
Approved by: bapt
Differential Revision: https://reviews.freebsd.org/D22289

4 years agoMFC r356029:
Mark Johnston [Thu, 9 Jan 2020 16:47:59 +0000 (16:47 +0000)]
MFC r356029:
lagg: Clean up handling of the rr_limit option.

4 years agoMFC r356300, r356503:
Konstantin Belousov [Thu, 9 Jan 2020 09:14:54 +0000 (09:14 +0000)]
MFC r356300, r356503:
Fix AT_EXECPATH for direct exec mode.

4 years agoMFC r356296:
Konstantin Belousov [Thu, 9 Jan 2020 08:29:31 +0000 (08:29 +0000)]
MFC r356296:
bhyve: terminate waiting loops if thread suspension is requested.

PR: 242724

4 years agoMFC r356293:
Konstantin Belousov [Thu, 9 Jan 2020 08:24:09 +0000 (08:24 +0000)]
MFC r356293:
Rename umtxq_check_susp() to thread_check_susp().

4 years agoMFC r356292:
Konstantin Belousov [Thu, 9 Jan 2020 08:20:31 +0000 (08:20 +0000)]
MFC r356292:
Style: remove trailing spaces/tabs.

4 years agoMFC r352261,r352262,r352265:
Bryan Drewery [Thu, 9 Jan 2020 01:14:26 +0000 (01:14 +0000)]
MFC r352261,r352262,r352265:

  r352261:
    mtree: Fix -f -f not considering type changes.
  r352262:
    mtree -c: Fix username logic when getlogin(3) fails.
  r352265:
    mtree -O: Fix not descending on hash collisions

Relnotes: yes

4 years agoMFC r356284: Remove extra check for provider being closed.
Alexander Motin [Thu, 9 Jan 2020 00:39:35 +0000 (00:39 +0000)]
MFC r356284: Remove extra check for provider being closed.

We already checked for that earlier, and since we hold topology lock
it could not change.

4 years agoMFC r351824, r356392: Report the Host Buffer Memory minimum and preferred sizes.
Alexander Motin [Thu, 9 Jan 2020 00:36:28 +0000 (00:36 +0000)]
MFC r351824, r356392: Report the Host Buffer Memory minimum and preferred sizes.

The Host Buffer feature (NVMe 1.4 section 89) allows for the NVMe card
request the host provide it buffer for lookaside tables and maybe
other things. Report the card's minimum and preferred sizes with
nvmecontrol/camcontrol identify.

4 years agoRemove duplicate kernel.h include which came back with 356524 due to
Bjoern A. Zeeb [Wed, 8 Jan 2020 23:39:23 +0000 (23:39 +0000)]
Remove duplicate kernel.h include which came back with 356524 due to
out-of-order MFCs.

4 years agoMFC r346535 (by hselasky):
Bjoern A. Zeeb [Wed, 8 Jan 2020 22:59:31 +0000 (22:59 +0000)]
MFC r346535 (by hselasky):

  Fix build for mips and powerpc after r346530.

  Need to include sys/kernel.h to define SYSINIT() which is used
  by sys/eventhandler.h .

This is now hit by r356489 which is unrelated to the original cause but
the fix was never MFCed and hence manifests with different code now.

4 years agoMFC r354859:
Dimitry Andric [Wed, 8 Jan 2020 21:22:44 +0000 (21:22 +0000)]
MFC r354859:

WITH_SYSTEM_LINKER: Fix rebuilding lld every time.

This is due to LLD_REVISION_STRING being renamed to LLD_REVISION in
r351442 and the value being moved to another location in r351965.

`make test-system-linker` can be used to see the values being used here.

Reported by: ler

4 years agoMFC: r354056
Jung-uk Kim [Wed, 8 Jan 2020 17:30:14 +0000 (17:30 +0000)]
MFC: r354056

Catch up with ACPICA 20191018.

4 years agoMFC r355034:
Dimitry Andric [Wed, 8 Jan 2020 17:23:52 +0000 (17:23 +0000)]
MFC r355034:

libclang_rt: enable on powerpc*

Summary:
Enable on powerpc64 and in lib/libclang_rt/Makefile change
MACHINE_CPUARCH to MACHINE_ARCH because on powerpc64
MACHINE_ARCH==MACHINE_CPUARCH so the 32-bit library overwrites 64-bit
library during installworld.

This patch doesn't enable any other libclang_rt libraries because they
need to be separately ported.

I have verified that games/julius (which fails on powerpc64 elfv2
without this change because of no libclang_rt profiling library) builds.

Test Plan: Ship it, test on powerpc and powerpcspe

Submitted by: pkubaj
Reviewed by: dim, jhibbits
Differential Revision: https://reviews.freebsd.org/D22425

4 years agoMFC r348671:
Bjoern A. Zeeb [Wed, 8 Jan 2020 17:05:57 +0000 (17:05 +0000)]
MFC r348671:

  Rather than using the legacy IP struct fields in the union for the
  port number, properly access them by their IPv6 names.
  This will make it easier to slice up and compile out address families
  in the future.

  No functional change intended.

4 years agoMFC r348861:
Bjoern A. Zeeb [Wed, 8 Jan 2020 17:04:40 +0000 (17:04 +0000)]
MFC r348861:

  Enhance the comment ieee80211_add_channel() to avoid a
  misunderstanding that the function does not work additive
  when repeatedly called for diffferent bands.

4 years agoMFC r354747:
Bjoern A. Zeeb [Wed, 8 Jan 2020 17:02:58 +0000 (17:02 +0000)]
MFC r354747:

  Allow per-file lex and yacc options.

  In order to allow software with multiple (different) options
  for lex and yacc add extra per-file options to the calls.
  This is especially useful when one .l file needs -Pprefix.

4 years agoMFC r354357-354358,354390,354395:
Bjoern A. Zeeb [Wed, 8 Jan 2020 16:32:16 +0000 (16:32 +0000)]
MFC r354357-354358,354390,354395:

  frag6 tests: set end to catch timeout as error
  ipv6 tests: Add very simplistic extension header tests
  ipv6 tests: cleanup
  ipv6 tests: test case for scapy bpf parsing bug

PR: 239380

4 years agoMFC r354092:
Bjoern A. Zeeb [Wed, 8 Jan 2020 16:15:43 +0000 (16:15 +0000)]
MFC r354092:

  Properly set VNET when nuking recvif from fragment queues.

  In theory the eventhandler invoke should be in the same VNET as
  the the current interface. We however cannot guarantee that for
  all cases in the future.

  So before checking if the fragmentation handling for this VNET
  is active, switch the VNET to the VNET of the interface to always
  get the one we want.

4 years agoMFC r350748,353792-353794,353963,353965-353966,354016-354017,
Bjoern A. Zeeb [Wed, 8 Jan 2020 16:14:20 +0000 (16:14 +0000)]
MFC r350748,353792-353794,353963,353965-353966,354016-354017,
    354019-354020,354037,354040,354042,354045-354046,354053,354081,
    354084:

  2nd half of the major frag6 rework and adding test cases.

  Cleanup structures, fix vnet teardown leak, add sysctls, whitespace
  cahnges, replace KAME hand-rolled queues with queue(9) TAILQs,
  comments, small improvements, do not leak packet queue entry in error
  case, fix counter leak in error case and optimise code, handling of
  overlapping fragments to conform to RFC 8200, prevent overwriting initial
  fragoff=0 packet meta-data.

  Submitted by: jtl (initally, partially)
  Sponsored by: Netflix (initially)

4 years agoMFC r344301 (by thj):
Bjoern A. Zeeb [Wed, 8 Jan 2020 15:50:45 +0000 (15:50 +0000)]
MFC r344301 (by thj):

  When dropping a fragment queue, account for the number of fragments in the
  queue. This improves accounting between the number of fragments received and
  the number of fragments dropped.

4 years agoMFC r353635 (by hselasky):
Bjoern A. Zeeb [Wed, 8 Jan 2020 15:41:04 +0000 (15:41 +0000)]
MFC r353635 (by hselasky):

  Fix panic in network stack due to use after free when receiving
  partial fragmented packets before a network interface is detached.

  When sending IPv4 or IPv6 fragmented packets and a fragment is lost
  before the network device is freed, the mbuf making up the fragment
  will remain in the temporary hashed fragment list and cause a panic
  when it times out due to accessing a freed network interface
  structure.

  1) Make sure the m_pkthdr.rcvif always points to a valid network
  interface. Else the rcvif field should be set to NULL.

  2) Use the rcvif of the last received fragment as m_pkthdr.rcvif for
  the fully defragged packet, instead of the first received fragment.

4 years agoMFC: r351081, r353764, r355739
Jung-uk Kim [Tue, 7 Jan 2020 20:35:43 +0000 (20:35 +0000)]
MFC: r351081, r353764, r355739

Merge ACPICA 2019081620191018, and 20191213.

4 years agoMFC r356329:
Dimitry Andric [Tue, 7 Jan 2020 20:13:31 +0000 (20:13 +0000)]
MFC r356329:

Merge commit 41449c58c from llvm git (by Roger Ferrer Ibanez):

  [RISCV] Fix evaluation of %pcrel_lo

  The following testcase

    function:
    .Lpcrel_label1:
          auipc   a0, %pcrel_hi(other_function)
          addi    a1, a0, %pcrel_lo(.Lpcrel_label1)
          .p2align        2          # Causes a new fragment to be emitted

          .type   other_function,@function
    other_function:
          ret

  exposes an odd behaviour in which only the %pcrel_hi relocation is
  evaluated but not the %pcrel_lo.

    $ llvm-mc -triple riscv64 -filetype obj t.s | llvm-objdump  -d -r -

    <stdin>:      file format ELF64-riscv

    Disassembly of section .text:
    0000000000000000 function:
           0:     17 05 00 00     auipc   a0, 0
           4:     93 05 05 00     mv      a1, a0
                  0000000000000004:  R_RISCV_PCREL_LO12_I other_function+4

    0000000000000008 other_function:
           8:     67 80 00 00     ret

  The reason seems to be that in RISCVAsmBackend::shouldForceRelocation
  we only consider the fragment but in RISCVMCExpr::evaluatePCRelLo we
  consider the section. This usually works but there are cases where
  the section may still be the same but the fragment may be another
  one. In that case we end forcing a %pcrel_lo relocation without any
  %pcrel_hi.

  This patch makes RISCVAsmBackend::shouldForceRelocation use the
  section, if any, to determine if the relocation must be forced or
  not.

  Differential Revision: https://reviews.llvm.org/D60657

This is a prerequisite for building and linking hard- and soft-float
riscv worlds with clang and lld.

Requested by: jhb

MFC r356330:

Merge commit da7b129b1 from llvm git (by James Clarke):

  [RISCV] Don't force Local Exec TLS for non-PIC

  Summary:

  Forcing Local Exec TLS requires the use of copy relocations. Copy
  relocations need special handling in the runtime linker when being
  used against TLS symbols, which is present in glibc, but not in
  FreeBSD nor musl, and so cannot be relied upon. Moreover, copy
  relocations are a hack that embed the size of an object in the ABI
  when it otherwise wouldn't be, and break protected symbols (which are
  expected to be DSO local), whilst also wasting space, thus they
  should be avoided whenever possible. As discussed in D70398, RISC-V
  should move away from forcing Local Exec, and instead use Initial
  Exec like other targets, with possible linker relaxation to follow.
  The RISC-V GCC maintainers also intend to adopt this
  more-conventional behaviour (see
  https://github.com/riscv/riscv-elf-psabi-doc/issues/122).

  Reviewers: asb, MaskRay

  Reviewed By: MaskRay

  Subscribers: emaste, krytarowski, hiraditya, rbar, johnrusso,
  simoncook, sabuasal, niosHD, kito-cheng, shiva0217, zzheng,
  edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe,
  PkmX, jocewei, psnobl, benna, Jim, lenary, s.egerton, pzheng,
  sameer.abuasal, apazos, llvm-commits, bsdjhb

  Tags: #llvm

  Differential Revision: https://reviews.llvm.org/D70649

This is a prerequisite for building and linking hard- and soft-float
riscv worlds with clang and lld.

Requested by: jhb

MFC r356331:

Merge commit c6b09bff5 from llvm git (by Luís Marques):

  [RISCV] Fix wrong CFI directives

  Summary: Removes CFI CFA directives that could incorrectly propagate
  beyond the basic block they were inteded for. Specifically it removes
  the epilogue CFI directives. See the branch_and_tail_call test for an
  example of the issue. Should fix the stack unwinding issues caused by
  the incorrect directives.

  Reviewers: asb, lenary, shiva0217
  Reviewed By: lenary
  Tags: #llvm
  Differential Revision: https://reviews.llvm.org/D69723

This is a prerequisite for building and linking hard- and soft-float
riscv worlds with clang and lld.

Requested by: jhb

MFC r356332:

Merge commit d7be3eab5 from llvm git (by Luís Marques):

  [RISCV] Handle fcopysign(f32, f64) and fcopysign(f64, f32)

  Summary: Adds tablegen patterns to explicitly handle fcopysign where
  the magnitude and sign arguments have different types, due to the
  sign value casts being removed the by DAGCombiner. Support for RV32IF
  follows in a separate commit. Adds tests for all relevant scenarios
  except RV32IF.

  Reviewers: lenary
  Reviewed By: lenary
  Tags: #llvm
  Differential Revision: https://reviews.llvm.org/D70678

This is a prerequisite for building and linking hard- and soft-float
riscv worlds with clang and lld.

Requested by: jhb

MFC r356333:

Merge commit 189b7393d from llvm git (by John Baldwin):

  [lld][RISCV] Use an e_flags of 0 if there are only binary input files.

  Summary:
  If none of the input files are ELF object files (for example, when
  generating an object file from a single binary input file via "-b
  binary"), use a fallback value for the ELF header flags instead of
  crashing with an assertion failure.

  Reviewers: MaskRay, ruiu, espindola

  Reviewed By: MaskRay, ruiu

  Subscribers: kevans, grimar, emaste, arichardson, asb, rbar,
  johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217,
  zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o,
  rkruppe, PkmX, jocewei, psnobl, benna, Jim, lenary, s.egerton,
  pzheng, sameer.abuasal, apazos, luismarques, llvm-commits, jrtc27

  Tags: #llvm

  Differential Revision: https://reviews.llvm.org/D71101

This is a prerequisite for building and linking hard- and soft-float
riscv worlds with clang and lld.

Requested by: jhb

4 years agoMFC r356256:
Dimitry Andric [Tue, 7 Jan 2020 20:09:58 +0000 (20:09 +0000)]
MFC r356256:

Merge commit 468a0cb5f from llvm git (by Craig Topper):

  [X86] Add X87 FCMOV support to X86FlagsCopyLowering.

  Fixes PR44396

Merge commit 86f48999f from llvm git (by Craig Topper):

  [X86] Fix typo in getCMovOpcode.

  The 64-bit HasMemoryOperand line was using CMOV32rm instead of
  CMOV64rm. Not sure how to test this. We have no test coverage that
  passes true for HasMemoryOperand.

This fixes 'Assertion failed: (MI.findRegisterDefOperand(X86::EFLAGS) &&
"Expected a def of EFLAGS for this instruction!"), function
runOnMachineFunction' when compiling the misc/gpsim port for i386.

Reported by: yuri
Upstream PR: https://bugs.llvm.org/show_bug.cgi?id=44396

4 years agoMFC r356100:
Dimitry Andric [Tue, 7 Jan 2020 20:09:02 +0000 (20:09 +0000)]
MFC r356100:

Merge commit d3aeac8e2 from llvm git (by Justin Hibbits)

  [PowerPC] Only use PLT annotations if using PIC relocation model

  Summary:
  The default static (non-PIC, non-PIE) model for 32-bit powerpc does
  not use @PLT annotations and relocations in GCC.  LLVM shouldn't use
  @PLT annotations either, because it breaks secure-PLT linking with
  (some versions of?) GNU LD.

  Update the available-externally.ll test to reflect that default mode
  should be the same as the static relocation, by using the same check
  prefix.

  Reviewed by:    sfertile
  Differential Revision: https://reviews.llvm.org/D70570

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D22913

MFC r356104 (by jhibbits):

[PowerPC] enable atomic.c in compiler_rt and do not check and forces
lock/lock_free decisions in compiled time

Summary:
Enables atomic.c in compiler_rt and forces clang to not emit a call for runtime
decision about lock/lock_free.  At compiling time, if clang can't decide if
atomic operation can be lock free, it emits calls to external functions  like
`__atomic_is_lock_free`, `__c11_atomic_is_lock_free` and
`__atomic_always_lock_free`, postponing decision to a runtime check.  According
to LLVM code documentation, the mechanism exists due to differences between
x86_64 processors that can't be decided at runtime.

On PowerPC and PowerPCSPE (32 bits), we already know in advance it can't be lock
free, so we force the decision at compile time and avoid having to implement it
in an external library.

This patch was made after 32 bit users testing the PowePC32 bit ISO reported
llvm could not be compiled with in-base llvm due to `__atomic_load8` not
implemented.

Submitted by: alfredo.junior_eldorado.org.br
Reviewed by: jhibbits, dim

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

MFC r356112 (by jhibbits):

[PowerPC64] Starting from FreeBSD 13.0, default to ELFv2 ABI

This changes the LLVM default powerpc64 ABI to ELFv2, if target OS is
FreeBSD >= 13.0

This will also be sent upstream.

Submitted by: alfredo.junior_eldorado.org.br
Reviewed by: dim, luporl
Relnotes: YES
Differential Revision: https://reviews.freebsd.org/D20383

4 years agoMFC r356005:
Dimitry Andric [Tue, 7 Jan 2020 20:06:26 +0000 (20:06 +0000)]
MFC r356005:

Merge commit f97936fab from llvm git (by Eric Fiselier):

  [libc++] Cleanup and enable multiple warnings.

  Too many warnings are being disabled too quickly. Warnings are
  important to keeping libc++ correct. This patch re-enables two
  warnings: -Wconstant-evaluated and -Wdeprecated-copy.

  In future, all warnings disabled for the test suite should require an
  attached bug. The bug should state the plan for re-enabling that
  warning, or a strong case why it should remain disabled.

This should fix a number of new g++ 9 warnings.

Requested by: rlibby

4 years agoMFC r356004:
Dimitry Andric [Tue, 7 Jan 2020 20:01:59 +0000 (20:01 +0000)]
MFC r356004:

Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
9.0.1 final release c1a0a213378a458fbea1a5c77b315c7dce08fd05.

Release notes for llvm, clang, lld and libc++ 9.0.1 will become
available here:

https://releases.llvm.org/9.0.1/docs/ReleaseNotes.html
https://releases.llvm.org/9.0.1/tools/clang/docs/ReleaseNotes.html
https://releases.llvm.org/9.0.1/tools/lld/docs/ReleaseNotes.html
https://releases.llvm.org/9.0.1/projects/libcxx/docs/ReleaseNotes.html

PR: 240629

4 years agoMFC r355948:
Dimitry Andric [Tue, 7 Jan 2020 19:54:29 +0000 (19:54 +0000)]
MFC r355948:

Bootstrap mergeinfo for contrib/llvm-project

Merge (record-only) the following paths to contrib/llvm-project:
* ^/vendor/llvm-project/master
* ^/vendor/llvm-project/release-8.x
* ^/vendor/llvm-project/release-9.x

MFC r355951:

Merge empty dir updates from r355950 in vendor/llvm-project.

MFC r355957:

Merge diff elimination updates from r355953 into vendor/llvm-project.

MFC r355959:

Consolidate FREEBSD-Xlist files of different llvm sub-projects into one.

4 years agoMFC r355940:
Dimitry Andric [Tue, 7 Jan 2020 19:49:10 +0000 (19:49 +0000)]
MFC r355940:

Move all sources from the llvm project into contrib/llvm-project.

This uses the new layout of the upstream repository, which was recently
migrated to GitHub, and converted into a "monorepo".  That is, most of
the earlier separate sub-projects with their own branches and tags were
consolidated into one top-level directory, and are now branched and
tagged together.

Updating the vendor area to match this layout is next.

4 years agoMerge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
Dimitry Andric [Tue, 7 Jan 2020 18:08:09 +0000 (18:08 +0000)]
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
9.0.0 final release r372316.

(NOTE: This does not yet consolidate all the llvm project sources under
contrib/llvm-project (e.g., MFC r355940), due to Subversion limitations.
It will be done in a follow-up MFC.)

MFC r348610 (by emaste):

build llvm-ar and llvm-nm with Clang (promote out of CLANG_EXTRAS)

To facilitate experimentation with LTO we require an ar that supports
LLVM IR, and to a lesser degree also an nm.  As a first step always
install llvm-ar and llvm-nm.

Sponsored by: The FreeBSD Foundation

MFC r350467 (by luporl):

[PPC64] Backport fix for missing IRELATIVE relocations

This is a backport of LLVM commit 8331f61a51a7a0a1efbf5ed398e181593023d151,
llvm-svn: 353981:

ELF: Allow GOT relocs pointing to non-preemptable ifunc to resolve to an
IRELATIVE where possible.

This is needed in order to make ifuncs work correctly on PPC64.

It fixes an issue with lld, in which it would skip emitting necessary IRELATIVE
relocations.  Without this change, indirect calls to ifuncs would result in a
segmentation fault, in static binaries or when defined in the main binary
(outside shared libraries).

This change also reverts the local
"Preserve relocations against ifuncs when -zifunc-noplt" commit and
replaces it by its upstream version, as part of the merge.

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

MFC r351662 (by emaste):

lldb: shorten thread names to make logs easier to follow

lldb prepends the thread name to log entries, and the existing thread
name for the FreeBSD ProcessMonitor thread was longer than the kernel's
supported thread name length, and so was truncated.  This made logs hard
to read, as the truncated thread name ran into the log message.  Shorten
"lldb.process.freebsd.operation" to just "freebsd.op" so that logs are
more readable.

(Upstreaming to lldb still to be done).

MFC r352095 (by emaste):

compiler-rt: use more __sanitizer_time_t on FreeBSD

A few structs were using long for time_t members.

Obtained from: LLVM r370755

MFC r352096 (by emaste):

compiler-rt: use 64-bit time_t for all FreeBSD archs except i386

Obtained from: LLVM r370756

MFC r352167 (by imp):

Remove dir empty since r276851

MFC r352168 (by imp):

Remove dirs empty since r280031

MFC r352169 (by imp):

Remove dir empty since r314564

MFC r352170 (by imp):

Remove dir empty since r327952

MFC r352171 (by imp):

Remove dirs (and their now-empty parents) empty since r344779

MFC r352792 (by emaste):

compiler-rt: correct RISC-V struct_kernel_stat64_sz

The value of struct_kernel_stat64_sz introduced by review D5021 for
RISC-V was incorrect.

Also add a __riscv_xlen == 64 conditional as the 32-bit ABI is not yet
finalized.

Submitted by: Luís Marques
Differential Revision: https://reviews.freebsd.org/D21684

MFC r353018 (by kevans):

clang: use -mxgot for 32-bit mips

Various bits in usr.bin/clang/* will fail to compile without -mxgot due to
truncated relocations. -mxgot entails a speed penalty, but I suspect we
don't care as much about compiler performance in 32-bit mips land.

Reviewed by: arichardson
Differential Revision: https://reviews.freebsd.org/D21698

MFC r353358:

Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
9.0.0 final release r372316.

Release notes for llvm, clang, lld and libc++ 9.0.0 are available here:

https://releases.llvm.org/9.0.0/docs/ReleaseNotes.html
https://releases.llvm.org/9.0.0/tools/clang/docs/ReleaseNotes.html
https://releases.llvm.org/9.0.0/tools/lld/docs/ReleaseNotes.html
https://releases.llvm.org/9.0.0/projects/libcxx/docs/ReleaseNotes.html

PR: 240629

MFC r353363:

Put in a band-aid fix for lldb 9 exiting with "Expected<T> must be
checked before access or destruction" when launching executables, while
we sort this out with upstream.

Reported by: jbeich
PR: 241137

MFC r353415:

Revert r353363 in preparation for applying upstream fix:

Put in a band-aid fix for lldb 9 exiting with "Expected<T> must be
checked before access or destruction" when launching executables, while
we sort this out with upstream.

PR: 241137

MFC r353416:

Pull in r374444 from upstream lldb trunk (by me):

  Fix process launch failure on FreeBSD after r365761

  Summary:
  After rLLDB365761, and with `LLVM_ENABLE_ABI_BREAKING_CHECKS`
  enabled, launching any process on FreeBSD crashes lldb with:

  ```
  Expected<T> must be checked before access or destruction.
  Expected<T> value was in success state. (Note: Expected<T> values in
  success mode must still be checked prior to being destroyed).
  ```

  This is because `m_operation_thread` and `m_monitor_thread` were
  wrapped in `llvm::Expected<>`, but this requires the objects to be
  correctly initialized before accessing them.

  To fix the crashes, use `llvm::Optional<>` for the members (as
  indicated by labath), and use local variables to store the return
  values of `LaunchThread` and `StartMonitoringChildProcess`.  Then,
  only assign to the member variables after checking if the return
  values indicated success.

  Reviewers: devnexen, emaste, MaskRay, mgorny

  Reviewed By: devnexen

  Subscribers: jfb, labath, krytarowski, lldb-commits

  Differential Revision: https://reviews.llvm.org/D68723

PR: 241137

MFC r353579 (by jhb):

Use __FreeBSD_version to determine if gets() has been removed.

GCC compilers set __FreeBSD__ statically to a build-time determined
targeted version (which in ports always matches the build host's
version).  This means that when building any version (12 or 13, etc.)
of riscv or some other architecture via GCC on a 12.x host,
__FreeBSD__ will always be set to 12.  As a result, __FreeBSD__ cannot
be used to reliably detect the target FreeBSD version being built.
Instead, __FreeBSD_version from either <sys/param.h> (in the kernel)
or <osreldate.h> (in userland) should be used.

This changes the gets() test in libc++ to use __FreeBSD_version from
<osreldate.h>.

Reported by: jenkins (riscv64 and amd64-gcc)
Reviewed by: dim, imp
Differential Revision: https://reviews.freebsd.org/D22034

MFC r353711 (by mhorne):

Fix build of LLVM RISC-V backend

Reviewed by: dim
MFC with: r353358
Differential Revision: https://reviews.freebsd.org/D21963

MFC r353738:

Pull in r372651 from upstream lld trunk (by Simon Atanasyan):

  [mips] Support elf32btsmipn32_fbsd / elf32ltsmipn32_fbsd emulations

  Patch by Kyle Evans.

Requested by: kevans

MFC r353739:

Pull in r374154 from upstream clang trunk (by Simon Atanasyan):

  [mips] Set default float ABI to "soft" on FreeBSD

  Initial patch by Kyle Evans.

  Fix PR43596

Requested by: kevans

MFC r353936:

Bump clang's default target CPU for the i386 architecture (aka "x86") to
i686, as per the discussion on the freebsd-arch mailing list.  Earlier
in r352030, I had already bumped it to i586, to work around missing
atomic 64 bit functions for the i386 architecture.

Relnotes: yes

MFC r354097:

Pull in r372186 from upstream llvm trunk (by Eli Friedman):

  [ARM] VFPv2 only supports 16 D registers.

  r361845 changed the way we handle "D16" vs. "D32" targets; there used
  to be a negative "d16" which removed instructions from the
  instruction set, and now there's a "d32" feature which adds
  instructions to the instruction set.  This is good, but there was an
  oversight in the implementation: the behavior of VFPv2 was changed.
  In particular, the "vfp2" feature was changed to imply "d32". This is
  wrong: VFPv2 only supports 16 D registers.

  In practice, this means if you specify -mfpu=vfpv2, the compiler will
  generate illegal instructions.

  This patch gets rid of "vfp2d16" and "vfp2d16sp", and fixes "vfp2"
  and "vfp2sp" so they don't imply "d32".

  Differential Revision: https://reviews.llvm.org/D67375

Pull in r372187 from upstream clang trunk (by Eli Friedman):

  [ARM] Update clang for removal of vfp2d16 and vfp2d16sp

  Matching fix for https://reviews.llvm.org/D67375 (r372186).

  Differential Revision: https://reviews.llvm.org/D67467

This should fix clang generating invalid opcodes for floating point
operations on armv6.

Requested by: mmel

MFC r354146:

Pull in r373338 from upstream llvm trunk (by Simon Pilgrim):

  Revert rL349624 : Let TableGen write output only if it changed,
  instead of doing so in cmake, attempt 2

  Differential Revision: https://reviews.llvm.org/D55842
  -----------------
  As discussed on PR43385 this is causing Visual Studio msbuilds to
  perpetually rebuild all tablegen generated files

Pull in r373664 from upstream llvm trunk (by Nico Weber):

  Reland r349624: Let TableGen write output only if it changed, instead
  of doing so in cmake

  Move the write-if-changed logic behind a flag and don't pass it with
  the MSVC generator. msbuild doesn't have a restat optimization, so
  not doing write-if-change there doesn't have a cost, and it should
  fix whatever causes PR43385.

This should fix the scenario where an incremental build from before
r353358 (the clang 9.0.0 upgrade) to r353358 or later fails to update
the timestamp of the generated lib/clang/headers/arm_fp16.h header.

After such a build, installing world from read-only source and object
directories would attempt to generate the header again, leading to
"clang-tblgen: error opening arm_fp16.h.d:Read-only file system".

Reported by: avg, np
PR: 241402

MFC r354339:

Merge commit 97e362607 from llvm git (by Nemanja Ivanovic):

  [PowerPC] Do not emit HW loop if the body contains calls to
  lrint/lround

  These two intrinsics are lowered to calls so should prevent the
  formation of CTR loops. In a subsequent patch, we will handle all
  currently known intrinsics and prevent the formation of HW loops if
  any unknown intrinsics are encountered.

  Differential revision: https://reviews.llvm.org/D68841

This should fix an "invalid CRT loop" assertion when building the
www/node port for powerpc64.

Requested by: Alfredo Dal'Ava Júnior <alfredo.junior@eldorado.org.br>

MFC r354347 (by cem):

Fix llvm-libunwind userspace build on ARM

GCC's libgcc exports a few ARM-specific symbols for ARM EABI, AEABI, or
EHABI or whatever it's called.  Export the same ones from LLVM-libunwind's
libgcc_s, on ARM.  As part of this, convert libgcc_s from a direct
Version.map to one constructed from component Symbol.map files.  This allows
the ARM-specific Symbol.map to be included only on ARM.

Fix ARM-only oddities in struct name/aliases in LLVM-libunwind to match
non-ARM definitions and ARM-specific expectations in libcxxrt /
libcompiler_rt.

No functional change intended for non-ARM architectures.

This commit does not actually flip the switch for ARM defaults from libgcc
to llvm-libunwind, but makes it possible (to compile, anyway).

MFC r354418 (by cem):

clang: Enable unwind tables on !amd64

There doesn't seem to be much sense in defaulting "on" unwind tables on
amd64 and not on other arches.  It causes surprising differences between
platforms, such as the PR below.

Prior to this change, FreeBSD inherited the default implementation of the
method from the Gnu.h Generic_Elf => Generic_GCC parent class, which
returned true only for amd64 targets.  Override that and opt on always,
similar to, e.g., NetBSD.

PR: 241562
Reported by: lwhsu
Reviewed by: dim
Discussed with: emaste
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D22252

MFC r354429:

Merge commit 8e34dd941 from llvm git (by Sanjay Patel):

  [x86] avoid crashing when splitting AVX stores with non-simple type
  (PR43916)

  The store splitting transform was assuming a simple type (MVT), but
  that's not necessarily the case as shown in the test.

This should fix 'Assertion failed: (isSimple() && "Expected a
SimpleValueType!")' when building the security/openssl111 port targeting
a CPU that supports AVX, but not AVX2, such as sandybridge.

PR: 241747

MFC r354469:

Merge commit f596f4507 from llvm git (by Sam Elliott):

  [RISCV] Add Custom Parser for Atomic Memory Operands

  Summary:
  GCC Accepts both (reg) and 0(reg) for atomic instruction memory
  operands. These instructions do not allow for an offset in their
  encoding, so in the latter case, the 0 is silently dropped.

  Due to how we have structured the RISCVAsmParser, the easiest way to
  add support for parsing this offset is to add a custom AsmOperand and
  parser. This parser drops all the parens, and just keeps the
  register.

  This commit also adds a custom printer for these operands, which
  matches the GCC canonical printer, printing both `(a0)` and `0(a0)`
  as `(a0)`.

  Reviewers: asb, lewis-revill

  Reviewed By: asb

  Subscribers: s.egerton, hiraditya, rbar, johnrusso, simoncook,
  apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay,
  zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o,
  rkruppe, jfb, PkmX, jocewei, psnobl, benna, Jim, llvm-commits

  Tags: #llvm

  Differential Revision: https://reviews.llvm.org/D65205

  llvm-svn: 367553

Merge commit f596f4507 from llvm git (by Sam Elliott):

  [RISCV] Add FreeBSD targets

  Reviewers: asb

  Reviewed By: asb

  Subscribers: simoncook, s.egerton, lenary, psnobl, benna, mhorne,
  emaste, kito-cheng, shiva0217, rogfer01, rkruppe, cfe-commits

  Tags: #clang

  Differential Revision: https://reviews.llvm.org/D57795

  Patch by James Clarke (jrtc27)

  llvm-svn: 367557

Merge commit f596f4507 from llvm git (by Hsiangkai Wang):

  [DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame.

  It is necessary to generate fixups in .debug_frame or .eh_frame as
  relaxation is enabled due to the address delta may be changed after
  relaxation.

  There is an opcode with 6-bits data in debug frame encoding. So, we
  also need 6-bits fixup types.

  Differential Revision: https://reviews.llvm.org/D58335

  llvm-svn: 366524

Merge commit f596f4507 from llvm git (by Hsiangkai Wang):

  [DebugInfo] Some fields do not need relocations even relax is enabled.

  In debug frame information, some fields, e.g., Length in CIE/FDE and
  Offset in FDE are attributes to describe the structure of CIE/FDE.
  They are not related to the relaxed code. However, these attributes
  are symbol differences. So, in current design, these attributes will
  be filled as zero and LLVM generates relocations for them.

  We only need to generate relocations for symbols in executable
  sections.  So, if the symbols are not located in executable sections,
  we still evaluate their values under relaxation.

  Differential Revision: https://reviews.llvm.org/D61584

  llvm-svn: 366531

Merge commit f596f4507 from llvm git (by Alex Bradbury):

  [RISCV] Don't force absolute FK_Data_X fixups to relocs

  The current behavior of shouldForceRelocation forces relocations for
  the majority of fixups when relaxation is enabled. This makes sense
  for fixups which incorporate symbols but is unnecessary for simple
  data fixups where the fixup target is already resolved to an absolute
  value.

  Differential Revision: https://reviews.llvm.org/D63404
  Patch by Edward Jones.

  llvm-svn: 369257

Merge commit f596f4507 from llvm git (by Alex Bradbury):

  [RISCV] Implement getExprForFDESymbol to ensure RISCV_32_PCREL is
  used for the FDE location

  Follow binutils in using RISCV_32_PCREL for the FDE initial location.
  As explained in the relevant binutils commit
  <https://github.com/riscv/riscv-binutils-gdb/commit/a6cbf936e3dce68114d28cdf60d510a3f78a6d40>,
  the ADD/SUB pair of relocations is problematic in the presence of
  linker relaxation.

  This patch has the same end goal as D64715 but includes test changes
  and avoids adding a new global VariantKind to MCExpr.h (preferring
  RISCVMCExpr VKs like the rest of the RISC-V backend).

  Differential Revision: https://reviews.llvm.org/D66419

  llvm-svn: 369375

This series of merges will permit riscv64 kernels and riscv64sf worlds
to build with clang instead of gcc (but still using the bfd linker).

Requested by: jhb
Obtained from: https://github.com/freebsd/freebsd/compare/master...bsdjhb:riscv_clang

MFC r354662 (by jhb):

Sync target triple generation with the version in Makefile.inc1.

Reviewed by: dim
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D22333

MFC r354692 (by emaste):

llvm: use AT_EXECPATH from ELF auxiliary vectors for getExecutablePath

/proc/curproc/file and the KERN_PROC_PATHNAME sysctl may not return the
desired path if there are multiple hardlinks to the file.

PR: 241932
Tested by: ler
Sponsored by: The FreeBSD Foundation

MFC r354707 (by emaste):

llvm: use elf_aux_info to get executable's path, if available

Obtained from: LLVM a0a38b81ea
MFC with: r354692
Sponsored by: The FreeBSD Foundation

MFC r354979:

Merge commit 7bed381ea from llvm git (by Simon Atanasyan):

  [mips] Implement Octeon+ `saa` and `saad` instructions

  `saa` and `saad` are 32-bit and 64-bit store atomic add instructions.

     memory[base] = memory[base] + rt

  These instructions are available for "Octeon+" CPU. The patch adds
  support for both instructions to MIPS assembler and diassembler and
  introduces new CPU type - "octeon+".

  Next patches will implement `.set arch=octeon+` directive and
  `AFL_EXT_OCTEONP` ISA extension flag support.

  Differential Revision: https://reviews.llvm.org/D69849

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans

MFC r354980:

Merge commit 3718102d4 from llvm git (by Simon Atanasyan):

  [mips] Support `octeon+` CPU in the `.set arch=` directive

  Differential Revision: https://reviews.llvm.org/D69850

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans

MFC r354981:

Merge commit bf996f761 from llvm git (by Simon Atanasyan):

  [mips] Write `AFL_EXT_OCTEONP` flag to the `.MIPS.abiflags` section

  Differential Revision: https://reviews.llvm.org/D69851

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans

MFC r354982:

Merge commit 3552d3e0f from llvm git (by Simon Atanasyan):

  [mips] Add `octeon+` to the list of CPUs accepted by the driver

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans

MFC r354983:

Merge commit e578d0fd2 from llvm git (by Simon Atanasyan):

  [mips] Fix `__mips_isa_rev` macros value for Octeon CPU

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans

MFC r354984:

Merge commit 0d14656b9 from llvm git (by Simon Atanasyan):

  [mips] Set __OCTEON__ macros

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans

MFC r354985:

Merge commit a751f557d from llvm git (by Simon Atanasyan):

  [mips] Set macros for Octeon+ CPU

This is one of the upstream changes needed for adding support for the
OCTEON+ CPU type, so that we can test Clang builds using the most
commonly available FreeBSD/mips64 reference platform, the Edge Router
Lite.

Requested by: kevans

MFC r355397:

Merge commit 241cbf201 from llvm git (by Nemanja Ivanovic):

  [PowerPC] Fix crash in peephole optimization

  When converting reg+reg shifts to reg+imm rotates, we neglect to
  consider the CodeGenOnly versions of the 32-bit shift mnemonics. This
  means we produce a rotate with missing operands which causes a crash.

  Committing this fix without review since it is non-controversial that
  the list of mnemonics to consider should include the 64-bit aliases
  for the exact mnemonics.

  Fixes PR44183.

This should fix "Assertion failed: (idx < size()), function operator[],
file /usr/src/contrib/llvm/include/llvm/ADT/SmallVector.h, line 153"
when building the graphics/mesa-dri port for the PowerPC64 ELFv2 ABI.

Reported by: Alfredo Dal'Ava Júnior <alfredo.junior@eldorado.org.br>

MFC r355602:

Add a few missed source files to libllvm, for the MK_LLVM_TARGET_BPF=yes
case.  Otherwise, linking of clang and other llvm based executables
would complain about missing symbols.

Reported by: rstone

MFC r355645 (by cem):

arm: libgcc_s: Fix ABI breakage introduced in r354347

Provide the symbol version for llvm-libunwind's _Unwind_Backtrace that libgcc
has historically provided on arm, in addition to the (default) standard version
used on all other arch.

Reported by: mmel

MFC r355803 (by mmel):

Fix LLVM libunwnwind _Unwind_Backtrace symbol version for ARM.
In original  GNU libgcc, _Unwind_Backtrace is published with GCC_3.3 version
for all architectures but ARM. For ARM should be publishes with GCC_4.3.0
version. This was originally omitted in r255095, fixed in r318024 and omitted
aging in LLVM libunwind implementation in r354347.

For ARM _Unwind_Backtrace should be published as default with GCC_4.3.0
version , (because this is right original version) and again as
normal(not-default) with GCC_3.3 version (to maintain ABI compatibility
compiled/linked with wrong pre r318024 libgcc)

PR: 233664

4 years agoMFC r355070:
Bjoern A. Zeeb [Tue, 7 Jan 2020 16:58:39 +0000 (16:58 +0000)]
MFC r355070:

  Allow kernel to compile without BPF.

  r297816 added some bpf magic for VIMAGE unconditionally which no longer
  allows kernels to compile without bpf (but with other networking).
  Add the missing ifdef checks and allow a kernel to compile without bpf
  again.

  PR: 242136
  Reported by: dave mischler.com

4 years agoMFC r354639:
Bjoern A. Zeeb [Tue, 7 Jan 2020 16:54:43 +0000 (16:54 +0000)]
MFC r354639:

  netstat: igmp stats, error on unexpected information, not only warn

  The igmp stats tend to print two lines of warning for an unexpected
  version and length.  Despite an invalid version and struct size it
  continues to try to do something with the data.  Do not try to parse
  the remainder of the struct and error on warning.

  Note the underlying issue of the data not being available properly
  is still there and needs to be fixed seperately.

  Reported by: test cases, lwhsu

4 years agoMFC r354572:
Bjoern A. Zeeb [Tue, 7 Jan 2020 16:52:05 +0000 (16:52 +0000)]
MFC r354572:

  libipsec: correct a typo

  Correct a typo in the ipsec_errlist and replicated in a comment.
  No functional changes.

4 years agoMFC r354416:
Bjoern A. Zeeb [Tue, 7 Jan 2020 16:49:50 +0000 (16:49 +0000)]
MFC r354416:

  m_pulldown(): Change an if () panic() into a KASSERT().

  If we pass in a NULL mbuf to m_pulldown() we are in a bad situation
  already.  There is no point in doing that check for production code.
  Change the if () panic() into a KASSERT.

4 years agoMFC r351329:
Bjoern A. Zeeb [Tue, 7 Jan 2020 16:47:25 +0000 (16:47 +0000)]
MFC r351329:

  gprof: disable building of a.out components

  On arm64, riscv, and s390x disable building of aout components.
  This allows gprof to build on these architectures which never supported
  the legacy a.out binary format.

Note: there might be more work needed for arm64 or risv and the MACHINE_
checks are based on what was use elsewhere in the tree at that time.  Other
will fix these parts with follow-up work.

4 years agoMFC r351327:
Bjoern A. Zeeb [Tue, 7 Jan 2020 16:44:19 +0000 (16:44 +0000)]
MFC r351327:

  athhal: disable unused function (big endian only)

  Disable ar9300_swap_tx_desc() for the moment.  It is an unused
  function only tried to compile on big endian systems.

4 years agoMFC r356216: Don't spin on cleanup_lock if we are not interrupt.
Alexander Motin [Tue, 7 Jan 2020 00:54:23 +0000 (00:54 +0000)]
MFC r356216: Don't spin on cleanup_lock if we are not interrupt.

If somebody else holds that lock, it will likely do the work for us.
If it won't, then we return here later and retry.

Under heavy load it allows to avoid lock congestion between interrupt and
polling threads.

4 years agoMFC of 356063
Kirk McKusick [Mon, 6 Jan 2020 21:14:27 +0000 (21:14 +0000)]
MFC of 356063

Do not ask to use journal in fsck_ffs if journal is out of date

4 years agoMFC r356201:
Hans Petter Selasky [Mon, 6 Jan 2020 09:50:44 +0000 (09:50 +0000)]
MFC r356201:
Fix spelling.

PR: 242891
Sponsored by: Mellanox Technologies

4 years agoMFC r356137:
Hans Petter Selasky [Mon, 6 Jan 2020 09:23:54 +0000 (09:23 +0000)]
MFC r356137:
Implement dump_stats command for usbconfig(8).

This command is useful when debugging USB device issues.

Sponsored by: Mellanox Technologies

4 years agoMFC r356136:
Hans Petter Selasky [Mon, 6 Jan 2020 09:20:04 +0000 (09:20 +0000)]
MFC r356136:
Implement new libusb v2.0 API function, libusb20_dev_get_stats().

This function is useful when debugging USB device issues.

Sponsored by: Mellanox Technologies

4 years agoMFC r356135:
Hans Petter Selasky [Mon, 6 Jan 2020 09:07:57 +0000 (09:07 +0000)]
MFC r356135:
Make USB statistics per device instead of per bus.

Bump the FreeBSD version due to structure change to
force recompilation of external USB modules.

Sponsored by: Mellanox Technologies

4 years agoMFC r356042: Make pass(4) handle misaligned buffers of MAXPHYS size.
Alexander Motin [Mon, 6 Jan 2020 01:12:15 +0000 (01:12 +0000)]
MFC r356042: Make pass(4) handle misaligned buffers of MAXPHYS size.

Since we are already using malloc()+copyin()/copyout() for smaller data
blocks, and since new asynchronous API does it always, I see no reason
to keep this ugly artificial size/alignment limitation in old API.

Tape applications suffer enough from the MAXPHYS limitations by itself,
and additional alignment requirement, often halving effectively usable
block size, does not help.

It would be good to use unmapped I/O here instead, but it require some
HBA drivers polishing first to support non-BIO unmapped buffers.

4 years agoMFC further inetd(8) cleanup: r356204, r356215, r356217-r356218,
Kyle Evans [Sun, 5 Jan 2020 21:35:02 +0000 (21:35 +0000)]
MFC further inetd(8) cleanup: r356204, r356215, r356217-r356218,
r356246-r356248, r356254, r356318

r356204:
inetd: don't leak `policy` on return

sep->se_policy gets a strdup'd version of policy, so we don't need it to
stick around afterwards.

While here, remove a couple of NULL checks prior to free(policy).

r356215:
inetd: knock out some clang analyze warnings

chargen_dg: clang-analyze is convinced that endring could be non-NULL at
entry, and thus wants to assume that rs == NULL. Just independently
initialize rs if it's NULL to appease the analyzer.

getconfigent: policy leaks on return

free_connlist: reorganize the loop to make it clear that we're not going to
access `conn` after it's been freed.

cpmip/hashval: left-shifts performed will result in UB as we take
signed 0xABC3D20F and left shift it by 5.

r356217:
inetd: prefer strtonum(3) to strspn(3)+atoi(3), NFC

strtonum(3) does effectively the same validation as we had, but it's more
concise.

r356218:
inetd: prefer strlcpy to strlen(3) check + strcpy(3), NFC

This is again functionally equivalent but more concise.

r356246:
inetd: add some macros for checking child limits, NFC

The main point here is capturing the maxchild > 0 check. A future change to
inetd will start tracking all of the child pids so that it can give proper
and consistent notification of process exit/signalling.

r356247:
inetd: track all child pids, regardless of maxchild spec

Currently, child pids are only tracked if maxchildren is specified. As a
consequence, without a maxchild limit we do not get a notice in syslog on
children aborting abnormally. This turns out to be a great debugging aide at
times.

Children are now tracked in a LIST; the management interface is decidedly
less painful when there's no upper bound on the number of entries we may
have at the cost of one small allocation per connection.

r356248:
inetd: convert remaining bzero(3) to memset(3), NFC

This change is purely in the name of noise reduction from static analyzers
that want to complain that bzero(3) is obsolete in favor of memset(3).

With this, clang-analyze at least is now noise free. WARNS= 6 also appears
to have been OK for some time now, so drop the current setting and opt for
the default.

r356254:
inetd: final round of trivial cleanup, NFC

Highlights:
- Use MAX() for maxsock raising; small readability improvement IMO
- malloc(3) + memset(3) -> calloc(3) where appropriate
- stop casting the return value of malloc(3)
- mallloc(3) -> reallocarray(3) where appropriate

A future change may enter capability mode when forking for some of the
built-in handlers.

r356318:
inetd: fix WITHOUT_TCP_WRAPPERS build after r356248

After increasing WARNS, building WITHOUT_TCP_WRAPPERS failed because of
some unused variables.

4 years agoMFC r356186:
Mark Johnston [Sun, 5 Jan 2020 18:15:41 +0000 (18:15 +0000)]
MFC r356186:
Add ARMv8 static relocation types used for control flow instructions.

4 years agoMFC r349720, r356228
Cy Schubert [Sat, 4 Jan 2020 00:51:03 +0000 (00:51 +0000)]
MFC r349720, r356228

r349720 (des):
Upgrade Unbound to 1.9.2.

r356228:
MFV r356143:

Update unbound 1.9.2 --> 1.9.6.

Security: CVE-2019-18934 (fixed by 1.9.5)

4 years agoMFC r355988-r355990
Cy Schubert [Sat, 4 Jan 2020 00:41:22 +0000 (00:41 +0000)]
MFC r355988-r355990

r355988:
MFV r353141 (by phillip):

Update libpcap from 1.9.0 to 1.9.1.

r355989:
MFV r353143 (phillip):

Update tcpdump from 4.9.2 to 4.9.3.

r355990:
MFV r355890:

Fix libpcap issue #893: check for invalid IPv4 addresses.

This fixes errors such as:

tcpdump -i lagg0 net 999.999.999.999

This was originally discovered on a Red Hat 7.7 server and verified
to also be a bug on FreeBSD.

Obtained from: https://github.com/the-tcpdump-group/libpcap/commit/ \
07070918d5e81a515315b395f334e52589fe0fb
Fixed by: https://github.com/guyharris

4 years agoMFC r356126:
Konstantin Belousov [Fri, 3 Jan 2020 01:21:15 +0000 (01:21 +0000)]
MFC r356126:
ufs: do not leave non-reclaimed vnodes with zero i_mode around.

MFC note: this should be a nop on stable/12.

4 years agoMFC r356107:
Mark Johnston [Fri, 3 Jan 2020 00:29:09 +0000 (00:29 +0000)]
MFC r356107:
Plug some ifaddr refcount leaks.

PR: 242746

4 years agoMFC r355942:
Mark Johnston [Fri, 3 Jan 2020 00:28:34 +0000 (00:28 +0000)]
MFC r355942:
Deduplicate code between if_delgroup() and if_delgroups().

4 years agoMFC r355055: Fix gcc build for bitstring_test by specifying "-fno-strict-overflow"
Eric Joyner [Thu, 2 Jan 2020 23:18:43 +0000 (23:18 +0000)]
MFC r355055: Fix gcc build for bitstring_test by specifying "-fno-strict-overflow"

Sponsored by: Intel Corporation