]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
7 weeks agoin6_rmx: remove unnecessary socketvar.h
Gleb Smirnoff [Tue, 7 May 2024 21:15:56 +0000 (14:15 -0700)]
in6_rmx: remove unnecessary socketvar.h

7 weeks agotcp_hostcache: remove unnecessary socketvar.h
Gleb Smirnoff [Tue, 7 May 2024 21:15:49 +0000 (14:15 -0700)]
tcp_hostcache: remove unnecessary socketvar.h

7 weeks agosockets: garbage collect PRCOREQUESTS and stale comment
Gleb Smirnoff [Tue, 7 May 2024 21:15:49 +0000 (14:15 -0700)]
sockets: garbage collect PRCOREQUESTS and stale comment

The code deleted predates FreeBSD history.  The comment deleted is 99%
outdated.  Why KAME decided to use these constants instead of normal ones
also lost in centuries.

7 weeks agonvme: Bump the alignment of struct nvme_health_information_page to 8
John Baldwin [Tue, 7 May 2024 20:48:06 +0000 (13:48 -0700)]
nvme: Bump the alignment of struct nvme_health_information_page to 8

This ensures that embedded uint64_t values used for statistics
counters are aligned when allocating a structure on the stack or as
part of a containing structure.  In particular this quiets
-Waddress-of-packed-member warnings from GCC when compiling the code
in nvmfd to update the stats.

Reported by: GCC

7 weeks agonvmecontrol: Fix a sign compare mismatch
John Baldwin [Tue, 7 May 2024 20:45:51 +0000 (13:45 -0700)]
nvmecontrol: Fix a sign compare mismatch

Even though mqes (uint16_t) and queue_size (u_int) are both unsigned,
the expression 'mqes + 1' gets promoted to int which is signed.  Keep
the value unsigned by explicitly promoting mqes to u_int before
incrementing the value.

Reported by: GCC

7 weeks agolibzpool: Disable -Wpointer-to-int-cast warnings for GCC
John Baldwin [Tue, 7 May 2024 19:32:58 +0000 (12:32 -0700)]
libzpool: Disable -Wpointer-to-int-cast warnings for GCC

This warning is already disabled for zfs.ko.

7 weeks agotcp: clean up macro useage in tcp_fixed_maxseg()
Richard Scheffenegger [Sat, 4 May 2024 08:42:42 +0000 (10:42 +0200)]
tcp: clean up macro useage in tcp_fixed_maxseg()

Replace local PAD macro with PADTCPOLEN macro
No functional change.

Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D45076

7 weeks agolibcbor: Ignore errors for unknown #pragmas
John Baldwin [Tue, 7 May 2024 18:44:52 +0000 (11:44 -0700)]
libcbor: Ignore errors for unknown #pragmas

libcbor embeds clang-specific #pragmas that GCC then warns about.

Reviewed by: emaste

7 weeks agojh7110: Add StarFive JH7110 clock/reset generator drivers
Jari Sihvola [Tue, 7 May 2024 16:06:20 +0000 (13:06 -0300)]
jh7110: Add StarFive JH7110 clock/reset generator drivers

Implement a core clknode driver for the JH7110 (StarFive VisionFive v2)
platform.

Add clock/reset generator drivers for the PLL, SYS, and AON clock
groupings.

Co-authored-by: mhorne
Reviewed by:    mhorne
Sponsored by:   The FreeBSD Foundation (mhorne's contributions)
Differential Revision:  https://reviews.freebsd.org/D43037

7 weeks agoRevert "jh7110: Add StarFive JH7110 clock/reset generator drivers"
Mitchell Horne [Tue, 7 May 2024 16:05:31 +0000 (13:05 -0300)]
Revert "jh7110: Add StarFive JH7110 clock/reset generator drivers"

I did not set the author field properly; revert to fix this.

This reverts commit 5d6d6278979b9eab598a23c804d23e930d2f7268.

7 weeks agojh7110: enable MMC driver
Mitchell Horne [Mon, 4 Mar 2024 18:38:43 +0000 (14:38 -0400)]
jh7110: enable MMC driver

Add a variant of the existing dwmmc driver, and enable it in the GENERIC
kernel.

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

7 weeks agojh7110: Add StarFive JH7110 clock/reset generator drivers
Mitchell Horne [Mon, 6 May 2024 17:10:01 +0000 (14:10 -0300)]
jh7110: Add StarFive JH7110 clock/reset generator drivers

Implement a core clknode driver for the JH7110 (StarFive VisionFive v2)
platform.

Add clock/reset generator drivers for the PLL, SYS, and AON clock
groupings.

Co-authored-by: mhorne
Reviewed by: mhorne
Sponsored by: The FreeBSD Foundation (mhorne's contributions)
Differential Revision: https://reviews.freebsd.org/D43037

7 weeks agostarfive: add a syscon driver
Mitchell Horne [Tue, 5 Mar 2024 23:57:30 +0000 (19:57 -0400)]
starfive: add a syscon driver

It serves the purpose of attaching syscon devices as early as possible;
this is required for early attachment of the PLL clock driver.

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

7 weeks agobusdma: better handling of small segment bouncing
Mitchell Horne [Wed, 14 Feb 2024 16:56:13 +0000 (12:56 -0400)]
busdma: better handling of small segment bouncing

Typically, when a DMA transaction requires bouncing, we will break up
the request into segments that are, at maximum, page-sized.

However, in the atypical case of a driver whose maximum segment size is
smaller than PAGE_SIZE, we end up inefficiently assigning each segment
its own bounce page. For example, the dwmmc driver has a maximum segment
size of 2048 (PAGE_SIZE / 2); a 4-page transfer ends up requiring 8
bounce pages in the current scheme.

We should attempt to batch segments into bounce pages more efficiently.
This is achieved by pushing all considerations of the maximum segment
size into the new _bus_dmamap_addsegs() function, which wraps
_bus_dmamap_addseg(). Thus we allocate the minimal number of bounce
pages required to complete the entire transfer, while still performing
the transfer with smaller-sized transactions.

For most drivers with a segment size >= PAGE_SIZE, this will have no
impact. For drivers like dwmmc mentioned above, this improves the memory
and performance efficiency when bouncing a large transfer.

Co-authored-by: jhb
Reviewed by: jhb
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45048

7 weeks agobusdma: deduplicate _bus_dmamap_addseg() function
Mitchell Horne [Wed, 14 Feb 2024 17:01:15 +0000 (13:01 -0400)]
busdma: deduplicate _bus_dmamap_addseg() function

It is functionally identical in all implementations, so move the
function to subr_busdma_bounce.c. The KASSERT present in the x86 version
is now enabled for all architectures. It should be universally
applicable.

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

7 weeks agofib_dxr: set fib_data field in struct dxr_aux early enough
Marko Zec [Tue, 7 May 2024 15:44:09 +0000 (17:44 +0200)]
fib_dxr: set fib_data field in struct dxr_aux early enough

Previously it was possible for dxr_build() to return with da->fd
unset in case of range_tbl or x_tbl malloc() failures.  This
may have led to NULL ptr dereferencing in dxr_change_rib_batch().

MFC after: 1 week

PR: 278422

7 weeks agofib_dxr: s/KASSERT/MPASS/
Marko Zec [Tue, 7 May 2024 15:33:23 +0000 (17:33 +0200)]
fib_dxr: s/KASSERT/MPASS/

MFC after: 1 week

7 weeks agofib_dxr: KASSERTs for chasing NULL ptr and runaway refcount suspects
Marko Zec [Tue, 7 May 2024 15:22:00 +0000 (17:22 +0200)]
fib_dxr: KASSERTs for chasing NULL ptr and runaway refcount suspects

MFC after: 1 week

7 weeks agofib_dxr: move the bulko of malloc() failure logging into dxr_build()
Marko Zec [Tue, 7 May 2024 15:11:30 +0000 (17:11 +0200)]
fib_dxr: move the bulko of malloc() failure logging into dxr_build()

7 weeks agoboot1.efi: Don't redundantly include devpath.c
Warner Losh [Tue, 7 May 2024 02:06:54 +0000 (20:06 -0600)]
boot1.efi: Don't redundantly include devpath.c

devpath.c is on both the comand line and in libefi. This is redundant
and was a mistake in 4cf36aa1017f9. It never should have been here. In
practice, this just means that the devpath.o from libefi.a goes unused.
This will cause problems with some upcoming changes (D44872) to enable
LTO to reduce the size of the binaries, so go ahead and make the change
now to reduce the changeset for that. No functional change indended.

Fixes: 4cf36aa1017f9
Co-authored-by: sobomax
Sponsored by: Netflix

7 weeks agodlopen(3): mention fdlopen for capsicum(4)
Ed Maste [Tue, 7 May 2024 01:45:50 +0000 (21:45 -0400)]
dlopen(3): mention fdlopen for capsicum(4)

Capsicum-sandboxed applications generally cannot use dlopen, as absolute
and cwd-relative paths cannot be accessed.  Mention that fdlopen is
useful for sandboxed applications.

PR: 277169
Reviewed by: markj, oshogbo
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45108

7 weeks agoRemove lingering geom_bde references.
Poul-Henning Kamp [Tue, 7 May 2024 09:25:23 +0000 (09:25 +0000)]
Remove lingering geom_bde references.

7 weeks agoRemove final cross-reference to GBDE
Poul-Henning Kamp [Tue, 7 May 2024 07:40:20 +0000 (07:40 +0000)]
Remove final cross-reference to GBDE

7 weeks agoRemove cross-references to GBDE
Poul-Henning Kamp [Tue, 7 May 2024 07:35:33 +0000 (07:35 +0000)]
Remove cross-references to GBDE

7 weeks agoRemove gbde from the "userland" pseudo-target
Poul-Henning Kamp [Tue, 7 May 2024 07:35:14 +0000 (07:35 +0000)]
Remove gbde from the "userland" pseudo-target

7 weeks agoAdd gbde rc.d script to ObsoleteFiles.inc
Poul-Henning Kamp [Tue, 7 May 2024 07:31:19 +0000 (07:31 +0000)]
Add gbde rc.d script to ObsoleteFiles.inc

7 weeks agoRemove GBDE source files
Poul-Henning Kamp [Tue, 7 May 2024 07:31:09 +0000 (07:31 +0000)]
Remove GBDE source files

7 weeks agoRemove GBDE stress test
Poul-Henning Kamp [Tue, 7 May 2024 07:26:39 +0000 (07:26 +0000)]
Remove GBDE stress test

7 weeks agoRemove documentation of GBDE rc support
Poul-Henning Kamp [Tue, 7 May 2024 07:25:51 +0000 (07:25 +0000)]
Remove documentation of GBDE rc support

7 weeks agoRemove gbde from rescue
Poul-Henning Kamp [Tue, 7 May 2024 07:23:38 +0000 (07:23 +0000)]
Remove gbde from rescue

7 weeks agoRemove GBDE rc support
Poul-Henning Kamp [Tue, 7 May 2024 07:23:03 +0000 (07:23 +0000)]
Remove GBDE rc support

7 weeks agoRemove gbde support from swapon(8)
Poul-Henning Kamp [Tue, 7 May 2024 07:21:46 +0000 (07:21 +0000)]
Remove gbde support from swapon(8)

7 weeks agoRemove gbde.4 man page
Poul-Henning Kamp [Tue, 7 May 2024 07:21:28 +0000 (07:21 +0000)]
Remove gbde.4 man page

7 weeks agoAdd GBDE to ObsoleteFiles.inc
Poul-Henning Kamp [Tue, 7 May 2024 06:50:52 +0000 (06:50 +0000)]
Add GBDE to ObsoleteFiles.inc

7 weeks agoDisconnect GBDE from the build. (Per earlier announcements of retirement.)
Poul-Henning Kamp [Tue, 7 May 2024 05:19:03 +0000 (05:19 +0000)]
Disconnect GBDE from the build. (Per earlier announcements of retirement.)

7 weeks agosg: Add sg(4) man page
Warner Losh [Mon, 6 May 2024 22:28:09 +0000 (16:28 -0600)]
sg: Add sg(4) man page

Add minimal sg(4) manual page. This implements a subset of the Linux
IOCTL interface for either native FreeBSD programs, or for Linux
binaries in the linuxulator.

Noticed by: Lexi Winter
Sponsored by: Netflix

7 weeks agolagg: enable tests that stress the configuration changes
Gleb Smirnoff [Mon, 6 May 2024 22:25:53 +0000 (15:25 -0700)]
lagg: enable tests that stress the configuration changes

I wasn't able to reproduce a crash in several runs.  Might be that
48698ead6ff0 or earlier changes have closed the races.  In case crashes
with just enabled tests are registered, I will either work on them or
disable tests again.

7 weeks agolagg: remove use of net epoch in the ioctl paths
Gleb Smirnoff [Mon, 6 May 2024 22:25:53 +0000 (15:25 -0700)]
lagg: remove use of net epoch in the ioctl paths

Rely on LAGG_SLOCK() instead.  The use of network epoch(9) here was added
in 6573d7580b851 (later tidied by 87bf9b9cbeebc) as a large sweep that
blindly substituted blocking kernel primitives with epoch(9).  In these
particular code paths use of epoch(9) is incorrect and doesn't provide any
protection against a stale pointer.  Recent fix 48698ead6ff0, which should
actually have removed the epoch use, created a potential sleeping in epoch
problem.

7 weeks agolagg: propagate up/down to the children
Gleb Smirnoff [Mon, 6 May 2024 22:25:53 +0000 (15:25 -0700)]
lagg: propagate up/down to the children

Based on the old submission from asomers@.  With modern state of locking
in lagg(4), the patch got much simplier.  Enable the test that was
waiting for this change.

PR: 226144
Reviewed by: asomers
Differential Revision: https://reviews.freebsd.org/D44605

7 weeks agonvmf: Add explicit alignment for struct nvmf_fabric_cmd
John Baldwin [Mon, 6 May 2024 22:17:43 +0000 (15:17 -0700)]
nvmf: Add explicit alignment for struct nvmf_fabric_cmd

This avoids -Wcast-align warnings from clang when upcasting from
struct nvmf_fabric_cmd to struct nvmf_fabric_prop_set_cmd.

Reported by: bapt
Sponsored by: Chelsio Communications

7 weeks agoclock_gettime.2: fix markup
Ed Maste [Mon, 6 May 2024 19:59:42 +0000 (15:59 -0400)]
clock_gettime.2: fix markup

The CLOCK_* constants are "defined variable or preprocessor constants"
and so use .Dv.

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

7 weeks agonvmf_tcp: Correct tests for PDU direction
John Baldwin [Mon, 6 May 2024 20:33:54 +0000 (13:33 -0700)]
nvmf_tcp: Correct tests for PDU direction

Add parentheses to ensure the correct order of operations.

Reported by: GCC

7 weeks agonvmf: Remove packing pragmas from nvmf_proto.h
John Baldwin [Mon, 6 May 2024 20:30:23 +0000 (13:30 -0700)]
nvmf: Remove packing pragmas from nvmf_proto.h

The protocol structures do not need explicit packing and static
assertions verify the size of all the structures as well as the
offsets of several key fields.  The pragma triggers warnings when
building with GCC.

Sponsored by: Chelsio Communications

7 weeks agorelease: Rework vm_extra_pre_umount
Colin Percival [Mon, 6 May 2024 20:26:52 +0000 (13:26 -0700)]
release: Rework vm_extra_pre_umount

The vm_extra_pre_umount function in vmimage.subr served two purposes:
It removed /etc/resolv.conf and /qemu (if cross-building), and it
provided a function for cloudware to override in order to make cloud
specific changes to the filesystem before constructing a disk image.

This resulted in a number of bugs:
1. When cross-building, the emulator binary was left as /qemu in the
Azure, GCE, Openstack and Vagrant images.
2. The build host's resolv.conf was left as /etc/resolv.conf in the
basic-ci and basic-cloudinit images.
3. When building GCE images, a Google-specific resolv.conf file was
constructed, and then deleted before the disk image was created.

Move the bits needed for running code inside a VM staging directory
from vm_install_base into a new vm_emulation_setup routine, and move
the corresponding cleanup bits from vm_extra_pre_umount to a new
vm_emulation_cleanup routine.

Remove the /qemu and /etc/resolv.conf cleanups from the cloudware
configuration files (where they exist) since we will now be running
vm_emulation_cleanup to remove those even when vm_extra_pre_umount
has been overridden.

Override vm_emulation_cleanup in gce.conf since in that one case (and
*only* that one case) we don't want to clean up resolv.conf (since it
was constructed for the VM image rather than copied from the host).

releng/14.1 candidate.

MFC after: 1 week
Sponsored by: https://www.patreon.com/cperciva

7 weeks agosockets: hide socket hhook(9)s under SOCKET_HHOOK
Gleb Smirnoff [Mon, 6 May 2024 19:49:29 +0000 (12:49 -0700)]
sockets: hide socket hhook(9)s under SOCKET_HHOOK

There are no in-tree consumers of these hooks.

Reviewed by: stevek
Differential Revision: https://reviews.freebsd.org/D44928

7 weeks agoarm: Remove stray references to dev/sound/chip.h
Christos Margiolis [Mon, 6 May 2024 19:35:30 +0000 (21:35 +0200)]
arm: Remove stray references to dev/sound/chip.h

Fixes: 923e0040a59a ("sound: Move chip.h contents to pcm/sound.h")
Reported by: Jenkins CI
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 weeks agotests/fusefs: fix all tests that depend on kern.maxphys
Gleb Smirnoff [Mon, 6 May 2024 19:03:20 +0000 (12:03 -0700)]
tests/fusefs: fix all tests that depend on kern.maxphys

The tests try to read kern.maxphys sysctl into int value, while
unsigned long is required.  Not sure when this was broken, seems like
since cd8537910406e.

Reviewed by: asomers
Differential Revision: https://reviews.freebsd.org/D45053

7 weeks agosound: Update pcm/vchan.c LICENSE header
Christos Margiolis [Mon, 6 May 2024 18:47:33 +0000 (20:47 +0200)]
sound: Update pcm/vchan.c LICENSE header

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

7 weeks agofib_dxr: update comment.
Marko Zec [Mon, 6 May 2024 18:42:31 +0000 (20:42 +0200)]
fib_dxr: update comment.

MFC after: 1 week

7 weeks agofib_dxr: free() does nothing if arg is NULL, so remove a redundant check.
Marko Zec [Mon, 6 May 2024 18:34:11 +0000 (20:34 +0200)]
fib_dxr: free() does nothing if arg is NULL, so remove a redundant check.

MFC after: 1 week

7 weeks agosound: Remove unused "num" argument from chn_init() and related callers
Christos Margiolis [Mon, 6 May 2024 18:33:11 +0000 (20:33 +0200)]
sound: Remove unused "num" argument from chn_init() and related callers

It is always -1 (i.e unused).

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D45095

7 weeks agosound: Rename pcm_getparentchannel() to vchan_getparentchannel()
Christos Margiolis [Mon, 6 May 2024 18:32:57 +0000 (20:32 +0200)]
sound: Rename pcm_getparentchannel() to vchan_getparentchannel()

Follow the rest of the vchan.c naming convention.

No functional change intended.

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

7 weeks agosound: Move vchan-related code to pcm/vchan.*
Christos Margiolis [Mon, 6 May 2024 18:32:46 +0000 (20:32 +0200)]
sound: Move vchan-related code to pcm/vchan.*

pcm/sound.* contains code that should be part of pcm/vchan.*.

Changes:
- pcm_setvchans() -> vchan_setnew()
- pcm_setmaxautovchans() -> vchan_setmaxauto()
- hw.snd.maxautovchans moved to pcm/vchan.c
- snd_maxautovchans declaration moved to pcm/vchan.h and definition to
  pcm/vchan.c

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

7 weeks agosound: Use nitems() where possible
Christos Margiolis [Mon, 6 May 2024 18:32:35 +0000 (20:32 +0200)]
sound: Use nitems() where possible

No functional change intended.

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

7 weeks agosound: Remove unused dsp_cdevs[] fields and devices
Christos Margiolis [Mon, 6 May 2024 18:32:25 +0000 (20:32 +0200)]
sound: Remove unused dsp_cdevs[] fields and devices

These fields and devices are unused as of e8c0d15a64fa ("sound: Get rid
of snd_clone and use DEVFS_CDEVPRIV(9)").

While here, remove unused SND_DEV_* defines from pcm/sound.h and convert
the list to an enum.

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

7 weeks agosound: Move chip.h contents to pcm/sound.h
Christos Margiolis [Mon, 6 May 2024 18:32:12 +0000 (20:32 +0200)]
sound: Move chip.h contents to pcm/sound.h

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

7 weeks agoRELNOTES: Mention hw.snd.version being removed
Christos Margiolis [Mon, 6 May 2024 18:35:35 +0000 (20:35 +0200)]
RELNOTES: Mention hw.snd.version being removed

Sponsored by: The FreeBSD Foundation

7 weeks agosound: Remove hw.snd.version and SND_DRV_VERSION
Christos Margiolis [Mon, 6 May 2024 18:30:58 +0000 (20:30 +0200)]
sound: Remove hw.snd.version and SND_DRV_VERSION

hw.snd.version and SND_DRV_VERSION define the sound driver version and
are meant to be used in bug reports, but because these values are
constant, there is not much useful information we can extract from them.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: dev_submerge.ch, emaste
Differential Revision: https://reviews.freebsd.org/D44996

7 weeks agosound: Convert pcm_chn_add() to void
Christos Margiolis [Mon, 6 May 2024 18:27:18 +0000 (20:27 +0200)]
sound: Convert pcm_chn_add() to void

It always returns 0.

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

7 weeks agosound: Add __assert_unreachable() to default cases in pcm_chn_add() and pcm_chn_remove()
Christos Margiolis [Mon, 6 May 2024 18:26:56 +0000 (20:26 +0200)]
sound: Add __assert_unreachable() to default cases in pcm_chn_add() and pcm_chn_remove()

We should normally never enter these cases.

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

7 weeks agosound: Merge pcm_chn_create() and chn_init()
Christos Margiolis [Mon, 6 May 2024 18:26:37 +0000 (20:26 +0200)]
sound: Merge pcm_chn_create() and chn_init()

Follow-up of b3ea087c05d8c75978a302cbb3fa92ce1afa3e49 ("sound: Merge
pcm_chn_destroy() and chn_kill()")

While here, add device_printf()'s to all failure points. Also fix an
existing bug where we'd unlock an already unlocked channel, in case we
went to "out" (now "out2") before locking the channel.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: dev_submerge.ch
Differential Revision: https://reviews.freebsd.org/D44993

7 weeks agofib_dxr: log malloc() failures.
Marko Zec [Mon, 6 May 2024 18:21:55 +0000 (20:21 +0200)]
fib_dxr: log malloc() failures.

MFC after: 1 week

7 weeks agogit-arc: Add list mode support for the update command
John Baldwin [Mon, 6 May 2024 17:49:04 +0000 (10:49 -0700)]
git-arc: Add list mode support for the update command

This can be particularly useful to do bulk-updates of multiple commits
using the same message, e.g.

  git arc update -lm "Move function xyz to libfoo" main..myfeature

Similar to the list mode for the create command, git arc will list all
the candidate revisions with a single prompt.  Once that is confirmed,
all the revisions are updated without showing the diffs or pausing
further prompts.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D45050

7 weeks agops: handle incorrect -D values
Jamie Landeg-Jones [Tue, 23 Apr 2024 16:44:36 +0000 (18:44 +0200)]
ps: handle incorrect -D values

I just noticed a slight issue with the '-D' option. Basically,
I accidentally typed something along the lines of:

ps -Dboth-p303

I.E. missing out the "space". Instead of giving an error, it behaved as
if I'd just typed "ps".

Looking at bin/ps/ps.c, where the -D option is parsed, it doesn't
error-out if there is no valid match.

This commit fixes the bug.

7 weeks agoendian.h: Define uint{16,32,64}_t
Warner Losh [Mon, 6 May 2024 15:10:46 +0000 (09:10 -0600)]
endian.h: Define uint{16,32,64}_t

The Draft Posix Issue 8 standard requires that these be defined. Define
them in the usual way that lets multiple headers define them. Opted to
not just use #include <stdint.h>, allowed by the draft, to be
conservative. Add notes about how we comply with Issue 8, and that we've
opted to define these only as macros, though the standard allows
functions, macros or both.

Sponsored by: Netflix

7 weeks agopw: Test home directory ownership and mode.
Dag-Erling Smørgrav [Mon, 6 May 2024 16:18:50 +0000 (18:18 +0200)]
pw: Test home directory ownership and mode.

MFC after: 3 days
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D45099

7 weeks agoadduser: Fix confusion between `uclass` and `_class`.
Dag-Erling Smørgrav [Mon, 6 May 2024 16:18:47 +0000 (18:18 +0200)]
adduser: Fix confusion between `uclass` and `_class`.

This caused adduser to produce an invalid `pw(8)` command line.  Due to
bugs in `pw(8)`, the command line was silently accepted and led to the
user being created, but locked out and with no home directory.

Also fix the default value for the “Another user?” prompt.

Fixes: 170d0882903e
MFC after: 3 days
Reviewed by: karels, allanjude
Differential Revision: https://reviews.freebsd.org/D45098

7 weeks agopw: Don't silently ignore unparsed command line arguments.
Dag-Erling Smørgrav [Mon, 6 May 2024 16:18:43 +0000 (18:18 +0200)]
pw: Don't silently ignore unparsed command line arguments.

MFC after: 3 days
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D45097

7 weeks agopw: Rename some enums.
Dag-Erling Smørgrav [Mon, 6 May 2024 16:18:39 +0000 (18:18 +0200)]
pw: Rename some enums.

Rename `M_PRINT` and `M_UPDATE` to `M_SHOW` and `M_MODIFY` to match the
names of the commands they represent.  No functional change intended.

MFC after: 3 days
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D45096

7 weeks agoif: guard against if_ioctl being NULL
Kristof Provost [Mon, 6 May 2024 09:39:08 +0000 (11:39 +0200)]
if: guard against if_ioctl being NULL

There are situations where an struct ifnet has a NULL if_ioctl pointer.

For example, e6000sw creates such struct ifnets for each of its ports so it can
call into the MII code.

If there is then a link state event this calls do_link_state_change()
-> rtnl_handle_ifevent() -> dump_iface() -> get_operstate() ->
get_operstate_ether(). That wants to know if the link is up or down, so it tries
to ioctl(SIOCGIFMEDIA), which doesn't go well if if_ioctl is NULL.

Guard against this, and return EOPNOTSUPP.

PR: 275920
MFC ater: 3 days
Sponsored by:   Rubicon Communications, LLC ("Netgate")

7 weeks agodts: Bump the freebsd branding version to 6.8
Emmanuel Vadot [Mon, 6 May 2024 08:47:26 +0000 (10:47 +0200)]
dts: Bump the freebsd branding version to 6.8

Sponsored by:   Beckhoff Automation GmbH & Co. KG

7 weeks agoImport device-tree files from Linux 6.8
Emmanuel Vadot [Mon, 6 May 2024 08:46:36 +0000 (10:46 +0200)]
Import device-tree files from Linux 6.8

Sponsored by: Beckhoff Automation GmbH & Co. KG

7 weeks agodts: Bump the freebsd branding version to 6.7
Emmanuel Vadot [Mon, 6 May 2024 08:46:20 +0000 (10:46 +0200)]
dts: Bump the freebsd branding version to 6.7

Sponsored by:   Beckhoff Automation GmbH & Co. KG

7 weeks agoImport device-tree files from Linux 6.7
Emmanuel Vadot [Mon, 6 May 2024 08:45:28 +0000 (10:45 +0200)]
Import device-tree files from Linux 6.7

Sponsored by: Beckhoff Automation GmbH & Co. KG

7 weeks agodts: Bump the freebsd branding version to 6.6
Emmanuel Vadot [Mon, 6 May 2024 08:44:59 +0000 (10:44 +0200)]
dts: Bump the freebsd branding version to 6.6

Sponsored by:   Beckhoff Automation GmbH & Co. KG

7 weeks agoImport device-tree files from Linux 6.6
Emmanuel Vadot [Mon, 6 May 2024 08:43:59 +0000 (10:43 +0200)]
Import device-tree files from Linux 6.6

Sponsored by: Beckhoff Automation GmbH & Co. KG

7 weeks agomlx5en: add diagnostic in one more case of failed eeprom read preparation
Konstantin Belousov [Sun, 5 May 2024 07:09:07 +0000 (10:09 +0300)]
mlx5en: add diagnostic in one more case of failed eeprom read preparation

Sponsored by: Nvidia Networking
MFC after: 1 week

7 weeks agoTCP can be subject to Sack Attacks lets fix this issue.
Randall Stewart [Sun, 5 May 2024 13:08:47 +0000 (09:08 -0400)]
TCP can be subject to Sack Attacks lets fix this issue.

There is a type of attack that a TCP peer can launch on a connection. This is for sure in Rack or BBR and probably even the default stack if it uses lists in sack processing. The idea of the attack is that the attacker is driving you to look at 100's of sack blocks that only update 1 byte. So for example if you have 1 - 10,000 bytes outstanding the attacker sends in something like:

ACK 0 SACK(1-512) SACK(1024 - 1536), SACK(2048-2536), SACK(4096 - 4608), SACK(8192-8704)
This first sack looks fine but then the attacker sends

ACK 0 SACK(1-512) SACK(1025 - 1537), SACK(2049-2537), SACK(4097 - 4609), SACK(8193-8705)
ACK 0 SACK(1-512) SACK(1027 - 1539), SACK(2051-2539), SACK(4099 - 4611), SACK(8195-8707)
...
These blocks are making you hunt across your linked list and split things up so that you have an entry for every other byte. Has your list grows you spend more and more CPU running through the lists. The idea here is the attacker chooses entries as far apart as possible that make you run through the list. This example is small but in theory if the window is open to say 1Meg you could end up with 100's of thousands link list entries.

To combat this we introduce three things.

when the peer requests a very small MSS we stop processing SACK's from them. This prevents a malicious peer from just using a small MSS to do the same thing.
Any time we get a sack block, we use the sack-filter to remove sacks that are smaller than the smallest v4 mss (minus 40 for max TCP options) unless it ties up to snd_max (since that is legal). All other sacks in theory should be at least an MSS. If we get such an attacker that means we basically start skipping all but MSS sized Sacked blocks.
The sack filter used to throw away data when its bounds were exceeded, instead now we increase its size to 15 and then throw away sack's if the filter gets over-run to prevent the malicious attacker from over-running the sack filter and thus we start to process things anyway.
The default stack will need to start using the sack-filter which we have talked about in past conference calls to take full advantage of the protections offered by it (and reduce cpu consumption when processing sacks).

After this set of changes is in rack can drop its SAD detection completely

Reviewed by:tuexen@, rscheff@
 Differential Revision: <https://reviews.freebsd.org/D44903>

7 weeks agorelease: Use qemu when cross-building vm images
Colin Percival [Sun, 5 May 2024 05:31:19 +0000 (22:31 -0700)]
release: Use qemu when cross-building vm images

For a bit over 5 years, we have used qemu when cross-building cloudware
images; in particular, it's necessary when installing packages which
might include post-install scripts.

Use qemu in the vm-images target too; while "generic" vm images don't
install packages, they still run newaliases and /etc/rc.d/ldconfig,
both of which fail without appropriate emulation.

MFC after: 1 week

7 weeks agoota: Merge one true awk 20240422 (a3b68e649d2d)
Warner Losh [Sat, 4 May 2024 21:50:33 +0000 (15:50 -0600)]
ota: Merge one true awk 20240422 (a3b68e649d2d)

Apr 22, 2024:
fixed regex engine gototab reallocation issue that was
introduced during the Nov 24 rewrite. Thanks to Arnold Robbins.
Fixed a scan bug in split in the case the separator is a single
character. thanks to Oguz Ismail for spotting the issue.

Mar 10, 2024:
fixed use-after-free bug in fnematch due to adjbuf invalidating
the pointers to buf. thanks to github user caffe3 for spotting
the issue and providing a fix, and to Miguel Pineiro Jr.
for the alternative fix.
MAX_UTF_BYTES in fnematch has been replaced with awk_mb_cur_max.
thanks to Miguel Pineiro Jr.

Sponsored by: Netflix

7 weeks agorc.conf.5: Fix translation from netmask to cdir
Warner Losh [Sat, 4 May 2024 21:41:36 +0000 (15:41 -0600)]
rc.conf.5: Fix translation from netmask to cdir

These two should have been 30 bit masks, not 32, as the original
netmasks were 255.255.255.252.

Fixes: cb808de400c7
Noticed by: Kelly Hays

7 weeks agonfsd: Fix Link conformance with RFC8881 for delegations
Rick Macklem [Sat, 4 May 2024 21:30:07 +0000 (14:30 -0700)]
nfsd: Fix Link conformance with RFC8881 for delegations

RFC8881 specifies that, when a Link operation occurs on an
NFSv4, that file delegations issued to other clients must
be recalled.  Discovered during a recent discussion on nfsv4@ietf.org.

Although I have not observed a problem caused by not doing
the required delegation recall, it is definitely required
by the RFC, so this patch makes the server do the recall.

Tested during a recent NFSv4 IETF Bakeathon event.

MFC after: 1 week

7 weeks agolib/clang: clean out old llvm/clang Sparc target remnants
Dimitry Andric [Sat, 4 May 2024 17:34:10 +0000 (19:34 +0200)]
lib/clang: clean out old llvm/clang Sparc target remnants

The WITH_LLVM_TARGET_ENABLE_SPARC option was removed a long time ago,
but some ifdefs were still laying around, so clean them up.

PR: 276104
MFC after: 3 days

7 weeks agoota: Import One True Awk 20240422 (a3b68e649d2d)
Warner Losh [Sat, 4 May 2024 17:06:52 +0000 (11:06 -0600)]
ota: Import One True Awk 20240422 (a3b68e649d2d)

Apr 22, 2024:
fixed regex engine gototab reallocation issue that was
introduced during the Nov 24 rewrite. Thanks to Arnold Robbins.
Fixed a scan bug in split in the case the separator is a single
character. thanks to Oguz Ismail for spotting the issue.

Mar 10, 2024:
fixed use-after-free bug in fnematch due to adjbuf invalidating
the pointers to buf. thanks to github user caffe3 for spotting
the issue and providing a fix, and to Miguel Pineiro Jr.
for the alternative fix.
MAX_UTF_BYTES in fnematch has been replaced with awk_mb_cur_max.
thanks to Miguel Pineiro Jr.

Note: This brings in the matchop-deref.* files that were missing (but in
FreeBSD already) and adds system-stauts.ok2. The latter has been deleted
in FreeBSD since it does not fit ATF well. Care must be taken to remove it
before the merge this time.

Sponsored by: Netflix

7 weeks agolibfido2: update to 1.14.0
Ed Maste [Sat, 4 May 2024 16:51:08 +0000 (12:51 -0400)]
libfido2: update to 1.14.0

Sponsored by: The FreeBSD Foundation

7 weeks agorc.conf.5: modernise network_interfaces
Lexi Winter [Sat, 4 May 2024 16:42:40 +0000 (10:42 -0600)]
rc.conf.5: modernise network_interfaces

It's not 1996 anymore, and we use CIDR nowadays.  Update the various
ifconfig_ examples to use CIDR notation instead of netmasks, and also
add an example of a basic ifconfig_ entry that most users will be
interested in.

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

7 weeks agoFixup: Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9
Dimitry Andric [Sat, 4 May 2024 10:19:32 +0000 (12:19 +0200)]
Fixup: Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9

Update version numbers, config headers, etc. Git tricked me into losing
these before pushing.

PR: 276104
Fixes: d67fc74b9249
MFC after: 3 days

7 weeks agoMerge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9
Dimitry Andric [Sat, 4 May 2024 10:19:32 +0000 (12:19 +0200)]
Merge llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9

This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.5-0-g617a15a9eac9.

PR: 276104
MFC after: 3 days

7 weeks agoarp(8): fix a typo in error message for -s/-S
Lexi Winter [Sat, 4 May 2024 15:02:39 +0000 (09:02 -0600)]
arp(8): fix a typo in error message for -s/-S

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

7 weeks agointro.2 as errno.2: Use the name macro for errno
Alexander Ziaee [Sat, 4 May 2024 14:54:21 +0000 (08:54 -0600)]
intro.2 as errno.2: Use the name macro for errno

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

7 weeks agointro.2: Add sys/syscall.h to SYNOPSIS
Alexander Ziaee [Sat, 4 May 2024 14:54:20 +0000 (08:54 -0600)]
intro.2: Add sys/syscall.h to SYNOPSIS

MFC after: 1 week
Co-authored-by: brooks
Reviewed by: brooks, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1192

7 weeks agointro.2 as errno.2: Update maximum hard link limit
Alexander Ziaee [Sat, 4 May 2024 14:54:20 +0000 (08:54 -0600)]
intro.2 as errno.2: Update maximum hard link limit

MFC after: 1 week
Co-authored-by: brooks
Reviewed by: brooks, emaste, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1192

7 weeks agoaic7xxx: make target mode enable a device hint
HP van Braam [Sat, 4 May 2024 14:40:15 +0000 (08:40 -0600)]
aic7xxx: make target mode enable a device hint

Previously it was only possible to enable target mode for these drivers
by rebuilding the kernel with AHC_TMODE_ENABLE or AHD_TMODE_ENABLE and a
bitmask of which units to statically enable for target mode.

There is no space-savings in the driver by not having AHC_TMODE_ENABLE
set, so in addition to the compile time option lets also introduce some
tunables:

hint.ahc.<unit>.tmode_enable=0/1
hint.ahd.<unit>.tmode_enable=0/1

For compatibility the old behavior is retained, but it can be overridden
with tunables

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

7 weeks agoaic7xxx: aicasm correct include file
HP van Braam [Sat, 4 May 2024 14:36:47 +0000 (08:36 -0600)]
aic7xxx: aicasm correct include file

aicasm just puts the value of the "-i" passed include file in the
generated file with quotes around it. This means that there are manual
edits made to aic7xxx_reg_print.c and aic79xx_reg_print.c

now we check to see if the value passed to '-i' starts with a '<', if it
does don't output the quotes.

Signed-off-by: HP van Braam <hp@tmm.cx>
Reviewed by: imp (minor code simplification)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1209

7 weeks agocheckstyle9: Relax sob line requirement
Warner Losh [Sat, 4 May 2024 13:56:36 +0000 (07:56 -0600)]
checkstyle9: Relax sob line requirement

7 weeks agopackages: add package for NTP
Lexi Winter [Sat, 4 May 2024 13:41:46 +0000 (07:41 -0600)]
packages: add package for NTP

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

7 weeks agoVendor import of llvm-project branch release/18.x llvmorg-18.1.5-0-g617a15a9eac9.
Dimitry Andric [Sat, 4 May 2024 10:17:01 +0000 (12:17 +0200)]
Vendor import of llvm-project branch release/18.x llvmorg-18.1.5-0-g617a15a9eac9.

7 weeks agoVendor import of libfido2 1.14.0
Ed Maste [Sat, 4 May 2024 00:05:23 +0000 (20:05 -0400)]
Vendor import of libfido2 1.14.0

7 weeks agozfs: unbreak macOS bootstrap
Martin Matuska [Fri, 3 May 2024 23:52:56 +0000 (01:52 +0200)]
zfs: unbreak macOS bootstrap

Temporary patch until vendor implements a fix.

7 weeks agolibcbor: vendor update to 0.11.0
Ed Maste [Fri, 3 May 2024 23:33:50 +0000 (19:33 -0400)]
libcbor: vendor update to 0.11.0

Sponsored by: The FreeBSD Foundation