]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
13 months agolibfido2: update to 1.10.0
Ed Maste [Fri, 5 May 2023 23:57:34 +0000 (19:57 -0400)]
libfido2: update to 1.10.0

Some highlights from NEWS:

 ** bio: fix CTAP2 canonical CBOR encoding in fido_bio_dev_enroll_*();
    gh#480.
 ** New API calls:
  - fido_dev_info_set;
  - fido_dev_io_handle;
  - fido_dev_new_with_info;
  - fido_dev_open_with_info.
 ** Documentation and reliability fixes.
 ** Support for TPM 2.0 attestation of COSE_ES256 credentials.

Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation

13 months agolibfido2: update to 1.9.0
Ed Maste [Fri, 5 May 2023 23:11:52 +0000 (19:11 -0400)]
libfido2: update to 1.9.0

Some highlights from NEWS:

 ** Added OpenSSL 3.0 compatibility.
 ** Removed OpenSSL 1.0 compatibility.
 ** Support for FIDO 2.1 "minPinLength" extension.
 ** Support for COSE_EDDSA, COSE_ES256, and COSE_RS1 attestation.
 ** Support for TPM 2.0 attestation.
 ** Support for device timeouts; see fido_dev_set_timeout().
 ** New API calls:
  - es256_pk_from_EVP_PKEY;
  - fido_cred_attstmt_len;
  - fido_cred_attstmt_ptr;
  - fido_cred_pin_minlen;
  - fido_cred_set_attstmt;
  - fido_cred_set_pin_minlen;
  - fido_dev_set_pin_minlen_rpid;
  - fido_dev_set_timeout;
  - rs256_pk_from_EVP_PKEY.
 ** Reliability and portability fixes.
 ** Better handling of HID devices without identification strings; gh#381.

Relnotes:       Yes
Sponsored by:   The FreeBSD Foundation

13 months agonfsd: Fix NFSv3 Readdir/ReaddirPlus reply for large i-node numbers
Rick Macklem [Fri, 5 May 2023 22:43:55 +0000 (15:43 -0700)]
nfsd: Fix NFSv3 Readdir/ReaddirPlus reply for large i-node numbers

If the i-node number (d_fileno) for a file on the server did
not fit in 32bits, it would be truncated to the low order 32bits
for the NFSv3 Readdir and ReaddirPlus RPC replies.
This is no longer correct, given that ino_t is now 64bits.

This patch fixes this by sending the full 64bits of d_fileno
on the wire in the NFSv3 Readdir/ReaddirPlus RPC reply.

PR: 271174
Reported by: bmueller@panasas.com
Tested by: bmueller@panasas.com
MFC after: 2 weeks

13 months agoAdd mrsasutil(8) as alias to mfiutil(8)
Doug Ambrisko [Wed, 24 Aug 2022 22:38:43 +0000 (15:38 -0700)]
Add mrsasutil(8) as alias to mfiutil(8)

mfiutil(8) in theory can work on devices attached to mrsas(4) but
mrsas(4) is missing the FreeBSD mfi(4) ioctl support.  Once that
support is added to mrsas(4) then mrsasutil(8) can manage mrsas(4)
attached devices.  So this commit depends on that.  When mrsasutil(8)
is run it automatically opens /dev/mrsas0 instead of /dev/mfi0.
Add -D <device> and -t <type> flag to optionally specify mrsas or mfi to
work with the existing -u <unit>.  Device is the device node with or
without /dev/

PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265794
Differential Revision: https://reviews.freebsd.org/D36343
Tested by: Dan Mahoney <freebsd@gushi.org>
Reviewed by: jhb

13 months agoApply libc++ fix for compiling <type_traits> with gcc 13
Dimitry Andric [Fri, 5 May 2023 16:19:40 +0000 (18:19 +0200)]
Apply libc++ fix for compiling <type_traits> with gcc 13

Merge commit 484e64f7e7b2 from llvm-project (by Roland McGrath):

  [libc++] Use __is_convertible built-in when available

  https://github.com/llvm/llvm-project/issues/62396 reports that
  GCC 13 barfs on parsing <type_traits> because of the declarations
  of `struct __is_convertible`.  In GCC 13, `__is_convertible` is a
  built-in, but `__is_convertible_to` is not.  Clang has both, so
  using either should be fine.

  Reviewed By: #libc, philnik

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

Reported by: Mark Millard <marklmi@yahoo.com>
MFC after: 3 days

13 months agodaemon: EINTR from kevent(2) is not a fatal error
Kyle Evans [Fri, 5 May 2023 15:12:13 +0000 (10:12 -0500)]
daemon: EINTR from kevent(2) is not a fatal error

Simply resume waiting for events rather than exiting if we took a signal
here.

This at least fixes running programs under daemon(8) in the face of
suspend/resume, which I suspect hits us with a spurious EINTR rather
than a signal anyways.

Reported and tested by: manu
Fixes: 8935a3993219b ("daemon: use kqueue for all events")

13 months agoman9: Add a manual page for kstack_contains(9).
Joseph Koshy [Tue, 2 May 2023 09:37:38 +0000 (10:37 +0100)]
man9: Add a manual page for kstack_contains(9).

Approved by: gnn (mentor)
Reviewed by: mhorne
Differential Revision: https://reviews.freebsd.org/D39933

13 months agoshare/mk/bsd.cpu.mk: add AltiVec / VSX to powerpc*'s MACHINE_CPU
Piotr Kubaj [Fri, 5 May 2023 14:19:19 +0000 (16:19 +0200)]
share/mk/bsd.cpu.mk: add AltiVec / VSX to powerpc*'s MACHINE_CPU

MFC after: 3 days
Approved by: jhibbits
Differential revision: https://reviews.freebsd.org/D39240

13 months agolibpcap: Update to 1.10.4
Joseph Mingrone [Fri, 5 May 2023 13:56:10 +0000 (10:56 -0300)]
libpcap: Update to 1.10.4

Changelog: https://git.tcpdump.org/libpcap/blob/104271ba4a14de6743e43bcf87536786d8fddea4:/CHANGES
Reviewed by: emaste
Obtained from: https://www.tcpdump.org/release/libpcap-1.10.4.tar.gz
Sponsored by: The FreeBSD Foundation

13 months agovmm: don't free unallocated memory
Corvin Köhne [Fri, 5 May 2023 06:36:20 +0000 (08:36 +0200)]
vmm: don't free unallocated memory

If vmx or svm is disabled in BIOS or the device isn't supported by vmm,
modinit won't allocate these state save areas. As kmem_free panics when
passing a NULL pointer to it, loading the vmm kernel module causes a
panic too.

PR: 271251
Reviewed by: markj
Fixes: 74ac712f72cfd6d7b3db3c9d3b72ccf2824aa183 ("vmm: Dynamically allocate a couple of per-CPU state save areas")
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D39974

13 months agobhyve(8): fix typo in examples
Alexey Marchenko [Fri, 5 May 2023 12:56:50 +0000 (14:56 +0200)]
bhyve(8): fix typo in examples

PR: 271259

13 months agodd: Fix SIGINT handling.
Dag-Erling Smørgrav [Fri, 5 May 2023 11:17:44 +0000 (11:17 +0000)]
dd: Fix SIGINT handling.

Currently, we handle SIGINT by calling summary() and _exit() directly from the signal handler, which we install after setup().  There are several issues with this:

* summary() is not signal safe;
* the parent is not informed about the signal;
* setup() can block on open(), and catching SIGINT at that stage will produce the correct exit status but will not print anything to stderr as POSIX demands.

Fix this by making SIGINT non-restartable, changing our signal handler to only set a flag, installing it before setup(), and checking the termination flag before and after every blocking operation, i.e. open(), read(), write().

Also add two test cases, one for catching SIGINT while opening the input and one for catching it while reading.  I couldn't think of an easy way to test catching SIGINT while writing (it's certainly feasible, but perhaps not from a shell script).

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: cracauer, ngie, imp
Differential Revision: https://reviews.freebsd.org/D39641

13 months agodd: Tidy up the tests.
Dag-Erling Smørgrav [Fri, 5 May 2023 11:17:39 +0000 (11:17 +0000)]
dd: Tidy up the tests.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: ngie
Differential Revision: https://reviews.freebsd.org/D39711

13 months agoMakefile.inc1: use make builtin :ts instead of sed
Ed Maste [Sun, 10 Apr 2022 22:52:48 +0000 (18:52 -0400)]
Makefile.inc1: use make builtin :ts instead of sed

Commit 3eb1b4da3cf7 replaced "xargs -n1" with a sed expression to
convert from space to newline as a list separator for *-old-* targets.
Dan Nelson followed up with a suggestion to use make's built-in :ts
instead, which should be slightly more efficient.

Reviewed by: sjg
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39972

13 months agopf: fix a few more prototypes
Kristof Provost [Fri, 5 May 2023 11:40:25 +0000 (13:40 +0200)]
pf: fix a few more prototypes

Fix function prototypes to use the same type for sa_family_t as the
definition.

Sponsored by: Rubicon Communications, LLC ("Netgate")

13 months agopvscsi: maximum target number is one less than number of targets
Yuri Pankov [Fri, 5 May 2023 09:48:57 +0000 (11:48 +0200)]
pvscsi: maximum target number is one less than number of targets

Fix the number of targets we inquiry to be one less than the maximum
number of targets adapter reports.  This gets rid of the errors reported
on VMware Workstation:

(probe36:pvscsi0:0:65:0): INQUIRY. CDB: 12 00 00 00 24 00
(probe36:pvscsi0:0:65:0): CAM status: CCB request completed with an error

While here, print the maximum number of targets.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D39867

13 months agontpd: Support IPv6-only hosts
Mina Galic [Fri, 5 May 2023 04:33:18 +0000 (21:33 -0700)]
ntpd: Support IPv6-only hosts

0.pool.* returns only IPv4 addresses.
2.pool.* returns both, IPv6 and IPv4 addresses.

conservatively extend our IPv4 only pool configuration by adding a
second pool, which also returns IPv6 addresses.

PR: 270536
Reported by: Lapo Luchini <lapo@lapo.it>
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/731
Differential Revision: https://reviews.freebsd.org/D39954

13 months agobuild.7: remove reference to deprecated mergemaster
Ed Maste [Fri, 3 Mar 2023 13:54:22 +0000 (08:54 -0500)]
build.7: remove reference to deprecated mergemaster

Sponsored by: The FreeBSD Foundation

13 months agosys/x86/x86/mptable.c: typo (compatiblity)
Igor Ostapenko [Fri, 5 May 2023 00:08:26 +0000 (01:08 +0100)]
sys/x86/x86/mptable.c: typo (compatiblity)

https://bugs.freebsd.org/269753

PR:                      269753
Reported by:             Igor Ostapenko
Approved by:             doc, src (delphij, imp, zlei)
Differential revision:   https://reviews.freebsd.org/D38741

13 months agosys/sys/_endian.h: typo (Compatiblity)
Igor Ostapenko [Fri, 5 May 2023 00:05:11 +0000 (01:05 +0100)]
sys/sys/_endian.h: typo (Compatiblity)

https://bugs.freebsd.org/269753

PR:                      269753
Reported by:             Igor Ostapenko
Approved by:             doc, src (delphij, imp, zlei)
Differential revision:   https://reviews.freebsd.org/D38741

13 months agosys/netpfil/ipfw/ip_fw2.c: typo (Compatiblity)
Igor Ostapenko [Fri, 5 May 2023 00:01:33 +0000 (01:01 +0100)]
sys/netpfil/ipfw/ip_fw2.c: typo (Compatiblity)

https://bugs.freebsd.org/269753

PR:                      269753
Reported by:             Igor Ostapenko
Approved by:             doc, src (delphij, imp, zlei)
Differential revision:   https://reviews.freebsd.org/D38741

13 months agosys/amd64/conf/FIRECRACKER: typo (compatiblity)
Igor Ostapenko [Thu, 4 May 2023 19:44:21 +0000 (20:44 +0100)]
sys/amd64/conf/FIRECRACKER: typo (compatiblity)

https://bugs.freebsd.org/269753

PR:                      269753
Reported by:             Igor Ostapenko
Approved by:             doc, src (delphij, imp, zlei)
Differential revision:   https://reviews.freebsd.org/D38741

13 months agoAdd wifi(4) alias for wlan(4).
Warner Losh [Thu, 4 May 2023 22:19:16 +0000 (16:19 -0600)]
Add wifi(4) alias for wlan(4).

Suggested by: jrtc27
Sponsored by: Netflix

13 months agompsutil(8): Remove a stray paragraph
Tom Hukins [Thu, 4 May 2023 22:05:15 +0000 (16:05 -0600)]
mpsutil(8): Remove a stray paragraph

Spotted by running `mandoc -Tlint usr.sbin/mpsutil/mpsutil.8`.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/729

13 months agompsutil(8): Improve English usage
Tom Hukins [Thu, 4 May 2023 22:05:15 +0000 (16:05 -0600)]
mpsutil(8): Improve English usage

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/729

13 months agompr(4) & mps(4): refer to related utilities
Tom Hukins [Thu, 4 May 2023 22:05:14 +0000 (16:05 -0600)]
mpr(4) & mps(4): refer to related utilities

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/729

13 months agobluetooth/hccontrol: Fix unterminated command list
Brian Campbell [Thu, 4 May 2023 22:01:31 +0000 (16:01 -0600)]
bluetooth/hccontrol: Fix unterminated command list

Signed-off-by: Brian Campbell <Brian.Campbell@ed.ac.uk>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/730

13 months agowlan(4): Mention WiFi more prominently
Tom Hukins [Mon, 1 May 2023 14:47:58 +0000 (15:47 +0100)]
wlan(4): Mention WiFi more prominently

WiFi is a commonly used term to describe wireless LANs.  Adding this
word will help readers better understand the contents of this manual
page and will help find the page when searching, for example when
running `man -k wifi`.

Pull Request: https://github.com/freebsd/freebsd-src/pull/721
Reviewed by: imp

13 months agoemac(4): Use bool rather than boolean_t.
John Baldwin [Thu, 4 May 2023 19:34:02 +0000 (12:34 -0700)]
emac(4): Use bool rather than boolean_t.

This was already using true/false rather than TRUE/FALSE.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D39927

13 months agoofw_cpu_early_foreach: Change callback to return bool instead of boolean_t.
John Baldwin [Thu, 4 May 2023 19:33:39 +0000 (12:33 -0700)]
ofw_cpu_early_foreach: Change callback to return bool instead of boolean_t.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D39926

13 months agodwc(4): Use bool rather than boolean_t.
John Baldwin [Thu, 4 May 2023 19:33:20 +0000 (12:33 -0700)]
dwc(4): Use bool rather than boolean_t.

This was already using true/false rather than TRUE/FALSE.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D39925

13 months agodpaa2: Replace boolean_t with bool.
John Baldwin [Thu, 4 May 2023 19:32:57 +0000 (12:32 -0700)]
dpaa2: Replace boolean_t with bool.

This was already using true/false rather than TRUE/FALSE.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D39924

13 months agoal: Replace boolean_t with either al_bool or bool.
John Baldwin [Thu, 4 May 2023 19:32:40 +0000 (12:32 -0700)]
al: Replace boolean_t with either al_bool or bool.

Use al_bool for interfaces and structures defined in the
OS-independent HAL in sys/contrib, and use plain bool for
FreeBSD-specific APIs and structures in sys/dev/al_eth.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D39923

13 months agoacpi_button: Replace boolean_t with better types.
John Baldwin [Thu, 4 May 2023 19:32:09 +0000 (12:32 -0700)]
acpi_button: Replace boolean_t with better types.

- Use an enum for the button type (it is not really a boolean value).

- Use bool for fixed.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D39922

13 months agopmap_{un}map_io_transient: Use bool instead of boolean_t.
John Baldwin [Thu, 4 May 2023 19:29:48 +0000 (12:29 -0700)]
pmap_{un}map_io_transient: Use bool instead of boolean_t.

Reviewed by: imp, kib
Differential Revision: https://reviews.freebsd.org/D39920

13 months agoimgact_elf: Change header_supported to return bool instead of boolean_t.
John Baldwin [Thu, 4 May 2023 19:29:29 +0000 (12:29 -0700)]
imgact_elf: Change header_supported to return bool instead of boolean_t.

Reviewed by: imp, kib, emaste
Differential Revision: https://reviews.freebsd.org/D39919

13 months agomd5 Makefile.depend.host
Simon J. Gerraty [Thu, 4 May 2023 19:03:34 +0000 (12:03 -0700)]
md5 Makefile.depend.host

13 months agolocal.dirdeps.mk skip N_host_libs for non-FreeBSD host
Simon J. Gerraty [Thu, 4 May 2023 18:58:39 +0000 (11:58 -0700)]
local.dirdeps.mk skip N_host_libs for non-FreeBSD host

The N_host_libs dance only makes sense if host is FreeBSD.
Even then, if MK_host_egacy is yes we need libmd

libnetbsd does not need libutil when using libegacy

Sponsored by: Juniper Networks, Inc.

13 months agotsort: Error out if writing to stdout failed.
Dag-Erling Smørgrav [Thu, 4 May 2023 17:26:59 +0000 (17:26 +0000)]
tsort: Error out if writing to stdout failed.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, imp
Differential Revision: https://reviews.freebsd.org/D39959

13 months agoncal: Error out if writing to stdout failed.
Dag-Erling Smørgrav [Thu, 4 May 2023 17:26:54 +0000 (17:26 +0000)]
ncal: Error out if writing to stdout failed.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans, imp
Differential Revision: https://reviews.freebsd.org/D39958

13 months agodirdeps.mk for host* DEP_TARGET_SPEC is just DEP_MACHINE
Simon J. Gerraty [Thu, 4 May 2023 18:29:33 +0000 (11:29 -0700)]
dirdeps.mk for host* DEP_TARGET_SPEC is just DEP_MACHINE

This helps avoid ugly noise in dirdeps.cache on Linux.

13 months agoUpdate meta.sys.mk ensure DEP_* set at level 1+
Simon J. Gerraty [Thu, 4 May 2023 16:46:47 +0000 (09:46 -0700)]
Update meta.sys.mk ensure DEP_* set at level 1+

13 months agopf: remove NULL check before uma_zfree()
Kristof Provost [Thu, 4 May 2023 15:20:02 +0000 (17:20 +0200)]
pf: remove NULL check before uma_zfree()

uma_zfree() can be called on a NULL pointer. Simplify the pf code a
little by removing the redundant checks.

Sponsored by: Rubicon Communications, LLC ("Netgate")

13 months agoAdd 'contrib/spleen/' from commit '5eab6333fa27e2b6954c6927859d462a004e57bb'
Ed Maste [Thu, 4 May 2023 15:46:25 +0000 (11:46 -0400)]
Add 'contrib/spleen/' from commit '5eab6333fa27e2b6954c6927859d462a004e57bb'

git-subtree-dir: contrib/spleen
git-subtree-mainline: 3582acbad303bb69895457a8a7dae0f485efe8ea
git-subtree-split: 5eab6333fa27e2b6954c6927859d462a004e57bb

Reviewed by: imp [earlier]
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20653

13 months agoamd64 mp_machdep.c: remove useless comment
Konstantin Belousov [Thu, 4 May 2023 06:24:03 +0000 (09:24 +0300)]
amd64 mp_machdep.c: remove useless comment

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D39945

13 months agoamd64: do not leak pcpu pages
Konstantin Belousov [Wed, 3 May 2023 09:41:46 +0000 (12:41 +0300)]
amd64: do not leak pcpu pages

Do not preallocate pcpu area backing pages on early startup, only
allocate enough of KVA for pcpu[MAXCPU] and the page for BSP.  Other
pages are allocated after we know the number of cpus and their
assignments to the domains.

PCPUs are not accessed until they are initialized, which happens on AP
startup.

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D39945

13 months agoamd64: initialize APs kpmap_store in init_secondary()
Konstantin Belousov [Thu, 4 May 2023 06:17:30 +0000 (09:17 +0300)]
amd64: initialize APs kpmap_store in init_secondary()

The APs pcpu area is zeroed in init_secondary() by pcpu_init(), so the
early initialization in pmap_bootstrap() is nop.

Fixes: 42f722e721cd010ae5759a4b0d3b7b93c2b9cad2ESC
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D39945

13 months agoVendor import of spleen font 1.9.3
Ed Maste [Thu, 4 May 2023 15:05:42 +0000 (11:05 -0400)]
Vendor import of spleen font 1.9.3

13 months agoImport libpcap 1.10.4
Joseph Mingrone [Thu, 4 May 2023 14:52:25 +0000 (11:52 -0300)]
Import libpcap 1.10.4

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

13 months agoVendor import of spleen font 1.6.0
Ed Maste [Thu, 4 May 2023 14:38:22 +0000 (10:38 -0400)]
Vendor import of spleen font 1.6.0

Obtained from: https://github.com/fcambus/spleen

13 months agostand: Fix oversight in updating OpenZFS: Add com.klarasystems:vdev_zaps_v2
Warner Losh [Thu, 4 May 2023 14:25:46 +0000 (08:25 -0600)]
stand: Fix oversight in updating OpenZFS: Add com.klarasystems:vdev_zaps_v2

com.klarasystems:vdev_zaps_v2 is a new feature that the last OpenZFS
import brought in. It needs to be on the list of supported features, but
that update didn't happen so I woke up to a mailbox with multiple
complaints.

CirrusCI test to boot twice with a zpool update inbetween coming later
today.

Sponsored by: Netflix

13 months agoObsoleteFiles: Complete 20201025: Remove cal data files
Li-Wen Hsu [Thu, 4 May 2023 04:28:52 +0000 (12:28 +0800)]
ObsoleteFiles: Complete 20201025: Remove cal data files

Fixes: d20d6550187a calendar: remove all datafiles except freebsd one
MFC after: 3 days

13 months agorelease: Report disk image filename
Ed Maste [Mon, 16 May 2022 18:37:21 +0000 (14:37 -0400)]
release: Report disk image filename

For someone new to the release bits it's not always clear what files are
being created. Report the disk image name explicitly.

Reviewed by: gjb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39953

13 months agofsck_ffs: fix the previous change that skipped pass 5 in some cases
Chuck Silvers [Wed, 3 May 2023 20:21:19 +0000 (13:21 -0700)]
fsck_ffs: fix the previous change that skipped pass 5 in some cases

The previous change involved calling check_cgmagic() twice in a row
for the same CG in order to differentiate when the CG was already ok vs.
when the CG was rebuilt, but that doesn't work because the second call
(which was supposed to rebuild the CG) returns 0 (indicating that
the CG was not rebuilt) due to the prevfailcg check causing an early
failure return.  Fix this by moving the rebuild part of check_cgmagic()
out into a separate function which is called by pass1() when it wants to
rebuild a CG.

Fixes: da86e7a20dc4a4b17e8d9e7630ed9b675cf71702
Reported by: pho
Discussed with: mckusick
Sponsored by: Netflix

13 months agolocal.meta.sys.mk set BOOTSTRAPPING
Simon J. Gerraty [Wed, 3 May 2023 19:20:02 +0000 (12:20 -0700)]
local.meta.sys.mk set BOOTSTRAPPING

When building for host on non-FreeBSD
some makefiles want to see BOOTSTRAPPING defined.

With this libmd and hence nmtree build ok

13 months agosctp: only start shutdown guard timer when sending SHUTDOWN chunk
Michael Tuexen [Wed, 3 May 2023 18:28:46 +0000 (20:28 +0200)]
sctp: only start shutdown guard timer when sending SHUTDOWN chunk

The intention is to protect a malicious peer not following the
shutdown procedures.

MFC after: 1 week

13 months agounix: Fix locking in uipc_peeraddr()
Mark Johnston [Wed, 3 May 2023 15:56:46 +0000 (11:56 -0400)]
unix: Fix locking in uipc_peeraddr()

After the locking protocol changed in commit 75a67bf3d00d ("AF_UNIX:
make unix socket locking finer grained"), uipc_peeraddr() was not
updated accordingly.

The link lock now only protects global socket lists.  The PCB lock is
used to protect the link between connected PCBs, so use that.  Remove an
old comment which appears to be noting that unp_conn is not set for
connected SOCK_DGRAM sockets (in one direction anyway).

Reviewed by: glebius
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39855

13 months agosrc.conf: add WITH_TOOLCHAIN description
Ed Maste [Tue, 2 May 2023 17:27:18 +0000 (13:27 -0400)]
src.conf: add WITH_TOOLCHAIN description

It is not used by the in-tree default configuration, but adding it
allows downstream projects with different defaults to make use of
Cirrus-CI (as the makeman test added in 85e8c2a03490 requires that
there are no missing option descriptions).

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39936

13 months agosctp: improve shutdown(..., SHUT_WR) handling
Michael Tuexen [Wed, 3 May 2023 15:30:50 +0000 (17:30 +0200)]
sctp: improve shutdown(..., SHUT_WR) handling

When shutdown(..., SHUT_WR) is called in the front states, send a
SHUTDOWN chunk when a COOKIE ACK chunk is received and there is
no outstanding data.

MFC after: 1 week

13 months agoauthpf: do not sprintf to a null pointer
Ed Maste [Wed, 3 May 2023 13:26:42 +0000 (09:26 -0400)]
authpf: do not sprintf to a null pointer

The fgetln loop will terminate with buf = NULL at EOF.

Reported by: GCC
Reviewed by: kp
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39947

13 months agozfs: merge openzfs/zfs@d96e29576
Martin Matuska [Wed, 3 May 2023 10:04:55 +0000 (12:04 +0200)]
zfs: merge openzfs/zfs@d96e29576

Notable upstream pull request merges:

  #11680 Add support for zpool user properties
  #14145 Storage device expansion "silently" fails on degraded vdev
  #14405 Create zap for root vdev
  #14659 Allow MMP to bypass waiting for other threads
  #14674 Miscellaneous FreBSD compilation bugfixes
  #14692 Fix some signedness issues in arc_evict()
  #14702 Fix typo in check_clones()
  #14715 module: small fixes for FreeBSD/aarch64
  #14716 Trim needless zeroes from checksum events
  #14719 vdev: expose zfs_vdev_max_ms_shift as a module parameter
  #14722 Fix "Detach spare vdev in case if resilvering does not happen"
  #14723 freebsd clone range fixes
  #14728 Fix BLAKE3 aarch64 assembly for FreeBSD and macOS
  #14735 Fix in check_filesystem()
  #14739 Fix data corruption when cloning embedded blocks
  #14758 Fix VERIFY(!zil_replaying(zilog, tx)) panic
  #14761 Revert "ZFS_IOC_COUNT_FILLED does unnecessary txg_wait_synced()"
  #14774 FreeBSD .zfs fixups
  #14776 FreeBSD: make zfs_vfs_held() definition consistent with declaration
  #14779 powerpc64: Support ELFv2 asm on Big Endian
  #14788 FreeBSD: add missing vop_fplookup assignments
  #14789 PAM: support the authentication facility
  #14790 Revert "Fix data race between zil_commit() and zil_suspend()"
  #14795 Fix positive ABD size assertion in abd_verify()
  #14798 Mark TX_COMMIT transaction with TXG_NOTHROTTLE
  #14804 Correct ABD size for split block ZIOs
  #14806 Use correct block pointer in block cloning case.
  #14808 blake3: fix up bogus checksums in face of cpu migration

Obtained from: OpenZFS
OpenZFS commit: d96e29576c89e6e547cb82b477651d2b85ea0fed

13 months agopf: improve source node error handling
Kajetan Staszkiewicz [Wed, 3 May 2023 08:31:05 +0000 (10:31 +0200)]
pf: improve source node error handling

Functions manipulating source nodes can fail due to various reasons like
memory allocation errors, hitting configured limits or lack of
redirection targets. Ensure those errors are properly caught and
propagated in the code. Increase the error counters not only when
parsing the main ruleset but the NAT ruleset too.

Cherry-picked from development of D39880

Reviewed by: kp
Sponsored by: InnoGames GmbH
Differential Revision: https://reviews.freebsd.org/D39940

13 months agopf: simplify structs with anonymous unions
Kristof Provost [Wed, 3 May 2023 06:02:43 +0000 (08:02 +0200)]
pf: simplify structs with anonymous unions

Rather than playing preprocessor hacks use actual anonymous unions.
No functional change.

Sponsored by: Rubicon Communications, LLC ("Netgate")

13 months agoRELNOTES: Document TI code removal from armv7 GENERIC kernel
Emmanuel Vadot [Wed, 3 May 2023 07:21:58 +0000 (09:21 +0200)]
RELNOTES: Document TI code removal from armv7 GENERIC kernel

Suggested by: mhorne
Sponsored by: Beckhoff Automation GmbH & Co. KG

13 months agoRELNOTES: Add fwget entry
Emmanuel Vadot [Wed, 3 May 2023 07:20:35 +0000 (09:20 +0200)]
RELNOTES: Add fwget entry

Sponsored by: Beckhoff Automation GmbH & Co. KG

13 months agovfs: reduce audit branching in namei_setup
Mateusz Guzik [Wed, 3 May 2023 06:56:10 +0000 (06:56 +0000)]
vfs: reduce audit branching in namei_setup

13 months agoriscv: Add pass(4) to GENERIC kernel
Jessica Clarke [Wed, 3 May 2023 04:14:57 +0000 (05:14 +0100)]
riscv: Add pass(4) to GENERIC kernel

Whilst we don't have ahci(4) currently, we do have umass(4), and need
pass(4) for smartctl(8) to be able to talk to such devices.

Reported by: David Gilbert <dgilbert@daveg.ca>
MFC after: 1 week

13 months agortld: don't add extraneous -L directory when MK_TOOLCHAIN == no
Ed Maste [Tue, 2 May 2023 19:57:20 +0000 (15:57 -0400)]
rtld: don't add extraneous -L directory when MK_TOOLCHAIN == no

rtld's Makefile used to add -L${LIBDIR} to LDFLAGS when MK_TOOLCHAIN was
no.  This was done as part of a change to fix building rtld with
MK_TOOLCHAIN == no (although I'm not sure this part was necessary).

In any case as of 5f2e84015da7 libc_pic.a is built independent of the
MK_TOOLCHAIN setting and the main part of the workaround has already
been removed.  Remove the rest now.

This reverts commit c0f5aeb0329d71e6b02379133c0c9c0145c9afea.

Reviewed by: jrtc27
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39938

13 months agovmrun.sh: mention new edk2 package
Christos Margiolis [Tue, 2 May 2023 19:19:08 +0000 (19:19 +0000)]
vmrun.sh: mention new edk2 package

uefi-edk2-bhyve no longer exists.

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

13 months agoConvert nfs bootp/diskless to use IfAPI
Justin Hibbits [Tue, 7 Feb 2023 19:37:03 +0000 (14:37 -0500)]
Convert nfs bootp/diskless to use IfAPI

Use the new IfAPI interface and address iterators so the nfs driver
doesn't need direct access to the interface structures.

Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38962

13 months agoMechanically convert if_hn(4) to IfAPI
Justin Hibbits [Mon, 26 Sep 2022 14:34:28 +0000 (10:34 -0400)]
Mechanically convert if_hn(4) to IfAPI

Reviewed by: zlei
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37855

13 months agoIfAPI: Add if_maddr_empty() to check for any maddrs
Justin Hibbits [Mon, 10 Apr 2023 18:20:00 +0000 (14:20 -0400)]
IfAPI: Add if_maddr_empty() to check for any maddrs

if_llmaddr_count() only counts link-level multicast addresses.
hv_netvsc(4) needs to know if there are any multicast addresses.  Since
hv_netvsc(4) is the only instance where this would be used, make it a
simple boolean.  If others need a if_maddr_count(), that can be added in
the future.

Reviewed by: melifaro
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39493

13 months agoriscv: retire the FPE kernel option
Mitchell Horne [Tue, 25 Apr 2023 17:51:35 +0000 (14:51 -0300)]
riscv: retire the FPE kernel option

We always build the kernel floating point support. Now that the
riscv64sf userspace variant has been removed the option is required for
correct operation.

Reviewed by: jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39851

13 months agoriscv: remove unused string from swtch.S
Mitchell Horne [Mon, 23 Jan 2023 17:11:16 +0000 (13:11 -0400)]
riscv: remove unused string from swtch.S

MFC after: 3 days
Sponsored by: The FreeBSD Foundation

13 months agoUse correct block pointer in block cloning case.
Pawel Jakub Dawidek [Tue, 2 May 2023 16:24:26 +0000 (01:24 +0900)]
Use correct block pointer in block cloning case.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14806

13 months agoWrap clang specific pragma
Brian Behlendorf [Tue, 2 May 2023 16:21:47 +0000 (09:21 -0700)]
Wrap clang specific pragma

Clang specific pragmas need to be wrapped to prevent a build
warning when compiling with gcc.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #14814

13 months agortsol: introduce an 'always' script
Kristof Provost [Tue, 2 May 2023 08:45:01 +0000 (10:45 +0200)]
rtsol: introduce an 'always' script

In addition to the 'M' and 'O' scripts (for when 'Managed' and 'Other'
flags are set) also introduce an 'always' script that is called for any
router advertisement (so even if M and O are not set).

This is primarly useful for systems like pfSense that wish to be
informed of routers for further system configuration.

See also https://redmine.pfsense.org/issues/14072

Reviewed by: melifaro
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D39931

13 months agofstatat(2): restore AT_EMPTY_PATH handling
Konstantin Belousov [Tue, 2 May 2023 15:11:39 +0000 (18:11 +0300)]
fstatat(2): restore AT_EMPTY_PATH handling

Fixes: cb858340dcbf214cc4c4d78dbb741620d7b3a252
Reported by: markj
Sponsored by: The FreeBSD Foundation

13 months agoIntel DMAR: remove parsing of 6-level paging capability
Jason A. Harmening [Mon, 1 May 2023 16:22:39 +0000 (11:22 -0500)]
Intel DMAR: remove parsing of 6-level paging capability

Early versions of the VT-d spec mentioned 6-level paging support as a
possible value for the SAGAW capability, but later versions removed it
and SAGAW=0x10 is currently listed as a reserved value.

The 6-level (agaw=64) entry in sagaw_bits is furthermore problematic
with clang15 because the attempted comparison against 1ULL << 64 in
dmar_maxaddr2mgaw() causes the compiler to elide the last iteration
of the initial loop, which bypasses the subsequent logic to find the
greatest HW-supported address width.  This results in 5-level paging
always being selected regardless of whether the hardware supports it,
which can result address translation failure due to invalid context-
entry programming.

Reviewed by: kib
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D39896

13 months agoamd64: store pcids pmap data in pcpu zone
Konstantin Belousov [Mon, 1 May 2023 05:17:45 +0000 (08:17 +0300)]
amd64: store pcids pmap data in pcpu zone

This change eliminates the struct pmap_pcid array embedded into struct
pmap and sized by MAXCPU, which would bloat with MAXCPU increase.  Also
it removes false sharing of cache lines, since the array elements are
mostly locally accessed by corresponding CPUs.

Suggested by: mjg
Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D39890

13 months agoamd64 pmap_pcid_alloc(): pass a pointer to struct pmap_pcid instead of cpuid
Konstantin Belousov [Mon, 1 May 2023 11:35:48 +0000 (14:35 +0300)]
amd64 pmap_pcid_alloc(): pass a pointer to struct pmap_pcid instead of cpuid

Cpuid is used to index the pmap->pm_pcids array only.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D39890

13 months agoamd64: add pmap_get_pcid() helper
Konstantin Belousov [Mon, 1 May 2023 11:02:59 +0000 (14:02 +0300)]
amd64: add pmap_get_pcid() helper

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D39890

13 months agoamd64 pmap: add pmap_pinit_pcids() helper
Konstantin Belousov [Mon, 1 May 2023 11:21:10 +0000 (14:21 +0300)]
amd64 pmap: add pmap_pinit_pcids() helper

to initialize pm_pcids array for a new user pmap

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D39890

13 months agoamd64: move definition of the struct pmap_pcids into _pmap.h
Konstantin Belousov [Mon, 1 May 2023 11:06:30 +0000 (14:06 +0300)]
amd64: move definition of the struct pmap_pcids into _pmap.h

and rename the structure to pmap_pcid.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D39890

14 months agoMFV: less v632.
Xin LI [Tue, 2 May 2023 03:43:57 +0000 (20:43 -0700)]
MFV: less v632.

MFC after: 2 weeks

14 months agosrc.conf.5: regen after MK_TOOLCHAIN / MK_INCLUDES decoupling
Ed Maste [Tue, 2 May 2023 00:39:30 +0000 (20:39 -0400)]
src.conf.5: regen after MK_TOOLCHAIN / MK_INCLUDES decoupling

14 months agosrc.opts.mk: Decouple MK_INCLUDES from MK_TOOLCHAIN
Ed Maste [Mon, 1 May 2023 20:58:42 +0000 (16:58 -0400)]
src.opts.mk: Decouple MK_INCLUDES from MK_TOOLCHAIN

Prior to 590461a4b89b installation of include files was controlled
directly by ${MK_TOOLCHAIN}.  590461a4b89b added an INCLUDES knob
defaulting to YES.  Setting WITHOUT_TOOLCHAIN forced it off to retain
existing behaviour.

Decouple them now, as there are reasonable use cases for installing
libraries and include files without a compiler or other tool chain
components.

Reviewed by: imp, jrtc27
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39918

14 months agoblake3: fix up bogus checksums in face of cpu migration
Mateusz Guzik [Tue, 2 May 2023 00:21:27 +0000 (02:21 +0200)]
blake3: fix up bogus checksums in face of cpu migration

This is a temporary measure until a better fix is sorted out.

Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Rich Ercolani <rincebrain@gmail.com>
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Sponsored by: Rubicon Communications, LLC ("Netgate")
Closes #14785
Closes #14808

14 months agoCorrect ABD size for split block ZIOs
Serapheim Dimitropoulos [Tue, 2 May 2023 00:18:42 +0000 (17:18 -0700)]
Correct ABD size for split block ZIOs

Currently when layering the ABD buffer of each split block on top of
an indirect vdev's ZIO ABD we don't specify the split block's ABD.
This results in those ABDs being incorrectly sized by inheriting
the size of their parent ABD which is larger than what each split
block needs.

The above behavior isn't causing any bugs currently but can lead
to unexpected ABD sizes for people analyzing and/or working on
the ZIO codepath. This patch fixes this behavior by properly setting
the ABD size for split block ZIOs.

Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Mark Maybee <mark.maybee@delphix.com>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Closes #14804

14 months agostand: More protection against malformed smbios tables
Warner Losh [Mon, 1 May 2023 21:12:41 +0000 (15:12 -0600)]
stand: More protection against malformed smbios tables

Add some more sanity checks to make sure we don't march off the end of
the table. Typically, smbios structures are well formed, or Windows
wouldn't boot. Sometimes they aren't, and this at least fails safe.

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

14 months agostand: Avoid unaligned access in smbios code
Warner Losh [Mon, 1 May 2023 21:12:34 +0000 (15:12 -0600)]
stand: Avoid unaligned access in smbios code

This code was written on x86 where unaligned accesses were
easy. LinuxBoot running on aarch64 uses mmap of /dev/mem to read the
smbios table. Linux's mapping of this memory doesn't allow the normal
unaligned fixup, so we get a bus error instead. We can't use the more
natural le16dec and friends because they optimize into a single,
unaligned memory load. We don't see this issue on aarch64 UEFI because
memory is mapped such that unaligned accesses are fixed up.

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

14 months agokboot: Add smbios support
Warner Losh [Mon, 1 May 2023 21:12:29 +0000 (15:12 -0600)]
kboot: Add smbios support

Add support for getting smbios from /sys/firmware/efi/systab, if
any. Add ptov mapping that uses mmap on /dev/mem to do the mapping with
64k pages (usually we only need 1 or two mappings).

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

14 months agokboot: Fix an off by one error
Warner Losh [Mon, 1 May 2023 21:12:24 +0000 (15:12 -0600)]
kboot: Fix an off by one error

Fix an off-by-one error that would mean we'd get stuck on the newline if
ACPI= wasn't first.

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

14 months agostand: Testing program for smbios
Warner Losh [Mon, 1 May 2023 21:12:19 +0000 (15:12 -0600)]
stand: Testing program for smbios

Write a quick and dirty testing program to dump physical memory to help
test and debug the smbios.c code in new environments.

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

14 months agokboot: Add HOST_MAP_FAILED define
Warner Losh [Mon, 1 May 2023 21:11:32 +0000 (15:11 -0600)]
kboot: Add HOST_MAP_FAILED define

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

14 months agostand: Add isspace to FreeBSD ctypes.h
Warner Losh [Mon, 1 May 2023 17:50:21 +0000 (11:50 -0600)]
stand: Add isspace to FreeBSD ctypes.h

And eliminate blake3_impl_hack.c since it's no longer needed.

Sponsored by: Netflix
Reviewed by: delphij
Differential Revision: https://reviews.freebsd.org/D39899

14 months agostand: back out the most of the horrible aarch64 kludge
Warner Losh [Mon, 1 May 2023 16:07:00 +0000 (10:07 -0600)]
stand: back out the most of the horrible aarch64 kludge

Add one ifdef to upstrem code and get rid of compiling the horrible
checked-in aarch64 assembler for the boot loader that the loader will
never use. I'll attempt to upstream this and adjust as needed.

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

14 months agostand: remove ZFS warning about computered but unused variable
Warner Losh [Mon, 1 May 2023 15:45:41 +0000 (09:45 -0600)]
stand: remove ZFS warning about computered but unused variable

Toss a __unused on the unexpected_errors variable. We compute it, but
never use it.

Sponsored by: Netflix

14 months agostand: Fix warning about variable unused
Warner Losh [Mon, 1 May 2023 15:35:16 +0000 (09:35 -0600)]
stand: Fix warning about variable unused

dflag is unused when LOADER_VERIEXEC isn't defined, so move it under the
ifdef.

Sponsored by: Netflix

14 months agostand/kboot: Simplify
Warner Losh [Mon, 1 May 2023 15:28:32 +0000 (09:28 -0600)]
stand/kboot: Simplify

There's plenty of stack in kboot, so use it here rather than the
malloc/free dance.

Sponsored by: Netflix
Reviewed by: tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D39416