]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 years agoAdd more obsolete files
antoine [Fri, 8 May 2020 20:15:18 +0000 (20:15 +0000)]
Add more obsolete files

4 years agobhyve: Pass the full string of options to the network backends.
afedorov [Fri, 8 May 2020 17:15:54 +0000 (17:15 +0000)]
bhyve: Pass the full string of options to the network backends.

Reviewed by: vmaffione
Approved by: vmaffione (mentor)
Sponsored by: vstack.com
Differential Revision: https://reviews.freebsd.org/D24735

4 years ago[net80211] Use the unicast key when transmitting DWDS AP multicast frames.
adrian [Fri, 8 May 2020 17:01:33 +0000 (17:01 +0000)]
[net80211] Use the unicast key when transmitting DWDS AP multicast frames.

I'm still not sure whether this is the full solution, but here goes.

I have a two node DWDS setup - a main AP with the ethernet bridge uplink
and a satellite AP in the back of the house. They're both AR9344+AR9580
dual band 11n APs.

The problem was that multicast frames was not going from the DWDS AP to
the DWDS STA. Unicast frames are fine, and multicast frames from the
DWDS STA to AP are fine.

Now, multicast and unicast frames from the STA -> AP are just transmitted
using the unicast key.  That's fine.  However, the AP -> STA multicast
frames by default are transmitted using the current default / multicast
key, the shared one between all STAs in a BSS.  Now, the DWDS implementation
ignores non WDS frames - it only allows about 4 address frames outside
of management / EAPOL frames! - so the STA side ignores the normal multicast
frames.

Instead, the AP side uses ieee80211_dwds_mcast() to send multicast frames
to each WDS VAP that was created as part of the "dynamic" part of DWDS.
This should be queuing them individually to each node instead of using
the normal multicast send path; and this is how they should get turned into
4-addr WDS frames.

HOWEVER, ieee80211_encap() was trying to use the default TX key to queue
them rather than the unicast key that's already setup.  Since this synthetic
node doesn't have the default TX key setup, transmission fails.  Things
would be fine in WEP and in open mode because in both cases you would
have static keys (or no keys) setup.  It just fails in WPA mode.

This resolves the issue.  AP DWDS multicast is now sent using the unicast
key just like in STA mode and I'm pretty sure the STA mode side will stil
work fine (as it's a STA VAP with a DWDS flag..)

Tested:

* TL-WDR3600/4300 APs

4 years agoFix a memory leak for ENCIOC_GETSTRING I introduced in r360171.
jhb [Fri, 8 May 2020 16:41:23 +0000 (16:41 +0000)]
Fix a memory leak for ENCIOC_GETSTRING I introduced in r360171.

MFC after: 1 week
Sponsored by: DARPA

4 years agosrc.conf.5: regen after BINUTILS changes
emaste [Fri, 8 May 2020 15:03:28 +0000 (15:03 +0000)]
src.conf.5: regen after BINUTILS changes

4 years agosrc.opts.mk: update BINUTILS options and add comments
emaste [Fri, 8 May 2020 14:54:40 +0000 (14:54 +0000)]
src.opts.mk: update BINUTILS options and add comments

BINUTILS is needed only for ports, and will be disabled once the failing
ports are addressed (likely by growing a binutils dependency).

BINUTILS_BOOTSTRAP is needed only on amd64, for skein_block_asm.s. There
is no need to enable it on i386.

This will all be removed before FreeBSD 13.0.

4 years agoRemove APPLEKEXT ifndefs
freqlabs [Fri, 8 May 2020 14:39:38 +0000 (14:39 +0000)]
Remove APPLEKEXT ifndefs

They are no longer useful.

Reviewed by: rmacklem
Approved by: mav (mentor)
MFC after: 1 week
Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D24752

4 years agoReinitialize thread0's stack base after enabling XSAVE.
markj [Fri, 8 May 2020 14:38:48 +0000 (14:38 +0000)]
Reinitialize thread0's stack base after enabling XSAVE.

Otherwise the initial call to set_top_of_stack(), which occurs before
fpuinit() sets the correct value for cpu_max_ext_state_size, leaves the
stack base at an incorrect location.  Then, when the full area is
zeroed, we end up erroneously zeroing part of the following page.

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D24754

4 years agoFix the sys.geom.class.multipath.misc.fail_on_error test on stable/12
asomers [Fri, 8 May 2020 02:42:15 +0000 (02:42 +0000)]
Fix the sys.geom.class.multipath.misc.fail_on_error test on stable/12

This test uses a gnop feature (delay probability) that isn't available on
stable/12.  But it's unnecessary; the test works fine without it.  Removing
it simplifies the test and, once MFCed, will allow it to pass on stable/12.

PR: 244158
Reported by: lwhsu
MFC after: 2 weeks

4 years agoDocument le_enable subcommand
takawata [Fri, 8 May 2020 01:19:29 +0000 (01:19 +0000)]
Document le_enable subcommand

4 years agoMerge commit 21e5e1724b75 from llvm git:
emaste [Thu, 7 May 2020 21:18:37 +0000 (21:18 +0000)]
Merge commit 21e5e1724b75 from llvm git:

  getMainExecutable: Fix hand-rolled AT_EXECPATH for older FreeBSD

  Once we hit AT_NULL, we need to bail out of the loop; not just the
  enclosing switch.  This fixes basic usage (e.g. `cc --version`) when
  AT_EXECPATH isn't present on older branches (e.g. under
  emu-user-static, at the moment), where we would previously run off
  the end of ::environ.

  Patch By: kevans

  Reviewed By: arichardson

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

MFC after: 3 days

4 years agoWhen in the SYN-SENT state bbr and rack will not properly send an ACK but instead...
rrs [Thu, 7 May 2020 20:29:38 +0000 (20:29 +0000)]
When in the SYN-SENT state bbr and rack will not properly send an ACK but instead start the D-ACK timer. This
causes so_reuseport_lb_test to fail since it slows down how quickly the program runs until the timeout occurs
and fails the test

Sponsored by: Netflix inc.
Differential Revision: https://reviews.freebsd.org/D24747

4 years agoBump __FreeBSD_version after linuxkpi changes
manu [Thu, 7 May 2020 19:51:53 +0000 (19:51 +0000)]
Bump __FreeBSD_version after linuxkpi changes

Requested by: zeising

4 years ago[PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities.
bdragon [Thu, 7 May 2020 19:32:49 +0000 (19:32 +0000)]
[PowerPC] kernel ifunc support for powerpc*, fix ppc64 relocation oddities.

This is a general cleanup of the relocatable kernel support on powerpc,
needed to enable kernel ifuncs.

 * Fix some relocatable issues in the kernel linker, and change to using
   a RELOCATABLE_KERNEL #define instead of #ifdef __powerpc__ for parts that
   other platforms can use in the future if they wish to have ET_DYN kernels.

 * Get rid of the DB_STOFFS hack now that the kernel is relocated to the DMAP
   properly across the board on powerpc64.

 * Add powerpc64 and powerpc32 ifunc functionality.

 * Allow AIM64 virtual mode OF kernels to run from the DMAP like other AIM64
   by implementing a virtual mode restart. This fixes the runtime address on
   PowerMac G5.

 * Fix symbol relocation problems on post-relocation kernels by relocating
   the symbol table.

 * Add an undocumented method for supplying kernel symbols on powernv and
   other powerpc machines using linux-style kernel/initrd loading -- If
   you pass the kernel in as the initrd as well, the copy resident in initrd
   will be used as a source for symbols when initializing the debugger.
   This method is subject to removal once we have a better way of doing this.

Approved by: jhibbits
Relnotes: yes
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D23156

4 years agoOptionalObsoleteFiles.inc: remove objdump
emaste [Thu, 7 May 2020 18:24:32 +0000 (18:24 +0000)]
OptionalObsoleteFiles.inc: remove objdump

objdump is removed unconditionally in ObsoleteFiles.inc

4 years agoSet PCM_CAP_VIRTUAL for virtual DSP devices.
hselasky [Thu, 7 May 2020 18:15:35 +0000 (18:15 +0000)]
Set PCM_CAP_VIRTUAL for virtual DSP devices.

Submitted by: Kevin Zheng <kevinz5000@gmail.com>
PR: 246206
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agovirtio_mmio: Add casts missing from r360722
jrtc27 [Thu, 7 May 2020 17:59:17 +0000 (17:59 +0000)]
virtio_mmio: Add casts missing from r360722

This fixes -Wshift-count-overflow warnings/errors on architectures using
32-bit physical addresses.

Reported by: lwhsu

4 years ago[PowerPC] Fix powerpcspe build failure after r360569
bdragon [Thu, 7 May 2020 17:58:07 +0000 (17:58 +0000)]
[PowerPC] Fix powerpcspe build failure after r360569

On powerpcspe, vm_paddr_t is 64 bit despite it being a 32 bit platform.
Adjust compile time assertion to compensate.

4 years agolinuxkpi: Add pci_iomap and pci_iounmap
manu [Thu, 7 May 2020 17:00:51 +0000 (17:00 +0000)]
linuxkpi: Add pci_iomap and pci_iounmap

Those function are use to map/unmap io region of a pci device.
Different resource can be mapped depending on the bar so use a
tailq to store them all.

Sponsored-by: The FreeBSD Foundation
Reviewed by: emaste, hselasky
Differential Revision: https://reviews.freebsd.org/D24696

4 years agops: extend the non-standard option -d (tree view) to work with -p
pstef [Thu, 7 May 2020 16:56:18 +0000 (16:56 +0000)]
ps: extend the non-standard option -d (tree view) to work with -p

Initially it seemed that there were multiple possible ways to do it.

Processing option -p could conditionally add selected processes and
their descendants to the list for further work, but it is not guaranteed
to know whether the -d option has been used or not, and it also doesn't
have access to the process list just yet.

There is also descendant_sort() which has access to all possibly needed
information, but serves the purely post-processing purpose of sorting
output.

Then there is the loop that uses invocation information and full process
list to create a list of processes for final display. It seems the most
natural place to implement this, but indeterminate state of the process
list and volatility of the final list that is being created obstruct
adding an elegant search for all elements of process descendancy trees.

So I opted for adding another loop, just before the one I mentioned
above. For all selected processes it conditionally adds direct
descendants to the end of this list of selected processes.

Possible usage:
* ps -auxd -p $$
* ps -auxd -p 1
* while x=$(pgrep svnlite); do clear; ps auxd -p $x; sleep 2; done
* ps -auxd -p `pgrep make`

Reviewed by: kevans, kaktus (earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24380

4 years agogpioiic_attach: fix a NULL pointer crash on hints-based systems
avg [Thu, 7 May 2020 13:11:32 +0000 (13:11 +0000)]
gpioiic_attach: fix a NULL pointer crash on hints-based systems

The attach method uses GPIO_GET_BUS() to get a "newbus" device
that provides a pin.  But on hints-based systems a GPIO controller
driver might not be fully initialized yet and it does not know gpiobus
hanging off it.  Thus, GPIO_GET_BUS() cannot be called yet.
The reason is that controller drivers typically create a child gpiobus
using gpiobus_attach_bus() and that leads to the following call chain:
gpiobus_attach_bus() -> gpiobus_attach() ->
bus_generic_attach(gpiobus) -> gpioiic_attach().
So, gpioiic_attach() is called before gpiobus_attach_bus() returns.

I observed this bug with nctgpio driver on amd64.
I think that the problem was introduced in r355276.

The fix is to avoid calling GPIO_GET_BUS() from the attach method.
Instead, we know that on hints-based systems only the parent gpiobus can
provide the pins.
Nothing is changed for FDT-based systems.

MFC after: 1 week

4 years agoUpdate the screen termcap entries
bapt [Thu, 7 May 2020 12:43:28 +0000 (12:43 +0000)]
Update the screen termcap entries

Those updates have been obtained form converting the terminfo information
provided by the screen sources to termcap.

MFC after: 3 days

4 years agoOptimize ENA Rx refill for low memory conditions
mw [Thu, 7 May 2020 11:28:39 +0000 (11:28 +0000)]
Optimize ENA Rx refill for low memory conditions

Sometimes, especially when there is not much memory in the system left,
allocating mbuf jumbo clusters (like 9KB or 16KB) can take a lot of time
and it is not guaranteed that it'll succeed. In that situation, the
fallback will work, but if the refill needs to take a place for a lot of
descriptors at once, the time spent in m_getjcl looking for memory can
cause system unresponsiveness due to high priority of the Rx task. This
can also lead to driver reset, because Tx cleanup routine is being
blocked and timer service could detect that Tx packets aren't cleaned
up. The reset routine can further create another unresponsiveness - Rx
rings are being refilled there, so m_getjcl will again burn the CPU.
This was causing NVMe driver timeouts and resets, because network driver
is having higher priority.

Instead of 16KB jumbo clusters for the Rx buffers, 9KB clusters are
enough - ENA MTU is being set to 9K anyway, so it's very unlikely that
more space than 9KB will be needed.

However, 9KB jumbo clusters can still cause issues, so by default the
page size mbuf cluster will be used for the Rx descriptors. This can have a
small (~2%) impact on the throughput of the device, so to restore
original behavior, one must change sysctl "hw.ena.enable_9k_mbufs" to
"1" in "/boot/loader.conf" file.

As a part of this patch (important fix), the version of the driver
was updated to v2.1.2.

Submitted by:   cperciva
Reviewed by:    Michal Krawczyk <mk@semihalf.com>
Reviewed by:    Ido Segev <idose@amazon.com>
Reviewed by:    Guy Tzalik <gtzalik@amazon.com>
MFC after:      3 days
PR:             225791, 234838, 235856, 236989, 243531
Differential Revision: https://reviews.freebsd.org/D24546

4 years agoNF has an internal option that changes the tcp_mcopy_m routine slightly (has
rrs [Thu, 7 May 2020 10:46:02 +0000 (10:46 +0000)]
NF has an internal option that changes the tcp_mcopy_m routine slightly (has
a few extra arguments). Recently that changed to only have one arg extra so
that two ifdefs around the call are no longer needed. Lets take out the
extra ifdef and arg.

Sponsored by: Netflix Inc
Differential Revision: https://reviews.freebsd.org/D24736

4 years agoFix indentation of the Kitty entry
bapt [Thu, 7 May 2020 08:58:08 +0000 (08:58 +0000)]
Fix indentation of the Kitty entry

MFC after: 2 days

4 years agoAdd rib_lookup() sockaddr lookup wrapper and make ifa_ifwithroute use it.
melifaro [Thu, 7 May 2020 08:11:36 +0000 (08:11 +0000)]
Add rib_lookup() sockaddr lookup wrapper and make ifa_ifwithroute use it.

Create rib_lookup() wrapper around per-af dataplane lookup functions.
This will help in the cases of having control plane af-agnostic code.

Switch ifa_ifwithroute() to use this function instead of rtalloc1().

Reviewed by: ae
Differential Revision: https://reviews.freebsd.org/D24731

4 years agovirtio: Support MMIO bus for all devices
jrtc27 [Wed, 6 May 2020 23:31:30 +0000 (23:31 +0000)]
virtio: Support MMIO bus for all devices

The bus is independent of the device, so all devices can be attached to
either a PCI bus or an MMIO bus. For example, QEMU's virtio-rng-device
gives the MMIO variant of virtio-rng-pci, and is now detected.

Reviewed by: andrew, br, brooks (mentor)
Approved by: andrew, br, brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D24730

4 years agovirtio_mmio: Support non-transitional version 2 devices
jrtc27 [Wed, 6 May 2020 23:28:51 +0000 (23:28 +0000)]
virtio_mmio: Support non-transitional version 2 devices

The non-legacy virtio MMIO specification drops the use of PFNs and
replaces them with physical addresses. Whilst many implementations are
so-called transitional devices, also implementing the legacy
specification, TinyEMU[1] does not. Device-specific configuration
registers have also changed to being little-endian, and must be accessed
using a single aligned access for registers up to 32 bits, and two
32-bit aligned accesses for 64-bit registers.

[1] https://bellard.org/tinyemu/

Reviewed by: br, brooks (mentor)
Approved by: br, brooks (mentor)
Differential Revision: https://reviews.freebsd.org/D24681

4 years agoDeprecate ubsec(4) for FreeBSD 13.0.
jhb [Wed, 6 May 2020 22:15:09 +0000 (22:15 +0000)]
Deprecate ubsec(4) for FreeBSD 13.0.

With the removal of in-tree consumers of DES, Triple DES, and
MD5-HMAC, the only algorithm this driver still supports is SHA1-HMAC.
This is not very useful as a standalone algorithm (IPsec AH-only with
SHA1 would be the only user).

This driver has also not been kept up to date with the original driver
in OpenBSD which supports a few more cards and AES-CBC on newer cards.
The newest card currently supported by this driver was released in
2005.

Reviewed by: cem
MFC after: 1 week
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D24691

4 years agoMerge commit 4ca2cad94 from llvm git (by Justin Hibbits):
dim [Wed, 6 May 2020 19:10:39 +0000 (19:10 +0000)]
Merge commit 4ca2cad94 from llvm git (by Justin Hibbits):

  [PowerPC] Add clang -msvr4-struct-return for 32-bit ELF

  Summary:

  Change the default ABI to be compatible with GCC. For 32-bit ELF
  targets other than Linux, Clang now returns small structs in
  registers r3/r4. This affects FreeBSD, NetBSD, OpenBSD. There is no
  change for 32-bit Linux, where Clang continues to return all structs
  in memory.

  Add clang options -maix-struct-return (to return structs in memory)
  and -msvr4-struct-return (to return structs in registers) to be
  compatible with gcc. These options are only for PPC32; reject them on
  PPC64 and other targets. The options are like -fpcc-struct-return and
  -freg-struct-return for X86_32, and use similar code.

  To actually return a struct in registers, coerce it to an integer of
  the same size. LLVM may optimize the code to remove unnecessary
  accesses to memory, and will return i32 in r3 or i64 in r3:r4.

  Fixes PR#40736

  Patch by George Koehler!

  Reviewed By: jhibbits, nemanjai
  Differential Revision: https://reviews.llvm.org/D73290

Requested by: jhibbits
MFC after: 3 days

4 years agosrc.conf.5: regen after objdump removal
emaste [Wed, 6 May 2020 18:43:27 +0000 (18:43 +0000)]
src.conf.5: regen after objdump removal

4 years agosrc.opts.mk: with BINUTILS limited to as it is used on i386 and amd64 only
emaste [Wed, 6 May 2020 18:40:52 +0000 (18:40 +0000)]
src.opts.mk: with BINUTILS limited to as it is used on i386 and amd64 only

4 years agoupdate WITH_/WITHOUT_BINUTILS descriptions for objdump removal
emaste [Wed, 6 May 2020 18:39:55 +0000 (18:39 +0000)]
update WITH_/WITHOUT_BINUTILS descriptions for objdump removal

4 years agobinutils: disconnect objdump from the build
emaste [Wed, 6 May 2020 18:38:40 +0000 (18:38 +0000)]
binutils: disconnect objdump from the build

The in-tree binutils is old and will not be updated.  It does not support
all archs supported by FreeBSD, and for the archs it does support not all
CPU features are supported.

Other tools have migrated to copyfree alternatives.  Although llvm-objdump
is nearly a drop-in replacement for GNU objdump it is missing a few options
and has some differences in output format.  For now just remove GNU objdump;
ports and developers can use a contemporary, maintained version from ports
or packages.  We can revisit installing llvm-objdump as objdump in the
future.

PR: 212319 [exp-run]
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D7338

4 years agoIn r358396 I merged llvm upstream commit 2e24219d3, which fixed "error:
dim [Wed, 6 May 2020 18:13:00 +0000 (18:13 +0000)]
In r358396 I merged llvm upstream commit 2e24219d3, which fixed "error:
unsupported relocation on symbol" when assembling arm 'adr' pseudo
instructions. However, the upstream commit did not take big-endian arm
into account.

Applying the same changes to the big-endian handling is straightforward,
thanks to Andrew Turner and Peter Smith for the hint. This will also be
submitted upstream.

MFC after: immediately, since this fix is meant for stable/11

4 years agousbhid: add several missing usages from Digitizer page
avg [Wed, 6 May 2020 15:24:31 +0000 (15:24 +0000)]
usbhid: add several missing usages from Digitizer page

This is applicable to HID in general, not just USB HID.

Inspired by: wulf
MFC after: 1 week

4 years agoarm: Don't enable interrupts in init_secondary().
markj [Wed, 6 May 2020 15:10:05 +0000 (15:10 +0000)]
arm: Don't enable interrupts in init_secondary().

This has the same reasoning as described in r357048.

Remove a stray declaration while here.

Reported and tested by: trasz
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoSimplify arm64's pmap_bootstrap() a bit.
markj [Wed, 6 May 2020 15:01:06 +0000 (15:01 +0000)]
Simplify arm64's pmap_bootstrap() a bit.

locore constructs an L2 page mapping the kernel and preloaded data
starting a KERNBASE (the same as VM_MIN_KERNEL_ADDRESS on arm64).
initarm() and pmap_bootstrap() use the preloaded metadata to
tell it where it can start allocating from.

pmap_bootstrap() currently iterates over the L2 page to find the last
valid entry, but doesn't do anything with the result.  Remove the loop
and zap some now-unused local variables.

MFC after: 2 weeks
Sponsored by: Juniper Networks, Klara Inc.
Differential Revision: https://reviews.freebsd.org/D24559

4 years agoAdd basic routing LPM tests.
melifaro [Wed, 6 May 2020 07:48:37 +0000 (07:48 +0000)]
Add basic routing LPM tests.

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

4 years agoGNU as: print a deprecation warning on program start
emaste [Wed, 6 May 2020 01:08:19 +0000 (01:08 +0000)]
GNU as: print a deprecation warning on program start

GNU as 2.17.50 will be removed before FreeBSD 13.

4 years agoDelete unused function newnfs_trimleading.
rmacklem [Wed, 6 May 2020 00:44:03 +0000 (00:44 +0000)]
Delete unused function newnfs_trimleading.

The NFS function called newnfs_trimleading() has not been used by the
code in long time. To give you a clue, it still had a K&R style function
declaration.
Delete it, since it is just cruft, as a part of the NFS mbuf handling
cleanup in preparation for adding ext_pgs mbuf support.
The ext_pgs mbuf support for the build/send side is needed by
nfs-over-tls.

4 years agoelfctl: update earliest FreeBSD revision to 12.2
emaste [Tue, 5 May 2020 21:50:52 +0000 (21:50 +0000)]
elfctl: update earliest FreeBSD revision to 12.2

elfctl has been merged to stable/12, and so will appear in FreeBSD 12.2

Reported by: Dewayne Geraghty
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

4 years agoAvoid underflowing a variable, which would result in taking more
tuexen [Tue, 5 May 2020 19:54:30 +0000 (19:54 +0000)]
Avoid underflowing a variable, which would result in taking more
data from the stream queues then needed.

Thanks to Timo Voelker for finding this bug and providing a fix.

MFC after: 3 days

4 years agoAdd HISTORY sections to document when this
bcr [Tue, 5 May 2020 19:31:47 +0000 (19:31 +0000)]
Add HISTORY sections to document when this
functionality first appeared in FreeBSD.

Submitted by: Gordon Bergling gbergling_gmail.com
Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D24677

4 years agoFix broken links in the man page by pointing to a
bcr [Tue, 5 May 2020 19:00:26 +0000 (19:00 +0000)]
Fix broken links in the man page by pointing to a
source that works or is the new location on the
same page.

Submitted by:     alfix86_gmail.com
Approved by:     bcr
Differential Revision: https://reviews.freebsd.org/D23769

4 years agols(1): Fix trivial SEGV due to NULL deref in OOM path
cem [Tue, 5 May 2020 18:06:32 +0000 (18:06 +0000)]
ls(1): Fix trivial SEGV due to NULL deref in OOM path

Reported by: Anton Rang <rang AT acm.org>
Sponsored by: Dell EMC Isilon

4 years agostrdup.3: Slightly canonicalize OOM return/error status
cem [Tue, 5 May 2020 17:57:04 +0000 (17:57 +0000)]
strdup.3: Slightly canonicalize OOM return/error status

Attempted to clean up the language around "this is a malloc'd object."  May be
passed as a parameter to free(3) is a bit obtuse.

Sponsored by: Dell EMC Isilon

4 years agopwcache.3: Explicitly document OOM condition
cem [Tue, 5 May 2020 17:55:45 +0000 (17:55 +0000)]
pwcache.3: Explicitly document OOM condition

The pwcache functions allocate memory, and may return NULL pointers if that
allocation fails and the corresponding uid or gid was not found in the local
password database.  Document this behavior.

Sponsored by: Dell EMC Isilon

4 years agoFix the computation of the numbers of entries of the mapping array to
tuexen [Tue, 5 May 2020 17:52:44 +0000 (17:52 +0000)]
Fix the computation of the numbers of entries of the mapping array to
look at when generating a SACK. This was wrong in case of sequence
numbers wrap arounds.

Thanks to Gwenael FOURRE for reporting the issue for the userland stack:
https://github.com/sctplab/usrsctp/issues/462
MFC after: 3 days

4 years agoacpi_video: try our best to work on systems without non-essential methods
avg [Tue, 5 May 2020 12:14:11 +0000 (12:14 +0000)]
acpi_video: try our best to work on systems without non-essential methods

Only _BCL and _BCM methods seem to be essential to the driver's
operation.  If _BQC is missing then we can assume that the current
brightness is whatever we set by the last _BCM invocation.  If _DCS or
_DGS is missing the we can make assumptions as well.

The change is based on a patch suggested by Anthony Jenkins
<Scoobi_doo@yahoo.com> in PR 207086.

PR: 207086
Submitted by: Anthony Jenkins <Scoobi_doo@yahoo.com (earlier version)
Reviewed by: manu
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D24653

4 years agoFix the EFI_DEBUG case, prio_str is only used when EFI_DEBUG is unset.
andrew [Tue, 5 May 2020 10:01:10 +0000 (10:01 +0000)]
Fix the EFI_DEBUG case, prio_str is only used when EFI_DEBUG is unset.

Sponsored by: Innovate UK

4 years agoAs with r352446 align blocks in boot1.efi
andrew [Tue, 5 May 2020 09:42:26 +0000 (09:42 +0000)]
As with r352446 align blocks in boot1.efi

We need to ensure the buffers are aligned before passing them to ReadBlocks.
Assume 512 bytes is enough for now.

Reviewed by: imp
MFC after: 1 month
Sponsored by: Innovate UK

4 years agoRevert r360514, to avoid unnecessary churn of the sources.
rmacklem [Tue, 5 May 2020 00:58:03 +0000 (00:58 +0000)]
Revert r360514, to avoid unnecessary churn of the sources.

r360514 prepared the NFS code for changes to handle ext_pgs mbufs on
the receive side. However, at this time, KERN_TLS does not pass
ext_pgs mbufs up through soreceive(). As such, as this time, only
the send/build side of the NFS mbuf code needs to handle ext_pgs mbufs.
Revert r360514 since the rather extensive changes required for receive
side ext_pgs mbufs are not yet needed.
This avoids unnecessary churn of the sources.

4 years agoInitial support for bhyve save and restore.
jhb [Tue, 5 May 2020 00:02:04 +0000 (00:02 +0000)]
Initial support for bhyve save and restore.

Save and restore (also known as suspend and resume) permits a snapshot
to be taken of a guest's state that can later be resumed.  In the
current implementation, bhyve(8) creates a UNIX domain socket that is
used by bhyvectl(8) to send a request to save a snapshot (and
optionally exit after the snapshot has been taken).  A snapshot
currently consists of two files: the first holds a copy of guest RAM,
and the second file holds other guest state such as vCPU register
values and device model state.

To resume a guest, bhyve(8) must be started with a matching pair of
command line arguments to instantiate the same set of device models as
well as a pointer to the saved snapshot.

While the current implementation is useful for several uses cases, it
has a few limitations.  The file format for saving the guest state is
tied to the ABI of internal bhyve structures and is not
self-describing (in that it does not communicate the set of device
models present in the system).  In addition, the state saved for some
device models closely matches the internal data structures which might
prove a challenge for compatibility of snapshot files across a range
of bhyve versions.  The file format also does not currently support
versioning of individual chunks of state.  As a result, the current
file format is not a fixed binary format and future revisions to save
and restore will break binary compatiblity of snapshot files.  The
goal is to move to a more flexible format that adds versioning,
etc. and at that point to commit to providing a reasonable level of
compatibility.  As a result, the current implementation is not enabled
by default.  It can be enabled via the WITH_BHYVE_SNAPSHOT=yes option
for userland builds, and the kernel option BHYVE_SHAPSHOT.

Submitted by: Mihai Tiganus, Flavius Anton, Darius Mihai
Submitted by: Elena Mihailescu, Mihai Carabas, Sergiu Weisz
Relnotes: yes
Sponsored by: University Politehnica of Bucharest
Sponsored by: Matthew Grooms (student scholarships)
Sponsored by: iXsystems
Differential Revision: https://reviews.freebsd.org/D19495

4 years agoAdd net epoch support back, which was taken out by accident in
tuexen [Mon, 4 May 2020 23:05:11 +0000 (23:05 +0000)]
Add net epoch support back, which was taken out by accident in
https://svnweb.freebsd.org/changeset/base/360639

Reviewed by: rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D24694

4 years agoThis fixes two issues found by ankitraheja09@gmail.com
rrs [Mon, 4 May 2020 23:02:58 +0000 (23:02 +0000)]
This fixes two issues found by ankitraheja09@gmail.com
1) When BBR retransmits the syn it was messing up the snd_max
2) When we need to send a RST we might not send it when we should

Reported by: ankitraheja09@gmail.com
Sponsored by:  Netflix.com
Differential Revision: https://reviews.freebsd.org/D24693

4 years agoUse a lookup table of algorithm types for alg_is_* helpers.
jhb [Mon, 4 May 2020 22:31:38 +0000 (22:31 +0000)]
Use a lookup table of algorithm types for alg_is_* helpers.

This makes it easier to maintain these functions as algorithms are
added or removed.

Reviewed by: cem
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D24668

4 years agoEnter the net epoch before calling the output routine in TCP BBR.
tuexen [Mon, 4 May 2020 22:02:49 +0000 (22:02 +0000)]
Enter the net epoch before calling the output routine in TCP BBR.
This was only triggered when setting the IPPROTO_TCP level socket
option TCP_DELACK.
This issue was found by runnning an instance of SYZKALLER.
Reviewed by: rrs
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D24690

4 years agoThis commit brings things into sync with the advancements that
rrs [Mon, 4 May 2020 20:28:53 +0000 (20:28 +0000)]
This commit brings things into sync with the advancements that
have been made in rack and adds a few fixes in BBR. This also
removes any possibility of incorrectly doing OOB data the stacks
do not support it. Should fix the skyzaller crashes seen in the
past. Still to fix is the BBR issue just reported this weekend
with the SYN and on sending a RST. Note that this version of
rack can now do pacing as well.

Sponsored by:Netflix Inc
Differential Revision:https://reviews.freebsd.org/D24576

4 years agoAdjust the fb to have a way to ask the underlying stack
rrs [Mon, 4 May 2020 20:19:57 +0000 (20:19 +0000)]
Adjust the fb to have a way to ask the underlying stack
if it can support the PRUS option (OOB). And then have
the new function call that to validate and give the
correct error response if needed to the user (rack
and bbr do not support obsoleted OOB data).

Sponsoered by: Netflix Inc.
Differential Revision:  https://reviews.freebsd.org/D24574

4 years agoSet LG_VADDR to 48 on RISC-V.
brooks [Mon, 4 May 2020 17:16:30 +0000 (17:16 +0000)]
Set LG_VADDR to 48 on RISC-V.

The Sv48 PTE format is the largest currently defined address space for
RISC-V. It makes no sense to define a larger size and doing so (at
least for 64-bits) forces rtrees down a slow path.

Reviewed by: vangyzen, jhb, mhorne
Obtained from: CheriBSD
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D24658

4 years agoAdd RFC reference for AES-CTR with IPsec.
jhb [Mon, 4 May 2020 16:50:01 +0000 (16:50 +0000)]
Add RFC reference for AES-CTR with IPsec.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 years agoSwitch DDB show route to direct rnh_matchaddr() call instead of rtalloc1().
melifaro [Mon, 4 May 2020 15:07:57 +0000 (15:07 +0000)]
Switch DDB show route to direct rnh_matchaddr() call instead of rtalloc1().

Eliminate the last rtalloc1() call to finish transition to the new routing
KPI defined in r359823.

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

4 years agoSimplify address parsing in DDB show route command.
melifaro [Mon, 4 May 2020 15:00:19 +0000 (15:00 +0000)]
Simplify address parsing in DDB show route command.

Use db_get_line() to overcome parser limitation.

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

4 years agoRemove now-unused rt_ifp,rt_ifa,rt_gateway,rt_mtu rte fields.
melifaro [Mon, 4 May 2020 14:31:45 +0000 (14:31 +0000)]
Remove now-unused rt_ifp,rt_ifa,rt_gateway,rt_mtu rte fields.

After converting routing subsystem customers to use nexthop objects
 defined in r359823, some fields in struct rtentry became unused.

This commit removes rt_ifp, rt_ifa, rt_gateway and rt_mtu from struct rtentry
 along with the code initializing and updating these fields.

Cleanup of the remaining fields will be addressed by D24669.

This commit also changes the implementation of the RTM_CHANGE handling.
Old implementation tried to perform the whole operation under radix WLOCK,
 resulting in slow performance and hacks like using RTF_RNH_LOCKED flag.
New implementation looks up the route nexthop under radix RLOCK, creates new
 nexthop and tries to update rte nhop pointer. Only last part is done under
 WLOCK.
In the hypothetical scenarious where multiple rtsock clients
 repeatedly issue RTM_CHANGE requests for the same route, route may get
 updated between read and update operation. This is addressed by retrying
 the operation multiple (3) times before returning failure back to the
 caller.

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

4 years agoRevert r360204, sys.netipsec.tunnel.empty.v{4,6} are fixed by r360560
lwhsu [Mon, 4 May 2020 11:23:55 +0000 (11:23 +0000)]
Revert r360204, sys.netipsec.tunnel.empty.v{4,6} are fixed by r360560

PR: 245832
Sponsored by: The FreeBSD Foundation

4 years ago[evdev] Sync event codes with Linux kernel 5.6
wulf [Mon, 4 May 2020 11:00:24 +0000 (11:00 +0000)]
[evdev] Sync event codes with Linux kernel 5.6

MFC after: 2 weeks

4 years ago[evdev] Add AT translated set1 scancodes for F-unlocked F1-12 keys.
wulf [Mon, 4 May 2020 10:59:17 +0000 (10:59 +0000)]
[evdev] Add AT translated set1 scancodes for F-unlocked F1-12 keys.

"F lock" is a switch between two sets of scancodes for function keys F1-F12
found on some Logitech and Microsoft PS/2 keyboards [1]. When "F lock" is
pressed, then F1-F12 act as function keys and produce usual keyscans for
these keys. When "F lock" is depressed, F1-F12 produced the same keyscans
but prefixed with E0.
Some laptops use [2] E0-prefixed F1-F12 scancodes for non-standard keys.

[1] https://www.win.tue.nl/~aeb/linux/kbd/scancodes-6.html
[2] https://reviews.freebsd.org/D21565

MFC after: 2 weeks

4 years agoOptimise use of sg_page_count() in __sg_page_iter_next() in the LinuxKPI.
hselasky [Mon, 4 May 2020 10:10:07 +0000 (10:10 +0000)]
Optimise use of sg_page_count() in __sg_page_iter_next() in the LinuxKPI.
No need to compute value twice.

No functional change intended.

MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoImplement more scatter and gather functions in the LinuxKPI.
hselasky [Mon, 4 May 2020 09:58:45 +0000 (09:58 +0000)]
Implement more scatter and gather functions in the LinuxKPI.

Differential Revision: https://reviews.freebsd.org/D24611
Submitted by: ashafer_badland.io (Austin Shafer)
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years agoFix warning about sleeping with non-sleepable lock when allocating
hselasky [Mon, 4 May 2020 08:05:01 +0000 (08:05 +0000)]
Fix warning about sleeping with non-sleepable lock when allocating
"current" from linux_cdev_pager_populate() in the LinuxKPI:

Backtrace:
witness_debugger()
witness_warn()
uma_zalloc_arg()
malloc()
linux_alloc_current()
linux_cdev_pager_populate()
vm_fault()
vm_fault_trap()
trap_pfault()
trap()
calltrap()

Suggested by: avg@
MFC after: 1 week
Sponsored by: Mellanox Technologies

4 years ago - Fix logic error in swapoff case: follow same handling of p and
delphij [Mon, 4 May 2020 05:49:11 +0000 (05:49 +0000)]
 - Fix logic error in swapoff case: follow same handling of p and
   linelen in the swapon case.
 - Use strlcpy instead of strncpy.

MFC after: 1 week

4 years agoFix intermittent cleanup failures in the ggated test
asomers [Sun, 3 May 2020 18:10:54 +0000 (18:10 +0000)]
Fix intermittent cleanup failures in the ggated test

MFC after: 2 weeks

4 years agoAdd session locking in cfiscsi_ioctl_handoff().
mav [Sun, 3 May 2020 16:14:55 +0000 (16:14 +0000)]
Add session locking in cfiscsi_ioctl_handoff().

While there, remove ifdef around cs_target check in cfiscsi_ioctl_list().
I am not sure why this ifdef was added, but without this check code will
crash below on NULL dereference.

Submitted by: Aleksandr Fedorov <aleksandr.fedorov@itglobal.com>
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24587

4 years agopf: Improve DIOCADDRULE validation
kp [Sun, 3 May 2020 16:09:35 +0000 (16:09 +0000)]
pf: Improve DIOCADDRULE validation

We expect the addrwrap.p.dyn value to be set to NULL (and assert such),
but do not verify it on input.

Reported-by: syzbot+936a89182e7d8f927de1@syzkaller.appspotmail.com
Reviewed by: melifaro (previous version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24538

4 years agoAdd references for the most important man7
bcr [Sun, 3 May 2020 10:35:36 +0000 (10:35 +0000)]
Add references for the most important man7
pages worth reading to intro(7).

Submitted by: Gordon Bergling gbergling_gmail.com
Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D24649

4 years agoFix various, mostly minor errors in man pages like:
bcr [Sun, 3 May 2020 10:15:58 +0000 (10:15 +0000)]
Fix various, mostly minor errors in man pages like:
- Abbreviated month name in .Dd
- position of HISTORY section
- alphabetical ordering within SEE ALSO section
- adding .Ed before .Sh DESCRIPTION
- remove trailing whitespaces
- Line break after a sentence stop
- Use BSD OS macros instead of hardcoded strings

No .Dd bumps as there was no actual content change made
in any of these pages.

Submitted by: Gordon Bergling gbergling_gmail.com
Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D24591

4 years agoAdd HISTORY sections to build(7), crypto(7),
bcr [Sun, 3 May 2020 09:54:19 +0000 (09:54 +0000)]
Add HISTORY sections to build(7), crypto(7),
ffs(7), growfs(7), and diskless(8).

Submitted by: Gordon Bergling gbergling_gmail.com
Approved by: bcr
Differential Revision: https://reviews.freebsd.org/D24271

4 years agoWe need to hold the periph lock when we release the ccb (and when we
imp [Sun, 3 May 2020 04:22:27 +0000 (04:22 +0000)]
We need to hold the periph lock when we release the ccb (and when we
run it). Make sure that we do. Simplify the flow a bit, and fix a
comment since we do need to do these things.

Noticed by: cperciva (not sure why my invariants kernel didn't trigger)

4 years agoipfw: whitespace fix in SCTP_ABORT_ASSOCIATION case statement comment
emaste [Sun, 3 May 2020 03:44:16 +0000 (03:44 +0000)]
ipfw: whitespace fix in SCTP_ABORT_ASSOCIATION case statement comment

Submitted by: Neel Chauhan <neel AT neelc DOT org>
Reviewed by: rgrimes, tuexen
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24602

4 years agoStep 4.2: start divorce of M_EXT and M_EXTPG
glebius [Sun, 3 May 2020 00:37:16 +0000 (00:37 +0000)]
Step 4.2: start divorce of M_EXT and M_EXTPG

They have more differencies than similarities. For now there is lots
of code that would check for M_EXT only and work correctly on M_EXTPG
buffers, so still carry M_EXT bit together with M_EXTPG. However,
prepare some code for explicit check for M_EXTPG.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoMechanically rename MBUF_EXT_PGS_ASSERT() to M_ASSERTEXTPG() to match
glebius [Sun, 3 May 2020 00:27:41 +0000 (00:27 +0000)]
Mechanically rename MBUF_EXT_PGS_ASSERT() to M_ASSERTEXTPG() to match
classical M_ASSERTPKTHDR.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 4.1: mechanically rename M_NOMAP to M_EXTPG
glebius [Sun, 3 May 2020 00:21:11 +0000 (00:21 +0000)]
Step 4.1: mechanically rename M_NOMAP to M_EXTPG

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 3: anonymize struct mbuf_ext_pgs and move all its fields into mbuf
glebius [Sun, 3 May 2020 00:12:56 +0000 (00:12 +0000)]
Step 3: anonymize struct mbuf_ext_pgs and move all its fields into mbuf
        within m_epg namespace.
All edits except the 'struct mbuf' declaration and mb_dupcl() were done
mechanically with sed:

s/->m_ext_pgs.nrdy/->m_epg_nrdy/g
s/->m_ext_pgs.hdr_len/->m_epg_hdrlen/g
s/->m_ext_pgs.trail_len/->m_epg_trllen/g
s/->m_ext_pgs.first_pg_off/->m_epg_1st_off/g
s/->m_ext_pgs.last_pg_len/->m_epg_last_len/g
s/->m_ext_pgs.flags/->m_epg_flags/g
s/->m_ext_pgs.record_type/->m_epg_record_type/g
s/->m_ext_pgs.enc_cnt/->m_epg_enc_cnt/g
s/->m_ext_pgs.tls/->m_epg_tls/g
s/->m_ext_pgs.so/->m_epg_so/g
s/->m_ext_pgs.seqno/->m_epg_seqno/g
s/->m_ext_pgs.stailq/->m_epg_stailq/g

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 2.5: Stop using 'struct mbuf_ext_pgs' in the kernel itself.
glebius [Sun, 3 May 2020 00:08:05 +0000 (00:08 +0000)]
Step 2.5: Stop using 'struct mbuf_ext_pgs' in the kernel itself.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoMake MBUF_EXT_PGS_ASSERT_SANITY() a macro, so that it prints file:line.
glebius [Sun, 3 May 2020 00:03:39 +0000 (00:03 +0000)]
Make MBUF_EXT_PGS_ASSERT_SANITY() a macro, so that it prints file:line.
While here, stop using struct mbuf_ext_pgs.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 2.4: Stop using 'struct mbuf_ext_pgs' in drivers.
glebius [Sat, 2 May 2020 23:58:20 +0000 (23:58 +0000)]
Step 2.4: Stop using 'struct mbuf_ext_pgs' in drivers.

Reviewed by: gallatin, hselasky
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 2.3: Rename mbuf_ext_pg_len() to m_epg_pagelen() that
glebius [Sat, 2 May 2020 23:52:35 +0000 (23:52 +0000)]
Step 2.3: Rename mbuf_ext_pg_len() to m_epg_pagelen() that
          uses mbuf argument.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 2.2:
glebius [Sat, 2 May 2020 23:46:29 +0000 (23:46 +0000)]
Step 2.2:
o Shrink sglist(9) functions to work with multipage mbufs down from
  four functions to two.
o Don't use 'struct mbuf_ext_pgs *' as argument, use struct mbuf.
o Rename to something matching _epg.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStep 2.1: Build TLS workqueue from mbufs, not struct mbuf_ext_pgs.
glebius [Sat, 2 May 2020 23:38:13 +0000 (23:38 +0000)]
Step 2.1: Build TLS workqueue from mbufs, not struct mbuf_ext_pgs.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoGet rid of the mbuf self-pointing pointer.
glebius [Sat, 2 May 2020 22:56:22 +0000 (22:56 +0000)]
Get rid of the mbuf self-pointing pointer.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoStart moving into EPG_/epg_ namespace. There is only one flag, but
glebius [Sat, 2 May 2020 22:49:14 +0000 (22:49 +0000)]
Start moving into EPG_/epg_ namespace.  There is only one flag, but
next commit brings in second flag, so let them already be in the
future namespace.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoIn mb_unmapped_compress() we don't need mbuf structure to keep data,
glebius [Sat, 2 May 2020 22:44:23 +0000 (22:44 +0000)]
In mb_unmapped_compress() we don't need mbuf structure to keep data,
but we need buffer of MLEN bytes.  This isn't just a simplification,
but important fixup, because previous commit shrinked sizeof(struct
mbuf) down below MSIZE, and instantiating an mbuf on stack no longer
provides enough data.

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoContinuation of multi page mbuf redesign from r359919.
glebius [Sat, 2 May 2020 22:39:26 +0000 (22:39 +0000)]
Continuation of multi page mbuf redesign from r359919.

The following series of patches addresses three things:

Now that array of pages is embedded into mbuf, we no longer need
separate structure to pass around, so struct mbuf_ext_pgs is an
artifact of the first implementation. And struct mbuf_ext_pgs_data
is a crutch to accomodate the main idea r359919 with minimal churn.

Also, M_EXT of type EXT_PGS are just a synonym of M_NOMAP.

The namespace for the newfeature is somewhat inconsistent and
sometimes has a lengthy prefixes. In these patches we will
gradually bring the namespace to "m_epg" prefix for all mbuf
fields and most functions.

Step 1 of 4:

 o Anonymize mbuf_ext_pgs_data, embed in m_ext
 o Embed mbuf_ext_pgs
 o Start documenting all this entanglement

Reviewed by: gallatin
Differential Revision: https://reviews.freebsd.org/D24598

4 years agoFix various Coverity-detected errors in nvme driver
dab [Sat, 2 May 2020 20:47:58 +0000 (20:47 +0000)]
Fix various Coverity-detected errors in nvme driver

This fixes several Coverity-detected errors in the nvme driver.

CIDs addressed: 100834410093771009380119374013054701403975,
1403980

Reviewed by: imp@, vangyzen@
MFC after: 5 days
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D24532

4 years agoResolve conflict between the fusefs(5) and mac_bsdextended(4) tests
asomers [Sat, 2 May 2020 20:14:59 +0000 (20:14 +0000)]
Resolve conflict between the fusefs(5) and mac_bsdextended(4) tests

mac_bsdextended(4), when enabled, causes ordinary operations to send many
more VOP_GETATTRs to file system. The fusefs tests expectations aren't
written with those in mind. Optionally expecting them would greatly
obfuscate the fusefs tests. Worse, certain fusefs functionality (like
attribute caching) would be impossible to test if the tests couldn't expect
an exact number of GETATTR operations.

This commit resolves that conflict by making two changes:

1. The fusefs tests will now check for mac_bsdextended, and skip if it's
   enabled.
2. The mac_bsdextended tests will now check whether the module is enabled, not
   merely loaded. If it's loaded but disabled, the tests will automatically
   enable it for the duration of the tests.

With these changes, a CI system can achieve best coverage by loading both
fusefs and mac_bsdextended at boot, and setting
security.mac.bsdextended.enabled=0

PR: 244229
Reported by: lwhsu
Reviewed by: cem
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D24577

4 years agokern_exec.c: Produce valid code ifndef SYS_PROTO_H
cem [Sat, 2 May 2020 18:54:25 +0000 (18:54 +0000)]
kern_exec.c: Produce valid code ifndef SYS_PROTO_H

Reported by: Coccinelle

4 years agoActually remove support for Triple DES, not just the warning.
jhb [Sat, 2 May 2020 17:18:32 +0000 (17:18 +0000)]
Actually remove support for Triple DES, not just the warning.

Missed in r360562.

4 years agoCleanup LUN addition/removal.
mav [Sat, 2 May 2020 16:54:59 +0000 (16:54 +0000)]
Cleanup LUN addition/removal.

 - Make ctl_add_lun() synchronous.  Asynchronous addition was used by
Copan's proprietary code long ago and never for upstream FreeBSD.
 - Move LUN enable/disable calls from backends to CTL core.
 - Serialize LUN modification and partially removal to avoid double frees.
 - Slightly unify backends code.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

4 years agoDocument removal of deprecated algorithms from /dev/crypto.
jhb [Sat, 2 May 2020 14:23:55 +0000 (14:23 +0000)]
Document removal of deprecated algorithms from /dev/crypto.