]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 months agonl_types.h: explicitly include cdefs.h
Val Packett [Tue, 16 Jan 2024 18:42:26 +0000 (15:42 -0300)]
nl_types.h: explicitly include cdefs.h

This file uses __BEGIN_DECLS/__END_DECLS. When bootstrapping from
Linux/musl, they were missing.

Sponsored by: https://www.patreon.com/valpackett
Pull Request: https://github.com/freebsd/freebsd-src/pull/1066

4 months agomount: document atime option
Ed Maste [Wed, 24 Jan 2024 16:26:23 +0000 (11:26 -0500)]
mount: document atime option

atime is enabled by default, but may be specified explicitly so that any
future change in the default would not have an effect on a given mount.

Reviewed by: olce, rgrimes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43580

4 months agokern: tty: fix recanonicalization
Kyle Evans [Wed, 24 Jan 2024 19:36:26 +0000 (13:36 -0600)]
kern: tty: fix recanonicalization

`ti->ti_begin` is actually the offset within the first block that is
unread, so we must use that for our lower bound.

Moving to the previous block has to be done at the end of the loop in
order to correctly handle the case of ti_begin == TTYINQ_DATASIZE.  At
that point, lastblock is still the last one with data written and the
next write into the queue would advance lastblock.  If we move to the
previous block at the beginning, then we're essentially off by one block
for the entire scan and run the risk of running off the end of the block
queue.

The ti_begin == 0 case is still handled correctly, as we skip the loop
entirely and the linestart gets recorded as the first byte available for
writing.  The bit after the loop about moving to the next block is also
still correct, even with both previous fixes in mind: we skipped moving
to the previous block if we hit ti_begin, and `off + 1` would in-fact be
a member of the next block from where we're reading if it falls on a
block boundary.

Reported by: dim
Fixes: 522083ffbd1ab ("kern: tty: recanonicalize the buffer on [...]")

4 months agopflowctl: fix usage message
Kristof Provost [Wed, 24 Jan 2024 19:35:35 +0000 (20:35 +0100)]
pflowctl: fix usage message

Reported by: Jim Pingle <jimp@netgate.com>
Sponsored by: Rubicon Communications, LLC ("Netgate")

4 months agopf: only check MTU for IPv6 packets when forwarding
Kristof Provost [Wed, 24 Jan 2024 16:34:01 +0000 (17:34 +0100)]
pf: only check MTU for IPv6 packets when forwarding

When the packets are generated locally (i.e. PFIL_FWD is not set) we
might generate overly large packets and rely on the NIC to fragment it
for us. In that case we'd reject a valid packet.

Reported by: Herbert J. Skuhra <herbert@gojira.at>
Tested by: Herbert J. Skuhra <herbert@gojira.at>
Fixes: 54c62e3e5d8cd90c5571a1d4c8c5f062d580480e
Sponsored by: Rubicon Communications, LLC ("Netgate")

4 months agoccdconfig: remove obsolete references to BSD disklabels
Ed Maste [Wed, 24 Jan 2024 15:05:09 +0000 (10:05 -0500)]
ccdconfig: remove obsolete references to BSD disklabels

ccd(4) previoulsy had knowledge of BSD disklabels, and relied on their
use on the underlying disks, but this hasn't been the case since 2003
(commit 0f76d6d822f4).

Remove disklabel references from the man page.

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

4 months agocallout: retire callout_async_drain()
Gleb Smirnoff [Wed, 24 Jan 2024 17:33:27 +0000 (09:33 -0800)]
callout: retire callout_async_drain()

This function was used only in TCP before 446ccdd08e2a.  It was born in
pain in 2016 to plug different complex panics in TCP timers.  It wasn't
warmly accepted in phabricator by all of the reviewers and my recollection
of overall agreement was that "if you need this KPI, then you'd better fix
your code to not need it".  However, the function served its duty well all
the way to FreeBSD 14.  But now that TCP doesn't need it anymore, let's
retire it to reduce complexity of callout code and also to avoid its
further use.

Reviewed by: jhb, markj, kib, rrs
Differential Revision: https://reviews.freebsd.org/D43546

4 months agotcp: pass maxseg around instead of calculating locally
Richard Scheffenegger [Wed, 24 Jan 2024 15:42:29 +0000 (16:42 +0100)]
tcp: pass maxseg around instead of calculating locally

Improve slowpath processing (reordering, retransmissions)
slightly by calculating maxseg only once. This typically
saves one of two calls to tcp_maxseg().

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

4 months agokcmp: Add a manual page
Mark Johnston [Wed, 24 Jan 2024 14:41:31 +0000 (09:41 -0500)]
kcmp: Add a manual page

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

4 months agorelease: rework distributions list
Ed Maste [Mon, 22 Jan 2024 14:49:02 +0000 (09:49 -0500)]
release: rework distributions list

Components like base.txz and ports.txz are called distributions in the
installer, and with the introduction of pkgbase we will start dealing
with normal pkg packages in the installer.  Rename EXTRA_PACKAGES to
DISTRIBUTIONS, and move base.txz and kernel.txz to that list.

This introduces no functional change but is a small cleanup in advance
of some pkgbase experimentation.

Reviewed by: cperciva
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43544

4 months agocrunch: remove fdisk from examples
Ed Maste [Tue, 23 Jan 2024 18:28:07 +0000 (13:28 -0500)]
crunch: remove fdisk from examples

It has been deprecated for a long time; gpart should be used instead.
The man page was updated in 2015 to declare it obsolete (b8c19fd719945).

4 months agozfs: merge openzfs/zfs@a4bf6baae
Martin Matuska [Wed, 24 Jan 2024 11:41:22 +0000 (12:41 +0100)]
zfs: merge openzfs/zfs@a4bf6baae

Notable upstream pull request merges:
 #15630 a4bf6baae FreeBSD: Fix file descriptor leak on pool import
 #15780 d9cb42da9 FreeBSD: Fix bootstrapping tools under Linux/musl

Obtained from: OpenZFS
OpenZFS commit: a4bf6baaeb70a01a4c13fd6139ebdc97bad172e9

4 months agojoin(1): Fix ordering in case of missing fields
Tijl Coosemans [Mon, 22 Jan 2024 10:35:31 +0000 (11:35 +0100)]
join(1): Fix ordering in case of missing fields

The comparison function had the ordering reversed causing join(1) to
miss some matching lines.

PR: 232405
Submitted by: Martijn van Duren <martijn@openbsd.org>
MFC after: 1 week

4 months agostress2: Remove fdisk(8) regression test
Peter Holm [Wed, 24 Jan 2024 08:55:34 +0000 (09:55 +0100)]
stress2: Remove fdisk(8) regression test

4 months agostress2: remove the usage of fdisk(8) as this is soon to be removed
Peter Holm [Wed, 24 Jan 2024 08:54:17 +0000 (09:54 +0100)]
stress2: remove the usage of fdisk(8) as this is soon to be removed

4 months agoBump __FreeBSD_version for kern_openatfp(9) and kcmp(2)
Konstantin Belousov [Tue, 23 Jan 2024 22:57:02 +0000 (00:57 +0200)]
Bump __FreeBSD_version for kern_openatfp(9) and kcmp(2)

4 months agoAdd kern_openatfp(9)
Konstantin Belousov [Sat, 20 Jan 2024 20:34:46 +0000 (22:34 +0200)]
Add kern_openatfp(9)

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

4 months agokern_openat(): minor style fixes
Konstantin Belousov [Sat, 20 Jan 2024 21:42:39 +0000 (23:42 +0200)]
kern_openat(): minor style fixes

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

4 months agokern_openat(): rename fd argument to dirfd
Konstantin Belousov [Sat, 20 Jan 2024 21:41:12 +0000 (23:41 +0200)]
kern_openat(): rename fd argument to dirfd

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

4 months agoregen
Konstantin Belousov [Fri, 19 Jan 2024 19:55:42 +0000 (21:55 +0200)]
regen

4 months agokcmp(2): implement for procdesc
Konstantin Belousov [Fri, 19 Jan 2024 22:37:39 +0000 (00:37 +0200)]
kcmp(2): implement for procdesc

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

4 months agokcmp(2): implement for linuxkpi cdevs
Konstantin Belousov [Fri, 19 Jan 2024 21:54:03 +0000 (23:54 +0200)]
kcmp(2): implement for linuxkpi cdevs

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

4 months agokcmp(2): implement for devfs files
Konstantin Belousov [Fri, 19 Jan 2024 21:36:50 +0000 (23:36 +0200)]
kcmp(2): implement for devfs files

Compare not vnodes, which are different between mount points, but
actual cdev referenced by the devfs node.

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

4 months agokcmp(2): implement for vnode files
Konstantin Belousov [Fri, 19 Jan 2024 21:24:31 +0000 (23:24 +0200)]
kcmp(2): implement for vnode files

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

4 months agokcmp(2): implement for generic file types
Konstantin Belousov [Fri, 19 Jan 2024 21:44:37 +0000 (23:44 +0200)]
kcmp(2): implement for generic file types

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

4 months agoAdd kcmp(2) userspace bits
Konstantin Belousov [Fri, 19 Jan 2024 19:55:11 +0000 (21:55 +0200)]
Add kcmp(2) userspace bits

Unlike Linux, we do provide libc wrapper.  All definitions and
prototypes are available from <unistd.h>

Tested by: manu
Reviewed by: brooks, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D43518

4 months agoAdd kcmp(2) kernel bits
Konstantin Belousov [Fri, 19 Jan 2024 19:49:36 +0000 (21:49 +0200)]
Add kcmp(2) kernel bits

This is based purely on reading the Linux kcmp(2) man page.
In addition to the Linux set of comparators, I also added KCMP_FILEOBJ to
compare underlying file' objects.

Tested by: manu
Reviewed by: brooks, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D43518

4 months agofile: add fo_cmp method
Konstantin Belousov [Fri, 19 Jan 2024 21:01:35 +0000 (23:01 +0200)]
file: add fo_cmp method

The method should return 0 if the file' underlying objects are same.  In
other words, if 0 is returned, io from either of file causes
modifications of the same object.

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

4 months agoAdd fget_remote()
Konstantin Belousov [Mon, 22 Jan 2024 22:31:55 +0000 (00:31 +0200)]
Add fget_remote()

The function holds and returns struct file for a file descriptor index
in the given process.

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

4 months agosys/file.h: style
Konstantin Belousov [Sat, 20 Jan 2024 21:49:11 +0000 (23:49 +0200)]
sys/file.h: style

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

4 months agoncurses: serialize the tinfo build a little bit
Kyle Evans [Wed, 24 Jan 2024 05:00:36 +0000 (23:00 -0600)]
ncurses: serialize the tinfo build a little bit

Move ncurses_dll.h to GENHDRS to start with; it's been generated from
ncurses_dll.h.in for years, so it's not actually in a different category
than all of the other GENHDRS.  Slap an .ORDER on it to ensure that we
build ncurses_dll.h and curses.h before any *.c gets compiled.

This should sufficiently address a build race seen downstream where
ncurses_dll.h is present but not yet populated.

Reviewed by: bapt
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D43540

4 months agoFix file descriptor leak on pool import.
Pawel Jakub Dawidek [Tue, 23 Jan 2024 23:03:48 +0000 (15:03 -0800)]
Fix file descriptor leak on pool import.

Descriptor leak can be easily reproduced by doing:

# zpool import tank
# sysctl kern.openfiles
# zpool export tank; zpool import tank
# sysctl kern.openfiles

We were leaking four file descriptors on every import.

Similar leak most likely existed when using file-based VDEVs.

External-issue: https://reviews.freebsd.org/D43529
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #15630

4 months agotcp: remove 20+ year old disabled code from d912c694ee00
Gleb Smirnoff [Tue, 23 Jan 2024 21:16:34 +0000 (13:16 -0800)]
tcp: remove 20+ year old disabled code from d912c694ee00

4 months agotcp: clear outdated comment mentioning T/TCP
Gleb Smirnoff [Tue, 23 Jan 2024 20:54:43 +0000 (12:54 -0800)]
tcp: clear outdated comment mentioning T/TCP

4 months agotcp: pass positive errno to tcp_drop()
Gleb Smirnoff [Tue, 23 Jan 2024 20:52:55 +0000 (12:52 -0800)]
tcp: pass positive errno to tcp_drop()

Fixes: 446ccdd08e2a9f704f6348cd7f679e59183b99b3

4 months agotmpfs: increase vfs.tmpfs.memory_percent to 100 as workaround
Mike Karels [Tue, 23 Jan 2024 17:23:38 +0000 (11:23 -0600)]
tmpfs: increase vfs.tmpfs.memory_percent to 100 as workaround

The changes to avoid letting tmpfs use all of memory + swap do not
work well with ZFS ARC.  The ARC can grow quite large, and will shrink
when there is memory pressure, but tmpfs does not allow for that.
Pending investigation of the right way to handle this, change the
default value of the vfs.tmpfs.memory_percent sysctl to 100 as a
workaround.  The sysctl can be set to 95 to get back to the previous
default.

4 months agomtree: stop creating old mixer(8) test directories
Dimitry Andric [Tue, 23 Jan 2024 18:40:01 +0000 (19:40 +0100)]
mtree: stop creating old mixer(8) test directories

The tests themselves were added to ObsoleteFiles.inc in commit
f7c4f4964971, but not yet removed from BSD.tests.dist.

PR: 274602
Fixes: f7c4f4964971

4 months agopowerpc: Add RF_LITTLEENDIAN resource flag
John Baldwin [Tue, 23 Jan 2024 17:38:36 +0000 (09:38 -0800)]
powerpc: Add RF_LITTLEENDIAN resource flag

If this powerpc-specific flag is set on a resource, then the
little-endian bus tag is always used when mapping that resource.

Make use of this flag in the mpc85xx/fsl_sata driver to avoid setting
the SATA BAR's bus tag after bus_alloc_resource.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D43553

4 months agosimplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY
John Baldwin [Tue, 23 Jan 2024 17:38:25 +0000 (09:38 -0800)]
simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY

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

4 months agoofw_pcib: Use bus_generic_rman_*
John Baldwin [Tue, 23 Jan 2024 17:38:09 +0000 (09:38 -0800)]
ofw_pcib: Use bus_generic_rman_*

- Implement bus_map/unmap_resource pulling bits from the previous
  ofw_pcib_activate/deactivate_resource.  One difference here is that
  the bus_unmap_resource implementation uses bus_space_unmap instead
  of pmap_unmapdev as a complement to the existing use of bus_space_map.

- Use bus_generic_rman_* in various routines for memory and I/O port
  resources.

- Use pci_domain_* for PCI_RES_BUS in
  ofw_pcib_activate/deactivate_resource.

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

4 months agopowerpc: Fix bus_space_unmap
John Baldwin [Tue, 23 Jan 2024 17:37:53 +0000 (09:37 -0800)]
powerpc: Fix bus_space_unmap

Previously it failed to compile since the macro passed too many
arguments to the function.  Fix by adding the bus handle to the
function and adding an implementation that calls pmap_unmapdev.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D43440

4 months agoarm64 thunder: Use bus_generic_rman_* in the pcie_pem driver
John Baldwin [Tue, 23 Jan 2024 17:37:41 +0000 (09:37 -0800)]
arm64 thunder: Use bus_generic_rman_* in the pcie_pem driver

- Implement bus_map/unmap_resource pulling bits from the previous
  thunder_pem_activate/deactivate_resource.

- Use bus_generic_rman_* in various routines for memory and I/O port
  resources.

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

4 months agoarm mv_pcib: Use bus_generic_rman_*
John Baldwin [Tue, 23 Jan 2024 17:37:30 +0000 (09:37 -0800)]
arm mv_pcib: Use bus_generic_rman_*

- Implement bus_get_rman pulling bits from mv_pcib_alloc_resource.

- Implement bus_map/unmap_resource pulling bits from
  mv_pcib_activate/deactivate_resource.

- Use bus_generic_rman_* to handle memory and I/O resources for
  mv_pcib_alloc/activate/adjust/deactivate/release_resource.

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

4 months agoarm nexus: Use bus_generic_rman_*
John Baldwin [Tue, 23 Jan 2024 17:37:13 +0000 (09:37 -0800)]
arm nexus: Use bus_generic_rman_*

- Implement bus_get_rman pulling bits from nexus_alloc_resource.

- Implement bus_map/unmap_resource pulling bits from
  nexus_activate/deactivate_resource.

- Use bus_generic_rman_* for
  bus_alloc/adjust/activate/deactivate/release_resource except for
  custom interrupt activate/deactivate logic still in
  nexus_activate/deactivate_resource.

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

4 months agopowerpc nexus: Use bus_generic_rman_*
John Baldwin [Tue, 23 Jan 2024 17:37:02 +0000 (09:37 -0800)]
powerpc nexus: Use bus_generic_rman_*

Reviewed by: imp, jhibbits
Differential Revision: https://reviews.freebsd.org/D43436

4 months agopowerpc powermac: Use bus_generic_rman_*
John Baldwin [Tue, 23 Jan 2024 17:36:49 +0000 (09:36 -0800)]
powerpc powermac: Use bus_generic_rman_*

Implement bus_map/unmap_resource and add bus_get_rman for use by
bus_generic_rman_*.

Reviewed by: imp, jhibbits
Differential Revision: https://reviews.freebsd.org/D43435

4 months agopowerpc mpc85xx: Use bus_generic_rman_*
John Baldwin [Tue, 23 Jan 2024 17:36:37 +0000 (09:36 -0800)]
powerpc mpc85xx: Use bus_generic_rman_*

- Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY for
  bus_activate/deactivate/adjust/release_resource.

- Implement bus_map/unmap_resource.

- Add an implementation of bus_adjust_resource.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D43434

4 months agopowerpc psim: Use bus_generic_rman_*
John Baldwin [Tue, 23 Jan 2024 17:36:26 +0000 (09:36 -0800)]
powerpc psim: Use bus_generic_rman_*

- Split out bits of iobus_activate/deactive_resource to implement
  iobus_map/unmap_resource.

- Use bus_generic_rman_* methods in several bus methods to handle
  memory and I/O port resources.

- Add an implementation of bus_adjust_resource.

Reviewed by: imp, jhibbits
Differential Revision: https://reviews.freebsd.org/D43433

4 months agopowerpc ps3bus: Use bus_generic_rman_*
John Baldwin [Tue, 23 Jan 2024 17:36:12 +0000 (09:36 -0800)]
powerpc ps3bus: Use bus_generic_rman_*

- Split out part of ps3bus_activate_resource into a
  ps3bus_map_resource method.

- Implement ps3bus_unmap_resource via pmap_unmapdev.

- Use bus_generic_rman_* to add bus_adjust_resource,
  bus_deactivate_resource, and bus_release_resource methods.

Reviewed by: imp, jhibbits
Differential Revision: https://reviews.freebsd.org/D43432

4 months agohyperv vmbus_pcib: Use pci_domain_*_bus for PCI_RES_BUS resources
John Baldwin [Tue, 23 Jan 2024 17:35:58 +0000 (09:35 -0800)]
hyperv vmbus_pcib: Use pci_domain_*_bus for PCI_RES_BUS resources

Specifically for bus_activate/adjust/deactivate_bus methods.

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

4 months agox86: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources
John Baldwin [Tue, 23 Jan 2024 17:35:47 +0000 (09:35 -0800)]
x86: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources

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

4 months agopci_host_generic: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources
John Baldwin [Tue, 23 Jan 2024 17:35:36 +0000 (09:35 -0800)]
pci_host_generic: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources

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

4 months agoacpi_pcib: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources
John Baldwin [Tue, 23 Jan 2024 17:35:22 +0000 (09:35 -0800)]
acpi_pcib: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources

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

4 months agopcib: Add helper routines for [de]activating PCI_RES_BUS resources
John Baldwin [Tue, 23 Jan 2024 17:35:08 +0000 (09:35 -0800)]
pcib: Add helper routines for [de]activating PCI_RES_BUS resources

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

4 months agobhyve: Prepare to add arm64 support to the gdb stub
Mark Johnston [Tue, 23 Jan 2024 16:41:13 +0000 (11:41 -0500)]
bhyve: Prepare to add arm64 support to the gdb stub

In particular:
- Stop assuming that the breakpoint size is one byte.
- Avoid referencing the "rip" field in machine-independent code, use a
  helper.

No functional change intended.

Reviewed by: corvink, jhb
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D43483

4 months agobhyve: Simplify register definitions a bit
Mark Johnston [Tue, 23 Jan 2024 16:40:52 +0000 (11:40 -0500)]
bhyve: Simplify register definitions a bit

It's awkward to have separate tables for information which is logically
connected.  Merge the gdb_regset[] and gdb_regsize[] arrays and update
gdb_read_regs() to cope with the result.  This makes the addition of
arm64 support a bit cleaner.

No functional change intended.

Reviewed by: corvink, jhb
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D43481

4 months agobhyve: Avoid underflows when handling remote commands
Mark Johnston [Tue, 23 Jan 2024 16:40:40 +0000 (11:40 -0500)]
bhyve: Avoid underflows when handling remote commands

Reviewed by: corvink, jhb
MFC after: 1 week
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D43480

4 months agosysctl.8: fix format typo
Igor Ostapenko [Tue, 23 Jan 2024 14:34:59 +0000 (16:34 +0200)]
sysctl.8: fix format typo

Signed-off-by: Igor Ostapenko <pm@igoro.pro>
4 months agoacpiconf: remove trailing space in "Mesurement Accuracy" output
Christos Margiolis [Tue, 23 Jan 2024 15:39:40 +0000 (17:39 +0200)]
acpiconf: remove trailing space in "Mesurement Accuracy" output

No functional change intended.

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

4 months agostand: Add 1440p to the list of known resolutions.
Dag-Erling Smørgrav [Tue, 23 Jan 2024 14:20:27 +0000 (15:20 +0100)]
stand: Add 1440p to the list of known resolutions.

MFC after: 1 week
Reviewed by: manu, kevans, imp
Differential Revision: https://reviews.freebsd.org/D43391

4 months agoarm/mpic: remove empty pic_init_secondary() hook
Elliott Mitchell [Tue, 23 Jan 2024 02:52:37 +0000 (02:52 +0000)]
arm/mpic: remove empty pic_init_secondary() hook

The default hook does nothing, so having an empty handler is pointless.
Simple cleanup.

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

4 months agobsdlabel: limit to 8 partitions
Ed Maste [Tue, 23 Jan 2024 02:05:58 +0000 (21:05 -0500)]
bsdlabel: limit to 8 partitions

bsdlabel is intended to support up to 20 partitions, but the disklabel
struct has a d_partitions array with only BSD_NPARTS_MIN (8) entries.
Previously, an attempt to operate on a bsdlabel with more than eight
partitions resulted in a buffer overflow.

As a stopgap limit bsdlabel to 8 partitions until this is fixed
properly.

PR: 276517

4 months agoZTS: Apply zfs_bclone_enabled to bclone tests
Brian Behlendorf [Tue, 23 Jan 2024 00:14:08 +0000 (16:14 -0800)]
ZTS: Apply zfs_bclone_enabled to bclone tests

If block cloning is disabled by default then enable it when running
the bclone tests.  Follow up to #15529.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #15796

4 months agodwc: Fix two typos in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 21:03:29 +0000 (22:03 +0100)]
dwc: Fix two typos in a source code comment

- s/recevied/received/
- s/descriptr/descriptor/

MFC after: 3 days

4 months agometa2deps.py: Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 21:00:36 +0000 (22:00 +0100)]
meta2deps.py: Fix a typo in a source code comment

- s/follwing/following/

MFC after: 3 days

4 months agovirtio(4): Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:59:06 +0000 (21:59 +0100)]
virtio(4): Fix a typo in a source code comment

- s/recevied/received/

MFC after: 3 days

4 months agousb: Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:57:06 +0000 (21:57 +0100)]
usb: Fix a typo in a source code comment

- s/recevied/received/

MFC after: 3 days

4 months agovmd(4): Fix typos in source code comments
Gordon Bergling [Mon, 22 Jan 2024 20:55:33 +0000 (21:55 +0100)]
vmd(4): Fix typos in source code comments

- s/harwdare/hardware/

MFC after: 3 days

4 months agonet80211: Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:54:36 +0000 (21:54 +0100)]
net80211: Fix a typo in a source code comment

- s/recevied/received/

MFC after: 3 days

4 months agortsock: Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:53:21 +0000 (21:53 +0100)]
rtsock: Fix a typo in a source code comment

- s/adddress/address/

MFC after: 3 days

4 months agonetlink(4): Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:52:16 +0000 (21:52 +0100)]
netlink(4): Fix a typo in a source code comment

- s/permament/permanent/

MFC after: 3 days

4 months agonetpfil: Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:50:57 +0000 (21:50 +0100)]
netpfil: Fix a typo in a source code comment

- s/strucutre/structure/

MFC after: 3 days

4 months agotcp_fastopen: Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:49:47 +0000 (21:49 +0100)]
tcp_fastopen: Fix a typo in a source code comment

- s/posession/possession/

MFC after: 3 days

4 months agonetinet6: Fix two typos in source code comments
Gordon Bergling [Mon, 22 Jan 2024 20:48:34 +0000 (21:48 +0100)]
netinet6: Fix two typos in source code comments

- s/adddress/address/

MFC after: 3 days

4 months agoaic7xxx: Fix two typos in source code comments
Gordon Bergling [Mon, 22 Jan 2024 20:47:23 +0000 (21:47 +0100)]
aic7xxx: Fix two typos in source code comments

- s/recevied/received/

MFC after: 3 days

4 months agobootpd(8): Fix a typo in a source code comment
Gordon Bergling [Mon, 22 Jan 2024 20:46:31 +0000 (21:46 +0100)]
bootpd(8): Fix a typo in a source code comment

- s/adddress/address/

MFC after: 3 days

4 months agotcp: remove outdated comment
Gleb Smirnoff [Mon, 22 Jan 2024 20:42:21 +0000 (12:42 -0800)]
tcp: remove outdated comment

This paragraph should have been removed in 446ccdd08e2a.

4 months agopflow: limit to no more than 128 flow exporters
Kristof Provost [Mon, 22 Jan 2024 16:35:54 +0000 (17:35 +0100)]
pflow: limit to no more than 128 flow exporters

While there are no inherent limits to the number of exporters we're
likely to scale rather badly to very large numbers. There's also no
obvious use case for more than a handful. Limit to 128 exporters to
prevent foot-shooting.

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

4 months agopflow: observation domain is an unsigned integer
Kristof Provost [Mon, 22 Jan 2024 16:34:44 +0000 (17:34 +0100)]
pflow: observation domain is an unsigned integer

Ensure we print it as such, rather than as a signed integer, as that
would lead to confusion.

Reported by: Jim Pingle <jimp@netgate.com>
Sponsored by: Rubicon Communications, LLC ("Netgate")

4 months agotcp_wrappers: silence a few warnings
Piotr Pawel Stefaniak [Sun, 21 Jan 2024 10:15:48 +0000 (11:15 +0100)]
tcp_wrappers: silence a few warnings

Mostly -Wdeprecated-non-prototype.

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

4 months agowg: detach bpf upon destroy as well
Aaron LI [Mon, 22 Jan 2024 16:18:56 +0000 (10:18 -0600)]
wg: detach bpf upon destroy as well

bpfattach() is called in wg_clone_create(), but the bpfdetach() is
missing from wg_close_destroy().  Add the missing bpfdetach() to avoid
leaking both the associated bpf bits as well as the ifnet that bpf will
hold a reference to.

PR: 276526
MFC after: 3 days

4 months agosqlite3: Vendor import of sqlite3 3.45.0
Cy Schubert [Mon, 22 Jan 2024 15:35:06 +0000 (07:35 -0800)]
sqlite3: Vendor import of sqlite3 3.45.0

Release notes at https://www.sqlite.org/releaselog/3_45_0.html

Obtained from:  https://www.sqlite.org/2024/sqlite-autoconf-3450000.tar.gz

MFC after: 2 weeks
Merge commit 'cdad538768db9e2c8258d19e9282fb5aaae80e46'

4 months agosqlite3: Vendor import of sqlite3 3.45.0
Cy Schubert [Mon, 22 Jan 2024 15:10:03 +0000 (07:10 -0800)]
sqlite3: Vendor import of sqlite3 3.45.0

Release notes at https://www.sqlite.org/releaselog/3_45_0.html

Obtained from:  https://www.sqlite.org/2024/sqlite-autoconf-3450000.tar.gz

4 months agopf tests: test ICMP6 packet too big with binat
Kristof Provost [Wed, 17 Jan 2024 17:03:56 +0000 (18:03 +0100)]
pf tests: test ICMP6 packet too big with binat

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

4 months agopf: work around icmp6 packet-too-big not being sent when binat-ing
Kristof Provost [Wed, 17 Jan 2024 17:11:27 +0000 (18:11 +0100)]
pf: work around icmp6 packet-too-big not being sent when binat-ing

If we're applying NPTv6 we pass a packet with a modified source and/or
destination address to the network stack.

If that packet then turns out to be larger than the MTU of the sending
interface the stack will attempt to generate an icmp6 packet-too-big
error, but may fail to look up the appropriate source address for that
error message. Even if it does, pf would still have to undo the binat
operation inside the icmp6 packet so the sending host can make sense of
the error.

We can avoid both problems entirely by having pf also perform the MTU
check (taking the potential refragmentation into account), and
generating the icmp6 error directly in pf.

See also: https://redmine.pfsense.org/issues/14290
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D43499

4 months agosound: use device_set_descf() to set device descriptions
Christos Margiolis [Mon, 22 Jan 2024 09:44:51 +0000 (11:44 +0200)]
sound: use device_set_descf() to set device descriptions

Commit 6b6914c1e21b introduced a printf-like version of
device_set_desc(), so use it to simplify device description setting in
the audio stack.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Reviewed by: dev_submerge.ch, markj
Differential Revision: https://reviews.freebsd.org/D43467

4 months agonewfs_msdos.8: example for specific cluster size
Alexander Ziaee [Fri, 12 Jan 2024 22:12:48 +0000 (17:12 -0500)]
newfs_msdos.8: example for specific cluster size

The usual use case in 2024 for newfs_msdosfs is creating filesystems on SD cards
for older hardware. In most tutorials, they call the cluster size "allocation
size". Therefore, add a small note next to cluster size that it is also called
allocation size, and add an example for how to do this.

Reviewed by: jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/1045

4 months agonetlink.h: s/typeof/__typeof
Lexi Winter [Thu, 18 Jan 2024 02:34:39 +0000 (02:34 +0000)]
netlink.h: s/typeof/__typeof

typeof() does not exist in -std=c99 mode and the relevant #define is
only for _KERNEL, so use __typeof here instead.

Reviewed by: jhb
MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1070

4 months agofind: Add -readable, -writable & -executable options
Ricardo Branco [Sun, 21 Jan 2024 19:53:05 +0000 (20:53 +0100)]
find: Add -readable, -writable & -executable options

Reviewed by: jhb, Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/1080

4 months agorc.d/kdc: Support start of MIT krb5kdc
Cy Schubert [Sat, 20 Jan 2024 13:52:35 +0000 (05:52 -0800)]
rc.d/kdc: Support start of MIT krb5kdc

Some users wishing to use the MIT krb5kdc have discovered the
kdc script workaround applied to the MIT krb5 ports is insufficient.
Let's build into this rc script the smarts to determine whether
base or ports Hiemdal kdc is being invoked or the MIT krb5kdc.

While at it, remove kdc_start_precmd(). This will simplify a future
jail patch.

Suggested by: netchild
Original patch: netchild
Reviewed by: emaste, netchild
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D43523

4 months agoaltq: Remove stale driver references
Warner Losh [Sun, 21 Jan 2024 17:00:49 +0000 (10:00 -0700)]
altq: Remove stale driver references

Remove xr to an(4) and npe(4) since they no longer exist in the tree.

Sponsored by: Netflix

4 months agofirmware(9): Update example
Warner Losh [Sat, 20 Jan 2024 04:32:16 +0000 (21:32 -0700)]
firmware(9): Update example

Update the example to include a firmware module in the kernel from npe
to iwn. Npe was deleted 6 years ago so makes a poor example of how to
embed firmware in the kernel.

Sponsored by: Netflix

4 months agojail: make sure jail.conf parse errors exit, and not crash.
Jamie Gritton [Sun, 21 Jan 2024 05:20:59 +0000 (21:20 -0800)]
jail: make sure jail.conf parse errors exit, and not crash.
Reported by: Mason Loring Bliss

4 months agofsck_msdosfs: do not call checksize() if the cluster is bad
John F. Carr [Sat, 20 Jan 2024 23:18:18 +0000 (01:18 +0200)]
fsck_msdosfs: do not call checksize() if the cluster is bad

PR: 276464
MFC after: 1 week

4 months agotools/build/make.py: Add missing comma to fix tinderbox and worlds
Jessica Clarke [Sat, 20 Jan 2024 22:07:48 +0000 (22:07 +0000)]
tools/build/make.py: Add missing comma to fix tinderbox and worlds

The missing comma meant this was interpreted as a single target called
"tinderboxworlds", and so neither tinderbox nor worlds were recognised
as being MI targets (i.e. still required TARGET(_ARCH) to be given).

Fixes: 5157b451c654 ("tools/build/make.py: Grow the list of MI targets")

4 months agonetipsec: fix LINT-NOINET build
Kristof Provost [Sat, 20 Jan 2024 14:37:40 +0000 (15:37 +0100)]
netipsec: fix LINT-NOINET build

udp_ipsec_input() is used for INET6, so we need it even in NOINET
builds. Build the relevant file if either of INET or INET6 are set.

4 months agoaic7xxx: Fix a typo in a kernel message
Gordon Bergling [Sat, 20 Jan 2024 21:01:10 +0000 (22:01 +0100)]
aic7xxx: Fix a typo in a kernel message

- s/recevied/received/

MFC after: 5 days

4 months agoif_llatbl: Fix a typo in a KASSERT message
Gordon Bergling [Sat, 20 Jan 2024 20:00:22 +0000 (21:00 +0100)]
if_llatbl: Fix a typo in a KASSERT message

- s/entires/entries/

MFC after: 5 days

4 months agogjournal(8): Fix a typo in a sysctl description
Gordon Bergling [Sat, 20 Jan 2024 19:58:08 +0000 (20:58 +0100)]
gjournal(8): Fix a typo in a sysctl description

- s/entires/entries/

MFC after: 5 days

4 months agoPCI_IOV_INIT.9: Fix a typo in the manual page
Gordon Bergling [Sat, 20 Jan 2024 19:20:32 +0000 (20:20 +0100)]
PCI_IOV_INIT.9: Fix a typo in the manual page

- s/infrastucture/infrastructure/

MFC after: 3 days