]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
8 hours agoaccept_filter: return different errors for non-listener and a busy socket main
Gleb Smirnoff [Thu, 25 Apr 2024 04:50:58 +0000 (21:50 -0700)]
accept_filter: return different errors for non-listener and a busy socket

The fact that an accept filter needs to be cleared first before setting to
a different one isn't properly documented.  The requirement that the
socket needs already be listening, although trivial, isn't documented
either.  At least return a more meaningful error than EINVAL for an
existing filter.  Cover this with a test case.

12 hours agoaccf_tls: accept filter that waits for TLS handshake header
Gleb Smirnoff [Wed, 24 Apr 2024 20:36:43 +0000 (13:36 -0700)]
accf_tls: accept filter that waits for TLS handshake header

17 hours agosyscalls.master: correct return type of {read,write}v
Brooks Davis [Wed, 24 Apr 2024 19:47:22 +0000 (20:47 +0100)]
syscalls.master: correct return type of {read,write}v

This was missed when read/write, etc were updated to return ssize_t.

Fixes: 2e83b2816183 Fix a few syscall arguments to use size_t instead of u_int.

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

17 hours agovfs_lookup.c: only call ktrcapfail() if KTRACE is enabled
Konstantin Belousov [Wed, 24 Apr 2024 19:06:14 +0000 (22:06 +0300)]
vfs_lookup.c: only call ktrcapfail() if KTRACE is enabled

Reviewed by: emaste, imp, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44931

17 hours agosys/namei.h: move NI_CAP_VIOLATION() macro from namei.h to vfs_lookup.c
Konstantin Belousov [Wed, 24 Apr 2024 18:55:37 +0000 (21:55 +0300)]
sys/namei.h: move NI_CAP_VIOLATION() macro from namei.h to vfs_lookup.c

Reviewed by: emaste, imp, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44931

17 hours agometa.autodep.mk do not override start_utc
Simon J. Gerraty [Wed, 24 Apr 2024 19:25:42 +0000 (12:25 -0700)]
meta.autodep.mk do not override start_utc

Update meta.autodep.mk
If included at level 0 it is important not to override start_utc

18 hours agoelf_common.h: Add STO_AARCH64_VARIANT_PCS
Andrew Turner [Wed, 17 Apr 2024 13:18:24 +0000 (14:18 +0100)]
elf_common.h: Add STO_AARCH64_VARIANT_PCS

This is used to mark symbols that use a variant procedure call with
a different calling convention to the main ABI.

Reviewed by: kib, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44868

18 hours agoshowconfig: Set MACHINE for src.opts.mk
Andrew Turner [Thu, 18 Apr 2024 15:22:46 +0000 (16:22 +0100)]
showconfig: Set MACHINE for src.opts.mk

Also set MACHINE and MACHINE_ARCH when reading config options from
src.opts.mk. This ensures any machine-dependent options are reported
correctly.

Reviewed by: emaste, imp
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44838

18 hours agoarm64: Check DMAP address is valid in PHYS_IN_DMAP
Andrew Turner [Mon, 8 Apr 2024 10:44:33 +0000 (10:44 +0000)]
arm64: Check DMAP address is valid in PHYS_IN_DMAP

When checking if a physical address is in the DMAP region we assume
all physical addresses between DMAP_MIN_PHYSADDR and DMAP_MAX_PHYSADDR
are able to be accesses through the DMAP. It may be the case that
there is device memory in this range that shouldn't be accessed through
the DMAP mappings.

Add a check to PHYS_IN_DMAP that the translated virtual address is a
valid kernel address. To support code that already checks the address
is valid add PHYS_IN_DMAP_RANGE.

PR: 278233
Reviewed by: alc, markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44677

18 hours agoarm64/vmm: Ensure the tlbi has completed
Andrew Turner [Mon, 15 Apr 2024 14:36:20 +0000 (14:36 +0000)]
arm64/vmm: Ensure the tlbi has completed

Ensure the TLB is invalidated before enabling the EL2 MMU. Without
this the TLB may be in an inconsistant state leading to a possible
exception when enabling the MMU.

PR: 277559
Reviewed by: markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D44799

23 hours agobhyve.8: Document arm64 support
Mark Johnston [Wed, 24 Apr 2024 13:57:42 +0000 (09:57 -0400)]
bhyve.8: Document arm64 support

- Mention the options that are amd64-only.
- Provide a minimal example for booting an arm64 guest.

Reviewed by: corvink
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D44738

23 hours agovmrun.sh: Stop passing -A to bhyve
Mark Johnston [Wed, 24 Apr 2024 13:57:50 +0000 (09:57 -0400)]
vmrun.sh: Stop passing -A to bhyve

It's a no-op now.

Sponsored by: Innovate UK

23 hours agobhyve.8: Remove mention of the -A flag
Mark Johnston [Wed, 24 Apr 2024 13:57:12 +0000 (09:57 -0400)]
bhyve.8: Remove mention of the -A flag

It is a no-op on amd64 now and is not implemented on arm64, so let's
remove mention of it altogether so as to reduce confusion for arm64
users.

Reviewed by: corvink, jhb
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D44737

23 hours agogeli.8: add some notes regarding performance tuning
Alan Somers [Mon, 22 Apr 2024 21:52:07 +0000 (15:52 -0600)]
geli.8: add some notes regarding performance tuning

MFC after: 1 week
Sponsored by: Axcient
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44908

24 hours agobusdma: uma_zcreate() does not fail
Mark Johnston [Tue, 23 Apr 2024 16:23:13 +0000 (12:23 -0400)]
busdma: uma_zcreate() does not fail

No functional change intended.

MFC after: 1 week

24 hours agokhelp: uma_zcreate() does not fail
Mark Johnston [Tue, 23 Apr 2024 16:22:27 +0000 (12:22 -0400)]
khelp: uma_zcreate() does not fail

No functional change intended.

MFC after: 1 week

24 hours agoudf: uma_zcreate() does not fail
Mark Johnston [Tue, 23 Apr 2024 16:20:50 +0000 (12:20 -0400)]
udf: uma_zcreate() does not fail

While here remove an old comment regarding preallocation; it appears to
refer to an optimization that is almost certainly irrelevant at this
point.

No functional change intended.

MFC after: 1 week

24 hours agowg: uma_zcreate() does not fail
Mark Johnston [Tue, 23 Apr 2024 16:19:08 +0000 (12:19 -0400)]
wg: uma_zcreate() does not fail

No functional change intended.

MFC after: 1 week

24 hours agodpaa: uma_zcreate() does not fail
Mark Johnston [Tue, 23 Apr 2024 16:18:21 +0000 (12:18 -0400)]
dpaa: uma_zcreate() does not fail

No functional change intended.

MFC after: 1 week

24 hours agong_pipe: Do not panic when memory allocations fail
Martin Vahlensieck [Wed, 17 Apr 2024 19:01:34 +0000 (21:01 +0200)]
ng_pipe: Do not panic when memory allocations fail

Signed-off-by: Martin Vahlensieck <git@academicsolutions.ch>
Reviewed by: markj
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1181

24 hours agong_pipe: Replace deprecated random() with prng32_bounded()
Martin Vahlensieck [Wed, 17 Apr 2024 18:59:22 +0000 (20:59 +0200)]
ng_pipe: Replace deprecated random() with prng32_bounded()

Signed-off-by: Martin Vahlensieck <git@academicsolutions.ch>
MFC after: 2 weeks
Reviewed by: markj
Pull Request: https://github.com/freebsd/freebsd-src/pull/1181

24 hours agong_pipe: Remove node when all hooks are disconnected
Martin Vahlensieck [Wed, 17 Apr 2024 18:51:40 +0000 (20:51 +0200)]
ng_pipe: Remove node when all hooks are disconnected

This is the behavior described in the man page.

Signed-off-by: Martin Vahlensieck <git@academicsolutions.ch>
Discussed with: glebius
Reviewed by: markj
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1181

24 hours agong_pipe: Fix whitespace
Martin Vahlensieck [Wed, 17 Apr 2024 18:50:39 +0000 (20:50 +0200)]
ng_pipe: Fix whitespace

Signed-off-by: Martin Vahlensieck <git@academicsolutions.ch>
Reviewed by: markj
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1181

31 hours agoheimdal: Fix compiling hdb ldap as a module
Cy Schubert [Fri, 10 Jan 2014 19:18:06 +0000 (13:18 -0600)]
heimdal: Fix compiling hdb ldap as a module

Fix build when WITH_OPENLDAP defined.

PR: 278430
Obtained from: Upstream c1c7da7f79

31 hours agokdc: Add restart option
Cy Schubert [Thu, 18 Apr 2024 18:56:54 +0000 (11:56 -0700)]
kdc: Add restart option

Add a new kdc_restart rc variable that manages kdc (or krb5kdc) under
daemon(8). This automatically restarts the kdc should it fail, i.e.
when it's configured to use LDAP as a backend and cannot connect to its
LDAP directory.

Set kdc_restart="YES" to auto restart kdc on abnormal termination.

Set kdc_restart_delay="N" to the number of seconds to delay before
restarting the kdc. The daemon(8) default seconds applies when not set.

Reported by: Lexi Winter <lexi.freebsd@le-fay.org>
PR: 278395
Differential Revision: https://reviews.freebsd.org/D44898

31 hours agoMFV: less: Do not trust st_size if it equals zero
Ricardo Branco [Wed, 24 Apr 2024 05:29:46 +0000 (22:29 -0700)]
MFV: less: Do not trust st_size if it equals zero

This is a smaller version of upstream
1fafd968b48e5cea6c85f126d77071a8de707a55 to address the
issue that less not being able to operate on files
residing in pseudo-filesystems that advertize a zero
size value.

PR: bin/276133
MFC after: 3 days

31 hours agoless: Do not trust st_size if it equals zero
Ricardo Branco [Fri, 5 Jan 2024 19:42:00 +0000 (20:42 +0100)]
less: Do not trust st_size if it equals zero

33 hours agoRevert "swapon: Do not overwrite Linux swap header"
Warner Losh [Wed, 24 Apr 2024 03:18:00 +0000 (21:18 -0600)]
Revert "swapon: Do not overwrite Linux swap header"

This reverts commit cf04a7775a4e8ff6fd28c768be9daa3d83dd382e.This is
broken on armv7, and closer scrutiny of the reviews shows I was in error
when I thought it was ready.

33 hours agoRevert "bsdinstall/distfetch.c: check environment variables before downloading and...
Warner Losh [Wed, 24 Apr 2024 03:16:58 +0000 (21:16 -0600)]
Revert "bsdinstall/distfetch.c: check environment variables before downloading and handle memory allocation errors"

This reverts commit 91bdebc958bb0da03f604bad19f99e3b10e96ac7. It wasn't
as ready as I thought

36 hours agoktrace: Remove CAPFAIL from default trace points
Jake Freeland [Wed, 24 Apr 2024 00:26:14 +0000 (19:26 -0500)]
ktrace: Remove CAPFAIL from default trace points

The CAPFAIL tracepoint was recently extended to report ECAPMODE
capability  violations for processes that do not enter capability mode.
This allows developers that are interested in Capsicumizing their
programs to determine where violations are being raised.

Previously, CAPFAIL only produced output for processes using Capsicum(4)
capabilties. Thus, most ktrace users never received log output from the
trace point. With the recent changes, this is no longer the case.

Having this trace point enabled by default will produce output for all
processes that use syscalls that are not permitted in capability mode.
This may lead to confusion for users that are not familiar with the
feature. Remove KTRFAC_CAPFAIL from ktrace's default points to avoid
this.

Approved by: markj (mentor)
Reviewed by: markj
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D44887

36 hours agoktrace: Describe CAPFAIL trace point in man page
Jake Freeland [Wed, 24 Apr 2024 00:25:16 +0000 (19:25 -0500)]
ktrace: Describe CAPFAIL trace point in man page

Update the ktrace(1) man page to describe the recently improved
capability failure tracing.

Approved by: markj (mentor)
Reviewed by: markj
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D44886

36 hours agosockets: inherit SO_ACCEPTFILTER from listener to child
Gleb Smirnoff [Wed, 24 Apr 2024 00:17:14 +0000 (17:17 -0700)]
sockets: inherit SO_ACCEPTFILTER from listener to child

This is crucial for operation of accept_filter(9).  See added comment.

Fixes: d29b95ecc0d049406d27a6c11939d40a46658733

38 hours agobsdinstall/distfetch.c: check environment variables before downloading and handle...
rilysh [Tue, 23 Apr 2024 22:40:19 +0000 (16:40 -0600)]
bsdinstall/distfetch.c: check environment variables before downloading and handle memory allocation errors

1. Currently, distfetch checks environment variables existence
when it will use them or in a case (in chdir()) it doesn't check
at all. As they are necessary to set before doing anything with
it, check them, if they set or not, before proceeding any further.
This also avoids extra cleaning when that environment variable
isn't set.

2. Handle memory allocation error in malloc(PATH_MAX) and replace
(sizeof const char *) with (sizeof char *). Both are similar and
const doesn't have a size.

3. Indent the error message a bit in chdir().

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1071

39 hours agozfs: merge openzfs/zfs@1f940de07
Martin Matuska [Tue, 23 Apr 2024 21:57:56 +0000 (23:57 +0200)]
zfs: merge openzfs/zfs@1f940de07

Notable upstream pull request merges:
 #16038 1f940de07 L2ARC: Cleanup buffer re-compression
 #16093 c183d164a Parallel pool import
 #16094 cd3e6b4f4 Add zfetch stats in arcstats
 #16103 35bf25848 Fix: FreeBSD Arm64 does not build currently
 #16104 4036b8d02 Refactor dbuf_read() for safer decryption
 #16110 9f83eec03 Handle FLUSH errors as "expected"
 #16117 c346068e5 zfs get: add '-t fs' and '-t vol' options

Obtained from:  OpenZFS
OpenZFS commit: 1f940de07224c2068e7c721222b1f3a519820ca9

39 hours agoswapon: Do not overwrite Linux swap header
Ricardo Branco [Tue, 23 Apr 2024 21:47:56 +0000 (15:47 -0600)]
swapon: Do not overwrite Linux swap header

Reviewed by: imp, jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/1084

39 hours agorelease: Change vmimage EFI GPT label
Jose Luis Duran [Tue, 23 Apr 2024 21:12:30 +0000 (15:12 -0600)]
release: Change vmimage EFI GPT label

This matches the default bsdinstall nomenclature.

PR: 278480
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1188

39 hours agonanobsd: Set a GPT label for EFI and cfg partitions
Jose Luis Duran [Tue, 23 Apr 2024 21:12:45 +0000 (15:12 -0600)]
nanobsd: Set a GPT label for EFI and cfg partitions

Use efiboot0 for the EFI partition, the nomenclature efiboot + #index
was taken from bsdinstall (zfsboot).

Use cfg for the cfg partition.  Poudriere firmware images are already
using this label.

PR: 278480
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1187

39 hours agosys/*/conf: do not use "../../conf/" when including std.*
Lexi Winter [Tue, 23 Apr 2024 21:11:24 +0000 (15:11 -0600)]
sys/*/conf: do not use "../../conf/" when including std.*

Since config(8) searches sys/conf by default, there's no need to specify
the full relative path here; replace it by the filename alone.

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

39 hours agosys: add conf/std.debug, generic debugging options
Lexi Winter [Tue, 23 Apr 2024 21:11:24 +0000 (15:11 -0600)]
sys: add conf/std.debug, generic debugging options

The new sys/conf/std.debug contains the list of debugging options
enabled by default in -CURRENT, so they don't need to be listed
individually in every kernel config.

The enabled options are the set of all debug options which were enabled
for the GENERIC kernel on any platform.  This means some architectures
now have debugging options enabled in GENERIC which weren't previously
enabled:

- amd64: [1]
- arm64: [2]
- arm: [2]. [3]
- i386: [1], [2]
- powerpc: [1], [2], [3]
- riscv: [2]

[1] ALT_BREAK_TO_DEBUGGER is now enabled.
[2] BUF_TRACKING, FULL_BUF_TRACKING, and QUEUE_MACRO_DEBUG_TRASH are now
    enabled.
[3] DEADLKRES is now enabled.

While here, move the documentation for the (commented out) K*SAN options
for amd64 from GENERIC to NOTES.

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

39 hours agosys/netpfil/pf: fix non-INET module build
Lexi Winter [Mon, 22 Apr 2024 21:59:12 +0000 (15:59 -0600)]
sys/netpfil/pf: fix non-INET module build

pf.ko, when built as a module without 'options INET' but with 'options
VIMAGE', won't load:

link_elf_obj: symbol vnet_entry_in_loopback_mask undefined

This is because it uses IN_LOOPBACK(), which in the VIMAGE case uses
INET-specific symbols.

Fix by making this check conditional on #ifdef INET.

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

39 hours agosys/net/if_bridge: support non-INET kernels
Lexi Winter [Tue, 23 Apr 2024 21:12:57 +0000 (15:12 -0600)]
sys/net/if_bridge: support non-INET kernels

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

40 hours agoahc(4)/ahd(4): target mode: cancel outstanding AIOs and INOTs
HP van Braam [Tue, 23 Apr 2024 20:47:12 +0000 (14:47 -0600)]
ahc(4)/ahd(4): target mode: cancel outstanding AIOs and INOTs

When disabling a lun there can still be outstanding AIOs and INOTs, when
this happens previously the lun would just fail to disable and trying to
re-use the lun would break the card.

isp(4) in target mode does the same thing when disabling a lun, in
testing this allows re-starting of ctld(8) with connected initiators and
allows initiators to gracefully resume afterwards.

Signed-off-by: HP van Braam <hp@tmm.cx>
Reviewed by: imp, mav
Pull Request: https://github.com/freebsd/freebsd-src/pull/1190

40 hours agoahc(4) clean up old Linux defines
HP van Braam [Tue, 23 Apr 2024 20:55:36 +0000 (14:55 -0600)]
ahc(4) clean up old Linux defines

Linux removed theirs starting in 2018 in commit:
"scsi: aic7xxx: Fix build using bare-metal toolchain"

Also remove now-useless sys/cdefs.h includes

Signed-off-by: HP van Braam <hp@tmm.cx>
Reviewed by: imp, mav, emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1189

41 hours agocheckstyle9.pl: Warn if there's no SOB line
Warner Losh [Tue, 23 Apr 2024 20:03:28 +0000 (14:03 -0600)]
checkstyle9.pl: Warn if there's no SOB line

If there's no Signed-off-by: line, complain.

Sponsored by: Netflix

41 hours agopow,powf(3),__ieee754_rem_pio2(f): Avoid negative integer left shift UB
Karl Tomlinson [Tue, 23 Apr 2024 18:18:25 +0000 (12:18 -0600)]
pow,powf(3),__ieee754_rem_pio2(f): Avoid negative integer left shift UB

A compiler clever enough to know that z is positive with a non-zero
biased exponent could, for example, optimize away the scalbnf(z,n) in
pow() because behavior for left shift of negative values is undefined.
`n` is negative when y*log2(|x|) < -0.5.  i.e. |x^y| < sqrt(0.5)

The intended behavior for operator<< in this code is to shift the two's
complement representation of the first operand.

In the pow() functions, the result is added to the IEEE 754 exponent of
z = 2^y'.  n may be negative enough to underflow the biased IEEE 754
exponent below zero, which is manifested in the sign bit of j
(which would correspond to the IEEE 754 sign bit).

The conversion from uint32_t to int32_t for out-of-int32_t-range values
is implementation defined.  The assumed behavior of interpreting the
uint32_t value as a two's complement representation of a signed value
is already assumed in many parts of the code, such as uses of
GET_FLOAT_WORD() with signed integers.

This code passes all the current tests, and makes some out of tree
fuzzing tests pass again rather than hit UB (detailed in the commentary
of the pull request).

Signed-off-by: Karl Tomlinson <karlt+@karlt.net>
Reviewed by: imp, steve kargl, dim
Pull Request: https://github.com/freebsd/freebsd-src/pull/1137

41 hours agolibc printf_render_errno(): do not use strerror()
Konstantin Belousov [Tue, 23 Apr 2024 17:15:22 +0000 (20:15 +0300)]
libc printf_render_errno(): do not use strerror()

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44916

41 hours agolibc: minor style, wrap long lines
Konstantin Belousov [Tue, 23 Apr 2024 17:14:34 +0000 (20:14 +0300)]
libc: minor style, wrap long lines

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44916

41 hours ago__vprintf(): switch from strerror() to strerror_rl()
Konstantin Belousov [Tue, 23 Apr 2024 17:10:30 +0000 (20:10 +0300)]
__vprintf(): switch from strerror() to strerror_rl()

This eliminates the use of non-thread-safe function in printf*() family,
and make the call locale-aware.  Also, it stops obliterating the
strerror() static buffer, which aligns with the POSIX requirement that
implementations must behave as if no standard-mandated functions call
strerror().

PR: 278556
Reported by: Jonathan Gruber <jonathan.gruber.jg@gmail.com>
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44916

41 hours agolibc: make strerror_rl() usable for libc
Konstantin Belousov [Tue, 23 Apr 2024 17:04:29 +0000 (20:04 +0300)]
libc: make strerror_rl() usable for libc

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44916

42 hours agosrc.conf.5: Regen after removing MK_NVME
John Baldwin [Tue, 23 Apr 2024 18:48:50 +0000 (11:48 -0700)]
src.conf.5: Regen after removing MK_NVME

42 hours agoRemove the MK_NVME build option
John Baldwin [Tue, 23 Apr 2024 18:47:44 +0000 (11:47 -0700)]
Remove the MK_NVME build option

The drivers and utilities are now built and installed unconditionally.

Reviewed by: imp, emaste
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44843

42 hours agonvmecontrol: Always build instead of being conditional on WITH_NVME
John Baldwin [Tue, 23 Apr 2024 18:47:26 +0000 (11:47 -0700)]
nvmecontrol: Always build instead of being conditional on WITH_NVME

This now builds fine on all platforms so always include it similar
to other tools such as camcontrol.

Reviewed by: imp, emaste
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44842

42 hours agocamcontrol: Enable WITH_NVME unconditionally
John Baldwin [Tue, 23 Apr 2024 18:46:53 +0000 (11:46 -0700)]
camcontrol: Enable WITH_NVME unconditionally

MK_NVME is no longer marked broken for any platforms, so just include
support for it always as we do for ATA and SCSI.

Reviewed by: emaste
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44841

43 hours agoUse MOVED_LIBS for usr/lib/libcxxrt.so.1 ObsoleteFiles.inc entry
Dimitry Andric [Tue, 23 Apr 2024 17:40:29 +0000 (19:40 +0200)]
Use MOVED_LIBS for usr/lib/libcxxrt.so.1 ObsoleteFiles.inc entry

Otherwise, the "make delete-old-libs" mechanism also deletes 32-bit
copies, such as in /usr/lib32.

Reported by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Fixes: 911a6479e18b

44 hours agoRELNOTES: Add an entry for the nfs_reserved_port_only default change
Mark Johnston [Tue, 23 Apr 2024 16:52:30 +0000 (12:52 -0400)]
RELNOTES: Add an entry for the nfs_reserved_port_only default change

Sponsored by: The FreeBSD Foundation

44 hours agonfsserver: Default to nfs_reserved_port_only="YES"
Mark Johnston [Tue, 23 Apr 2024 16:51:03 +0000 (12:51 -0400)]
nfsserver: Default to nfs_reserved_port_only="YES"

This setting causes the NFS server to check that all RPCs are sent from
a privileged (<= 1023) port, rejecting those that are not.  This
slightly raises the bar for a user with network access to an
unauthenticated NFS server to access exported NFS filesystems.

Users that use traditional NFS clients (e.g., those provided by FreeBSD
or Linux) should not see any difference, assuming that unprivileged
filesystem mounting is disallowed.

Note that the setting is per-VNET, so may be overridden in VNET jails
without affecting the rest of the system.

Discussed with: freebsd-arch@
Reviewed by: rmacklem, bz, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44906

44 hours agoAdd test for pthread_sigqueue(3)
Konstantin Belousov [Sat, 20 Apr 2024 19:59:14 +0000 (22:59 +0300)]
Add test for pthread_sigqueue(3)

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

44 hours agopthread_sigqueue(3): document
Konstantin Belousov [Sat, 20 Apr 2024 22:16:08 +0000 (01:16 +0300)]
pthread_sigqueue(3): document

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

44 hours agolibthr: add pthread_sigqueue(3)
Konstantin Belousov [Fri, 19 Apr 2024 14:40:40 +0000 (17:40 +0300)]
libthr: add pthread_sigqueue(3)

PR: 278459
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44867

44 hours agosys/signal.h: move union sigval into dedicated private header sys/_sigval.h
Konstantin Belousov [Fri, 19 Apr 2024 14:57:51 +0000 (17:57 +0300)]
sys/signal.h: move union sigval into dedicated private header sys/_sigval.h

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

44 hours agosigqueue(2): Document __SIGQUEUE_TID
Konstantin Belousov [Sat, 20 Apr 2024 21:58:15 +0000 (00:58 +0300)]
sigqueue(2): Document __SIGQUEUE_TID

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

44 hours agosigqueue(2): add impl-specific flag __SIGQUEUE_TID
Konstantin Belousov [Fri, 19 Apr 2024 14:29:05 +0000 (17:29 +0300)]
sigqueue(2): add impl-specific flag __SIGQUEUE_TID

The flag allows the pid argument to designate a thread from the calling
process.  The flag value is carved from the high bit of the signal
number, which slightly changes the ABI of syscall.

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

44 hours agokern_thr.c: normalize includes
Konstantin Belousov [Fri, 19 Apr 2024 14:27:42 +0000 (17:27 +0300)]
kern_thr.c: normalize includes

Remove extra sys/param.h, provided by sys/systm.h.
Order the rest alphabetically.

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

44 hours agokern_thr.c/kern_sig.c: remove sys/cdefs.h
Konstantin Belousov [Fri, 19 Apr 2024 14:25:04 +0000 (17:25 +0300)]
kern_thr.c/kern_sig.c: remove sys/cdefs.h

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

44 hours agokern_thread.c: remove unneeded include of sys/param.h
Konstantin Belousov [Fri, 19 Apr 2024 14:46:08 +0000 (17:46 +0300)]
kern_thread.c: remove unneeded include of sys/param.h

Handled by sys/systm.h already.

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

44 hours agoSupport ARP for 802 networks
Denny Page [Sat, 13 Apr 2024 17:16:08 +0000 (10:16 -0700)]
Support ARP for 802 networks

This is used by 802.3 Ethernet.  (Also be used by 802.4 Token Bus and
802.5 Token Ring, but we don't support those.)

This was accidentally removed along with FDDI support in commit
0437c8e3b198, presumably because comments implied it was used only by
FDDI or Token Ring.

Fixes: 0437c8e3b198 ("Remove support for FDDI networks.")
Reviewed-by: emaste
Signed-off-by: Denny Page <dennypage@me.com>
Pull-request: https://github.com/freebsd/freebsd-src/pull/1166

45 hours agoL2ARC: Cleanup buffer re-compression
Alexander Motin [Tue, 23 Apr 2024 16:06:00 +0000 (12:06 -0400)]
L2ARC: Cleanup buffer re-compression

When compressed ARC is disabled, we may have to re-compress when
writing into L2ARC.  If doing so we can't fit it into the original
physical size, we should just fail immediately, since even if it
may still fit into allocation size, its checksum will never match.

While there, refactor the code similar to other compression places
without using abd_return_buf_copy().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #16038

45 hours agoieee80211_vap(9): fix the title
Mitchell Horne [Sun, 19 Mar 2023 22:58:56 +0000 (19:58 -0300)]
ieee80211_vap(9): fix the title

MFC after: 3 days

45 hours agoUpdate manual page references and macros to align to mandoc syntax
Christopher Davidson [Fri, 9 Feb 2024 03:57:52 +0000 (22:57 -0500)]
Update manual page references and macros to align to mandoc syntax

xlocale.3: Comment out reference to atof_l(3), atoi_l(3), atol_l(3), atoll_l(3)
  These manual page references do not exist.

lagg.4: Change the reference for /etc/rc.conf from a reference link
  .Xr -> .Pa based on the context within the manual page it is used.

buf.9: Remove .Xr entries from the file
  The buf.9 manual page contains a commented out .Xr reference.
  The <filmmein> 9 entry is a placeholder and has been removed for
  clarity.

Reviewed by: mhorne
Pull Request: https://github.com/freebsd/freebsd-src/pull/1114

2 days agosrc.conf: regen after 91d35fb663e0, WITHOUT_CAPSICUM removal
Ed Maste [Tue, 23 Apr 2024 12:48:18 +0000 (08:48 -0400)]
src.conf: regen after 91d35fb663e0, WITHOUT_CAPSICUM removal

Sponsored by: The FreeBSD Foundation

2 days agoRemove WITHOUT_CAPSICUM build support
Ed Maste [Tue, 23 Apr 2024 11:20:59 +0000 (07:20 -0400)]
Remove WITHOUT_CAPSICUM build support

Capsicum is non-optional as of c24c117b9644 ("Remove
WITHOUT_{CAPSICUM,CASPER} options").

`#ifndef WITHOUT_CAPSICUM` is left in the source for the benefit of
downstream consumers, but is never defined in FreeBSD.

Reviewed by: oshogbo
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D42077

2 days agozfsbootcfg(8), zpool_influxdb(8): move to the zfs package
Lexi Winter [Mon, 22 Apr 2024 22:07:30 +0000 (16:07 -0600)]
zfsbootcfg(8), zpool_influxdb(8): move to the zfs package

These tools are only useful on a system running ZFS.

Reviewed by: imp, manu
Pull Request: https://github.com/freebsd/freebsd-src/pull/1175

2 days agoswab.c(libc): use a simplified version of byte swapping
rilysh [Mon, 22 Apr 2024 21:52:25 +0000 (15:52 -0600)]
swab.c(libc): use a simplified version of byte swapping

This version of swab function simplifies the logic of swapping adjacent
bytes. Previous version of swab() used an arbitrary unrolling, which was
relevant back in the day but unnecessary for modern compilers, as if the
input size is known at compile time, they can do it automatically.

This version of swab() is inspired by musl.
A similar version can be found at: https://github.com/openbsd/src/blob/master/lib/libc/string/swab.c

Signed-off-by: rilysh <nightquick@proton.me>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1086

2 days agoifconfig tunnelfib is implemented in wg(4)
Gregory Shapiro [Mon, 22 Apr 2024 22:10:00 +0000 (16:10 -0600)]
ifconfig tunnelfib is implemented in wg(4)

MFC After: 1 week
Reviewed by: imp, zlei, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/1186

2 days agoalc(4): disable MSI-X by default on Killer cards
Lexi Winter [Mon, 22 Apr 2024 22:09:26 +0000 (16:09 -0600)]
alc(4): disable MSI-X by default on Killer cards

Several users with alc(4)-based "Killer" Ethernet cards have reported
issues with this driver not passing traffic, which are solved by
disabling MSI-X using the provided tunable.

To work around this issue, disable MSI-X by default on this card.

This is done by having msix_disable default to 2, which means
"auto-detect".  The user can still override this to either 0 or 1 as
desired.

Since these are slow (1Gbps) Ethernet ICs used in low-end systems, it's
unlikely this will cause any practical performance issues; on the other
hand, the card not working by default likely causes issues for many new
FreeBSD users who find their network port doesn't work and have no idea
why.

PR: 230807
MFC after: 1 week

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

2 days agoumount: Support partitions & slices with -d option
Ricardo Branco [Mon, 22 Apr 2024 22:08:58 +0000 (16:08 -0600)]
umount: Support partitions & slices with -d option

Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1183

2 days agoshare/examples: move examples into appropriate packages
Lexi Winter [Mon, 22 Apr 2024 22:08:22 +0000 (16:08 -0600)]
share/examples: move examples into appropriate packages

Allow a new variable SE_xxxPACKAGE to be used to place an example group
into a package.

Move the following examples into existing appropriate packages:

- bhyve examples into FreeBSD-bhyve
- bootforth examples into FreeBSD-bootloader
- csh examples into FreeBSD-csh
- ipfw examples into FreeBSD-ipfw
- jail examples into FreeBSD-jail
- pf examples into FreeBSD-pf
- ppp examples into FreeBSD-ppp
- printing examples into FreeBSD-lp
- uefisign examples into FreeBSD-efi-tools
- ypldap examples into FreeBSD-yp
- hast examples into FreeBSD-hast

Move all other examples into the new 'FreeBSD-examples' package.

This removes a significant number of files from the FreeBSD-utilities
package.

Reviewed by: imp, manu
Pull Request: https://github.com/freebsd/freebsd-src/pull/1176

2 days agopackage: add DESC and COMMENT for cron package
Lexi Winter [Mon, 22 Apr 2024 22:05:54 +0000 (16:05 -0600)]
package: add DESC and COMMENT for cron package

Reviewed by: imp, manu, Mina Galic
Pull Request: https://github.com/freebsd/freebsd-src/pull/1172

2 days agopackage: move cron into its own package
Lexi Winter [Mon, 22 Apr 2024 22:05:53 +0000 (16:05 -0600)]
package: move cron into its own package

Reviewed by: imp, manu, Mina Galic
Pull Request: https://github.com/freebsd/freebsd-src/pull/1172

2 days agopackage: move hv_{vss,kvp}_daemon into hyperv-tools
Lexi Winter [Mon, 22 Apr 2024 22:00:55 +0000 (16:00 -0600)]
package: move hv_{vss,kvp}_daemon into hyperv-tools

Reviewed by: imp, manu
Pull Request: https://github.com/freebsd/freebsd-src/pull/1170

2 days agolinux: ignore setsockopt(IPV6_RECVERR)
Lexi Winter [Mon, 22 Apr 2024 21:58:11 +0000 (15:58 -0600)]
linux: ignore setsockopt(IPV6_RECVERR)

Under Linux, the socket options IP_RECVERR and IPV6_RECVERR are used to
receive socket errors via a dedicated 'error queue' which can be
retrieved via recvmsg().  FreeBSD does not support this functionality.

For IPv4, the sysctl compat.linux.ignore_ip_recverr can be set to 1 to
silently ignore attempts to set IP_RECVERR and return success to the
application, which is wrong, but is required for (among other things)
a functional DNS client in recent versions of glibc.

Add support for ignoring IPV6_RECVERR, controlled by the same sysctl.
This fixes DNS in Linux when using IPv6 resolvers.

Reviewed by: imp, Jose Luis Duran
Pull Request: https://github.com/freebsd/freebsd-src/pull/1118

2 days agolibipsec: make const-correct
Lexi Winter [Mon, 22 Apr 2024 21:56:24 +0000 (15:56 -0600)]
libipsec: make const-correct

- add const to the appropriate places in the libipsec public API and the
  relevant internal functions needed to support that.

- replace caddr_t with c_caddr_t in ipsec_dump_policy()

- update the ipsec_dump_policy manpage to use c_caddr_t (this manpage
  was already wrong as it had "char *" instead of caddr_t previously).

While here, update pfkeyv2.h to not cast away const in the PFKEY_*()
macros.

This should not cause any ABI changes as the actual types have not
changed.

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

2 days agozfs-kmod: fix empty rpm requires/conflicts
Todd [Tue, 23 Apr 2024 00:55:41 +0000 (17:55 -0700)]
zfs-kmod: fix empty rpm requires/conflicts

Fix an error in zfs-kmod.spec that causes kmod-zfs packages not to
include the correct RPM requires/conflicts relationships.  With this
change applied, RPM correctly no longer allows kmod-zfs & zfs-dkms
packages to be installed together.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Todd Seidelmann <18294602+seidelma@users.noreply.github.com>
Closes #16121

2 days agogeli.8: minor proofreading
Alan Somers [Mon, 22 Apr 2024 21:11:09 +0000 (15:11 -0600)]
geli.8: minor proofreading

MFC after: 3 days
Sponsored by: Axcient
Reviewed by: imp, pauamma (manpages)
Differential Revision: https://reviews.freebsd.org/D44907

2 days agolibcxxrt: align more with libc/Makefile
Brooks Davis [Mon, 22 Apr 2024 18:37:17 +0000 (19:37 +0100)]
libcxxrt: align more with libc/Makefile

Use src.opts.mk instead of bsd.own.mk and define PACKAGE first.

Fixes: da77a1b4f0dff libcxxrt: don't export nonexistant symbols

2 days agolibsys/arm: make vfork less of an outlier
Brooks Davis [Mon, 22 Apr 2024 19:13:35 +0000 (20:13 +0100)]
libsys/arm: make vfork less of an outlier

Following the pattern of other architectures, make __sys_vfork the main
symbol and _vfork and vfork weak aliases.  This avoids the need to
special case vfork in the generated list of symbols.

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

2 days agoopenssl: don't export nonexistant symbols
Brooks Davis [Mon, 22 Apr 2024 19:13:28 +0000 (20:13 +0100)]
openssl: don't export nonexistant symbols

These are all OpenSSL 1.1.0 and 1.1.1 symbols that aren't present in our
OpenSSL 3.0 builds.

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

2 days agosrc.conf.5: rebuild after WITH_NVME changes
Brooks Davis [Mon, 22 Apr 2024 18:41:44 +0000 (19:41 +0100)]
src.conf.5: rebuild after WITH_NVME changes

WITH_NVME is no longer marked broken on armv7, riscv64, or powerpc.

Fixes: 2fda3ab0ac19 WITH_NVME: Remove from broken.
Differential Revision: https://reviews.freebsd.org/D44850

2 days agoMake __libsys_interposing_slot libsys only
Brooks Davis [Mon, 22 Apr 2024 18:24:36 +0000 (19:24 +0100)]
Make __libsys_interposing_slot libsys only

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44881

2 days agolibthr: always use __libc_interposing_slot()
Brooks Davis [Mon, 22 Apr 2024 18:24:26 +0000 (19:24 +0100)]
libthr: always use __libc_interposing_slot()

Use __libc_interposing_slot() in favor of __libsys_interposing_slot() so
that the interposing interface is entierly between libc and libthr with
libsys only involved as an implementation detail.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D44880

2 days agogeli: add a read-only kern.geom.eli.use_uma_bytes sysctl
Alan Somers [Mon, 22 Apr 2024 18:03:40 +0000 (12:03 -0600)]
geli: add a read-only kern.geom.eli.use_uma_bytes sysctl

It reports the value of the g_eli_alloc_sz variable.  Allocations of
this size or less will use UMA.  Larger allocations will use malloc.
Since malloc is slower, it is useful for users to know this variable so
they can avoid such allocations.  For example, ZFS users can set
vfs.zfs.vdev.aggregation_limit to this value.

MFC after: 1 week
Sponsored by: Axcient
Reviewed by: markj, imp
Differential Revision: https://reviews.freebsd.org/D44904

2 days agoadduser: Fix a syntax error
Joseph Mingrone [Mon, 22 Apr 2024 19:04:13 +0000 (16:04 -0300)]
adduser: Fix a syntax error

Reported by: Jose Luis Duran <jlduran@gmail.com>
Fixes: b37333899bd2
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44871

2 days agolibcxxrt: define SHLIBDIR before including bsd.own.mk
Dimitry Andric [Mon, 22 Apr 2024 18:43:27 +0000 (20:43 +0200)]
libcxxrt: define SHLIBDIR before including bsd.own.mk

Otherwise bsd.own.mk overrides it, causing libcxxrt.so.1 to be
erroneously installed into /usr/lib.

Also add an ObsoleteFiles.inc entry, for removing the bad copy.

Reported by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Fixes: da77a1b4f0df

2 days agoRefactor dbuf_read() for safer decryption
Alexander Motin [Mon, 22 Apr 2024 18:41:03 +0000 (14:41 -0400)]
Refactor dbuf_read() for safer decryption

In dbuf_read_verify_dnode_crypt():
 - We don't need original dbuf locked there. Instead take a lock
on a dnode dbuf, that is actually manipulated.
 - Block decryption for a dnode dbuf if it is currently being
written.  ARC hash lock does not protect anonymous buffers, so
arc_untransform() is unsafe when used on buffers being written,
that may happen in case of encrypted dnode buffers, since they
are not copied by dbuf_dirty()/dbuf_hold_copy().

In dbuf_read():
 - If the buffer is in flight, recheck its compression/encryption
status after it is cached, since it may need arc_untransform().

Tested-by: Rich Ercolani <rincebrain@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #16104

2 days agozfs get: add '-t fs' and '-t vol' options
Ryan [Mon, 22 Apr 2024 17:59:31 +0000 (01:59 +0800)]
zfs get: add '-t fs' and '-t vol' options

Make `zfs get` accept `fs` for `filesystem` and `vol` for `volume`.

Reviewed-by: Rob Norris <rob.norris@klarasystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan <errornointernet@envs.net>
Closes #16117

2 days agomfc-candidates: use stable/14 as default MFC-to branch
Ed Maste [Mon, 22 Apr 2024 17:54:52 +0000 (13:54 -0400)]
mfc-candidates: use stable/14 as default MFC-to branch

This tool is typically invoked from within a working tree containing the
desired MFC target branch, which is detected automatically.  It also has
a default for when it is invoked from elsewhere.  Switch the default to
the most recent branch, stable/14.

Sponsored by: The FreeBSD Foundation

2 days agoztest: use ASSERT3P to compare pointers
Brooks Davis [Mon, 22 Apr 2024 17:48:58 +0000 (10:48 -0700)]
ztest: use ASSERT3P to compare pointers

With a sufficiently modern gcc (I saw this with gcc13), gcc complains
when casting pointers to an integer of a different type (even a larger
one).  On 32-bt ASSERT3U does this on 32-bit systems by casting a 32-bit
pointer to uint64_t so use ASSERT3P which uses uintptr_t.

Fixes: 5caeef02fa53 RAID-Z expansion feature
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Brooks Davis <brooks.davis@sri.com>
Closes #16115

2 days agoZTS: user_namespace_004.ksh avoid error in cleanup if unsupported
Seth Troisi [Mon, 22 Apr 2024 17:47:44 +0000 (10:47 -0700)]
ZTS: user_namespace_004.ksh avoid error in cleanup if unsupported

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Seth Troisi <sethtroisi@google.com>
Closes #16114

2 days agoAdd newline to two zpool messages
Seth Troisi [Mon, 22 Apr 2024 17:45:39 +0000 (10:45 -0700)]
Add newline to two zpool messages

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Seth Troisi <sethtroisi@google.com>
Closes #16113

2 days agothread: Add a missing include of asan.h
Mark Johnston [Mon, 22 Apr 2024 17:07:53 +0000 (13:07 -0400)]
thread: Add a missing include of asan.h

I didn't notice this during testing because invariants-enabled kernels
implicitly include asan.h via kassert.h.

Reported by: Lexi Winter <lexi@le-Fay.org>
Fixes: 800da341bc4a ("thread: Simplify sanitizer integration with thread creation")