1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00
Commit Graph

20957 Commits

Author SHA1 Message Date
Mark Johnston
a20249443b makefs.8: Clarify that makefs-generated zpools always have the same GUID
PR:		282832
MFC after:	1 week
2024-11-19 21:18:38 +00:00
Mark Johnston
e19c607ff9 makefs.8: Remove a warning about makefs -t zfs being experimental
This should have been done with commit d9fe718287 but was missed.

Fixes:	d9fe718287 ("makefs: Remove the warning printed when makefs -t zfs is used")
MFC after:	3 days
2024-11-19 21:18:38 +00:00
Mark Johnston
48c738b038 jail: Let a couple of parameter types be specified as lists
vnet.interface and zfs.dataset can be used to specify multiple
interfaces/datasets in jail.conf, but not on the command-line, which is
a bit surprising.  Extend the handling of ip(4|6).addr to those
parameters, update the description of vnet.interface in jail.8, and add
a rudimentary regression test.

Reviewed by:	zlei, jamie
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47651
2024-11-19 21:05:24 +00:00
Kyle Evans
9ab59e900c daemon: tests: add a test for missed SIGTERM
This is somewhaht hard to test reliably, but we'll give it a shot.  Startup
a sleep(1) daemon with a hefty restart delay.  In refactoring of daemon(8),
we inadvertently started dropping SIGTERMs that came in while we were
waiting to restart the child, so we employ the strategy:

 - Pop the child sleep(1) first
 - Wait for sleep(1) to exit (pid file truncated)
 - Pop the daemon(8) with a SIGTERM
 - Wait for daemon(8) to exit

The pidfile is specifically truncated outside of the event loop so that we
don't have a kqueue to catch it in the current model.

PR:		277959
Reviewed by:	des, markj
Differential Revision:	https://reviews.freebsd.org/D47005
2024-11-19 13:51:27 -06:00
Kyle Evans
bc1dfc316a daemon: stop rebuilding the kqueue every restart of the child
We populate the kqueue with all of four kevents: three signal handlers and
one for read of the child pipe.  Every time we start the child, we rebuild
this kqueue from scratch for the child and tear it down before we exit and
check if we need to restart the child.  As a consequence, we effectively
drop any of the signals we're interested in between restarts.

Push the kqueue out into the daemon state to avoid losing any signal events
in the process, and reimplement the restart timer in terms of kqueue timers.
The pipe read event will be automatically deleted upon last close, which
leaves us with only the signal events that really get retained between
restarts of the child.

PR:		277959
Reviewed by:	des, markj
Differential Revision:	https://reviews.freebsd.org/D47004
2024-11-19 13:51:27 -06:00
Kyle Evans
aa8722cc18 daemon: truncate the pidfile when we're waiting to restart child
We need to be able to test some more restart behavior that depends on
knowing specifically where we're at (inside the event loop or outside of
the event loop).  Truncate the pidfile until the process is restarted to
give the test a clean marker rather than having to add arbitrary delays
and hoping for the best.

Reviewed by:	des, markj
Differential Revision:	https://reviews.freebsd.org/D47003
2024-11-19 13:51:26 -06:00
Jose Luis Duran
21ca690b56
ppp.8: Fix typo cuad0 -> cuau0
Fix a typo that was missed probably because it was capitalized.
Mark up with .Pa and fix capitalization.

Specify that cuaUX and cuauX are for USB and UART attachments
respectively.

- Silence most lint warnings
- Update outdated links
- Minor style fixes
- Some igor(1) warnings were ignored on purpose

PR:		248359
Reviewed by:	imp, mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Approved by:	emaste (mentor)
Fixes:	839f11a4fe ("A number of places in the source tree still reference cuad.* after sio(4) was deprecated by uart(4).")
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1515
2024-11-19 01:04:20 +00:00
Bjoern A. Zeeb
5399052c63 bsdinstall: wlanconfig: fix interface UP on (re-)starting wpa_supplicant
Make sure an interface is back up before (re-)starting wpa_supplicant
in wlanconfig not relying on wpa to UP the interface (though we fixed
that).

Sponsored by:	The FreeBSD Foundation
Reviewed by:	emaste (in D47491)
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D47491
2024-11-19 00:06:16 +00:00
Ed Maste
2d9ff965b5 bsdinstall: skip tzsetup UTC question
During installation bsdinstall asks (via tzsetup):

> Is this machine's CMOS clock set to UTC?  If it is set to local time,
> or you don't know, please choose NO here!

Most operating systems, except for Windows, use UTC in the hardware
real-time clock by default.  This question from tzsetup is presumably
intended to aid in dual-boot-with-Windows configurations, but these
represent a fraction of all FreeBSD installs.

Rather than asking this question on every install just default to UTC.
Users who want to dual-boot Windows can create /etc/wall_cmos_clock.
We can look at making this smarter in the future.

Reviewed by:	bapt, brooks, brd, cy, 0mp, ngie
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45569
2024-11-12 14:49:04 -05:00
Cy Schubert
c607b3258f ntp: Switch to upstream man pages
The downstream (FreeBSD) ntp man pages are out of date. Switch to those
provided by ntp.org (nwtime.org).

PR:			104493
Differential Revision:	https://reviews.freebsd.org/D47319
2024-11-11 19:10:04 -08:00
Bjoern A. Zeeb
1eb3f15c14 fwget: add -q for quiet output
Introduce -q to quieten other output (unless -v is also given).

pkg-install(8) currently has no option to allow skipping unavail
packages but it will just fail.
We would realy want to try to install as much firmware found as
possible from the installer.
Work around this by doing one firmware package at a time.
For that it is highly helpful to be able to query (or possibly re-query)
all outstanding fimrware packages.
-q together with -n only shows each package to be installed one by line.

Once https://github.com/freebsd/pkg/issues/2195 will be implemented
we could undo this part of the change and future changes to the installer
and use the new option for pkg-install(8) there.

While here switch to getopts so -qn works and not just -q -n.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D47445
2024-11-08 18:13:54 +00:00
Vladimir Kondratyev
5036d9652a rtlbtfw: Firmware loader for Realtek 87XX/88XX bluetooth USB adaptors
Firmware files are available in the comms/rtlbt-firmware port.

Sponsored by:	Future Crew LLC
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D46739
2024-11-07 02:30:29 +03:00
Vladimir Kondratyev
aa0b938434 iwmbtfw(8): Ignore unexpected HCI events
If Intel firmware is already in operational mode at boot that takes
place at warm boot, BT adaptor can generate extra HCI events which
interferes with firmware mode detection logic. Ignore them.

Sponsored by:	Future Crew LLC
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D46737
2024-11-07 02:27:48 +03:00
Vladimir Kondratyev
c1643cedbf iwmbtfw(4): Add support for 9260/9560 bluetooth adaptors
Required firmware files are already included in to comms/iwmbt-firmware port

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	bz
Differential Revision:	https://reviews.freebsd.org/D46735
2024-11-07 02:26:51 +03:00
Mark Johnston
88dd055092 syslogd: Fix handling of unix socket modes
When bind() is called, the process umask is applied, so one has to
either clear the umask before binding or call chmod() to add permissions
after the fact.  Do the former here to ensure that the socket always has
the correct mode.

Reported by:	Lexi Winter <lexi@le-fay.org>
Fixes:		2b8c3a05e0 ("syslogd: Set unix socket modes atomically")
2024-11-05 18:24:03 +00:00
Mark Johnston
5ef0cd25c4 bhyve: Convert to using vm_openf()
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D47032
2024-11-05 01:40:41 +00:00
Mark Johnston
c2b34d0607 bhyvectl: Convert to use vm_openf()
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D47031
2024-11-05 01:40:41 +00:00
Graham Percival
c7c3ef8949 manuals: Remove trailing spaces
This does not change the rendered ascii at all.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1473
2024-11-04 11:26:14 -04:00
Ed Maste
914752d0f7 praudit: correct test case
The -n flag specifies that user and group IDs should remain numeric, not
be mapped to names.  The golden output for praudit -n, however,
contained user and group names.

Reported by: markj
Reviewed by: markj
Fixes: ba10bfe509 ("libbsm: honour AU_OFLAG_NORESOLVE")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47434
2024-11-04 08:57:13 -05:00
Ed Maste
75d11bfbc6 dconschat: Increase WARNS to 2
Follow the existing pattern of fflush() in verbose mode.

PR:		71665
Sponsored by:	The FreeBSD Foundation
2024-11-03 15:18:39 -05:00
Mark Johnston
2b8c3a05e0 syslogd: Set unix socket modes atomically
Take advantage of the ability to atomically set unix socket modes to
ensure that /var/run/logpriv always has mode 0600.

MFC after:	1 month
2024-11-03 16:46:53 +00:00
Ed Maste
856e158dc4 freebsd-update: improve pkgbase check
The previous version used a case-insensitive match (default for -x).
The presence of packages like freebsd-git-devtools and freebsd-ftpd
would falsely trigger the packaged base check.

Instead, just use `pkg which /usr/bin/uname` as a packaged base
indication.  pkg uses /usr/bin/uname to determine ABI, so we can rely on
it existing.  If it comes from a package then packaged base is in use.

Also, extend the check to all freebsd-update commands.  It is easier to
just disallow all commands, and easier to test.

Reported by: Mark Millard
Reviewed by: manu
Fixes: cf1aba2857 ("freebsd-update: refuse to operate on a pkgbase system")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47378
2024-11-02 15:24:39 -04:00
Ed Maste
f65c19a242 kbdcontrol: correct bell frequency for vt(4)
Do the `1193182 / pitch` hack only for sc(4).

PR:		281713
Reported by:	Rudolf Polzer
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46803
2024-11-01 11:54:40 -04:00
Ruslan Bukin
7ab1a32cd4 bhyve/riscv: Initial import.
Add machine-dependent parts for bhyve hypervisor to support
virtualization on RISC-V ISA.

No objection:	markj
Sponsored by: UK Research and Innovation
Differential Revision: https://reviews.freebsd.org/D45512
2024-10-31 20:24:12 +00:00
Ed Maste
cf1aba2857 freebsd-update: refuse to operate on a pkgbase system
FreeBSD-update is not compatible with packaged base.

PR:		282252
Reviewed by:	bapt, markj (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47341
2024-10-31 14:35:44 -04:00
Zhenlei Huang
b6d4e3bee3 ndp: Bring back the -A option for the netlink implementation
This was lost during the conversion to netlink.

Reviewed by:	kp
Fixes:		91fbe0819b ndp: convert ndp(8) to netlink
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47234
2024-11-01 00:32:14 +08:00
Zhenlei Huang
12c04071cf ndp: Move the global variable repeat into struct ndp_opts
An upcoming fix for the netlink based implementation requires this
refactoring.

No functional change intended.

Reviewed by:	kp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47233
2024-11-01 00:32:13 +08:00
Graham Percival
b74aaa1a21 manuals: Fix dates
These were reported by `mandoc -T lint ...` as warnings.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1475
2024-10-28 12:26:03 -03:00
Mark Johnston
878ede1a0d fstyp: Fix some memory safety bugs
In the hammer2 label reader, make sure to check for a NULL return from
read_buf().

In the NTFS label reader,
- Avoid an infinite loop if a record length is 0.
- Avoid walking past the end of the buffer.
- When a label is found, avoid reading past the end of the buffer.

PR:		278281
Reviewed by:	emaste
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D47292
2024-10-28 15:03:53 +00:00
Bjoern A. Zeeb
a4128aad85 iwlwifi: update Intel's iwlwifi/mvm driver.
This version is based on
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
98f7e32f20d28ec452afb208f9cffc08448a2652 ( tag: v6.11 ).

Sponsored by:	The FreeBSD Foundation
MFC after:	14 days
2024-10-28 14:42:25 +00:00
Zhenlei Huang
56b17de1e8 makefs: Remove a stray semicolon
MFC after:	1 week
2024-10-24 23:04:48 +08:00
Zhenlei Huang
d96ba5a623 config: Remove a stray semicolon
MFC after:	1 week
2024-10-24 23:04:48 +08:00
John Baldwin
8c8ebbb045 bhyve ahci: Improve robustness of TRIM handling
The previous fix for a stack buffer leak in the ahci device model
actually broke the handling of TRIM as one of the checks it added
caused TRIM commands to never be completed.  This resulted in command
timeouts if a guest OS did a 'newfs -E' of an AHCI disk, for example.
Also, for the invalid case the previous check was handling, the device
model should be failing with an error rather than claiming success.

To resolve this, validate the length of a TRIM request and fail with
an error if it exceeds the maximum number of supported blocks
advertised via IDENTIFY.  In addition, if the PRDT does not provide
enough data, fail the command with an error rather than performing a
partial completion.

This is somewhat complicated by the implementation of TRIM in the ahci
device model.  A single TRIM request can specify multiple LBA ranges.
The device model handles this by dispatching blockif_delete() requests
one at a time.  When a blockif_delete() request completes, the device
model locates the TRIM buffer and searches for the next LBA range to
handle.  Previously, the device model would re-read the trim buffer
from guest memory each time.  However, this was subject to some
unpleasant races if the guest changed the PRDT entries or CFIS while a
command was in flight.  Instead, read the buffer of trim ranges once
and cache it across multipe internal blockif requests.

Reviewed by:	mav
Fixes:		71fa171c64 bhyve: Initialize stack buffer in pci_ahci
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D47224
2024-10-24 10:18:09 -04:00
Mark Johnston
c22be0b181 mixer: Fix a bogus free() call in the main loop
After a strsep() call, p might not point at the original allocation
anymore.

Reported by:	CHERI
Reviewed by:	christos
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47266
2024-10-23 22:12:45 +00:00
Konstantin Belousov
41b95006f2 acpidump(8): add const qualifier to the known tables array
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
2024-10-23 23:00:10 +03:00
Konstantin Belousov
5a6e19cac0 acpidump: use acpica definitions for devscope types in DMAR decoding
and add missed acpi namespace device type entry decoding.

Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-10-22 22:34:34 +03:00
Konstantin Belousov
8f553746b4 acpidump: correct memcmp() result check
Fixes:	e9ab827df9
Sponsored by:	The FreeBSD Foundation
2024-10-22 22:34:33 +03:00
Corvin Köhne
08139140c5
bhyve: merge adjacent E820 entries
EDKII can allocate adjacent E820 entries only if they are at a page
boundary.  For some unknown and probably strange reasons, Intel puts
it's OpRegion at an offset of 0x18 bytes. If the VBT lays directly
behind the OpRegion, we're going to try allocating two adjacent E820
sharing the same page. This causes EDKII to do not properly allocate
those entries. A Linux guest then isn't able to map the VBT and those
fails to find it.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D45336
2024-10-22 14:17:02 +02:00
Hans Rosenfeld
d93fbcf022
bhyve: TPM 2.0 emulation with swtpm
Implement a TPM 2.0 emulation backend to connect to a running swtpm
instance using a UNIX domain socket.

Reviewed by:		corvink
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D46373
2024-10-22 14:04:24 +02:00
Hans Rosenfeld
bc3d09e90b
bhyve: TPM CRB: pass actual TPM request length to backend execute_cmd()
The TPM spec (TPM Library, Part3: Commands, Section 5.2: Command Header
Validation) requires that no more bytes are written than the size of the
commands, as given in the request header. Thus the TPM CRB interface
needs to get the command size from the request header and pass that to
the emulation backend.

As the guest OS driver can set the address and size of the command and
response buffers freely within the limits of the provided CRB data
buffer, bhyve should verify that the values set in the corresponding
registers make sense before processing a command.

Reviewed by:		corvink
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D46564
2024-10-22 14:04:23 +02:00
Hans Rosenfeld
2feea221b2
bhyve: don't crash when guest writes TPM int_enable register
FreeBSD's own TPM driver writes 0 to the INT_ENABLE register during
attach, making sure interrupts are off. bhyve really shouldn't kill the
VM when that happens just because it doesn't support TPM interrupts.
Even if a guest was trying to enable interrupts, we should just ignore
it like real TPM hardware would.

Reviewed by:		corvink
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D46562
2024-10-22 14:04:21 +02:00
Poul-Henning Kamp
f50d2fced2 Give usbdump a '-u' option for unbuffered output. 2024-10-21 11:21:05 +00:00
Ka Ho Ng
968bcca262 libkldelf: add a private library for kernel/kld-related ELF parsing
The libkldelf library was originally a part of kldxref(8). It exposed
ELF parsing helpers specialized in parsing KLDs and the kernel
executable. The library can be used to read metadata such as linker_set,
mod_depend, mod_version and PNP match info, and raw data from the ELF.

To promote the reuse of the facilities the ELF parsing code is separated
from kldxref(8) into a new private library.

For now, libkldelf's source files will be compiled into kldxref(8)
directly if kldxref is built during bootstrapping phase. The reason is
linking kldxref(8) against the libkldelf static library has an unwanted
side effect which renders the linker sets inside the libkldelf
implementation empty if the static library is not build by ld -r all the
.o files into a single .o before producing the static library.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Suggested by:	jrtc27, markj
Differential Revision:	https://reviews.freebsd.org/D46719
2024-10-18 20:20:13 +00:00
Zhenlei Huang
17120e4bc3 ndp: Remove a stray semicolon
MFC after:	1 week
2024-10-17 21:05:29 +08:00
John Baldwin
60516a51ab devinfo: Output device description in verbose mode
The description is listed in angle brackets after the device name
similar to device probe messages.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D47157
2024-10-16 14:09:05 -04:00
Pierre Pronchery
b34a4edefb bhyve: avoid buffer overflow in pci_vtcon_control_send
This is a follow-up to the fix for HYP-19, addressing another condition
where an overflow might still occur. (Spotted by jhb@, thanks!)

Reported by:    Synacktiv
Reviewed by:	markj
Security:       HYP-19
Sponsored by:   Alpha-Omega Project
Sponsored by:   The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46882
2024-10-15 16:54:19 -04:00
Graham Percival
229381deb2 manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1459
2024-10-15 17:20:47 -03:00
Graham Percival
6e1fc01180 manuals: Fix "unusual .Xr" warnings with a script
These were reported by `mandoc -T lint ...` as warnings:
- unusual Xr order
- unusual Xr punctuation

Fixes made by script in https://github.com/Tarsnap/freebsd-doc-scripts

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1464
2024-10-15 17:18:14 -03:00
Alexander Ziaee
5c59e40bc4 wpa_supplicant: xref relevant wpa_passphrase(8)
Reviewed by:	mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1461
2024-10-15 17:18:02 -03:00
Andrew Turner
e51ed89897 bhyve/aarch64: Handle unknown exceptions
When an exception class is unhandled by the kernel we handle it in
userspace by exiting the process. Rather than exiting raise an unknown
reason exception in the guest. The guest can then handle the exception
as it wishes.

Reviewed by:	markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46511
2024-10-15 18:24:42 +01:00