]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agocapsicum: Limit socket operations in capability mode
Mark Johnston [Wed, 7 Apr 2021 18:19:52 +0000 (14:19 -0400)]
capsicum: Limit socket operations in capability mode

Capsicum did not prevent certain privileged networking operations,
specifically creation of raw sockets and network configuration ioctls.
However, these facilities can be used to circumvent some of the
restrictions that capability mode is supposed to enforce.

Add capability mode checks to disallow network configuration ioctls and
creation of sockets other than PF_LOCAL and SOCK_DGRAM/STREAM/SEQPACKET
internet sockets.

Reviewed by: oshogbo
Discussed with: emaste
Reported by: manu
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29423

3 years agouefisign: handle empty sections
Eric van Gyzen [Tue, 6 Apr 2021 14:42:20 +0000 (09:42 -0500)]
uefisign: handle empty sections

loader.efi has an empty set_Xfic section.  Handle it correctly.

```
Sections:
Idx Name          Size      VMA               LMA               File off  Algn
[...]
3 set_Xcom      00000168  00000000000d4000  00000000000d4000  000d0e00  2**2
      CONTENTS, ALLOC, LOAD, DATA
4 set_Xfic      00000000  00000000000d4168  00000000000d4168  00000000  2**2
      ALLOC, LOAD, DATA
5 .sdata        00000448  00000000000d5000  00000000000d5000  000d1000  2**2
      CONTENTS, ALLOC, LOAD, DATA
[...]
```

Reviewed by: trasz, dab
Reported by: andy.y.liu@dell.com
Tested by: andy.y.liu@dell.com
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D29606

3 years agoipfw: update man page example for nat show log
Roman Bogorodskiy [Wed, 7 Apr 2021 15:37:46 +0000 (15:37 +0000)]
ipfw: update man page example for nat show log

In d6164b77f8b779cd7357387dcfcd3407f1457579 the ability to show
ranges of nat log entries was removed.

PR: 254192
Reviewed by: allanjude

3 years agopf tests: Test multi-wan rdr
Kristof Provost [Tue, 6 Apr 2021 11:25:49 +0000 (13:25 +0200)]
pf tests: Test multi-wan rdr

This replicates an issue observed on pfSense: https://redmine.pfsense.org/issues/11436

In essence, reply-to is needed to ensure that connections always leave
the WAN interface they came in on, but this confused the state tracking.

MFC after: 2 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agopf: Do not short-circuit processing for REPLY_TO
Kristof Provost [Wed, 7 Apr 2021 13:46:44 +0000 (15:46 +0200)]
pf: Do not short-circuit processing for REPLY_TO

When we find a state for packets that was created by a reply-to rule we
still need to process the packet. The state may require us to modify the
packet (e.g. in rdr or nat cases), which we won't do with the shortcut.

MFC after: 2 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

3 years agolibnv: Allow use in non-sleepable contexts
Kristof Provost [Thu, 25 Mar 2021 12:59:14 +0000 (13:59 +0100)]
libnv: Allow use in non-sleepable contexts

44c125c4cebc2fd87c6260b90eddae11201f5232 switched the nvlist allocations
to be M_WAITOK, but this precludes the use in non-sleepable contexts.
(E.g. with a nonsleepable lock held).

All callers for these allocation functions already cope with memory
alloation failures, so there's no reason to allow sleeping during
allocations.

Reviewed by: melifaro, oshogbo
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29556

3 years agopf tests: make synproxy and nat work correctly even if inetd is running
Kurosawa Takahiro [Wed, 7 Apr 2021 06:17:51 +0000 (08:17 +0200)]
pf tests: make synproxy and nat work correctly even if inetd is running

tests/sys/netfil/pf/synproxy fails if inetd has been running
outside of the jail because pidfile_open() fails with EEXIST.
tests/sys/netfil/pf/nat has the same problem but the test succeeds
because whether inetd is running is not so important.

Fix the problem by changing the pidfile path from the default
location.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29622

3 years agoDocument vnode_pager_setsize(9)
Ka Ho Ng [Wed, 7 Apr 2021 11:00:31 +0000 (19:00 +0800)]
Document vnode_pager_setsize(9)

MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Reviewed by: bcr
Approved by: philip (mentor)
Differential Revision: https://reviews.freebsd.org/D29408

3 years agolibarchive: Make test_read_append_filter_wrong_program pass again
Alex Richardson [Wed, 7 Apr 2021 10:35:10 +0000 (11:35 +0100)]
libarchive: Make test_read_append_filter_wrong_program pass again

libarchive: Apply upstream commit a1b7bf8013fb7a11a486794247daae592db6f5ae

This fixes the failing test_read_append_filter_wrong_program test in CI
which has been failing since 01-Dec-2020.

Commit message from https://github.com/libarchive/libarchive/commit/a1b7bf8013fb7a11a486794247daae592db6f5ae

    Silence stderr in test_read_append_filter_program

    When the FreeBSD testsuite runs the libarchive tests it checks that stderr
    is empty. Since #1382 this is no longer the case. This change restores
    the behaviour of silencing bunzip2 stderr but doesn't bring back the
    output text check.

    Partially reverts 2e7aa5d9

MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29036

3 years agotests/sys/net/routing: XFAIL the two failing tests
Alex Richardson [Wed, 7 Apr 2021 09:33:21 +0000 (10:33 +0100)]
tests/sys/net/routing: XFAIL the two failing tests

They have been failing for 1.5 months and the patch to fix them is stuck
in review so mark them as XFAIL for now to get Jenkins back to green.

To be reverted when https://reviews.freebsd.org/D28886 (or similar) is
commited.

Reviewed By: kp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D29528

3 years agoadd Xr to the rc.d script...
John-Mark Gurney [Tue, 6 Apr 2021 23:32:57 +0000 (16:32 -0700)]
add Xr to the rc.d script...

3 years agoIntroduce "soft" serseq variant.
Alexander Motin [Tue, 6 Apr 2021 21:27:16 +0000 (17:27 -0400)]
Introduce "soft" serseq variant.

With new ZFS prefetcher improvements it is no longer needed to fully
serialize reads to reach decent prediction hit rate.  Softer variant
only creates small time window to reduce races instead of completely
blocking following reads while previous is running.  It much less
hurts the performance in case of prediction miss.

MFC after: 1 month

3 years agocache: update an assert on CACHE_FPL_STATUS_ABORTED
Mateusz Guzik [Tue, 6 Apr 2021 20:31:48 +0000 (22:31 +0200)]
cache: update an assert on CACHE_FPL_STATUS_ABORTED

Since symlink support it can get upgraded to CACHE_FPL_STATUS_DESTROYED.

Reported by: bdrewery

3 years agoports(7): update instructions for git
Rene Ladan [Tue, 6 Apr 2021 20:24:12 +0000 (22:24 +0200)]
ports(7): update instructions for git

Reviewed by: gjb, imp, lwhsu, mat
Differential Revision: https://reviews.freebsd.org/D29502

3 years agomount: Disallow mounting over a jail root
Mark Johnston [Mon, 5 Apr 2021 21:19:15 +0000 (17:19 -0400)]
mount: Disallow mounting over a jail root

Discussed with: jamie
Approved by: so
Security: CVE-2020-25584
Security: FreeBSD-SA-21:10.jail_mount

3 years agovm_fault: Shoot down multiply mapped COW source page mappings
Mark Johnston [Mon, 15 Mar 2021 20:02:17 +0000 (16:02 -0400)]
vm_fault: Shoot down multiply mapped COW source page mappings

Reviewed by: kib, rlibby
Discussed with: alc
Approved by: so
Security: CVE-2021-29626
Security: FreeBSD-SA-21:08.vm

3 years agoAllocate extra inodes in makefs when leaving free space in UFS images.
Nathan Whitehorn [Tue, 6 Apr 2021 17:43:29 +0000 (13:43 -0400)]
Allocate extra inodes in makefs when leaving free space in UFS images.

By default, makefs(8) has very few spare inodes in its output images,
which is fine for static filesystems, but not so great for VM images
where many more files will be added. Make makefs(8) use the same
default settings as newfs(8) when creating images with free space --
there isn't much point to leaving free space on the image if you
can't put files there. If no free space is requested, use current
behavior of a minimal number of available inodes.

Reviewed by: manu
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D29492

3 years agouefisign: fix handling of errors from child proc
Eric van Gyzen [Tue, 6 Apr 2021 14:36:52 +0000 (09:36 -0500)]
uefisign: fix handling of errors from child proc

Close the unused pipe file descriptors so the parent will notice if
the child exits prematurely.  Previously, the parent would block
forever on a read from the pipe.

    $ uefisign -c foo.cert -k foo.key -o loader.efi loader.efi.unsigned
    uefisign: section points inside the headers
    load: 0.06  cmd: uefisign 4502 [piperd] 7.25r 0.00u 0.00s 0% 5968k
    ... _sleep+0x1be pipe_read+0x3d6 kern_readv+0x8c sys_read+0x83 ...

Reviewed by: trasz
MFC after: 1 week
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D29605

3 years agopci_user: fix build for 32-bit platforms
Marcin Wojtas [Tue, 6 Apr 2021 16:50:36 +0000 (18:50 +0200)]
pci_user: fix build for 32-bit platforms

Commit: f2f1ab39c040 ("pci_user: call bus_translate_resource before BAR mmap")
broke build for 32-bit platforms due to rman_res_t and vm_paddr_t
incompatible types. Fix that.

3 years agopci_user: call bus_translate_resource before BAR mmap
Marcin Wojtas [Tue, 6 Apr 2021 15:10:04 +0000 (17:10 +0200)]
pci_user: call bus_translate_resource before BAR mmap

On some armv8 machines it is possible that the mapping between CPU
and PCI bus BAR base addresses is not 1:1. In case a BAR is allocated
in kernel using bus_alloc_resource_any this translation is handled in
ofw_pci_activate_resource.

Do the same in pci_user.c by calling bus_translate_resource devmethod.
This fixes mmaping BARs to userspace on Marvell SoCs (Armada 7k8k/CN913x)
and possibly many other platforms.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: kib
Obtained from: Semihalf
Sponsored by: Marvell
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D29604

3 years agopciconf: Use VM_MEMATTR_DEVICE on supported architectures
Marcin Wojtas [Tue, 6 Apr 2021 15:00:05 +0000 (17:00 +0200)]
pciconf: Use VM_MEMATTR_DEVICE on supported architectures

Some architectures - armv7, armv8 and riscv use VM_MEMATTR_DEVICE
when mapping device registers in kernel. Do the same in pciconf.
On armada8k SoC all reads from BARs mapped with hitherto attribute
(VM_MEMATTR_UNCACHEABLE) return 0xff's.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Reviewed by: kib
Obtained from: Semihalf
Sponsored by: Marvell
Differential revision: https://reviews.freebsd.org/D29603

3 years agopci_dw: fix outbound I/O window configuration
Marcin Wojtas [Tue, 6 Apr 2021 12:31:39 +0000 (14:31 +0200)]
pci_dw: fix outbound I/O window configuration

Use viewport "2" instead of "0" and change window type from MEM to IO.
Without these changes the MEM ATU window can be overwritten with the IO one.

Submitted by: Kornel Duleba <mindal@semihalf.com>
Obtained from: Semihalf
Sponsored by: Marvell
Differential revision: https://reviews.freebsd.org/D29516

3 years agopowerpc64: add missing TLB invalidations to radix
Leandro Lupori [Tue, 6 Apr 2021 11:31:44 +0000 (08:31 -0300)]
powerpc64: add missing TLB invalidations to radix

Radix MMU code was missing TLB invalidations when some Level 3 PDEs were
modified. This caused TLB multi-hit machine check interrupts when
superpages were enabled.

Reviewed by: jhibbits
MFC after: 2 weeks
Sponsored by: Eldorado Research Institute (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D29511

3 years agoAdd Siemens SITOP UPS500S usb device
Poul-Henning Kamp [Tue, 6 Apr 2021 10:56:27 +0000 (10:56 +0000)]
Add Siemens SITOP UPS500S usb device

3 years ago[bc] Update to version 4.0.0
Stefan Eßer [Tue, 6 Apr 2021 09:57:07 +0000 (11:57 +0200)]
[bc] Update to version 4.0.0

This version fixes an issue (missing pop of top-of-stack value in the
"P" command of the dc program).

This issue did not affect the bc program, since it does not use dc as
an back-end to actually perform the calculations as was the case with
the traditional bc and dc programs.

The major number has been bumped due to Windows support that has been
added to this version. It does not correspond to a major change that
might affect FreeBSD.

MFC after:   3 days

3 years agoMerge commit '7a590c074ceede12b2b6e794f8703d6fa5749918'
Stefan Eßer [Tue, 6 Apr 2021 08:48:09 +0000 (10:48 +0200)]
Merge commit '7a590c074ceede12b2b6e794f8703d6fa5749918'

Update to version 4.0.0

This version fixes an issue (missing pop of top-of-stack value in the
"P" command of the dc program).

This issue did not affect the bc program, since it does not use dc as
an back-end to actually perform the calculations as was the case with
the traditional bc and dc programs.

The major number has been bumped due to Windows support that has been
added to this version. It does not correspond to a major change that
might affect FreeBSD.

3 years agoVendor import of Gavin D. Howard's bc version 4.0.0
Stefan Eßer [Tue, 6 Apr 2021 08:44:52 +0000 (10:44 +0200)]
Vendor import of Gavin D. Howard's bc version 4.0.0

3 years agogptboot.efi: Add man page
Warner Losh [Tue, 6 Apr 2021 05:55:08 +0000 (23:55 -0600)]
gptboot.efi: Add man page

Add a man page for gptboot.efi. Describe when and how to use this as it differs
from the BIOS cases. Include cross reference for the preferred method described
in efibootmgr(8) as well as cross links in both gptboot(8) and gptboot.efi(8) to
the other.

This man page was heavily copied from the gptboot.8 man page by Warren Block.
They are different enough to need separate man pages for clarity, but there's
enough similarity that I worry about the duplication. In the really long term,
gptboot(8) will disappear, so having the same info here will help when that
day comes. In the short to medium term, the information is likely to not
change in gptboot(8) and any changes to gptboot.efi(8) will be easier to
make in a separate copy.

loader.efi(8) needs a complete rewrite from scratch, otherwise I'd have
referenced gptboot.efi(8) from there.

Suggetions from: cress@, mhorne@
Reviewed by: rpokala@
Differential Revision: https://reviews.freebsd.org/D29591

3 years agobsdinstall: remove ftp7.ua.freebsd.org mirror
Philip Paeps [Tue, 6 Apr 2021 02:32:52 +0000 (10:32 +0800)]
bsdinstall: remove ftp7.ua.freebsd.org mirror

PR: 254779
Reported by: Dmytro <dima@dima.rv.ua>

3 years agobsdconfig: remove ftp7.ua.freebsd.org mirror
Philip Paeps [Tue, 6 Apr 2021 02:32:23 +0000 (10:32 +0800)]
bsdconfig: remove ftp7.ua.freebsd.org mirror

PR: 254779
Reported by: Dmytro <dima@dima.rv.ua>

3 years agolinuxkpi: remove erronously committed diff save file
Konstantin Belousov [Tue, 6 Apr 2021 00:42:13 +0000 (03:42 +0300)]
linuxkpi: remove erronously committed diff save file

Sponsored by: Mellanox Technologies/NVidia Networking
MFC after: 1 week

3 years agolinuxkpi: drop single-use variable
Konstantin Belousov [Tue, 30 Mar 2021 08:46:42 +0000 (11:46 +0300)]
linuxkpi: drop single-use variable

Reviewed by: hselasky
Sponsored by: Mellanox Technologies/NVidia Networking
MFC after: 1 week

3 years agolinuxkpi: avoid counting per-thread use for the embedded linux cdevs
Konstantin Belousov [Tue, 30 Mar 2021 08:45:24 +0000 (11:45 +0300)]
linuxkpi: avoid counting per-thread use for the embedded linux cdevs

The counter is not used to control destroy.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies/NVidia Networking
MFC after: 1 week

3 years agolinuxkpi: do not destroy/free embedded linux cdevs
Konstantin Belousov [Tue, 30 Mar 2021 08:44:19 +0000 (11:44 +0300)]
linuxkpi: do not destroy/free embedded linux cdevs

They have their own lifetime managed by the containing objects.
Premature and unexpected free causes corruption.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies/NVidia Networking
MFC after: 1 week

3 years agolinuxkpi: rename cdev to ldev
Konstantin Belousov [Tue, 30 Mar 2021 08:43:21 +0000 (11:43 +0300)]
linuxkpi: rename cdev to ldev

the variables hold pointers to a linux_cdev, not to a FreeBSD cdev.

Reviewed by: hselasky
Sponsored by: Mellanox Technologies/NVidia Networking
MFC after: 1 week

3 years agolinuxkpi: copy ldev into local to test and free the same pointer
Konstantin Belousov [Tue, 30 Mar 2021 08:41:00 +0000 (11:41 +0300)]
linuxkpi: copy ldev into local to test and free the same pointer

Reviewed by: hselasky
Sponsored by: Mellanox Technologies/NVidia Networking
MFC after: 1 week

3 years agortld dl_iterate_phdr(): dlpi_tls_data is wrong
Konstantin Belousov [Mon, 5 Apr 2021 03:05:44 +0000 (06:05 +0300)]
rtld dl_iterate_phdr(): dlpi_tls_data is wrong

dl_iterate_phdr() dlpi_tls_data should provide the TLS module segment
address, and not the TLS init segment address as it does now.

Reported by: emacsray@gmail.com
PR: 254774
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 years agoqat: Make prototypes consistent with the implementation
Mark Johnston [Mon, 5 Apr 2021 20:23:22 +0000 (16:23 -0400)]
qat: Make prototypes consistent with the implementation

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 years agolibc: Fix the WITH_HESIOD build
Mark Johnston [Mon, 5 Apr 2021 20:23:18 +0000 (16:23 -0400)]
libc: Fix the WITH_HESIOD build

Reported by: Daniel Braniss <danny@cs.huji.ac.il>
MFC after: 1 week

3 years agoixl(4): Add tunable to override Flow Control settings
Krzysztof Galazka [Mon, 5 Apr 2021 18:08:33 +0000 (11:08 -0700)]
ixl(4): Add tunable to override Flow Control settings

Add flow_control to hw.ixl tunables tree to let override
initial flow control configuration for all interfaces.
Keep using configuration set by NVM by default.

Reviewed by: erj@, gallatin@
Tested by: gowtham.kumar.ks_intel.com
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D29338

3 years agofreebsd-update: improve mandoc db generation
Ed Maste [Sun, 4 Apr 2021 00:57:26 +0000 (20:57 -0400)]
freebsd-update: improve mandoc db generation

freebsd-update compares the dates on man pages with mandoc.db, and if
any newer pages are found it regenerates mandoc.db.

Previously, if mandoc.db did not already exist the check failed and
freebsd-update then failed to create one.  Now, check that mandoc.db
exists before performing the check for newer pages.

Reported by: bdrewery (in D10482)
Reviewed by: gordon
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29575

3 years agorelease: move installworld before installkernel
Ed Maste [Mon, 5 Apr 2021 17:16:01 +0000 (13:16 -0400)]
release: move installworld before installkernel

To support -DNO_ROOT work.  The top-level installworld target creates a
new METALOG starting with `#mtree 2.0` so it needs to be first, to avoid
overwriting installkernel METALOG entries.

Reviewed by: gjb
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29582

3 years agopowerpc: Fix programmer's switch driver and add to GENERIC
Brandon Bergren [Mon, 5 Apr 2021 17:04:12 +0000 (12:04 -0500)]
powerpc: Fix programmer's switch driver and add to GENERIC

Older G4 and G3 models have a programmer's switch that can be used to
generate an interrupt to drop into the debugger.

This code hadn't been tested for a long time. It had been broken back
in 2005 in r153050.

Repair and modernize the code and add it to GENERIC.

Reviewed by: jhibbits (approved w/ removal of unused sc_dev var)
Sponsored by: Tag1 Consulting, Inc.
Differential Revision: https://reviews.freebsd.org/D29131

3 years agowait for device mounts in zpool and dumpon
Chuck Tuffli [Fri, 5 Mar 2021 16:13:23 +0000 (08:13 -0800)]
wait for device mounts in zpool and dumpon

If the root file system is composed from multiple devices, wait for
devices to be ready before running zpool and dumpon rc scripts.

An example of this is if the bulk of the root file system exists on a
fast device (e.g. NVMe) but the /var directory comes from a ZFS dataset
on a slower device (e.g. SATA). In this case, it is possible that the
zpool import may run before the slower device has finished being probed,
leaving the system in an intermediate state.

Fix is to add root_hold_wait to the zpool and dumpon (which has a
similar issue) rc scripts.

PR: 242189
Reported by: osidorkin@gmail.com
Reviewed by: allanjude
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D29101

3 years agorc: make ctld depend on NETWORKING
Edward Tomasz Napierala [Mon, 5 Apr 2021 15:40:49 +0000 (16:40 +0100)]
rc: make ctld depend on NETWORKING

This fixes a problem where ctld(8) would refuse to start on boot
with a specific IP address to listen on configured in ctl.conf(5).
It also fixes a problem where ctld(8) would fail to start with
some network interfaces which require a sysctl.conf(5) tweak
to configure them, eg to switch them from InfiniBand to IP mode.

PR: 232397
Reported By: Mahmoud Al-Qudsi <mqudsi at neosmart.net>
Submitted By: Jeremy Faulkner <gldisater at gmail.com>
Reviewed By: mav
Differential Revision: https://reviews.freebsd.org/D29578

3 years agoMerge the QorIQ GPIO drivers between arm and powerpc
Justin Hibbits [Mon, 5 Apr 2021 15:35:15 +0000 (10:35 -0500)]
Merge the QorIQ GPIO drivers between arm and powerpc

Summary:
They're nearly identical, so don't use two copies.  Merge the newer
driver into the older one, and move it to a common location.

Add the Semihalf and associated copyrights in addition to mine, since
it's a non-trivial amount of code merged.

Reviewed By: mw
Differential Revision: https://reviews.freebsd.org/D29520

3 years agoSet PCIe device's Max_Payload_Size to match PCIe root's.
Alexander Motin [Mon, 5 Apr 2021 14:34:40 +0000 (10:34 -0400)]
Set PCIe device's Max_Payload_Size to match PCIe root's.

Usually on boot the MPS is already configured by BIOS.  But we've
found that on hot-plug it is not true at least for our Supermicro
X11 boards.  As result, mismatch between root's configuration of
256 bytes and device's default of 128 bytes cause problems for some
devices, while others seem to work fine.

MFC after: 1 month
Sponsored by: iXsystems, Inc.

3 years agoTweak language involving ZFS installation; no content changes.
Nathan Whitehorn [Mon, 5 Apr 2021 14:23:00 +0000 (10:23 -0400)]
Tweak language involving ZFS installation; no content changes.

3 years agoAdd some general notes about scripted installations.
Nathan Whitehorn [Mon, 5 Apr 2021 14:10:34 +0000 (10:10 -0400)]
Add some general notes about scripted installations.

3 years agopf: Add static DTrace probe points
Kristof Provost [Fri, 2 Apr 2021 13:53:34 +0000 (15:53 +0200)]
pf: Add static DTrace probe points

These two have proven to be useful during debugging. We may as well keep
them permanently.
Others will be added as their utility becomes clear.

Reviewed by: gnn
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29555

3 years agopf: change pf_route so pf only runs when packets enter and leave the stack.
Kristof Provost [Fri, 2 Apr 2021 10:23:42 +0000 (12:23 +0200)]
pf: change pf_route so pf only runs when packets enter and leave the stack.

before this change pf_route operated on the semantic that pf runs
when packets go over an interface, so when pf_route changed which
interface the packet was on it would run pf_test again. this change
changes (restores) the semantic that pf is only supposed to run
when packets go in or out of the network stack, even if route-to
is responsibly for short circuiting past the network stack.

just to be clear, for normal packets (ie, those not touched by
route-to/reply-to/dup-to), there isn't a difference between running
pf when packets enter or leave the stack, or having pf run when a
packet goes over an interface.

the main reason for this change is that running the same packet
through pf multiple times creates confusion for the state table.
by default, pf states are floating, meaning that packets are matched
to states regardless of which interface they're going over. if a
packet leaving on em0 is rerouted out em1, both traversals will end
up using the same state, which at best will make the accounting
look weird, or at worst fail some checks in the state and get
dropped.

another reason for this commit is is to make handling of the changes
that route-to makes consistent with other changes that are made to
packet. eg, when nat is applied to a packet, we don't run pf_test
again with the new addresses.

the main caveat with this diff is you can't have one rule that
pushes a packet out a different interface, and then have a rule on
that second interface that NATs the packet. i'm not convinced this
ever worked reliably or was used much anyway, so we don't think
it's a big concern.

discussed with many, with special thanks to bluhm@, sashan@ and
sthen@ for weathering most of that pain.
ok claudio@ sashan@ jmatthew@

Obtained from: OpenBSD
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D29554

3 years agoiflib: add support for netmap offsets
Vincenzo Maffione [Mon, 5 Apr 2021 07:54:47 +0000 (07:54 +0000)]
iflib: add support for netmap offsets

Follow-up change to a6d768d845c173823785c71bb18b40074e7a8998.
This change adds iflib support for netmap offsets, enabling
applications to use offsets on any driver backed by iflib.

3 years agonfsd: make the server repeat CB_RECALL every couple of seconds
Rick Macklem [Mon, 5 Apr 2021 01:15:54 +0000 (18:15 -0700)]
nfsd: make the server repeat CB_RECALL every couple of seconds

Commit 01ae8969a9ee stopped the NFSv4.1/4.2 server from implicitly
binding the back channel to a new TCP connection so that it
conforms to RFC5661, for NFSv4.1/4.2. An effect of this
for the Linux NFS client is that it will do a
BindConnectionToSession when it sees NFSV4SEQ_CBPATHDOWN
set in a sequence reply. This will fix the back channel, but the
first attempt at a callback like CB_RECALL will already have
failed. Without this patch, a CB_RECALL will not be retried
and that can result in a 5 minute delay until the delegation
times out.

This patch modifies the code so that it will retry the
CB_RECALL every couple of seconds, often avoiding the
5 minute delay.

This is not critical for correct behaviour, but avoids
the 5 minute delay for the case where the Linux client
re-binds the back channel via BindConnectionToSession.

MFC after: 2 weeks

3 years agoreadelf: return error in case of invalid file
Ed Maste [Mon, 5 Apr 2021 01:01:28 +0000 (21:01 -0400)]
readelf: return error in case of invalid file

GNU readelf exits with an error for a number of invalid file cases.
Previously ELF Tool Chain readelf always exited with 0.  Now we exit 1
upon detecting an error with one or more input files, but in any case
all of them are processed.

This should catch common failure cases.  We still do not report an error
for some types of malformed ELF files, but this is consistent with GNU
readelf.

PR: 252727
Reviewed by: jkoshy, markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D29377

3 years agonfsd: fix BindConnectionToSession so that it clears "cb path down"
Rick Macklem [Sun, 4 Apr 2021 22:05:39 +0000 (15:05 -0700)]
nfsd: fix BindConnectionToSession so that it clears "cb path down"

Commit 01ae8969a9ee stopped the NFSv4.1/4.2 server from implicitly
binding the back channel to a new TCP connection so that it
conforms to RFC5661, for NFSv4.1/4.2. An effect of this
for the Linux NFS client is that it will do a
BindConnectionToSession when it sees NFSV4SEQ_CBPATHDOWN
set in a sequence reply. It will do this for every RPC
reply until it no longer sees the flag.
Without that patch, this will happen until the client does
an Open, which will clear LCL_CBDOWN.

This patch clears LCL_CBDOWN right away, so that
NFSV4SEQ_CBPATHDOWN will no longer be sent to the client
in Sequence replies and the Linux client will not repeat
the BindConnectionToSession RPCs.

This is not critical for correct behaviour, but reduces
RPC overheads for cases where the Open will not be done
for a while.

MFC after: 2 weeks

3 years agoamd64 fabs.S: use '.section .rodata' instead of '.rodata'
Konstantin Belousov [Sun, 4 Apr 2021 19:25:43 +0000 (22:25 +0300)]
amd64 fabs.S: use '.section .rodata' instead of '.rodata'

Seems to be an issue with older gnu as

Reported by: rscheff
Sponsored by: The FreeBSD Foundation
MFC after: 6 days

3 years agojail: fix jail(8) synposis and usage message to match reality.
Jamie Gritton [Sun, 4 Apr 2021 17:49:38 +0000 (10:49 -0700)]
jail: fix jail(8) synposis and usage message to match reality.

Reported by: yuri
PR: 254741
MFC after: 5 days

3 years agoAdd sysctl debug.uma_reclaim
Konstantin Belousov [Sun, 4 Apr 2021 16:28:14 +0000 (19:28 +0300)]
Add sysctl debug.uma_reclaim

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 years agoStyle
Konstantin Belousov [Sun, 4 Apr 2021 16:27:42 +0000 (19:27 +0300)]
Style

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

3 years agostress2: Added a new regression test
Peter Holm [Sun, 4 Apr 2021 08:36:09 +0000 (10:36 +0200)]
stress2: Added a new regression test

3 years agostress2: update the list of test not to run
Peter Holm [Sun, 4 Apr 2021 08:31:52 +0000 (10:31 +0200)]
stress2: update the list of test not to run

3 years agostress2: Add note about problems found.
Peter Holm [Sun, 4 Apr 2021 08:27:53 +0000 (10:27 +0200)]
stress2: Add note about problems found.

3 years agoloader: we should support pools without features
Toomas Soome [Fri, 2 Apr 2021 23:40:51 +0000 (02:40 +0300)]
loader: we should support pools without features

nvlist_check_features_for_read() does return error when there
are no features for read.

MFC after: 5 days

3 years agoamd64 fabs.S: put signbit into rodata instead of text
Konstantin Belousov [Sun, 4 Apr 2021 01:36:32 +0000 (04:36 +0300)]
amd64 fabs.S: put signbit into rodata instead of text

Noted by: jrtc27
MFC after: 1 week
Sponsored by: The FreeBSD Foundation

3 years agolibc/<arch>/sys/cerror.S: fix typo
Konstantin Belousov [Sat, 3 Apr 2021 01:36:41 +0000 (04:36 +0300)]
libc/<arch>/sys/cerror.S: fix typo

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

3 years agoamd64 fabs(3): move signbit to .text
Konstantin Belousov [Sat, 3 Apr 2021 01:32:10 +0000 (04:32 +0300)]
amd64 fabs(3): move signbit to .text

There is no reason for signbit quad to be writeable.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 years agoRemove kgmon(8)
Konstantin Belousov [Fri, 2 Apr 2021 22:00:20 +0000 (01:00 +0300)]
Remove kgmon(8)

Follow-up to the removal of the mcov from kernel.

Noted by: mckusick
Reviewed by: mckusick
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D29563

3 years agoffsinfo: Update example to avoid to-be-deprecated vinum
Ed Maste [Mon, 29 Mar 2021 00:04:29 +0000 (20:04 -0400)]
ffsinfo: Update example to avoid to-be-deprecated vinum

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

3 years agolibc: use standard LF line endings, not CRLF
Ed Maste [Wed, 31 Mar 2021 17:04:36 +0000 (13:04 -0400)]
libc: use standard LF line endings, not CRLF

3 years agolock_delay(9): improve interaction with restrict_starvation
Edward Tomasz Napierala [Sat, 3 Apr 2021 12:08:45 +0000 (13:08 +0100)]
lock_delay(9): improve interaction with restrict_starvation

After e7a5b3bd058, the la->delay value was adjusted after
being set by the starvation_limit code block, which is wrong.

Reported By: avg
Reviewed By: avg
Fixes: e7a5b3bd058
Sponsored By: NetApp, Inc.
Sponsored By: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D29513

3 years agopam: add option to not prompt for password if it's set to empty
Edward Tomasz Napierala [Sat, 3 Apr 2021 12:01:45 +0000 (13:01 +0100)]
pam: add option to not prompt for password if it's set to empty

Add a new option to pam_unix(8), "emptyok", which makes it not prompt
for password, if it's set to an empty one.  It is similar to "nullok",
which makes it not prompt for password if the hash itself is empty.

Reviewed By: markj
Sponsored By: NetApp, Inc.
Sponsored By: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D27569

3 years agoFix typo in xhci nvlist node name, and also increment device counter.
Peter Grehan [Sat, 3 Apr 2021 04:32:54 +0000 (14:32 +1000)]
Fix typo in xhci nvlist node name, and also increment device counter.

This allows the xhci tablet device to be recognized and a PCI device
instantiated.

Reviewed by: jhb
Fixes: 621b5090487d Refactor configuration management in bhyve.
MFC after: 3 months.

3 years agofbt: Remove some handling for multiple CTF containers
Mark Johnston [Fri, 2 Apr 2021 21:42:26 +0000 (17:42 -0400)]
fbt: Remove some handling for multiple CTF containers

This was ported from illumos but not completely done.  Currently we do
not perform type deduplication between KLDs and the kernel, i.e., kernel
modules have a complete type graph.  So, remove it for now since it's
not functional and complicates the task of modifying various CTF type
definitions, and we are hitting some limits in the current format which
necessitate an update.

No functional change intended.

MFC after: 2 weeks

3 years agodtrace: Document the libdir, nolibs and syslibdir options
Domagoj Stolfa [Fri, 2 Apr 2021 21:19:47 +0000 (17:19 -0400)]
dtrace: Document the libdir, nolibs and syslibdir options

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29541

3 years agosendfile: Fix error initialization in sendfile_getobj()
Mark Johnston [Fri, 2 Apr 2021 21:12:56 +0000 (17:12 -0400)]
sendfile: Fix error initialization in sendfile_getobj()

Reviewed by: chs, kib
Reported by: jhb
Fixes: faa998f6ff695
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D29540

3 years agoEnsure that all allocated data structures in fsck_ffs are freed.
Kirk McKusick [Fri, 2 Apr 2021 18:57:34 +0000 (11:57 -0700)]
Ensure that all allocated data structures in fsck_ffs are freed.

Several large data structures are allocated by fsck_ffs to track
resource usage. Most but not all were deallocated at the end of
checking each filesystem. This commit consolidates the freeing
of all data structures in one place and adds one that had previously
been missing.

It is important to clean up these data structures as they can be
large. If the previous allocations have not been freed, fsck_ffs
can run out of address space when many large filesystems are being
checked. An alternative would be to fork a new instance of fsck_ffs
for each filesystem to be checked, but we choose to free the small
set of large structures to save the fork overhead.

Reported by:  Chuck Silvers
Tested by:    Chuck Silvers
MFC after:    7 days
Sponsored by: Netflix

3 years agofix typo in 38ea2bd0698e
Richard Scheffenegger [Fri, 2 Apr 2021 18:34:33 +0000 (20:34 +0200)]
fix typo in 38ea2bd0698e

3 years agoUse sbuf_drain unconditionally
Richard Scheffenegger [Fri, 2 Apr 2021 18:26:48 +0000 (20:26 +0200)]
Use sbuf_drain unconditionally

After making sbuf_drain safe for external use,
there is no need to protect the call.

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

3 years agoMake sbuf_drain safe for external use
Richard Scheffenegger [Fri, 2 Apr 2021 18:11:45 +0000 (20:11 +0200)]
Make sbuf_drain safe for external use

While sbuf_drain was an internal function, two
KASSERTS checked the sanity of it being called.
However, an external caller may be ignorant if
there is any data to drain, or if an error has
already accumulated. Be nice and return immediately
with the accumulated error.

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

3 years agonetmap: update unit tests with libnetmap tests
Vincenzo Maffione [Fri, 2 Apr 2021 14:39:30 +0000 (14:39 +0000)]
netmap: update unit tests with libnetmap tests

3 years agolibnetmap: reset errno in nmreq_register_decode()
Vincenzo Maffione [Fri, 2 Apr 2021 14:31:57 +0000 (14:31 +0000)]
libnetmap: reset errno in nmreq_register_decode()

The reset is necessary at the beginning of the function, because of
the errno logic in the error path (set errno to EINVAL if not set).
If errno is already set when calling the function, and the function
fails, the previous errno value will be inherited.

3 years agoconfig(8): remove support for -p
Konstantin Belousov [Thu, 1 Apr 2021 01:16:32 +0000 (04:16 +0300)]
config(8): remove support for -p

and other equivalent ways to request mcount-based profiling, like
'profile N' in kernel config.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D29529

3 years agox86: remove gcov kernel support
Konstantin Belousov [Wed, 31 Mar 2021 21:04:55 +0000 (00:04 +0300)]
x86: remove gcov kernel support

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D29529

3 years agonullfs: protect against user creating inconsistent state
Konstantin Belousov [Thu, 1 Apr 2021 17:42:14 +0000 (20:42 +0300)]
nullfs: protect against user creating inconsistent state

The VFS conventions is that VOP_LOOKUP() methods do not need to handle
ISDOTDOT lookups for VV_ROOT vnodes (since they cannot, after all).  Nullfs
bypasses VOP_LOOKUP() to lower filesystem, and there, due to user actions,
it is possible to get into situation where
- upper vnode does not have VV_ROOT set
- lower vnode is root
- ISDOTDOT is requested
User just needs to nullfs-mount non-root of some filesystem, and then move
some directory under mount, out of mount, using lower filesystem.

In this case, nullfs cannot do much, but we still should and can ensure
internal kernel structures are consistent.  Avoid ISDOTDOT lookup forwarding
when VV_ROOT is set on lower dvp, return somewhat arbitrary ENOENT.

PR: 253593
Reported by: Gregor Koscak <elogin41@gmail.com>
Test by: Patrick Sullivan <sulli00777@gmail.com>
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 years agonetmap: restore commit a56e6334d1b7ed6e6faaa8b4612d948005ba74f5
Vincenzo Maffione [Fri, 2 Apr 2021 10:43:19 +0000 (10:43 +0000)]
netmap: restore commit a56e6334d1b7ed6e6faaa8b4612d948005ba74f5

The fix in a56e6334d1b7ed6e6faaa8b4612d948005ba74f5
was accidentally reverted by commit 45c67e8f6b56b9744f01142747fadf291fe3fad2.

3 years agoLinuxKPI: treat firmware file names more lenient
Bjoern A. Zeeb [Wed, 31 Mar 2021 15:25:01 +0000 (15:25 +0000)]
LinuxKPI: treat firmware file names more lenient

A lot of firmware files have a "-" in the name.  That "-" is a problem
when dealing with shell variables or loader (e.g., auto-loading .ko).
It may thus often be convenient to generate firmware kernel object files
with s/-/_/g in the name.  In order to automatically find them from
drivers using LinuxKPI also substitue the '-' for a '_' like we do
for '/' and '.' already.

Reviewed-by: hselasky, manu (ok)
MFC-after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29514

3 years agomlx5: remove dependency on ifnet specifics of linux/netdevice.h
Bjoern A. Zeeb [Tue, 30 Mar 2021 15:58:55 +0000 (15:58 +0000)]
mlx5: remove dependency on ifnet specifics of linux/netdevice.h

Rename the last remaining bits depending on ifnet from linux/netdevice.h
instead of using the compat macros. This helps clearing up
struct netdevice being struct ifnet from linux/netdevice.h.

Sponsored-by: The FreeBSD Foundation
MFC-after: 2 weeks
Reviewed-by: hselasky, kib
X-D-R: D29366
Differential Revision: https://reviews.freebsd.org/D29497

3 years agoPartially revert r248770.
Dmitry Chagin [Fri, 2 Apr 2021 08:43:17 +0000 (11:43 +0300)]
Partially revert r248770.

Under geom(4) nvme_ns_bio_process() is on the path where sleep
is prohibited as g_io_shedule_down() calls THREAD_NO_SLEEPNG()
before geom->start().

Reviewed By: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D29539

3 years agonetmap: several typo fixes
Vincenzo Maffione [Fri, 2 Apr 2021 07:01:20 +0000 (07:01 +0000)]
netmap: several typo fixes

No functional changes intended.

3 years agonetmap: fix typo bug in netmap_compute_buf_len
Vincenzo Maffione [Fri, 2 Apr 2021 06:42:34 +0000 (06:42 +0000)]
netmap: fix typo bug in netmap_compute_buf_len

3 years agocache: add high level overview
Mateusz Guzik [Thu, 11 Feb 2021 15:39:28 +0000 (16:39 +0100)]
cache: add high level overview

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

3 years agocache: fix resizing in face of lockless lookup
Mateusz Guzik [Mon, 29 Mar 2021 19:17:57 +0000 (21:17 +0200)]
cache: fix resizing in face of lockless lookup

Reported by: pho
Tested by: pho

3 years agovfs: add vfs_smr_quiesce
Mateusz Guzik [Tue, 30 Mar 2021 14:44:10 +0000 (16:44 +0200)]
vfs: add vfs_smr_quiesce

This can be used to observe all CPUs not executing while within
vfs_smr_enter.

3 years agostats(3): Improve t-digest merging of samples which result in mu adjustment underflow.
Lawrence Stewart [Fri, 2 Apr 2021 01:29:29 +0000 (12:29 +1100)]
stats(3): Improve t-digest merging of samples which result in mu adjustment underflow.

Allow the calculation of the mu adjustment factor to underflow instead of
rejecting the VOI sample from the digest and logging an error. This trades off
some (currently unquantified) additional centroid error in exchange for better
fidelity of the distribution's density, which is the right trade off at the
moment until follow up work to better handle and track accumulated error can be
undertaken.

Obtained from: Netflix
MFC after: immediately

3 years agoRemove bt.4 man page.
Cy Schubert [Mon, 29 Mar 2021 05:14:36 +0000 (22:14 -0700)]
Remove bt.4 man page.

r339568 (a1db7455b75d7557fd171a537e2d95aceb20846e) removed bt(4).
This revision removes the man page

Reviewed by: emaste (previous version)
Differential Revision: https://reviews.freebsd.org/D29480

3 years agoACPICA: Fix build with options ACPI_DEBUG
Jung-uk Kim [Fri, 2 Apr 2021 01:18:49 +0000 (21:18 -0400)]
ACPICA: Fix build with options ACPI_DEBUG

3 years agoMerge ACPICA 20210331.
Jung-uk Kim [Thu, 1 Apr 2021 22:01:03 +0000 (18:01 -0400)]
Merge ACPICA 20210331.

(cherry picked from commit 1e02e5b0ba8634758c128dcb43c67342c7219cd4)

3 years agocryptocheck: Expand the set of sizes tested by -z.
John Baldwin [Thu, 1 Apr 2021 22:42:30 +0000 (15:42 -0700)]
cryptocheck: Expand the set of sizes tested by -z.

Test individual sizes up to the max encryption block length as well as
a few sizes that include 1 full block and a partial block before
doubling the size.

Reviewed by: cem, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29518

3 years agoossl: Don't encryt/decrypt too much data for chacha20.
John Baldwin [Thu, 1 Apr 2021 22:42:18 +0000 (15:42 -0700)]
ossl: Don't encryt/decrypt too much data for chacha20.

The loops for Chacha20 and Chacha20+Poly1305 which encrypted/decrypted
full blocks of data used the minimum of the input and output segment
lengths to determine the size of the next chunk ('todo') to pass to
Chacha20_ctr32().  However, the input and output segments could extend
past the end of the ciphertext region into the tag (e.g.  if a "plain"
single mbuf contained an entire TLS record).  If the length of the tag
plus the length of the last partial block together were at least as
large as a full Chacha20 block (64 bytes), then an extra block was
encrypted/decrypted overlapping with the tag.  Fix this by also
capping the amount of data to encrypt/decrypt by the amount of
remaining data in the ciphertext region ('resid').

Reported by: gallatin
Reviewed by: cem, gallatin, markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D29517

3 years agonfsv4 client: factor loop contents out into a separate function
Rick Macklem [Thu, 1 Apr 2021 22:36:37 +0000 (15:36 -0700)]
nfsv4 client: factor loop contents out into a separate function

Commit fdc9b2d50fe9 replaced a couple of while loops with LIST_FOREACH()
loops.  This patch factors the body of that loop out into a separate
function called nfscl_checkown().
This prepares the code for future changes to use a hash table of
lists for open searches via file handle.

This patch should not result in a semantics change.

MFC after: 2 weeks