]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoUpgrade to version 3.3.0
Stefan Eßer [Wed, 17 Feb 2021 21:56:16 +0000 (22:56 +0100)]
Upgrade to version 3.3.0

This update changes the behavior of "-e" or "-f" in BC_ENV_ARGS:

Use of these options on the command line makes bc exit after executing
the given commands. These options will not cause bc to exit when
passed via the environment (but EOF in STDIN or -e or -f on the
command line will make bc exit as before).

The same applies to DC_ENV_ARGS with regard to the dc program.

3 years agogicv3_its: Don't restrict target CPUs based on SRAT
D Scott Phillips [Tue, 16 Feb 2021 18:07:27 +0000 (10:07 -0800)]
gicv3_its: Don't restrict target CPUs based on SRAT

ACPI Sec 5.2.16.5 (SRAT, GIC Interrupt Translation Service (ITS)
Affinity Structure) says:

> The GIC ITS Affinity Structure provides the association between
> a GIC ITS and a proximity domain. This enables the OSPM to
> discover the memory that is closest to the ITS, and use that in
> allocating its management tables and command queue.

Previously the ITS driver was using the proximity domain to
restrict which CPUs can be targeted by an LPI. We keep that logic
just for the original dual socket ThunderX which cannot forward
LPIs between sockets.

We also use the SRAT entry for its intended purpose of attempting
to allocate ITS table structures near the ITS.

Reviewed by: andrew
Sponsored by: Ampere Computing LLC
Differential Revision: https://reviews.freebsd.org/D28340

3 years agoGiant: move back Giant removal until 14
Warner Losh [Wed, 17 Feb 2021 16:28:41 +0000 (09:28 -0700)]
Giant: move back Giant removal until 14

Update the Giant Lock warning message to FreeBSD 14. It's growing increasling
clear that this won't be done before 13.0.

MFC: Insta (re@'s request)

3 years agoHandle negative return values from syncache_expand().
John Baldwin [Wed, 17 Feb 2021 21:28:04 +0000 (13:28 -0800)]
Handle negative return values from syncache_expand().

These errors do not clear so to NULL, so the existing check was
treating these failures as success.  The rest of do_pass_establish()
then tried to use the listen socket as if it was a connection socket
newly created by syncache_expand().

In addition, for negative return values, do not send a RST to the
peer.

Reported by: Sony Arpita Das @ Chelsio
Reviewed by: np
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D28243

3 years agofwohci: Cast bitfield to uint32_t before passing it to roundup2().
John Baldwin [Wed, 17 Feb 2021 21:12:06 +0000 (13:12 -0800)]
fwohci: Cast bitfield to uint32_t before passing it to roundup2().

The fallback for __align_up() used by roundup2() uses __typeof__()
which doesn't work for bitfields.  This fixes the build on GCC which
uses the fallback.

Reviewed by: arichardson, markj
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D28599

3 years agogicv3_its: Leave LPI interrupts enabled during handling
D Scott Phillips [Wed, 17 Feb 2021 19:06:48 +0000 (14:06 -0500)]
gicv3_its: Leave LPI interrupts enabled during handling

This follows the behavior on x86 where edge triggered interrupts are
not disabled when executing the handler. Because the ITS is a shared
resource, contention for the command queue lock can be substantial.

Suggested by: gallatin
Reviewed by: andrew
Tested by: gallatin
Sponsored by: Ampere Computing LLC
Differential Revision: https://reviews.freebsd.org/D28709

3 years agoAdd ifdef TCPHPTS around build_ack_entry and do_bpf_and_csum to avoid
Randall Stewart [Wed, 17 Feb 2021 17:49:42 +0000 (12:49 -0500)]
Add ifdef TCPHPTS around build_ack_entry and do_bpf_and_csum to avoid
warnings when HPTS is not included

Thanks to Gary Jennejohn for pointing this out.

3 years agoFix bootstrap tools build on macOS after 02af91c52e71e8a0f47251e637c9687f35d45dd9
Alex Richardson [Wed, 17 Feb 2021 16:03:11 +0000 (16:03 +0000)]
Fix bootstrap tools build on macOS after 02af91c52e71e8a0f47251e637c9687f35d45dd9

After changing the namespace.h header we need to provide _err on macOS, too.
Previously we used the system libc err*/warn*, but that does not provide
_err/_warn (which is used by other bootstrapped files from libc).
To fix this problem bootstrap err.c on macOS as well.

Fixes: 02af91c52 (Fix crossbuild bootstrap tools build with Clang 12)

3 years agoarm64: use macros to access special register values
Mitchell Horne [Thu, 28 Jan 2021 17:53:00 +0000 (13:53 -0400)]
arm64: use macros to access special register values

3 years agoBump __FreeBSD_version after f2583be110ca
Mitchell Horne [Wed, 17 Feb 2021 15:56:40 +0000 (11:56 -0400)]
Bump __FreeBSD_version after f2583be110ca

Provide a compatibility point around the ABI-breaking change.

Sponsored by: The FreeBSD Foundation

3 years agoarm64: extend struct db_reg to include watchpoint registers
Mitchell Horne [Thu, 28 Jan 2021 17:49:47 +0000 (13:49 -0400)]
arm64: extend struct db_reg to include watchpoint registers

The motivation is to provide access to these registers from userspace
via ptrace(2) requests PT_GETDBREGS and PT_SETDBREGS.

This change breaks the ABI of these particular requests, but is
justified by the fact that the intended consumers (debuggers) have not
been taught to use them yet. Making this change now enables active
upstream work on lldb to begin using this interface, and take advantage
of the hardware debugging registers available on the platform.

PR: 252860
Reported by: Michał Górny (mgorny@gentoo.org)
Reviewed by: andrew, markj (earlier version)
Tested by: Michał Górny (mgorny@gentoo.org)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28415

3 years agoarm64: handle watchpoint exceptions from EL0
Mitchell Horne [Fri, 5 Feb 2021 21:46:48 +0000 (17:46 -0400)]
arm64: handle watchpoint exceptions from EL0

This is a prerequisite to allowing the use of hardware watchpoints for
userspace debuggers.

This is also a slight departure from the x86 behaviour, since `si_addr`
returns the data address that triggered the watchpoint, not the
address of the instruction that was executed. Otherwise, there is no
straightforward way for the application to determine which watchpoint
was triggered. Make a note of this in the siginfo(3) man page.

Reviewed by: jhb, markj (earlier version)
Tested by: Michał Górny (mgorny@gentoo.org)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28561

3 years agoarm64: validate breakpoint registers
Mitchell Horne [Tue, 9 Feb 2021 18:29:38 +0000 (14:29 -0400)]
arm64: validate breakpoint registers

In particular, we want to disallow setting breakpoints on kernel
addresses from userspace. The control register fields are validated or
ignored as appropriate.

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

3 years agolibdtrace: Stop relying on lex compatibility
Mark Johnston [Wed, 17 Feb 2021 15:49:38 +0000 (10:49 -0500)]
libdtrace: Stop relying on lex compatibility

It does not appear to be required, and as of commit 6b7e592c215f
("lex: Do not let input() return 0 when end-of-file is reached") it
causes input to return 0 instead of EOF when end-of-input is reached.

PR: 253440
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

3 years agoBump the FreeBSD kernel version in kernel boot shim.
Hans Petter Selasky [Wed, 17 Feb 2021 15:45:09 +0000 (16:45 +0100)]
Bump the FreeBSD kernel version in kernel boot shim.

Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoUpdate the LRO processing code so that we can support
Randall Stewart [Wed, 27 Jan 2021 17:09:32 +0000 (12:09 -0500)]
Update the LRO processing code so that we can support
a further CPU enhancements for compressed acks. These
are acks that are compressed into an mbuf. The transport
has to be aware of how to process these, and an upcoming
update to rack will do so. You need the rack changes
to actually test and validate these since if the transport
does not support mbuf compression, then the old code paths
stay in place. We do in this commit take out the concept
of logging if you don't have a lock (which was quite
dangerous and was only for some early debugging but has
been left in the code).

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

3 years agopf tests: Explicitly ask for python3
Kristof Provost [Wed, 17 Feb 2021 10:45:54 +0000 (11:45 +0100)]
pf tests: Explicitly ask for python3

If we install the scapy package (which we do list as a dependency) we
don't automatically install python (but we do have python3).

MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC (“Netgate”’)

3 years agopf: Assert that pfil_link() calls succeed
Kristof Provost [Wed, 17 Feb 2021 10:44:37 +0000 (11:44 +0100)]
pf: Assert that pfil_link() calls succeed

These should only fail if we use them incorrectly, so assert that they
succeed.

MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC (“Netgate”’)

3 years agoarm64: rpi4: gpio: Add brcm,bcm2711-gpio compatible
Emmanuel Vadot [Wed, 17 Feb 2021 12:12:45 +0000 (13:12 +0100)]
arm64: rpi4: gpio: Add brcm,bcm2711-gpio compatible

Looks like we never enabled the main gpio controller on the RPI4 board.
Now gpio are usable.

MFC after: 3 days

3 years agoarm64: rpi4: firmware: Attach at BUS_PASS_BUS + BUS_PASS_ORDER_LATE
Emmanuel Vadot [Wed, 17 Feb 2021 12:11:36 +0000 (13:11 +0100)]
arm64: rpi4: firmware: Attach at BUS_PASS_BUS + BUS_PASS_ORDER_LATE

The node have now a compatible with simple-mfd so we need to attach
at the same pass so the specific driver will be used.

MFC after: 3 days
PR: 252971

3 years agoautomount(8): fix absolute path when creating a mountpoint
Robert Wing [Wed, 17 Feb 2021 09:22:23 +0000 (00:22 -0900)]
automount(8): fix absolute path when creating a mountpoint

When executing automount(8), it will attempt to create the directory where an
autofs filesystem is to be mounted. Explicity set the root path for this
directory to "/".

This fixes the issue where the directory being created was being treated as a
relative path instead of an absolute path (as expected).

PR:     224601
Reported by:    kusumi.tomohiro@gmail.com
Reviewed by:    trasz
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D27832

3 years agoFix crossbuild bootstrap tools build with Clang 12
Alex Richardson [Wed, 10 Feb 2021 11:05:02 +0000 (11:05 +0000)]
Fix crossbuild bootstrap tools build with Clang 12

Clang 12 no longer allows re-defining a weak symbol as non-weak. This
happed here because we compile err.c with _err defined to err. To fix
this, use the same approach as the libc namespace.h

3 years agopf: Remove unused return value from (de)hook_pf()
Kristof Provost [Tue, 16 Feb 2021 11:40:51 +0000 (12:40 +0100)]
pf: Remove unused return value from (de)hook_pf()

These functions always return 0, which is good, because the code calling
them doesn't handle this error gracefully.

As the functions always succeed remove their return value, and the code
handling their errors (because it was never executed anyway).

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC (“Netgate”’)

3 years agolex: Do not let input() return 0 when end-of-file is reached
Jung-uk Kim [Wed, 17 Feb 2021 07:22:47 +0000 (02:22 -0500)]
lex: Do not let input() return 0 when end-of-file is reached

Importing flex 2.6.4 has introduced a regression: input() now returns 0
instead of EOF to indicate that the end of input was reached, just like
traditional AT&T and POSIX lex.  Note the behavior contradicts flex(1).
See "INCOMPATIBILITIES WITH LEX AND POSIX" section for information.
This incompatibility traces back to the original version and documented
in its manual page by the Vern Paxson.

Apparently, it has been reported in a few places, e.g.,

https://github.com/westes/flex/issues/448
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911415

Unfortunately, this also breaks the scanner used by libdtrace and
dtrace is unable to resolve some probe argument types as a result.  See
PR253440 for more information.

Note the regression was introduced by the following upstream commit
without any explanation or documentation change:

https://github.com/westes/flex/commit/f863c9490e6912ffcaeb12965fb3a567a10745ff

Now we restore the traditional flex behavior unless lex-compatibility
mode is set with "-l" option because I believe the author originally
wanted to make it more lex and POSIX compatible.

PR: 253440
Reported by: markj

3 years agoOpenSSL: Regen assembly files for OpenSSL 1.1.1j
Jung-uk Kim [Wed, 17 Feb 2021 05:35:11 +0000 (00:35 -0500)]
OpenSSL: Regen assembly files for OpenSSL 1.1.1j

3 years agoOpenSSL: Remove obsolete include directory
Jung-uk Kim [Wed, 17 Feb 2021 03:53:37 +0000 (22:53 -0500)]
OpenSSL: Remove obsolete include directory

This directory was deprecated since OpenSSL 1.1.1e.

https://github.com/openssl/openssl/pull/9681

3 years agocxgbe(4): Save proper zone index on low memory in refill_fl().
Alexander Motin [Wed, 17 Feb 2021 02:15:28 +0000 (21:15 -0500)]
cxgbe(4): Save proper zone index on low memory in refill_fl().

When refill_fl() fails to allocate large (9/16KB) mbuf cluster, it
falls back to safe (4KB) ones.  But it still saved into sd->zidx
the original fl->zidx instead of fl->safe_zidx.  It caused problems
with the later use of that cluster, including memory and/or data
corruption.

While there, make refill_fl() to use the safe zone for all following
clusters for the call, since it is unlikely that large succeed.

MFC after: 3 days
Sponsored by: iXsystems, Inc.
Reviewed by: np, jhb
Differential Revision: https://reviews.freebsd.org/D28716

3 years agolinux: Update the i386/linux vdso deinitialization routine
Mark Johnston [Tue, 16 Feb 2021 22:06:20 +0000 (17:06 -0500)]
linux: Update the i386/linux vdso deinitialization routine

This was missed in commit 0fc8a796722 ("linux: Unmap the VDSO page when
unloading").

Reported by: Mark Millard
MFC with: 0fc8a796722

3 years agoOpenSSL: Regen manual pages for OpenSSL 1.1.1j.
Jung-uk Kim [Tue, 16 Feb 2021 22:05:00 +0000 (17:05 -0500)]
OpenSSL: Regen manual pages for OpenSSL 1.1.1j.

3 years agoOpenSSL: Merge OpenSSL 1.1.1j
Jung-uk Kim [Tue, 16 Feb 2021 22:00:27 +0000 (17:00 -0500)]
OpenSSL: Merge OpenSSL 1.1.1j

Merge commit '4f55bd5321b72491d4eff396e4928e9ab0706735'

3 years agoFix NOINET6 build broken by 2fe5a79425c7.
Alexander V. Chernikov [Tue, 16 Feb 2021 21:49:48 +0000 (21:49 +0000)]
Fix NOINET6 build broken by 2fe5a79425c7.

Reported by: mjg

3 years agoFix dst/netmask handling in routing socket code.
Alexander V. Chernikov [Tue, 16 Feb 2021 20:30:04 +0000 (20:30 +0000)]
Fix dst/netmask handling in routing socket code.

Traditionally routing socket code did almost zero checks on
 the input message except for the most basic size checks.

This resulted in the unclear KPI boundary for the routing system code
 (`rtrequest*` and now `rib_action()`) w.r.t message validness.

Multiple potential problems and nuances exists:
* Host bits in RTAX_DST sockaddr. Existing applications do send prefixes
 with hostbits uncleared. Even `route(8)` does this, as they hope the kernel
 would do the job of fixing it. Code inside `rib_action()` needs to handle
 it on its own (see `rt_maskedcopy()` ugly hack).
* There are multiple way of adding the host route: it can be DST without
 netmask or DST with /32(/128) netmask. Also, RTF_HOST has to be set correspondingly.
 Currently, these 2 options create 2 DIFFERENT routes in the kernel.
* no sockaddr length/content checking for the "secondary" fields exists: nothing
 stops rtsock application to send sockaddr_in with length of 25 (instead of 16).
 Kernel will accept it, install to RIB as is and propagate to all rtsock consumers,
 potentially triggering bugs in their code. Same goes for sin_port, sin_zero, etc.

The goal of this change is to make rtsock verify all sockaddr and prefix consistency.
Said differently, `rib_action()` or internals should NOT require to change any of the
 sockaddrs supplied by `rt_addrinfo` structure due to incorrectness.

To be more specific, this change implements the following:
* sockaddr cleanup/validation check is added immediately after getting sockaddrs from rtm.
* Per-family dst/netmask checks clears host bits in dst and zeros all dst/netmask "secondary" fields.
* The same netmask checking code converts /32(/128) netmasks to "host" route case
 (NULL netmask, RTF_HOST), removing the dualism.
* Instead of allowing ANY "known" sockaddr families (0<..<AF_MAX), allow only actually
 supported ones (inet, inet6, link).
* Automatically convert `sockaddr_sdl` (AF_LINK) gateways to
  `sockaddr_sdl_short`.

Reported by: Guy Yur <guyyur at gmail.com>
Reviewed By: donner
Differential Revision: https://reviews.freebsd.org/D28668
MFC after: 3 days

3 years agoAdd ifa_try_ref() to simplify ifa handling inside epoch.
Alexander V. Chernikov [Tue, 16 Feb 2021 20:12:58 +0000 (20:12 +0000)]
Add ifa_try_ref() to simplify ifa handling inside epoch.

More and more code migrates from lock-based protection to the NET_EPOCH
 umbrella. It requires some logic changes, including, notably, refcount
 handling.

When we have an `ifa` pointer and we're running inside epoch we're
 guaranteed that this pointer will not be freed.
However, the following case can still happen:
 * in thread 1 we drop to 0 refcount for ifa and schedule its deletion.
 * in thread 2 we use this ifa and reference it
 * destroy callout kicks in
 * unhappy user reports bug

To address it, new `ifa_try_ref()` function is added, allowing to return
 failure when we try to reference `ifa` with 0 refcount.
Additionally, existing `ifa_ref()` is enforced with `KASSERT` to provide
 cleaner error in such scenarious.

Reviewed By: rstone, donner
Differential Revision: https://reviews.freebsd.org/D28639
MFC after: 1 week

3 years agoMake in_localip_more() fib-aware.
Alexander V. Chernikov [Tue, 16 Feb 2021 20:00:46 +0000 (20:00 +0000)]
Make in_localip_more() fib-aware.

It fixes loopback route installation for the interfaces
 in the different fibs using the same prefix.

Reviewed By: donner
PR: 189088
Differential Revision: https://reviews.freebsd.org/D28673
MFC after: 1 week

3 years agoImport OpenSSL 1.1.1j.
Jung-uk Kim [Tue, 16 Feb 2021 19:54:02 +0000 (14:54 -0500)]
Import OpenSSL 1.1.1j.

3 years agojail: Handle a possible race between jail_remove(2) and fork(2)
Jamie Gritton [Tue, 16 Feb 2021 19:19:13 +0000 (11:19 -0800)]
jail: Handle a possible race between jail_remove(2) and fork(2)

jail_remove(2) includes a loop that sends SIGKILL to all processes
in a jail, but skips processes in PRS_NEW state.  Thus it is possible
the a process in mid-fork(2) during jail removal can survive the jail
being removed.

Add a prison flag PR_REMOVE, which is checked before the new process
returns.  If the jail is being removed, the process will then exit.
Also check this flag in jail_attach(2) which has a similar issue.

Reported by:    trasz
Approved by:    kib
MFC after:      3 days

3 years agoUse iflib_if_init_locked() during media change instead of iflib_init_locked().
Allan Jude [Sun, 14 Feb 2021 18:39:09 +0000 (18:39 +0000)]
Use iflib_if_init_locked() during media change instead of iflib_init_locked().

iflib_init_locked() assumes that iflib_stop() has been called, however,
it is not called for media changes.
iflib_if_init_locked() calls stop then init, so fixes the problem.

PR: 253473
MFC after: 3 days
Reviewed by: markj
Sponsored by: Juniper Networks, Inc., Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D28667

3 years agobi_load: only add MODULEP on arches that have it defined
Roger Pau Monné [Tue, 16 Feb 2021 15:06:14 +0000 (16:06 +0100)]
bi_load: only add MODULEP on arches that have it defined

Do not attempt to add MODINFOMD_MODULEP to the kernel medatada on
arches that don't have it defined.

This fixes the build for arches different than amd64 after
7d3259775cb69f250df3e7fe51d6fff2283c6f20.

Sponsored by: Citrix Systems R&D
Reported by: lwhsu, arichardson

3 years agolinux: Unmap the VDSO page when unloading
Mark Johnston [Tue, 16 Feb 2021 14:30:21 +0000 (09:30 -0500)]
linux: Unmap the VDSO page when unloading

linux_shared_page_init() creates an object and grabs and maps a single
page to back the VDSO.  When destroying the VDSO object, we failed to
destroy the mapping and free KVA.  Fix this.

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

3 years agoUpdate capsicum-test to git commit 7707222b46abe52d18fd4fbb76115ffdb3e6f74b
Alex Richardson [Tue, 16 Feb 2021 14:35:12 +0000 (14:35 +0000)]
Update capsicum-test to git commit 7707222b46abe52d18fd4fbb76115ffdb3e6f74b

This includes changes to use GTEST_SKIP() instead of the local hand-rolled
mechanism as well as a few minor cleanups.

3 years agoxen/efi: introduce a PV interface for EFI run time services for dom0
Roger Pau Monné [Fri, 12 Feb 2021 12:11:34 +0000 (13:11 +0100)]
xen/efi: introduce a PV interface for EFI run time services for dom0

FreeBSD when running as a dom0 under Xen is not supposed to access the
run time services directly, and instead should proxy the calls through
Xen using an hypercall interface that exposes access to selected run
time services.

Implement the efirt interface on top of the Xen provided hypercalls.

Sponsored by: Citrix Systems R&D
Reviewed by: kib
Differential revision: https://reviews.freebsd.org/D28621

3 years agoefirt: add hooks for diverging EFI implementations
Roger Pau Monné [Fri, 12 Feb 2021 11:11:58 +0000 (12:11 +0100)]
efirt: add hooks for diverging EFI implementations

Introduce a set of hooks for MI EFI public functions, so that a new
implementation can be done. This will be used to implement the Xen PV
EFI interface that's used when running FreeBSD as a Xen dom0 from UEFI
firmware. Also make the efi_status_to_errno non-static since it will
be used to evaluate status return values from the PV interface.

No functional change indented.

Sponsored by: Citrix Systems R&D
Reviewed by: kib, imp
Differential revision: https://reviews.freebsd.org/D28620

3 years agoxen/boot: allow specifying boot method when booted from Xen
Roger Pau Monné [Mon, 8 Feb 2021 10:28:36 +0000 (11:28 +0100)]
xen/boot: allow specifying boot method when booted from Xen

Allow setting the bootmethod variable from the Xen PVH entry point, in
order to be able to correctly set the underlying firmware mode when
booted as a dom0.

Move the bootmethod variable to be defined in x86/cpu_machdep.c
instead so it can be shared by both i386 and amd64.

Sponsored by: Citrix Systems R&D
Reviewed by: kib
Differential revision: https://reviews.freebsd.org/D28619

3 years agostand/multiboot2: add support for booting a Xen dom0 in UEFI mode
Roger Pau Monné [Wed, 27 Jan 2021 11:23:32 +0000 (12:23 +0100)]
stand/multiboot2: add support for booting a Xen dom0 in UEFI mode

Add some basic multiboot2 infrastructure to the EFI loader in order to
be capable of booting a FreeBSD/Xen dom0 when booted from UEFI.

Only a very limited subset of the multiboot2 protocol is implemented
in order to support enough to boot into Xen, the implementation
doesn't intend to be a full multiboot2 capable implementation.

Such multiboot2 functionality is hooked up into the amd64 EFI loader,
which is the only architecture that supports Xen dom0 on FreeBSD.

The options to boot a FreeBSD/Xen dom0 system are exactly the same as
on BIOS, and requires setting the xen_kernel and xen_cmdline options
in loader.conf.

Sponsored by: Citrix Systems R&D
Reviewed by: tsoome, imp
Differential revision: https://reviews.freebsd.org/D28497

3 years agostand/efi: add modulep to kernel metadata
Roger Pau Monné [Fri, 5 Feb 2021 10:11:36 +0000 (11:11 +0100)]
stand/efi: add modulep to kernel metadata

This mirrors the functionality of the BIOS amd64 bi_load function,
that stashes the absolute address of the module metadata. This is
required for booting as a Xen dom0 that does relocate the modulep and
the loaded modules, and thus requires adjusting the offset.

No functional change introduced, further patches will make use of this
functionality for Xen dom0 loading.

Sponsored by: Citrix Systems R&D
Reviewed by: imp
Differential revision: https://reviews.freebsd.org/D28496

3 years agostand/efi: allow not exiting boot services
Roger Pau Monné [Fri, 5 Feb 2021 10:15:19 +0000 (11:15 +0100)]
stand/efi: allow not exiting boot services

Xen requires that UEFI BootServices are enabled in order to boot, so
introduce a new parameter to bi_load in order to select whether BS
should be exited.

No functional change introduced in this patch, as all current users of
bi_load request BS to be exited. Further changes will make use of this
functionality.

Note the memory map is still appended to the kernel metadata, even
when it could be modified by further calls to the Boot Services, as it
will be used to detect if the kernel has been booted from UEFI.

Sponsored by: Citrix Systems R&D
Reviewed by: tsoome, imp
Differential revision: https://reviews.freebsd.org/D28495

3 years agoUpdate capsicum-test to 7707222b46abe52d18fd4fbb76115ffdb3e6f74b
Alex Richardson [Tue, 16 Feb 2021 13:12:51 +0000 (13:12 +0000)]
Update capsicum-test to 7707222b46abe52d18fd4fbb76115ffdb3e6f74b

Using the following steps:
```
git worktree add ../freebsd-vendor-capsicum-test freebsd/vendor/google/capsicum-test
cd ../freebsd-vendor-capsicum-test
git remote add upstream-capsicum-test https://github.com/google/capsicum-test
git fetch upstream-capsicum-test
git checkout -f upstream-capsicum-test/dev --
git rm -rf autoconf/ casper/ gtest-1.10.0/ libcaprights/
git commit
```

3 years agoupdate the SACK loss recovery to RFC6675, with the following new features:
Richard Scheffenegger [Tue, 16 Feb 2021 11:18:43 +0000 (12:18 +0100)]
update the SACK loss recovery to RFC6675, with the following new features:
- improved pipe calculation which does not degrade under heavy loss
- engaging in Loss Recovery earlier under adverse conditions
- Rescue Retransmission in case some of the trailing packets of a request got lost

All above changes are toggled with the sysctl "rfc6675_pipe" (disabled by default).

Reviewers: #transport, tuexen, lstewart, slavash, jtl, hselasky, kib, rgrimes, chengc_netapp.com, thj, #manpages, kbowling, #netapp, rscheff
Reviewed By: #transport
Subscribers: imp, melifaro
MFC after: 2 weeks
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D18985

3 years agozfs: change file mode of all merged tests
Martin Matuska [Tue, 16 Feb 2021 11:23:43 +0000 (12:23 +0100)]
zfs: change file mode of all merged tests

If the ksh files are not executable then the tests are not run
and reported as failed.

MFC after: 2 weeks
X-MFC-with: 6b52139eb8e8eda0ea263b24735556194f918642

3 years agopf tests: Test unicast reverse path forwarding check
Kristof Provost [Mon, 15 Feb 2021 21:16:36 +0000 (22:16 +0100)]
pf tests: Test unicast reverse path forwarding check

Ensure that pf's urpf-failed keyword works as expected.

PR: 253479
MFC after: 1 week
Reviewed by: melifaro@
Differential Revision: https://reviews.freebsd.org/D28694

3 years agoSource repo changes to add new committer Rajesh Kumar M A
Rajesh Kumar M A [Tue, 16 Feb 2021 08:52:09 +0000 (08:52 +0000)]
Source repo changes to add new committer Rajesh Kumar M A

Approved by: vmaffione, gallatin

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

3 years agoUFS snapshots: properly set the vm object size.
Konstantin Belousov [Mon, 15 Feb 2021 03:36:02 +0000 (05:36 +0200)]
UFS snapshots: properly set the vm object size.

Citing Kirk:
The previous code [before 8563de2f2799b2cb -- kib] did not call
vnode_pager_setsize() but worked because later in ffs_snapshot() it
does a UFS_WRITE() to output the snaplist. Previously the UFS_WRITE()
allocated the extra block at the end of the file which caused it to do
the needed vnode_pager_setsize(). But the new code had already allocated
the extra block, so UFS_WRITE() did not extend the size and thus did not
do the vnode_pager_setsize().

PR: 253158
Reported by: Harald Schmalzbauer <bugzilla.freebsd@omnilan.de>
Reviewed by: mckusick
Tested by: cy
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 years agopgcache read: protect against reads past end of the vm object size
Konstantin Belousov [Mon, 15 Feb 2021 03:34:06 +0000 (05:34 +0200)]
pgcache read: protect against reads past end of the vm object size

If uio_offset is past end of the object size, calculated resid is negative.
Delegate handling this case to the locked read, as any other non-trivial
situation.

PR: 253158
Reported by: Harald Schmalzbauer <bugzilla.freebsd@omnilan.de>
Tested by: cy
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

3 years agozfs: merge OpenZFS master-436ab35a5
Martin Matuska [Tue, 16 Feb 2021 00:39:34 +0000 (01:39 +0100)]
zfs: merge OpenZFS master-436ab35a5

- speed up writing to ZFS pools without ZIL devices (aa755b3)
- speed up importing ZFS pools (2d8f72da0e0199cf0977a)
...

MFC after: 2 weeks
Reviewed by: mjg (partial)
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D28677

3 years agoUpdate OpenZFS to master-436ab35a5
Martin Matuska [Mon, 15 Feb 2021 23:33:50 +0000 (00:33 +0100)]
Update OpenZFS to master-436ab35a5

3 years agoFix two failing tests after ATF update
Alex Richardson [Mon, 15 Feb 2021 22:11:30 +0000 (22:11 +0000)]
Fix two failing tests after ATF update

Since https://github.com/freebsd/atf/commit/4581cefc1e3811dd3c926b5dd4b15fd63d2e19da
ATF opens the results file on startup. This fixes problems like
capsicumized tests not being able to open the file on exit.

However, this test closes all file descriptors just to check that
socketpair returns fd 3+4 and thereby also closes the ATF results file.
This then results in an EBADF when writing the result so the test is
reported as broken.

While system calls that create new file descriptors (must?) use the lowest
available file descriptor number, it does not seem useful to test this
property here. Drop the check for FD==3/4 to unbreak the testsuite.

We could also try to re-open the results file in ATF if we get a EBADF
error, but that will fail when running under Capsicum.

Reviewed By: cem
Differential Revision: https://reviews.freebsd.org/D28683

3 years agoFix fget_only_user() to return ENOTCAPABLE on a failed capsicum check
Alex Richardson [Mon, 15 Feb 2021 22:09:33 +0000 (22:09 +0000)]
Fix fget_only_user() to return ENOTCAPABLE on a failed capsicum check

After eaad8d1303da500ed691bd774742a4555a05e729 four additional
capsicum-test tests started failing. It turns out this is because
fget_only_user() was returning EBADF on a failed capsicum check instead
of forwarding the return value of cap_check_inline() like
fget_unlocked_seq().

capsicum-test failures before this:
```
[  FAILED  ] 7 tests, listed below:
[  FAILED  ] Capability.OperationsForked
[  FAILED  ] Capability.NoBypassDAC
[  FAILED  ] Pdfork.OtherUserForked
[  FAILED  ] PipePdfork.WildcardWait
[  FAILED  ] OpenatTest.WithFlag
[  FAILED  ] ForkedOpenatTest_WithFlagInCapabilityMode._
[  FAILED  ] Select.LotsOFileDescriptorsForked
```
After:
```
[  FAILED  ] 3 tests, listed below:
[  FAILED  ] Capability.NoBypassDAC
[  FAILED  ] Pdfork.OtherUserForked
[  FAILED  ] PipePdfork.WildcardWait
```

Reviewed By: mjg
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28691

3 years agomsun: ctanh/ctanhf: Import fix from musl libc
Alex Richardson [Mon, 15 Feb 2021 22:06:41 +0000 (22:06 +0000)]
msun: ctanh/ctanhf: Import fix from musl libc

This applies musl commit b02eed9c4841913d690a2d0029737d72615384fe by
Szabolcs Nagy and updates the tests accordingly. This also allows
removing an XFAIL from the test.

musl commit message:

complex: fix ctanh(+-0+i*nan) and ctanh(+-0+-i*inf)

These cases were incorrect in C11 as described by
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1886.htm

PR: 217528

Reviewed By: dim
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28578

3 years agolibpmc: fix linking with C programs
Alan Somers [Mon, 15 Feb 2021 22:51:31 +0000 (15:51 -0700)]
libpmc: fix linking with C programs

Revision r334749 Added some C++ code to libpmc.  It didn't change the ABI,
but it did introduce a dependency on libc++.  Nobody noticed because every
program that in the base system that uses libpmc is also C++.

Reported-by: Dom Dwyer <dom@itsallbroken.com>
Reviewed By: vangyzen
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28550

3 years agoRemove per-packet ifa refcounting from IPv6 fast path.
Alexander V. Chernikov [Mon, 15 Feb 2021 21:59:21 +0000 (21:59 +0000)]
Remove per-packet ifa refcounting from IPv6 fast path.

Currently ip6_input() calls in6ifa_ifwithaddr() for
 every local packet, in order to check if the target ip
 belongs to the local ifa in proper state and increase
 its counters.

in6ifa_ifwithaddr() references found ifa.
With epoch changes, both `ip6_input()` and all other current callers
 of `in6ifa_ifwithaddr()` do not need this reference
 anymore, as epoch provides stability guarantee.

Given that, update `in6ifa_ifwithaddr()` to allow
 it to return ifa without referencing it, while preserving
 option for getting referenced ifa if so desired.

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

3 years agoEnforce net epoch in in6_selectsrc().
Alexander V. Chernikov [Sat, 13 Feb 2021 14:32:10 +0000 (14:32 +0000)]
Enforce net epoch in in6_selectsrc().

in6_selectsrc() may call fib6_lookup() in some cases, which requires
 epoch. Wrap in6_selectsrc* calls into epoch inside its users.
Mark it as requiring epoch by adding NET_EPOCH_ASSERT().

MFC after: 1 weeek
Differential Revision: https://reviews.freebsd.org/D28647

3 years agopxeboot(8): remove antiquated information
Guangyuan Yang [Mon, 15 Feb 2021 22:03:37 +0000 (22:03 +0000)]
pxeboot(8): remove antiquated information

While I was there:
- Fix some typos
- Fix an excessive argument "indent" reported by mandoc -Tlint
- Replace a dead link with the one suggested by
  https://www.uefi.org/uefi

Submitted by: linimon (in part)
Reviewed by: bcr
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D27774

3 years agoRemove now-unused RTF_RNH_LOCKED route flag.
Alexander V. Chernikov [Sun, 14 Feb 2021 13:45:14 +0000 (13:45 +0000)]
Remove now-unused RTF_RNH_LOCKED route flag.

MFC after: 1 week

3 years agoImprove size readability.
Michael Reifenberger [Mon, 15 Feb 2021 19:23:32 +0000 (20:23 +0100)]
Improve size readability.
Preserve more space for swap devise names.
Prevent line overflow with long devise name.
Don't draw a bar when swap is not used at all.
Simplify and optimize code.
Change the label to end at end of 100%.
PR: 251655
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D27496

3 years agoFix divide-by-zero panic when ASLR is enabled and superpages disabled
Jason A. Harmening [Mon, 15 Feb 2021 02:47:22 +0000 (18:47 -0800)]
Fix divide-by-zero panic when ASLR is enabled and superpages disabled

When locating the anonymous memory region for a vm_map with ASLR
enabled, we try to keep the slid base address aligned on a superpage
boundary to minimize pagetable fragmentation and maximize the potential
usage of superpage mappings.  We can't (portably) do this if superpages
have been disabled by loader tunable and pagesizes[1] is 0, and it
would be less beneficial in that case anyway.

PR: 253511
Reported by: johannes@jo-t.de
MFC after: 1 week
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D28678

3 years agobsd.links.mk wants full paths
Simon J. Gerraty [Mon, 15 Feb 2021 18:05:00 +0000 (10:05 -0800)]
bsd.links.mk wants full paths

The values in LINKS need to be full paths.

3 years agolockmgr: shrink struct lock by 8 bytes on LP64
Mateusz Guzik [Mon, 15 Feb 2021 04:24:17 +0000 (05:24 +0100)]
lockmgr: shrink struct lock by 8 bytes on LP64

Currently the struct has a 4 byte padding stemming from 3 ints.

1. prio comfortably fits in short, unfortunately there is no dedicated
   type for it and plumbing it throughout the codebase is not worth it
   right now, instead an assert is added which covers also flags for
   safety
2. lk_exslpfail can in principle exceed u_short, but the count is
   already not considered reliable and it only ever gets modified
   straight to 0. In other words it can be incrementing with an upper
   bound of USHRT_MAX

With these in place struct lock shrinks from 48 to 40 bytes.

Reviewed by: kib (previous version)
Differential Revision: https://reviews.freebsd.org/D28680

3 years agolinux: drop unneeded casts
Edward Tomasz Napierala [Mon, 15 Feb 2021 12:34:10 +0000 (12:34 +0000)]
linux: drop unneeded casts

No functional changes.

Sponsored By: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28533

3 years agozfs: Avoid updating the L2ARC device header unnecessarily
Martin Matuska [Mon, 15 Feb 2021 08:10:01 +0000 (09:10 +0100)]
zfs: Avoid updating the L2ARC device header unnecessarily

From openzfs-master 0ae184a6b commit message:
  If we do not write any buffers to the cache device and the evict hand
  has not advanced do not update the cache device header.

Cherry-picked from openzfs 0ae184a6baaf71e155e9b19af81b75474622ff58
Patch Author:   George Amanakis <gamanakis@gmail.com>

MFC after:         3 days
Reviewed by:            delphij
Differential Revision:  https://reviews.freebsd.org/D28682

3 years agozfs: fix RAIDZ2/3 not healing parity with 2+ bad disks
Martin Matuska [Mon, 15 Feb 2021 07:40:27 +0000 (08:40 +0100)]
zfs: fix RAIDZ2/3 not healing parity with 2+ bad disks

From openzfs-master 62d4287f2 commit message:
  When scrubbing, (non-sequential) resilvering, or correcting a checksum
  error using RAIDZ parity, ZFS should heal any incorrect RAIDZ parity by
  overwriting it.  For example, if P disks are silently corrupted (P being
  the number of failures tolerated; e.g. RAIDZ2 has P=2), `zpool scrub`
  should detect and heal all the bad state on these disks, including
  parity.  This way if there is a subsequent failure we are fully
  protected.

  With RAIDZ2 or RAIDZ3, a block can have silent damage to a parity
  sector, and also damage (silent or known) to a data sector.  In this
  case the parity should be healed but it is not.

Cherry-picked from openzfs 62d4287f279a0d184f8f332475f27af58b7aa87e
Patch Author: Matthew Ahrens <matthew.ahrens@delphix.com>

MFC after: 3 days
Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D28681

3 years agoifconfig: fix incorrect wg allowed-ips netmask
Michael Chiu [Mon, 15 Feb 2021 00:38:26 +0000 (00:38 +0000)]
ifconfig: fix incorrect wg allowed-ips netmask

Currently when peer information is displayed with `ifconfig wgN peer ..`
or `ifconfig wgN peer-list`, the netmask of the first `allowed-ips` will
be used as the netmask of all CIDR in `allowed-ips`.  For example, if
the list is `192.168.1.0/24, 172.16.0.0/16`, it will display as
`192.168.1.0/24, 172.16.0.0/24`. While this does not affect the actual
functionality, it is very confusing.

Submitted by:   Michael Chiu <nyan -at- myuji.xyz>
Reviewed by: grehan
Differential Revision: https://reviews.freebsd.org/D28655
MFC after: 1 day

3 years agogetdirentries.2: fix for NFS mounts
Rick Macklem [Mon, 15 Feb 2021 02:16:58 +0000 (18:16 -0800)]
getdirentries.2: fix for NFS mounts

It was reported that getdirentries(2) was
returning dirents with d_off set to 0 for an NFS
mount.

This is believed to be correct behaviour at
this time (it may change for some NFS mounts
in the future), but is inconsistent with what the
getdirentries(2) man page says.

This patch fixes the man page.

This is a content change.

PR: 253428
Reviewed by: asomers
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D28664

3 years agoLinks for bmake and bmake.1
Simon J. Gerraty [Mon, 15 Feb 2021 01:20:10 +0000 (17:20 -0800)]
Links for bmake and bmake.1

Some folk forget that make is bmake, and want the links...

MFC after: 1 week

3 years agoopenssh: port upgrade doc and script to git
Ed Maste [Wed, 10 Feb 2021 00:50:32 +0000 (19:50 -0500)]
openssh: port upgrade doc and script to git

Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28564

3 years agoloader_lua: consider userboot console as serial
Toomas Soome [Sun, 14 Feb 2021 08:28:29 +0000 (10:28 +0200)]
loader_lua: consider userboot console as serial

We use ascii box chars with serial console because we do not know
if terminal can draw unixode box chars. Same problem is about userboot
console.

MFC after: 5 days

3 years agoFix for locking order reversal in USB audio driver, when using mmap().
Hans Petter Selasky [Sun, 14 Feb 2021 19:29:16 +0000 (20:29 +0100)]
Fix for locking order reversal in USB audio driver, when using mmap().

Locking the second lock which causes the LOR, can be skipped because
the code updating the shared variables is always executing from the
same USB thread.

lock order reversal:
  1st 0xfffff80005cc3840 pcm7:play:dsp7.p0 (pcm play channel, sleep mutex)
@ usb_transfer.c:2342
  2nd 0xfffff80005cc3860 pcm7:record:dsp7.r0 (pcm record channel, sleep mutex)
@ uaudio.c:2317

lock order pcm record channel -> pcm play channel established at:
witness_checkorder+0x461
__mtx_lock_flags+0x98
dsp_mmap_single+0x151
vm_mmap_cdev+0x65
devfs_mmap_f+0x143
kern_mmap_req+0x594
sys_mmap+0x46
amd64_syscall+0x12e
fast_syscall_common+0xf8

lock order pcm play channel -> pcm record channel attempted at:
witness_checkorder+0xd82
__mtx_lock_flags+0x98
uaudio_chan_play_callback+0xeb
usbd_callback_wrapper+0x7ec
usb_command_wrapper+0x7e
usb_callback_proc+0x8e
usb_process+0xf3
fork_exit+0x80
fork_trampoline+0xe

Found by: Stefan Ehmann <shoesoft@gmx.net>
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agomissed three fcntl.h header files
Martin Matuska [Sun, 14 Feb 2021 17:29:21 +0000 (18:29 +0100)]
missed three fcntl.h header files

3 years agoOnly require mac_veriexec for verified_exec
Simon J. Gerraty [Sun, 14 Feb 2021 17:20:41 +0000 (09:20 -0800)]
Only require mac_veriexec for verified_exec

The veriexec option is redundant, mac_veriexec is sufficient.

MFC after: 1 week

#
#                                                         72 columns --|
#
# Uncomment and complete these metadata fields, as appropriate:
#
# PR: <If and which Problem Report is related.>
# Reported by: <If someone else reported the issue.>
# Reviewed by: <If someone else reviewed your modification.>
# Approved by: <If you needed approval for this commit.>
# Obtained from: <If the change is from a third party.>
# MFC after: <N [day[s]|week[s]|month[s]].  Request a reminder email>
# MFH: <Ports tree branch name.  Request approval for merge.>
# Relnotes: <Set to 'yes' for mention in release notes.>
# Security: <Vulnerability reference (one per line) or description.>
# Sponsored by: <If the change was sponsored by an organization.>
# Pull Request: <https://github.com/freebsd/<repo>/pull/###>
# Differential Revision: <https://reviews.freebsd.org/D###>
#
# "Pull Request" and "Differential Revision" require the *full* GitHub or
# Phabricator URL.  The commit author should be set appropriately, using
# `git commit --author` if someone besides the committer sent in the change.
#
# Uncomment and complete these metadata fields, as appropriate:
#
# PR:
# Reported by: <If someone else reported the issue.>
# Reviewed by: <If someone else reviewed your modification.>
# Approved by: <If you needed approval for this commit.>
# Obtained from: <If the change is from a third party.>
# MFC after: <N [day[s]|week[s]|month[s]].  Request a reminder email>
# MFH: <Ports tree branch name.  Request approval for merge.>
# Relnotes: <Set to 'yes' for mention in release notes.>
# Security: <Vulnerability reference (one per line) or description.>
# Sponsored by: <If the change was sponsored by an organization.>
# Pull Request: <https://github.com/freebsd/<repo>/pull/###>
# Differential Revision: <https://reviews.freebsd.org/D###>
#
# "Pull Request" and "Differential Revision" require the *full* GitHub or
# Phabricator URL.  The commit author should be set appropriately, using
# `git commit --author` if someone besides the committer sent in the change.
#

3 years agopf: Slightly relax pf_rule_addr validation
Kristof Provost [Sat, 13 Feb 2021 15:31:52 +0000 (16:31 +0100)]
pf: Slightly relax pf_rule_addr validation

Ensure we don't reject no-route / urpf-failed addresses.

PR: 253479
Reported by: michal AT microwave.sk
Revied by: donner@
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28650

3 years agotcp: improve behaviour when using TCP_NOOPT
Michael Tuexen [Sun, 14 Feb 2021 11:10:31 +0000 (12:10 +0100)]
tcp: improve behaviour when using TCP_NOOPT

Use ISS for SEG.SEQ when sending a SYN-ACK segment in response to
an SYN segment received in the SYN-SENT state on a socket having
the IPPROTO_TCP level socket option TCP_NOOPT enabled.

Reviewed by: rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D28656

3 years agoDo not reference returned ifa in in6_ifawithifp().
Alexander V. Chernikov [Sun, 14 Feb 2021 10:11:06 +0000 (10:11 +0000)]
Do not reference returned ifa in in6_ifawithifp().

The only place where in6_ifawithifp() is used is ip6_output(),
 which uses the returned ifa to bump traffic counters.
Given ifa stability guarantees is provided by epoch, do not refcount ifa.

This eliminates 2 atomic ops from IPv6 fast path.

Reviewed By: rstone
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28649

3 years agoprocstat: distinguish vm map guards in procstat vm output.
Konstantin Belousov [Sun, 14 Feb 2021 00:37:24 +0000 (02:37 +0200)]
procstat: distinguish vm map guards in procstat vm output.

Requested and reviewed by: rwatson (previous version)
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28658

3 years agoUpdate OpenZFS to master-c1c31a835
Martin Matuska [Sun, 14 Feb 2021 00:09:23 +0000 (01:09 +0100)]
Update OpenZFS to master-c1c31a835

Discussed with: mjguzik

3 years agoAdd metor -> mentee information (docs)
Fernando Apesteguía [Sat, 13 Feb 2021 18:18:03 +0000 (19:18 +0100)]
Add metor -> mentee information (docs)

As per Committers Guide Step 5

Reviewed by: 0mp

Accepted By: 0mp (mentor)

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

3 years agohidraw: Make HIDIOCGRDESCSIZE ioctl return report descriptor size
Vladimir Kondratyev [Sat, 13 Feb 2021 18:19:02 +0000 (21:19 +0300)]
hidraw: Make HIDIOCGRDESCSIZE ioctl return report descriptor size

defined by hardware rather than cached one to match HIDIOCGRDESC ioctl.
This fixes errors reported by hid-tools being run against /dev/hidraw#
device node belonging to driver which overloads report descriptor.

MFC after: 1 week

3 years agohkbd: Fix handling of keyboard ErrorRollOver reports
Vladimir Kondratyev [Sat, 13 Feb 2021 18:18:07 +0000 (21:18 +0300)]
hkbd: Fix handling of keyboard ErrorRollOver reports

Ignore fantom keyboard state reports entirelly rather than ignore
RollOver states for each key separatelly.  Latter results in spurious
release/push pairs of events on each fantom keyboard state report.

Reported by: Jan Martin Mikkelsen <janm_AT_transactionware_DOT_com>
Submitted by: Jan Martin Mikkelsen (initial version)
PR: 253249
MFC after: 1 week

3 years agoukbd: Fix handling of keyboard ErrorRollOver reports
Vladimir Kondratyev [Sat, 13 Feb 2021 18:12:56 +0000 (21:12 +0300)]
ukbd: Fix handling of keyboard ErrorRollOver reports

Ignore fantom keyboard state reports entirelly rather than ignore
RollOver states for each key separatelly.  Latter results in spurious
release/push pairs of events on each fantom keyboard state report.

Reported by: Jan Martin Mikkelsen <janm_AT_transactionware_DOT_com>
Submitted by: Jan Martin Mikkelsen (initial version)
PR: 253249
MFC after: 1 week

3 years agotools/build/make.py: drop workaround for cc --version not being parsed
Alex Richardson [Sat, 13 Feb 2021 13:54:20 +0000 (13:54 +0000)]
tools/build/make.py: drop workaround for cc --version not being parsed

Previously bsd.compiler.mk was not able to detect the compiler type for
Ubuntu's /usr/bin/cc unless we were invoking the /usr/bin/gcc symlink.
This problem has been fixed by 9c6954329a9285547881ddd60e393b7c55ed30c4
so we can drop the workaround from make.py.

Reviewed By: jrtc27
Differential Revision: https://reviews.freebsd.org/D28323

3 years agobin/pkill: Fix {pgrep,pkill}-j_test.sh
Alex Richardson [Sat, 13 Feb 2021 13:53:50 +0000 (13:53 +0000)]
bin/pkill: Fix {pgrep,pkill}-j_test.sh

The POSIX sh case statement does not allow for pattern matching using the
regex + qualifier so this case statement never matches. Instead just check
for a string starting with a digit followed by any character.

While touching these files also fix various shellcheck warnings.

`kyua -v parallelism=4 test` failed before, succeeds now.

Reviewed By: imp
Differential Revision: https://reviews.freebsd.org/D28480

3 years agolib/libc/tests/rpc: Correctly set timeout
Alex Richardson [Sat, 13 Feb 2021 13:52:59 +0000 (13:52 +0000)]
lib/libc/tests/rpc: Correctly set timeout

The rpc_control() API does not accept the CLCR_SET_RPCB_TIMEOUT command,
it only accepts RPC_SVC_CONNMAXREC_GET/RPC_SVC_CONNMAXREC_SET, so it was
not doing anything.
Instead of incorrectly calling this API, use clnt_create_timed() instead.

I noticed this because the test was timing out after 120s in the CheriBSD CI.

Reviewed By: ngie
Differential Revision: https://reviews.freebsd.org/D28478

3 years agoUpdate Subversion to 1.14.1 LTS. See contrib/subversion/CHANGES for a
Dimitry Andric [Sat, 13 Feb 2021 13:38:51 +0000 (14:38 +0100)]
Update Subversion to 1.14.1 LTS. See contrib/subversion/CHANGES for a
summary of changes, or for a more thorough overview:

https://subversion.apache.org/docs/release-notes/1.14

NOTE 1: There is no need to dump and reload repositories, and the
working copy format is still the same as Subversion 1.8 through 1.13.

NOTE 2: The upstream release also contains a fix for a security issue in
mod_dav_svn (CVE-2020-17525), but since we do not build or use any
Apache modules, it is not an issue for the FreeBSD base system.

Relnotes: yes
MFC after: 3 days

3 years agoRegenerate src.conf(5) after FMTREE default change
Kyle Evans [Wed, 10 Feb 2021 15:11:55 +0000 (09:11 -0600)]
Regenerate src.conf(5) after FMTREE default change

3 years agobuild: turn off FMTREE by default to prepare for removal
Kyle Evans [Wed, 10 Feb 2021 14:57:25 +0000 (08:57 -0600)]
build: turn off FMTREE by default to prepare for removal

nmtree is derived from fmtree, and has been the default mtree(8) since
6adfbbbf161, a little over a year after its introduction.

fmtree has not seen any substantial work since then, except for build
fixes and runtime issues that were diagnosed in nmtree and backported
because this was still in the tree.

Turn it off by default.

Reviewed by: bdrewery, brooks, cy, emaste
Differential Revision: https://reviews.freebsd.org/D28573

3 years agofmtree: add a deprecation notice to the manpage
Kyle Evans [Wed, 10 Feb 2021 15:10:52 +0000 (09:10 -0600)]
fmtree: add a deprecation notice to the manpage

Note that this mtree(8) is actually installed as fmtree(8), while
mtree(8) is located in ^/contrib/mtree -- thus, the reference to
mtree(8) makes a lot more sense in the context in which folks would
actually notice it. Shout-out to Ravi for pointing out that this may
not be an obvious fact.

MFC after: 3 days
Reviewed by: bdrewery, brooks, cy, emaste
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D28573

3 years agofusefs: set d_off during VOP_READDIR
Alan Somers [Fri, 12 Feb 2021 01:01:10 +0000 (18:01 -0700)]
fusefs: set d_off during VOP_READDIR

This allows d_off to be used with lseek to position the file so that
getdirentries(2) will return the next entry.  It is not used by
readdir(3).

PR: 253411
Reported by: John Millikin <jmillikin@gmail.com>
Reviewed by: cem
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D28605

3 years agoFix ifa refcount leak during route addition.
Alexander V. Chernikov [Fri, 12 Feb 2021 20:56:52 +0000 (20:56 +0000)]
Fix ifa refcount leak during route addition.

Reported by: rstone
Reviewed by: rstone
MFC after: 1 day

3 years agogit-arc(1): Fix nits pointed out in final review
Daniel Ebdrup Jensen [Fri, 12 Feb 2021 22:39:00 +0000 (23:39 +0100)]
git-arc(1): Fix nits pointed out in final review

Pointy hat to: me

3 years agogit-arc(1): Add manual page
Daniel Ebdrup Jensen [Fri, 12 Feb 2021 22:35:02 +0000 (23:35 +0100)]
git-arc(1): Add manual page

Add manual page based on the usage in the script with a few changes and
hook it up to the build.

Reviewed by: 0mp, markj
Differential Revision: https://reviews.freebsd.org/D28519

3 years agogit-arc: Use a separate message file
Mark Johnston [Fri, 12 Feb 2021 20:58:17 +0000 (15:58 -0500)]
git-arc: Use a separate message file

Rather than putting revision metadata in .git/arc/create-message, create
a tmpfile and use that.  Otherwise arc diff always prompts about it and
in some cases complains because its standard input is piped.

Reported by: imp
Differential Revision: https://reviews.freebsd.org/D28614

3 years agoFix various NOINET* builds broken by 145bf6c0af48.
Alexander V. Chernikov [Fri, 12 Feb 2021 20:36:20 +0000 (20:36 +0000)]
Fix various NOINET* builds broken by 145bf6c0af48.

Reported by: mjg, bdragon