Commit graph

20777 commits

Author SHA1 Message Date
Mariusz Zaborski d3bb35d4e5 jail: allow adjustment of host time
Add a special permission to the jail to adjust and to set the host time.
This can be useful if we want to compartmentalize the NTP daemon
from the rest of the system.

Reviewed by:	olce, imp
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45545
2024-06-28 12:23:31 +02:00
Alexander Ziaee cfe55a8af8 fwget.8: polish
MFC after:	3 days
Reviewed by:	imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1269
2024-06-27 18:28:32 -06:00
Alexander Ziaee 18a27dd641 wpa_cli.8: describe better + tag spdx + linter nit
"how do I switch active wifi network on console"
"% apropos wifi"

MFC after:	3 days
Reviewed by:	mhorne, imp
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1299
2024-06-27 11:55:41 -03:00
Mark Johnston 7d6932d20a ctladm: Fix a race when loading ctl.ko
If multiple ctladm processes try to load ctl.ko at the same time, only
one will succeed.  Handle this possibility by retrying the operation
(open /dev/cam/ctl) if kldload returns EEXIST, rather than bailing.
This at least helps ensure that ctladm tests can be run in parallel
when ctl.ko is not preloaded.

Reviewed by:	asomers
MFC after:	1 week
2024-06-25 15:29:03 -04:00
Jamie Gritton 63875db56b Document the zfs.mount_snapshot parameter in jail(8).
PR:		274263
Differential Revision:	https://reviews.freebsd.org/D45647
2024-06-24 13:03:45 -07:00
Alan Somers a1608e8854 ctladm: add a copyright header to the port test
[skip ci]

MFC with:	9747d11d91
Reported by:	markj
Sponsored by:	Axcient
2024-06-24 09:17:27 -06:00
Andrew Turner 68f044de29 binmiscctl.8: Change the example to armv7
armv6 is in the process of being removed.

Reviewed by:	manu, imp, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45641
2024-06-20 09:26:18 +00:00
Xin LI 8a607939de Update leap-seconds to leap-seconds.3676924800
Obtained from:  ftp://ftp.boulder.nist.gov/pub/time/leap-seconds.3676924800
MFC after:      3 days
2024-06-18 19:10:33 -07:00
Alan Somers bb95fbf634 ctladm: deprecate the undocumented "port -l" option
It was mostly removed from the man page in
9c887a4f86, but left in the command.
Fully remove it from the man page, and warn if anybody uses it.  Remove
it entirely for FreeBSD 16.

PR:		279546
MFC after:	2 weeks
Reviewed by:	mav
Sponsored by:	Axcient
Differential Revision: https://reviews.freebsd.org/D45522
2024-06-18 15:13:44 -06:00
Ed Maste c6030b3804 Revert "tzsetup: ask local/UTC question only on x86"
I am unsure if AArch64 Windows systems keep UTC or local time in the RTC
by default, so keep tzsetup consistent across architectures for now.

This reverts commit aa6fb1d277.

Reported by:	 Mark Millard
2024-06-17 13:04:40 -04:00
Kristof Provost c57c261790 iovctl: allow vlan restrictions to be passed to the driver
Allow iovctl to create VFs that are restricted to specific VLAN IDs.

Reviewed by:	kib, np
MFC after:	2 weeks
Sponsored by:	Orange Business Services
Differential Revision:	https://reviews.freebsd.org/D45402
2024-06-17 10:50:15 +02:00
Navdeep Parhar e827b61cac cxgbetool(8): Be flexible about the nexus name.
Use the name as-is but perform cxgbe specific ioctls on the device to
make sure that it is a Terminator device nexus.  Determine the chip
type, pf/vf, etc. from the device registers rather than the nexus name.

This allows cxgbetool to work with the VF driver.

MFC after:	1 week
Sponsored by:	Chelsio Communications
2024-06-16 18:54:02 -07:00
Alan Somers 2909ddd17c ctld: plug memory leaks
MFC after:	2 weeks
Reviewed by:	mav
Sponsored by:	Axcient
Reported by:	valgrind
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1288
2024-06-14 12:08:38 -06:00
Ed Maste aa6fb1d277 tzsetup: ask local/UTC question only on x86
Storing local time in the RTC is a legacy of 1990s PCs; it's not
relevant on other platforms of interest to FreeBSD.

While here switch to C99 bool.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	allanjude (earlier), imp (earlier)
Differential Revision: https://reviews.freebsd.org/D45575
2024-06-14 12:15:48 -04:00
Ed Maste 70e3e1bde9 tzsetup: add detail for -s option
Skipping the UTC question via -s will not create or delete
/etc/wall_cmos_clock.

Reported by:	Tomoaki AOKI
Reviewed by:	imp, allanjude, jrm
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45576
2024-06-14 10:02:31 -04:00
Ed Maste a16cb8709d tzsetup: Correct UTC description
UTC is Coordinated Universal Time, not Greenwich Mean Time.

Reviewed by:	imp, allanjude
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45573
2024-06-12 20:24:49 -04:00
Andrew Turner 9a4813e1dc bhyve: Fix the build with gcc
gcc doesn't like const and static to not be at the start of a variable
declaration. Update the gdb_regset arrays to make it more obvious they
are arrays of struct gdb_reg and to fix the gcc build.

Reviewed by:	corvink, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45550
2024-06-11 13:12:43 +00:00
Alan Somers edbd489d09 ctladm: don't require the use of "-p" with "port -r"
When removing a port, the ioctl frontend requires the "-p" argument.
But other frontends, like cfiscsi, do not.  So don't require that
argument in the ctladm command.  The frontend driver will report an
error if any required argument is missing.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:    mav
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1279
2024-06-10 10:01:25 -06:00
Alan Somers afecc74cd7 ctladm: better documentation for adding and removing cfiscsi ports
MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:    mav
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1279
2024-06-10 10:01:25 -06:00
Alan Somers 591de7534f ctladm: print port number with a succesful "port -c" command
Make "ctladm port -c" print the port number of the newly successful
port.  This way it won't have to be guessed by a subsequent "ctladm
portlist" command.  That means it's safe to use it concurrently with
other ctladm processes.  In particular, this allows the tests to be run
in parallel.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:    mav
Pull Request:   https://github.com/freebsd/freebsd-src/pull/1279
2024-06-10 10:01:25 -06:00
Alan Somers 9747d11d91 Add some ATF tests for ctladm
So far only "ctladm port -c" and "ctladm port -r" are covered.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	mav
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1279
2024-06-10 10:01:25 -06:00
Kristof Provost d9ab899931 pf: migrate DIOCGETLIMIT/DIOCSETLIMIT to netlink
Event:		Kitchener-Waterloo Hackathon 202406
2024-06-07 20:59:02 +02:00
Warner Losh c0c066f86d config: Remove redundant code
since errx is marked dead2, we don't need this.

Noticed by:		jrtc27
Sponsored by:		Netflix
2024-06-06 15:48:38 -06:00
Alan Somers 60107d23d8 ctladm.8: fix several errors in the "port" section
* Document the "-d" option.
* Add the "-c" and "-r" options to the summary.
* Correct the list of required options.
* Clarify that the "-t" option is only for use with "-o", "-w", and "-W"
* Replace references to the nonexistent "-n" with "-p".

Also, fix a few related error strings in the ctladm command.

MFC after:	2 weeks
Sponsored by:	Axcient
Reviewed by:	jhb
Differential Revision: https://reviews.freebsd.org/D45503
2024-06-06 11:22:06 -06:00
Mark Johnston 05704402ac bhyve: Add a stub VM_EXITCODE_REG_EMUL handler
This lets us print a few fields of interest before aborting the VM loop.

No functional change intended.

Reviewed by:	corvink, andrew
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44741
2024-06-04 15:06:42 -04:00
Mark Johnston a0ca4af945 bhyve: Add arm64 support to the gdb stub
- Add -G to the arm64 getopt handler.
- Add static register definitions and extensible XML definitions.
- Provide definitions for MD bits such as breakpoint encoding and
  length.
- Ensure that bhyve re-injects breakpoint exceptions that it is not
  responsible for.

Reviewed by:	andrew
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D44740
2024-06-04 15:03:17 -04:00
Corvin Köhne e425e601b9
bhyve: verify OpRegion size
If the OpRegion size doesn't match the size of our igd_opregion struct, it's
using a different layout than we're expecting. To avoid strange issues, we
should exit hard. If we see any devices in the field with a different OpRegion
size, we can analyse it and fix it accordingly.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D45335
2024-06-04 09:08:49 +02:00
Corvin Köhne 5e09c5a1ed
bhyve: use correct size to map the OpRegion
We're already converting the size reported by the OpRegion header from
kilobytes to bytes. We don't have to do that twice when mapping the OpRegion.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D45334
2024-06-04 09:08:34 +02:00
Dapeng Gao fbfdf57d65 Fix off-by-one bug in btpand
`ul` reaches `__arraycount(services)` before the bound-check happens, causing undefined behaviour.

Reviewed by:	imp, jrtc27
Fixes:		7718ced0ea ("Add btpand(8) daemon from NetBSD.")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45463
2024-06-03 20:30:36 +01:00
Dapeng Gao 5dda778db6 Use correct function declaration for yyerror
According to the POSIX standard at
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html
`yyerror` should return `int`. Add unreachable since errx never returns.

Reviewed by:	imp, kib
Differential Revision:	https://reviews.freebsd.org/D45447
2024-06-03 12:14:10 -06:00
Mark Johnston be2f92a96b makefs/zfs: Add a helper function for adding ZAP entries
Some ZAPs are used to represent sets, in which keys and values are the
same.  Add a helper function for this case.  No functional change
intended.

MFC after:	1 week
2024-06-01 11:16:18 -04:00
Alexander Ziaee 9c0d6df100 man bluetooth/fwdownloaders: alignment nits, SPDX
MFC after: 3 days

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1267
2024-05-31 14:26:09 -06:00
Konstantin Belousov 1eb7099eac acpidump: improve length calculation for several IVHD elements
Use sizeofs of structures corresponding to the parsed device entry.
This does not change the calculation, but fixes logical inconsistency.

Sponsored by:	The FreeBSD Foundation
Sponsored by:	Advanced Micro Devices (AMD)
MFC after:	1 week
2024-05-31 22:10:39 +03:00
Alexander Ziaee 2c901189bb man bluetooth/fwdownloaders: terse descriptions
+ descriptions no longer wrap on a standard console, no keywords removed
+ more consistent language with other firmware tooling manuals

MFC after: 3 days
Reviewed by: imp (bumped date for Nd changes)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1266
2024-05-31 11:40:44 -06:00
Mike Karels d2f1f71ec8 pw userdel: destroy home dataset if empty
When removing a user's home directory, if the directory is a ZFS
dataset, it cannot be removed.  If the directory has been emptied,
use "zfs destroy" to destroy it.  This complements the automatic
dataset creation in adduser.  Note that datasets within the directory
and snapshots are not handled, as the complete path is not constructed.

While here, add waitpid() calls to rmat() and pw_user_del().

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D45348
2024-05-29 18:55:14 -05:00
Pierre Pronchery 19dbf72a27 bhyve: correctly remove a memory mapping
In a normal code path while setting up GPU passthrough, the size
parameter to munmap() is wrong and its operation not checked for errors,
therefore leaking resources.

Reported by:	Coverity Scan
CID:		1519830
Sponsored by:	The FreeBSD Foundation

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1262
2024-05-29 13:39:29 -06:00
Kristof Provost cd2054d48b libpfctl: add pfctl_get_rule_h()
Add a handle variant of pfctl_get_rule(). This converts us from using
the nvlist variant to the netlink variant, and also moves us closer to a
world where all libpfctl functions take the handle.

While here have pfctl use the new function.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
2024-05-28 22:27:22 +02:00
Cy Schubert 018a4ab7b0 ntp: Update version strings
Reported by:	"Herbert J. Skuhra" <herbert@gojira.at>
MFC after:	3 days
Fixes:		f5f40dd63b
2024-05-27 02:19:51 -07:00
Cy Schubert f5f40dd63b ntp: Vendor import of ntp-4.2.8p18
MFC:	3 days

Merge commit '1f833b3fc9968c3dd7ed79ccf0525ebf16c891ad' into main
2024-05-26 18:41:22 -07:00
Joshua Kinard a8f86ecd61 newsyslog: Fix case of the 'P' flag in newsyslog.conf(5)
PR: 279303
Reviewed-by: emaste
Signed-off-by: Joshua Kinard <freebsd@kumba.dev>
2024-05-26 21:34:14 -04:00
Warner Losh 364c014d9b cross-tools: fts has different types for cmp routine
fts has different types for its compare rotuine. Other systems, not
4.4BSD based, have a non-const version. Before we tested against
__GLIBC__, but now we test against __linux__ because that's Linux's API
and musl doesn't define __GLIBC__.

In addition, link against libftl on this platform since musl doesn't
include ftl routines in libc, but rather in libftl.

Co-authored-by:		Val Packett <val@packett.cool>
Sponsored by:		Netflix
Pull Request:		https://github.com/freebsd/freebsd-src/pull/1066
Reviewed by:		val_packett.cool
Differential Revision:	https://reviews.freebsd.org/D45349
2024-05-26 11:38:30 -06:00
Ed Maste b128bedfb9 mptutil: correct man page date
PR:             279201
Fixes:          9a49a37929 ("mptutil: document that disabled/enab...")
Sponsored by:   The FreeBSD Foundation
2024-05-25 14:02:36 -04:00
Bjoern A. Zeeb d33f5a0afa fwget: update wireless IDs for rtw88/89, ath1xk, mt76 and add iwlwifi
Update and add (new) PCI IDs for Realtek rtw88/89, Mediatek 7996/7925,
QCA ath1xk, and add Intel iwlwifi IDs.

Rather than using a package per driver add fine(r) grained flavors
even though it is a lot more likely to break in certain cases.

For Intel we need a great level of detail to match PCI IDs so also pass
the full pciconf -l line to into the pci_* files as "$2" to have access
to these.

This lines up with ports commit 80f50c9eb66d.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	manu (earlier version)
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D44918
2024-05-23 22:26:59 +00:00
Lexi Winter 77f06c476c rtadvd(8): support PREF64 (RFC 8781)
PREF64 allows a router to advertise the network's NAT64 prefix, allowing
clients to auto-configure CLAT.  This makes it possible to deploy
IPv6-only or IPv6-mostly client access networks without the need for
DNS64.

Reviewed by: imp, glebius (prior suggetions done)
Pull Request: https://github.com/freebsd/freebsd-src/pull/1206
2024-05-23 14:40:48 -06:00
Lexi Winter 2356b60be7 arp(8): allow -i with -s
arp(8) usually disallows adding a static ARP entry for an IP address
which is not configured on a local interface.

Change this to allow such ARP entries to be added if '-i' is provided to
specify the interface the ARP entry relates to.

Due to limitations in the kernel lltable, this still requires that a
host route exists for the target address, but allows static ARP entries
to be configured to proxy ARP for, e.g., local jails which use an IPv4
address with a /32 route.

Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/1220
2024-05-23 14:02:57 -06:00
Zhenlei Huang d76ef58d56 freebsd-update: Correctly check if pkg(8) is present
On systems without pkg(8) installed, `command -v pkg` will return
success and falsely report that pkg(8) is present. Fix that by checking
via the `pkg -N` form.

This is missing from the final revision of D39695.

Reported by:	delphij
Reviewed by:	fernape, delphij
Fixes:		bc0c6c9cf3 freebsd-update: Add check for kernel modules
Differential Revision:	https://reviews.freebsd.org/D45292
2024-05-23 12:10:17 +08:00
Christos Margiolis e3b94b375e mixer(8): Use mixer_get_path()
Sponsored by:	The FreeBSD Foundation
MFC after:	1 day
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45276
2024-05-23 02:57:43 +02:00
Christos Margiolis 0e80798518 mixer(8): Ignore mixer_open() failures for the -a option
The most likely reason mixer_open() will fail is because either the
device doesn't exist, or because it is disabled, so there is not reason
to kill the application. Instead, continue and print the rest of the
enabled mixers.

PR:		277615
Sponsored by:	The FreeBSD Foundation
MFC after:	1 day
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45151
2024-05-23 02:57:25 +02:00
Oleksandr Kryvulia 6841c2677c zzz: Fix output formatting when suspend state not supported
Reviewed by: imp (who also simplified things a little)
Differenetial Revision: https://reviews.freebsd.org/D45299
2024-05-22 14:21:18 -06:00
Juraj Lutter 7618c9e163 daemon: Add -C (--restart-count) option
Add a new option (-C, --restart-count) to specify the maximum
number of times that the controlled process is restarted if
restart (-r) is restarted.

Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D44944
2024-05-22 09:45:23 +02:00