]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 days agocons: Add boot option to mute boot messages after banner
Justin Hibbits [Tue, 30 Apr 2024 20:07:30 +0000 (16:07 -0400)]
cons: Add boot option to mute boot messages after banner

This is useful for embedded systems, where it provides feedback that the
kernel has booted, but avoids printing the probe messages.  If both
mutemsgs and verbose are set, verbose cancels the mute.

Additionally, this unmutes the console on panic, so a user can see what
happened leading up to the panic.

Obtained from:  Juniper Networks, Inc.

4 days agocxgbe(4): Minor tweaks to comments.
Navdeep Parhar [Tue, 30 Apr 2024 20:01:07 +0000 (13:01 -0700)]
cxgbe(4): Minor tweaks to comments.

No functional change intended.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 days agocxgbe(4): Initialize mps_bg_map to an invalid value if it's not known.
Navdeep Parhar [Tue, 30 Apr 2024 19:51:29 +0000 (12:51 -0700)]
cxgbe(4): Initialize mps_bg_map to an invalid value if it's not known.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 days agocxgbe(4): Do not read hardware registers to determine the number of ports.
Navdeep Parhar [Tue, 30 Apr 2024 19:42:14 +0000 (12:42 -0700)]
cxgbe(4): Do not read hardware registers to determine the number of ports.

PORTVEC obtained from the firmware is the authoritative source of this
information, and nports (calculated from PORTVEC) is available by the
time t4_port_init runs.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 days agoFix new users of MAXPHYS and hide it from the kernel namespace
Andrew Gallatin [Mon, 29 Apr 2024 23:11:56 +0000 (19:11 -0400)]
Fix new users of MAXPHYS and hide it from the kernel namespace

In cd8537910406, kib made maxphys a load-time tunable.  This made
the #define MAXPHYS in sys/param.h  almost entirely obsolete, as
it could now be overridden by kern.maxphys at boot time, or by
opt_maxphys.h.

However, decades of tradition have led to several new, incorrect, uses
of MAXPHYS in other parts of the kernel, mostly by seasoned
developers.  I've corrected those uses here in a mechanical fashion,
and verified that it fixes a bug in the md driver that I was
experiencing.

Since using MAXPHYS is such an easy mistake to make, it is best to
hide it from the kernel namespace.  So I've moved its definition to
_maxphys.h, which is now included in param.h only for userspace.

That brings up the fact that lots of userspace programs use MAXPHYS
for different reasons, most of them probably wrong.  Userspace consumers
that really need to know the value of maxphys should probably be
changed to use the kern.maxphys sysctl.  But that's outside the scope
of this change.

Reviewed by: imp, jkim, kib, markj
Fixes: 30038a8b4efc ("md: Get rid of the pbuf zone")
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D44986

4 days agocxgbe(4): Allocate a taskqueue per port instead of per channel.
Navdeep Parhar [Tue, 30 Apr 2024 17:51:45 +0000 (10:51 -0700)]
cxgbe(4): Allocate a taskqueue per port instead of per channel.

All the channels are not used on all boards and there's no point
allocating taskqueues that will never be used.

MFC after: 1 week
Sponsored by: Chelsio Communications

4 days agolibsys: don't try to expose freebsd7___semctl
Brooks Davis [Tue, 30 Apr 2024 02:43:30 +0000 (03:43 +0100)]
libsys: don't try to expose freebsd7___semctl

This has always been in libc and never exported directly.  I accidently
included it along side some freebsd11_* symbols based on a tree where I
moved semctl(2).

Fixes: df1a09ba524d0 libsys: expose a few more symbols for libc's use

4 days agotftpd: Untangle a conditional.
Dag-Erling Smørgrav [Tue, 30 Apr 2024 14:56:10 +0000 (16:56 +0200)]
tftpd: Untangle a conditional.

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

4 days agovm: Fix error handling in vm_thread_stack_back()
Mark Johnston [Mon, 29 Apr 2024 16:22:36 +0000 (12:22 -0400)]
vm: Fix error handling in vm_thread_stack_back()

vm_object_page_remove() wants to busy the page, but that won't work
here.  (Kernel stack pages are always busy.)

Make the error handling path look more like vm_thread_stack_dispose().

Reported by: pho
Reviewed by: kib, bnovkov
Fixes: 7a79d0669761 ("vm: improve kstack_object pindex calculation to avoid pindex holes")
Differential Revision: https://reviews.freebsd.org/D45019

4 days agoRemove remnants of portsnap(8)
Olivier Certner [Mon, 22 Apr 2024 13:02:46 +0000 (22:02 +0900)]
Remove remnants of portsnap(8)

This was prompted by noticing that '/var/db/portsnap' still exists on
newly-installed machines.

With this change, all mentions of portsnap(8) in the tree are gone,
except for the historical note in the AUTHORS section of manpage
phttpget(8).

locate(1) will thus start indexing again '/var/db/portsnap' on machines
where this directory still exists, which may be a good way to push
administrators to delete it.

Reviewed by:            cperciva
Approved by:            emaste (mentor)
MFC after:              3 days
Sponsored by:           The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D45023

4 days agolibarchive: merge bugfixes from vendor branch
Martin Matuska [Tue, 30 Apr 2024 09:53:06 +0000 (11:53 +0200)]
libarchive: merge bugfixes from vendor branch

 #2147 archive_string: clean up strncat_from_utf8_to_utf8 (36047967a)
 #2153 archive_match: check archive_read_support_format_raw()
       return value (0ce1b4c38)
 #2154 archive_match: turn counter into flag (287e05d53)
 #2155 lha: Do not allow negative file sizes (93b11caed)
 #2156 tests: setenv LANG to en_US.UTF-8 in bsdunzip test_I.c (83e8b0ea8)

MFC after: 3 days

4 days agoUpdate vendor/libarchive to libarchive master 83e8b0ea8
Martin Matuska [Tue, 30 Apr 2024 09:41:59 +0000 (11:41 +0200)]
Update vendor/libarchive to libarchive master 83e8b0ea8

 #2147 archive_string: clean up strncat_from_utf8_to_utf8 (36047967a)
 #2153 archive_match: check archive_read_support_format_raw()
       return value (0ce1b4c38)
 #2154 archive_match: turn counter into flag (287e05d53)
 #2155 lha: Do not allow negative file sizes (93b11caed)
 #2156 tests: setenv LANG to en_US.UTF-8 in bsdunzip test_I.c (83e8b0ea8)

Obtained from: libarchive
Libarchive commit: 83e8b0ea8c3b07e07ac3dee90a8724565f8e53fd

4 days agoarm64: Check for virtio for scmi_virtio.c
Andrew Turner [Tue, 30 Apr 2024 08:50:38 +0000 (08:50 +0000)]
arm64: Check for virtio for scmi_virtio.c

scmi_virtio.c depends on virtio. Check for this before including it in
the kernel.

Reported by: Isaac Cilia Attard (via cperciva)
Sponsored by: Arm Ltd

4 days agokcmp_pget(): do not accept TIDs
Konstantin Belousov [Mon, 29 Apr 2024 21:04:25 +0000 (00:04 +0300)]
kcmp_pget(): do not accept TIDs

Otherwise pget() might still look up and hold the current process.

Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 days agokcmp_pget(): add an assert that we did not hold the current process
Konstantin Belousov [Mon, 29 Apr 2024 18:51:53 +0000 (21:51 +0300)]
kcmp_pget(): add an assert that we did not hold the current process

Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

4 days agolinuxkpi: Add linuxkpi_video module
Emmanuel Vadot [Wed, 24 Apr 2024 08:14:36 +0000 (10:14 +0200)]
linuxkpi: Add linuxkpi_video module

This contain the hdmi code and the aperture code like in linux.

Differential Revision: https://reviews.freebsd.org/D44925
Reviewed by: bz
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG

4 days agolinuxkpi: hdmi: Split the module declaration to a new file
Emmanuel Vadot [Wed, 24 Apr 2024 07:59:20 +0000 (09:59 +0200)]
linuxkpi: hdmi: Split the module declaration to a new file

In order to have a proper linuxkpi_video kmod, move the module declaration
to a new file as linuxkpi_video will also include linux_hdmi.c

Differential Revision: https://reviews.freebsd.org/D44926
Reviewed by: bz, emaste, wulf
Sponsored by: Beckhoff Automation GmbH & Co. KG

4 days agortld.1: clarify interaction between -u and -o
Konstantin Belousov [Sun, 28 Apr 2024 21:45:12 +0000 (00:45 +0300)]
rtld.1: clarify interaction between -u and -o

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

4 days agortld direct exec: make -u behavior match the description
Konstantin Belousov [Sun, 28 Apr 2024 20:57:54 +0000 (23:57 +0300)]
rtld direct exec: make -u behavior match the description

Instead of only ignoring insecure env vars, clear them all.

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

4 days agortld: add direct-exec option -o
Konstantin Belousov [Sun, 28 Apr 2024 03:19:39 +0000 (06:19 +0300)]
rtld: add direct-exec option -o

allowing to set any known LD_ parameter for the current rtld invocation,
but without polluting the activated' binary environment.  In other
words, the set parameter is not exported into the environment.

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

5 days agozio: try to execute TYPE_NULL ZIOs on the current task
Rob N [Mon, 29 Apr 2024 22:57:32 +0000 (08:57 +1000)]
zio: try to execute TYPE_NULL ZIOs on the current task

Many TYPE_NULL ZIOs are used to provide a sync point for child ZIOs, and
do not do any actual work themselves. However, they are still dispatched
to a dedicated, single-thread taskq, which leads to their execution
being entirely task switch and dequeue overhead for no actual reason.

This commit changes it so that when selecting a parent ZIO to execute,
if the parent is TYPE_NULL and has no done function (that is, no
additional work), it is executed on the same thread. This reduces task
switches and frees up CPU cores for other work.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16134

5 days agovdev probe to slow disk can stall mmp write checker
Don Brady [Mon, 29 Apr 2024 21:35:53 +0000 (15:35 -0600)]
vdev probe to slow disk can stall mmp write checker

Simplify vdev probes in the zio_vdev_io_done context to
avoid holding the spa config lock for a long duration.

Also allow zpool clear if no evidence of another host
is using the pool.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Don Brady <don.brady@klarasystems.com>
Closes #15839

5 days agocxgbe(4): Shared code update to deal with partial failure in query_params.
Navdeep Parhar [Wed, 14 Feb 2024 01:28:53 +0000 (17:28 -0800)]
cxgbe(4): Shared code update to deal with partial failure in query_params.

Obtained from: Chelsio Communications
MFC after: 1 week
Sponsored by: Chelsio Communications

5 days agocxgbe(4): Reword the comment explaining the atid/cookie split.
Navdeep Parhar [Sat, 1 Apr 2023 23:07:36 +0000 (16:07 -0700)]
cxgbe(4): Reword the comment explaining the atid/cookie split.

Avoid a magic constant while here.  No functional change intended.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 days agoFix arcstats for FreeBSD after zfetch support
Ameer Hamza [Mon, 29 Apr 2024 20:28:50 +0000 (01:28 +0500)]
Fix arcstats for FreeBSD after zfetch support

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #16141

5 days agocxgbe(4): Add missing description for a port type.
Navdeep Parhar [Mon, 29 Apr 2024 20:27:48 +0000 (13:27 -0700)]
cxgbe(4): Add missing description for a port type.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 days agocxgbe(4): Retire t4_intr_clear.
Navdeep Parhar [Fri, 26 Apr 2024 00:39:55 +0000 (17:39 -0700)]
cxgbe(4): Retire t4_intr_clear.

The firmware clears the interrupts already and it has a better idea of
exactly what to clear for which generation of the ASIC.  There is no
need for the driver to get involved.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 days agocxgbe(4): Add a helper function to locate MPS/MAC registers.
Navdeep Parhar [Thu, 25 Apr 2024 05:24:49 +0000 (22:24 -0700)]
cxgbe(4): Add a helper function to locate MPS/MAC registers.

These register blocks are at different locations in different chips.

MFC after:      1 week
Sponsored by:   Chelsio Communications

5 days agoOverflowing refreservation is bad
Rich Ercolani [Mon, 29 Apr 2024 18:32:49 +0000 (14:32 -0400)]
Overflowing refreservation is bad

Someone came to me and pointed out that you could pretty
readily cause the refreservation calculation to exceed
2**64, given the 2**17 multiplier in it, and produce
refreservations wildly less than the actual volsize in cases where
it should have failed.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rich Ercolani <rincebrain@gmail.com>
Closes #15996

5 days agoGCC: Fixes for gcc 14 on Fedora 40
Tony Hutter [Mon, 29 Apr 2024 18:31:50 +0000 (11:31 -0700)]
GCC: Fixes for gcc 14 on Fedora 40

- Workaround dangling pointer in uu_list.c (#16124)
- Fix calloc() transposed arguments in zpool_vdev_os.c
- Make some temp variables unsigned to prevent triggering a
  '-Werror=alloc-size-larger-than' error.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #16124
Closes #16125

5 days agocxgbe(4): Remove tx_modq lookup table.
Navdeep Parhar [Fri, 29 Mar 2024 05:49:32 +0000 (22:49 -0700)]
cxgbe(4): Remove tx_modq lookup table.

The driver always uses the same modulation queue as the channel and the
table is unnecessary.

MFC after:      1 week
Sponsored by:   Chelsio Communications

5 days agopflow: handle unattached states
Kristof Provost [Mon, 29 Apr 2024 09:51:17 +0000 (11:51 +0200)]
pflow: handle unattached states

It's possible for states to be cleaned up (through pf_detach_state()) that
have not been fully attached. For example if there's an ID conflict during
pf_state_insert().

pflow exports states from pf_detach_state(), so it can get called on such
states, but did not account for this and could end up dereferencing a NULL
state key.

Check for this in export_pflow() and do not export unattached states.

See also: https://redmine.pfsense.org/issues/15446
Sponsored by: Rubicon Communications, LLC ("Netgate")

5 days agoctl: Fix CTL GET EVENT STATUS NOTIFICATION valid bits
HP van Braam [Mon, 29 Apr 2024 14:34:46 +0000 (08:34 -0600)]
ctl: Fix CTL GET EVENT STATUS NOTIFICATION valid bits

Linux as an initiator periodically sends the following to SCSI cdrom
devices: 4a 01 00 00 10 00 00 00 08 00

According to the ctl_cmd_entry for this command this is invalid which
leads to a lot of failed SCSI commands.

The mask in this commit is based off of an early draft of the mmc
standard, https://www.t10.org/ftp/t10/document.97/97-108r0.pdf,
as well as subsequent standards (mmc2 through mmc6).

This solves the issue with Linux initiators.

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

5 days agopf: convert DIOCGETSTATUS to netlink
Kristof Provost [Sat, 23 Mar 2024 06:31:51 +0000 (07:31 +0100)]
pf: convert DIOCGETSTATUS to netlink

Introduce pfctl_get_status_h() because we need the pfctl_handle. In this variant
use netlink to obtain the information.

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

5 days agolibpfctl: allow access to the fd
Kristof Provost [Wed, 24 Apr 2024 06:40:05 +0000 (08:40 +0200)]
libpfctl: allow access to the fd

pfctl_open() opens both /dev/pf and a netlink socket. Allow access to the /dev/
pf fd via pfctl_fd().
This means that libpfctl users no longer have to open /dev/pf themselves for any
calls that are not yet available in libpfctl.

Sponsored by: Rubicon Communications, LLC ("Netgate")
MFC after: 2 weeks

5 days agolibpfctl: fix incorrect pcounters array size
Kristof Provost [Fri, 26 Apr 2024 14:07:38 +0000 (16:07 +0200)]
libpfctl: fix incorrect pcounters array size

The array is 2 x 2 x 2, not 2 x 2 x 3.

Sponsored by: Rubicon Communications, LLC ("Netgate")
MFC after: 2 weeks

5 days agopackage: fix dependency generation
Lexi Winter [Mon, 29 Apr 2024 14:30:46 +0000 (08:30 -0600)]
package: fix dependency generation

A bug in release/packages/generate-ucl.sh causes package dependencies
(other than shlib depends) to not be generated correctly, meaning
packages are missing their dependencies.

generate-ucl.sh creates the UCL file by:

1. copying ${uclsource} (template.ucl) to ${uclfile}
2. appending dependencies to ${uclfile}
3. calling generate-ucl.lua on ${uclsource} to create ${uclfile}

This breaks because the dependencies added in step 2 are overwritten in
step 3.

Fix this by calling generate-ucl.lua with ${uclfile} as both the input
and output file, so anything we added to ${uclfile} is preserved.

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

5 days agopackage: FreeBSD-periodic should depend on FreeBSD-cron
Lexi Winter [Mon, 29 Apr 2024 14:29:13 +0000 (08:29 -0600)]
package: FreeBSD-periodic should depend on FreeBSD-cron

Reported by: des
Reviewed by: imp, des
Pull Request: https://github.com/freebsd/freebsd-src/pull/1204

5 days agoservices.5: describe better
Alexander Ziaee [Mon, 29 Apr 2024 14:00:01 +0000 (08:00 -0600)]
services.5: describe better

Use a more specific description for this man page, and add SDPX tag
while here.

Reviewed by: imp, meena
Signed-off-by: Alexander Ziaee <concussious@runbox.com>
Pull Request: https://github.com/freebsd/freebsd-src/pull/1194

5 days agoAdd libxo support to du
Nathan Huff [Mon, 29 Apr 2024 04:59:18 +0000 (22:59 -0600)]
Add libxo support to du

Convert du to use libxo enabling structured output.

[[ minor style fixes by imp ]]

Signed-off-by: Nathan Huff <nhuff@acm.org>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1145

5 days agoarm64/vmm: Handle VM_EXITCODE_SUSPENDED
Mark Johnston [Mon, 29 Apr 2024 14:19:27 +0000 (10:19 -0400)]
arm64/vmm: Handle VM_EXITCODE_SUSPENDED

This is required for bhyve reboot to work.  In particular, unless we
suspend vcpu threads here, vm_reinit() will fail with EBUSY.

The implementation is copied from amd64; in the not-too-distant future
the amd64 and arm64 copies of vmm.c and vmm_dev.c will be merged, so
for now it's useful to minimize diffs between amd64 and arm64.

Reviewed by: corvink, andrew
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D44934

5 days agobhyve: Fix handling of -r
Mark Johnston [Mon, 29 Apr 2024 14:13:50 +0000 (10:13 -0400)]
bhyve: Fix handling of -r

Just make "restore_file" a global variable so that it can be set by the
MD option handler.

Reviewed by: corvink
Reported by: bdrewery
Fixes: 981f9f7495bb ("bhyve: Push option parsing down into bhyverun_machdep.c")
Differential Revision: https://reviews.freebsd.org/D44974

5 days agoadduser: Really fix a syntax error
Dag-Erling Smørgrav [Mon, 29 Apr 2024 10:29:35 +0000 (12:29 +0200)]
adduser: Really fix a syntax error

Fixes: 5cafc38f1129
Differential Revision: https://reviews.freebsd.org/D44871

5 days agolibulog: Make sure ut_line, ut_user, ut_host are terminated.
Dag-Erling Smørgrav [Mon, 29 Apr 2024 10:11:12 +0000 (12:11 +0200)]
libulog: Make sure ut_line, ut_user, ut_host are terminated.

MFC after: 3 days
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D45004

5 days agolibarchive: merge from vendor branch
Martin Matuska [Mon, 29 Apr 2024 08:15:04 +0000 (10:15 +0200)]
libarchive: merge from vendor branch

Libarchive 3.7.4 + three fixes from master

Security fixes:
 #2135 rar: Fix OOB in rar e8 filter (CVE-2024-26256)
 #2145 zip: Fix out of boundary access
 #2148 rar: Fix OOB in rar delta filter
 #2149 rar: Fix OOB in rar audio filter

Important bugfixes:
 #2131 7zip: Limit amount of properties
 #2110 bsdtar: Fix error handling around strtol() usages
 #2116 passphrase: Never allow empty passwords
 #2124 rar: Fix "File CRC Error" when extracting specific rar4 archives
 #2123 xar: Avoid infinite link loop
 #2150 xar: Fix another infinite loop and expat error handling
 #2108 zip: Update AppleDouble support for directories
 #2071 zstd: Implement core detectiongit

PR: 278588 (exp-run)
MFC after: 1 day

5 days agoCherry-pick commits from libarchive to vendor/libarchive
Martin Matuska [Mon, 29 Apr 2024 07:18:17 +0000 (09:18 +0200)]
Cherry-pick commits from libarchive to vendor/libarchive

 #2148 fix: OOB in rar delta filter (a1cb648d5)
 #2149 fix: OOB in rar audio filter (3006bc5d0)
 #2150 xar: Fix another infinite loop and expat error handling (b910cb70d)

Obtained from: libarchive
Libarchive commits: b910cb70d4c1b311c9d85cd536a6c91647c43df7
a1cb648d52f5b6d3f31184d9b6a7cbca628459b7
3006bc5d02ad3ae3c4f9274f60c1f9d2d834734b

5 days agorights.4: various corrections on capability rights
CismonX [Mon, 29 Apr 2024 04:48:26 +0000 (22:48 -0600)]
rights.4: various corrections on capability rights

- A file descriptor obtained from accept(2), accept4(2) and openat(2)
  is not always assigned all capability rights.  Instead, it inherits
  capability rights from the "parent" socket/dir file descriptor.
- getdents(2) and getdirentries(2) requires CAP_READ.
- openat(2) with O_WRONLY|O_TRUNC does not require CAP_SEEK.

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

5 days agoglabel: Add support for Linux swap
Ricardo Branco [Mon, 29 Apr 2024 04:38:15 +0000 (22:38 -0600)]
glabel: Add support for Linux swap

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

5 days agopackage: move OpenBSM auditing into its own package
Lexi Winter [Wed, 24 Apr 2024 17:54:44 +0000 (18:54 +0100)]
package: move OpenBSM auditing into its own package

Move auditing runtime (auditd, etc.) into the new FreeBSD-audit package.
Also move the runtime OpenBSM manual pages from libbsm into auditd so
they get installed with the right package.

Add an UPDATING entry noting the new packages.

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

5 days agopackage: move authpf into the FreeBSD-pf package
Lexi Winter [Mon, 29 Apr 2024 04:31:02 +0000 (22:31 -0600)]
package: move authpf into the FreeBSD-pf package

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

5 days agoUPDATING: add entry for recent pkgbase changes
Lexi Winter [Mon, 29 Apr 2024 04:28:49 +0000 (22:28 -0600)]
UPDATING: add entry for recent pkgbase changes

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

5 days agosetkey: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:38:15 +0000 (18:38 +0100)]
setkey: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agoipf: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:38:03 +0000 (18:38 +0100)]
ipf: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agocamcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:37:33 +0000 (18:37 +0100)]
camcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agoipfw: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:36:35 +0000 (18:36 +0100)]
ipfw: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agozonectl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:14:45 +0000 (18:14 +0100)]
zonectl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agowlandebug: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:14:34 +0000 (18:14 +0100)]
wlandebug: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agousbconfig: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:14:17 +0000 (18:14 +0100)]
usbconfig: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agorwhod: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:13:47 +0000 (18:13 +0100)]
rwhod: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agopstat: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:13:32 +0000 (18:13 +0100)]
pstat: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agoppp: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:13:19 +0000 (18:13 +0100)]
ppp: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agondp: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:13:02 +0000 (18:13 +0100)]
ndp: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agomoused: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:12:44 +0000 (18:12 +0100)]
moused: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agokbdcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:11:56 +0000 (18:11 +0100)]
kbdcontrol: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agoctld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:11:34 +0000 (18:11 +0100)]
ctld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agoctladm: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:11:10 +0000 (18:11 +0100)]
ctladm: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agobtxld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Tue, 7 Nov 2023 17:10:52 +0000 (18:10 +0100)]
btxld: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agortadvctl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Mon, 29 Apr 2024 02:55:30 +0000 (20:55 -0600)]
rtadvctl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agortadvd: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Mon, 29 Apr 2024 02:55:30 +0000 (20:55 -0600)]
rtadvd: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agobluetooth: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])
Elyes Haouas [Mon, 29 Apr 2024 02:55:30 +0000 (20:55 -0600)]
bluetooth: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0])

Pull Request: https://github.com/freebsd/freebsd-src/pull/888
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
5 days agoaxgbe: Various stability improvements
Stephan de Wit [Mon, 29 Apr 2024 01:57:26 +0000 (19:57 -0600)]
axgbe: Various stability improvements

Hook in RSS glue.

Default to "off" for the split header feature to ensure netmap
compatibility.

Change the PCS indirection register values based on hardware type
(ported from Linux).

Move tunable settings to sysctl_init() and set the defaults there.
Ensure it's called at the right time by moving it back.

Reset PHY RX data path when mailbox command times out (Ported from
Linux).

Check if VLAN HW tagging is enabled before assuming a VLAN tag
is present in a descriptor.

Disable the hardware filter since multicast traffic is dropped
in promisc mode.

Remove unnecessary return statement.

Missing sfp_get_mux, causing a race between ports to read
SFP(+) sideband signals.

Validate and fix incorrectly initialized polarity/configuration
registers.

Remove unnecessary SFP reset.

axgbe_isc_rxd_pkt_get has no error state, remove unnecessary
big packet check.

Enable RSF to prevent zero-length packets while in Netmap mode.

DMA cache coherency update (ported from Linux).

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

5 days agounionfs_rename: fix numerous locking issues
Jason A. Harmening [Sun, 18 Feb 2024 00:20:51 +0000 (18:20 -0600)]
unionfs_rename: fix numerous locking issues

There are a few places in which unionfs_rename() accesses fvp's private
data without holding the necessary lock/interlock.  Moreover, the
implementation completely fails to handle the case in which fdvp is not
the same as tdvp; in this case it simply fails to lock fdvp at all.
Finally, it locks fvp while potentially already holding tvp's lock, but
makes no attempt to deal with possible LOR there.

Fix this by optimistically using the vnode interlock to protect
the short accesses to fdvp and fvp private data, sequentially.
If a file copy or shadow directory creation is required to prepare
the upper FS for the rename operation, the interlock must be dropped
and fdvp/fvp locked as necessary.

Additionally, use ERELOOKUP (as suggested by kib@) to simplify the
locking logic and eliminate unionfs_relookup() calls for file-copy/
shadow-directory cases that require tdvp's lock to be dropped.

Reviewed by: kib (earlier version), olce
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D44788

6 days agoRELNOTES: Fix wrong commit hash
Christos Margiolis [Sun, 28 Apr 2024 19:59:17 +0000 (21:59 +0200)]
RELNOTES: Fix wrong commit hash

Fixes: 25723d66369f ("sound: Retire unit.*")
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

6 days agosound: Remove chn_timeout check from chn_init()
Christos Margiolis [Sun, 28 Apr 2024 19:47:33 +0000 (21:47 +0200)]
sound: Remove chn_timeout check from chn_init()

This check is not related to channel initializion, but is also
unnecessary, since sysctl_hw_snd_timeout() takes care of checking if
chn_timeout is within bounds.

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

6 days agosound: Add missing space in dev.pcm.X.mode description
Christos Margiolis [Sun, 28 Apr 2024 19:47:11 +0000 (21:47 +0200)]
sound: Add missing space in dev.pcm.X.mode description

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

6 days agosound: Move pcm_chnref() and pcm_chnrelease() to pcm/channel.c
Christos Margiolis [Sun, 28 Apr 2024 19:46:55 +0000 (21:46 +0200)]
sound: Move pcm_chnref() and pcm_chnrelease() to pcm/channel.c

Improve code layering. These are channel functions, and so they do not
belong in pcm/sound.c.

While here, assert in chn_ref() that new refcount won't be negative.

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

6 days agosound: Merge pcm_chn_destroy() and chn_kill()
Christos Margiolis [Sun, 28 Apr 2024 19:46:08 +0000 (21:46 +0200)]
sound: Merge pcm_chn_destroy() and chn_kill()

pcm_chn_destroy() acts like a wrapper around chn_kill(), and
additionally calls a few more functions that should in fact be part of
chn_kill()'s logic. Merge pcm_chn_destroy()'s functionality in
chn_kill() to improve readability, as well as code layering.

While here, convert chn_kill() to void as it currently always returns 0.

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

6 days agosound: Retire unit.*
Christos Margiolis [Sun, 28 Apr 2024 19:44:35 +0000 (21:44 +0200)]
sound: Retire unit.*

The unit.* code is largely obsolete and imposes limits that are no
longer needed nowadays.

- Capping the maximum allowed soundcards in a given machine. By default,
  the limit is 512 (snd_max_u() in unit.c), and the maximum possible is
  2048 (SND_UNIT_UMAX in unit.h). It can also be tuned through the
  hw.snd.maxunit loader(8) tunable. Even though these limits are large
  enough that they should never cause problems, there is no need for
  this limit to exist in the first place.
- Capping the available device/channel types. By default, this is 32
  (snd_max_d() in unit.c). However, these types are pre-defined in
  pcm/sound.h (see SND_DEV_*), so the cap is unnecessary when we know
  that their number is constant.
- Capping the number of channels per-device. By default, the limit 1024
  (snd_max_c() in unit.c). This is probably the most problematic of the
  limits mentioned, because this limit can never be reached, as the
  maximum is hard-capped at either hw.snd.maxautovchans (16 by default),
  or SND_MAXHWCHAN and SND_MAXVCHANS.

These limtits are encoded in masks (see SND_U_MASK, SND_D_MASK,
SND_C_MASK in unit.h) and are used to construct a bitfield of the form
[dsp_unit, type, channel_unit] in snd_mkunit() which is assigned to
pcm_channel->unit.

This patch gets rid of everything unit.*-related and makes a slightly
different use of the "unit" field to only contain the channel unit
number. The channel type is stored in a new pcm_channel->type field, and
the DSP unit number need not be stored at all, since we can fetch it
from device_get_unit(pcm_channel->dev). This change has the effect that
we no longer need to impose caps on the number of soundcards,
device/channel types and per-device channels. As a result the code is
noticeably simplified and more readable.

Apart from the fact that the hw.snd.maxunit loader(8) tunable is also
retired as a side-effect of this patch, sound(4)'s behavior remains the
same.

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

6 days agosound: Assert that we do not enter chn_sleep() with CHN_F_SLEEPING
Christos Margiolis [Sun, 28 Apr 2024 19:40:52 +0000 (21:40 +0200)]
sound: Assert that we do not enter chn_sleep() with CHN_F_SLEEPING

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

6 days agosound: Fix panic caused by sleeping-channel destruction during asynchronous detach
Christos Margiolis [Sun, 28 Apr 2024 19:40:40 +0000 (21:40 +0200)]
sound: Fix panic caused by sleeping-channel destruction during asynchronous detach

Currently we are force-destroying all channels unconditionally in
pcm_killchan(). However, since asynchronous audio device detach is
possible as of 44e128fe9d92, if we do not check whether the channel is
sleeping or not and forcefully kill it, we will get a panic from
cv_timedwait_sig() (called from chn_sleep()), because it will try to use
a freed lock/cv.

Modify pcm_killchan() (renamed to pcm_killchans() since that's a more
appropriate name now) to loop through the channel list and destroy only
the channels that are awake, otherwise wake up the sleeping thread and
try again. This loop is repeated until all channels are awakened and
destroyed.

To reduce code duplication, implement chn_shutdown() which wakes up the
channel and sets CHN_F_DEAD, and use it in pcm_unregister() and
pcm_killchans().

Reported by: KASAN
Fixes: 44e128fe9d92 ("sound: Implement asynchronous device detach")
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44923

6 days agosound: Wrap dsp_clone() and mixer_clone() with bus_topo_lock()
Christos Margiolis [Sun, 28 Apr 2024 19:40:29 +0000 (21:40 +0200)]
sound: Wrap dsp_clone() and mixer_clone() with bus_topo_lock()

Make sure that the softc isn't freed in between the checks.

Sponsored by: The FreeBSD Foundation
MFC after; 1 day
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44991

6 days agosound: Fix NULL dereference in dsp_clone() and mixer_clone()
Christos Margiolis [Sun, 28 Apr 2024 19:40:14 +0000 (21:40 +0200)]
sound: Fix NULL dereference in dsp_clone() and mixer_clone()

If we only have a single soundcard attached and we detach it right
before entering [dsp|mixer]_clone(), there is a chance pcm_unregister()
will have returned already, meaning it will have set snd_unit to -1, and
thus devclass_get_softc() will return NULL here.

While here, 1) move the calls to dsp_destroy_dev() and mixer_uninit()
below the point where we unset SD_F_REGISTERED, and 2) follow what
mixer_clone() does and make sure we don't use a NULL d->dsp_dev in
dsp_clone().

Reported by: KASAN
Sponsored by: The FreeBSD Foundation
MFC after: 1 day
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44924

6 days agortld snprintf: do not erronously skip a char at the buffer boundary
Konstantin Belousov [Sun, 28 Apr 2024 06:37:24 +0000 (09:37 +0300)]
rtld snprintf: do not erronously skip a char at the buffer boundary

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

6 days agogettimeofday.2: Do mention improbable future removal
Mateusz Piotrowski [Sun, 28 Apr 2024 18:06:05 +0000 (20:06 +0200)]
gettimeofday.2: Do mention improbable future removal

As kib@ noted:

> Obviously gettimeofday(2) is not going to be removed
> even in the far future.

Reported by: kib
Fixes: 4395d3ced5cf Document that gettimeofday() is obsolescent
MFC after: 3 days

6 days agodate: Correctly check outcome of mktime().
Dag-Erling Smørgrav [Sun, 28 Apr 2024 17:12:58 +0000 (19:12 +0200)]
date: Correctly check outcome of mktime().

X-MFC-With: 7b390cb63689
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44982

6 days agobhyve.8: Update and rearrange to improve readability
Chris Moerz [Fri, 26 Apr 2024 18:23:13 +0000 (15:23 -0300)]
bhyve.8: Update and rearrange to improve readability

bhyve's man page is a very long block of text that has grown to
proportions that make it hard to read.  In particular, the level of
nesting of various content means man can no longer render the text in a
user-friendly way.

To remedy this:
- move the -s argument documentation into a separate section and
  reformat the various arguments so they are consistent
- add documentation on how to use the -o config.dump feature
- make the listing of various arguments more consistent
- consolidated duplicate listings of TPM backends
- add an example for the config.dump feature
- fix various formatting inconsistencies.

Reviewed by: emaste, imp, jrm, Pau Amma <pauamma@gundo.com>, rgrimes
Differential Revision: https://reviews.freebsd.org/D43940

6 days agobitset: Add ORNOT macros
Jake Freeland [Sun, 28 Apr 2024 00:20:34 +0000 (19:20 -0500)]
bitset: Add ORNOT macros

Macros to ANDNOT a bitset currently exist, but there are no ORNOT
equivalents. Introduce ORNOT macros for bitset(9), cpuset(9), and
domainset(9).

Approved by: markj (mentor)
Reviewed by: markj
MFC after: 1 week
Sponsored by: NIKSUN, Inc.
Differential Revision: https://reviews.freebsd.org/D44976

7 days agonfscl: Clear out a lot of cruft related to B_DIRECT
Rick Macklem [Sun, 28 Apr 2024 00:10:48 +0000 (17:10 -0700)]
nfscl: Clear out a lot of cruft related to B_DIRECT

There is only one place in the unpatched sources where B_DIRECT is
set in the NFS client and this code is never executed. As such, this patch
removes this code that is never executed, since B_DIRECT should never
be set.

During a IETF testing event this week, I saw a crash in ncl_doio_directwrite(),
but this function is only called if B_DIRECT is set.
I cannot explain how ncl_doio_directwrite() got called, but once this patch
was applied to the sources, the crash did not recur. This is not surprising,
since this patch deleted the function.

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

7 days agouuidgen(1): Add EXAMPLES to manual page
Fernando Apesteguía [Thu, 7 Sep 2023 15:17:38 +0000 (17:17 +0200)]
uuidgen(1): Add EXAMPLES to manual page

Approved by: manpages@ (gbe@)
Reviewed by: gbe@, pauamma
Differential Revision: https://reviews.freebsd.org/D43494

7 days agosnd_hdspe(4): Recognize newer firmware's PCI vendor id.
Florian Walpen [Sat, 27 Apr 2024 08:48:37 +0000 (09:48 +0100)]
snd_hdspe(4): Recognize newer firmware's PCI vendor id.

At least for HDSPe RayDAT cards, newer firmware comes with RME's own PCI
vendor id instead of the Xilinx one. Other HDSPe cards are probably also
affected. Update snd_hdspe(4) to recognize both the old Xilinx and the
new RME vendor ids.

Differential Revision: https://reviews.freebsd.org/D44978
MFC after: 1 day

7 days agokrpc: Ref cnt the client structures for TLS upcalls
Rick Macklem [Sat, 27 Apr 2024 00:55:24 +0000 (17:55 -0700)]
krpc: Ref cnt the client structures for TLS upcalls

A crash occurred during testing, where the client structures had
already been free'd when the upcall thread tried to lock them.

This patch acquires a reference count on both of the structures
and these are released when the upcall is done, so that the
structures cannot be free'd prematurely.  This happened because
the testing is done over a very slow vpn.

Found during a IETF bakeathon testing event this week.

MFC after: 5 days

8 days agoscript: handle terminal resize on SIGWINCH
Kyle Evans [Fri, 26 Apr 2024 16:12:00 +0000 (11:12 -0500)]
script: handle terminal resize on SIGWINCH

Add a -w flag to forward terminal resize events on to the child, which
can be useful in some circumstances to avoid terminal corruption.

Reviewed by: des
Co-authored-by: Xavier Beaudouin <xavier.beaudouin@klarasystems.com>
Sponsored by: Modirum MDPay
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D44167

8 days agoscript: minor style improvements
Xavier Beaudouin [Fri, 26 Apr 2024 16:10:15 +0000 (11:10 -0500)]
script: minor style improvements

Fix some nits pointed out by checkstyle9.pl in advance of functional
changes to script(1).

Reviewed by: des
Sponsored by: Modirum MDPay
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D44167

8 days agodate: Fix tests by initializing timespec structure
Mateusz Piotrowski [Fri, 26 Apr 2024 15:19:18 +0000 (17:19 +0200)]
date: Fix tests by initializing timespec structure

The tests related to nanosecond support were failing on amd64 due to
uninitialized timespec structure.

Fixes: eeb04a736cb9 date: Add support for nanoseconds
Reviewed by: markj
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D44975

8 days agoUpdate vendor/libarchive to 3.7.4
Martin Matuska [Fri, 26 Apr 2024 10:11:59 +0000 (12:11 +0200)]
Update vendor/libarchive to 3.7.4

Security fixes:
 #2135 rar: Fix OOB in rar e8 filter (CVE-2024-26256)
 #2145 zip: Fix out of boundary access

Important bugfixes:
 #2131 7zip: Limit amount of properties
 #2110 bsdtar: Fix error handling around strtol() usages
 #2116 passphrase: Never allow empty passwords
 #2124 rar: Fix "File CRC Error" when extracting specific rar4 archives
 #2123 xar: Avoid infinite link loop
 #2108 zip: Update AppleDouble support for directories
 #2071 zstd: Implement core detection

Obained from: libarchive
Libarchive commit: 313aa1fa10b657de791e3202c168a6c833bc3543

8 days agostyle.9: Document the existence of tools/build/checkstyle9.pl
Mateusz Piotrowski [Fri, 26 Apr 2024 09:37:01 +0000 (11:37 +0200)]
style.9: Document the existence of tools/build/checkstyle9.pl

MFC after: 3 days
Sponsored by: Klara, Inc.

8 days agodate: Add support for nanoseconds
Mateusz Piotrowski [Sun, 21 Apr 2024 21:25:32 +0000 (23:25 +0200)]
date: Add support for nanoseconds

This patch introduces support for a conversion specification for
nanoseconds.

The format of %N is meant to be compatible with that of GNU date.

The nanoseconds conversion specification is implemented directly in
date(1) instead of libc (in strftime(3)) to avoid introducing
non-standard functions to libc at this time and modifying struct tm.

Apart from introducing the nanoseconds conversion specification, this
patch brings the following changes:

- The "ns" format for ISO 8061 dates is now unlocked. E.g., date -Ins
  prints:
      2024-04-22T12:20:28,763742224+02:00
- The -r flag when fed a file is now aware of the nanosecond part of the last
  modification time.
- date(1) is now able to set the time with nanosecond precision. It is
  not possible as of now to do that by specifying nanoseconds directly
  via the command-line arguments. Instead, the -r flag can be used.
- date(1) is now using the clock_gettime(3) family of functions instead
  of ctime(3) family of functions where possible.

Reviewed by: des, markj
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D44905

8 days agostress2: More detailed error reporting
Peter Holm [Fri, 26 Apr 2024 08:20:49 +0000 (10:20 +0200)]
stress2: More detailed error reporting

8 days agonfscl: Do not use nfso_own for delayed nfsrpc_doclose()
Rick Macklem [Fri, 26 Apr 2024 03:58:21 +0000 (20:58 -0700)]
nfscl: Do not use nfso_own for delayed nfsrpc_doclose()

When an initial attempt to close an NFSv4 lock returns NFSERR_DELAY,
the open structure is put on a list for delayed closing.  When this
is done, the nfso_own field is set to NULL, so it cannot be used by
nfsrpc_doclose().

Without this patch, the NFSv4 client can crash when a NFSv4 server
replies NFSERR_DELAY to a Close operation.  Fortunately, most extant
NFSv4 servers do not do this.  This patch avoids the crash for any
that do return NFSERR_DELAY for Close.

Found during a IETF bakeathon testing event this week.

MFC after: 5 days

8 days agoCTL: READ(6) should be allowed on CD devices
HP van Braam [Fri, 26 Apr 2024 02:31:12 +0000 (20:31 -0600)]
CTL: READ(6) should be allowed on CD devices

DOS ASPI drivers use this, with this change applied it is possible to
load a DOS ASPI CDROM driver and run the Windows 98 installer.

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