1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-18 02:19:39 +00:00
Commit Graph

20914 Commits

Author SHA1 Message Date
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
Warner Losh
3ff9ea7dc2 acpidump: Add -T TBLN to print a specific ACPI fixed table
Add the ability to dump a specific ACPI table rather than all of them.

Sponsored by:		Netflix
Reviewed by:		andrew
Differential Revision:	https://reviews.freebsd.org/D47082
2024-10-15 05:10:06 -06:00
Warner Losh
e9ab827df9 acpidump: Sort signature ifs alphabetically and make table driven
Sort the ACPI signatures alphabetically and move it into a table we can iterate through

Sponsored by:		Netflix
Reviewed by:		andrew, markj
Differential Revision:	https://reviews.freebsd.org/D47081
2024-10-15 05:09:45 -06:00
Warner Losh
bbfd734823 acpidump: Document the alphabit soup of ACPI Table names
Clarify what's reported with -t (it's all the fixed acpi tables,
not just the listed ones). The listed tables are more fully decoded,
while all other tables just have their headers decoded.

Sponsored by:		Netflix
Reviewed by:		adrian
Differential Revision:	https://reviews.freebsd.org/D47080
2024-10-15 05:08:24 -06:00
Warner Losh
19dd881177 acpidump: Use ACPI_NAMESEG_SIZE instead of 4
In a couple of places, we use 4 instead of ACPI_NAMESEG_SIZE. Use the

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D47109
2024-10-15 05:07:30 -06:00
Warner Losh
5d3fb72667 acpidump: Move to acpi.rsdp
Switch from the long obsolete hint.0.acpi.rsdp to acpi.rsdp to get the
root of the ACPI tables.

MFC After:		1 week
Sponsored by:		Netflix
Reviewed by:		andrew, markj
Differential Revision:	https://reviews.freebsd.org/D47079
2024-10-15 05:05:07 -06:00
Simon J. Gerraty
a64729f507 Update Makefile.depend files
After building packages we have a number of new
and updated Makefile.depend files

Reviewed by:	stevek
2024-10-14 10:26:17 -07:00
Mark Johnston
4e15366c6a makefs: Record a larger TXG number in the uberblock
By default, OpenZFS will perform metadata verification of the most
recent TXGs, but this can be very slow since all data in a pool
generated by makefs was logically written in a single transaction.

Avoid triggering this verification by default, but add an option to
restore the previous behaviour and enable it in regression test cases.

Reported by:	cperciva
Tested by:	cperciva (previous version)
MFC after:	2 weeks
2024-10-14 13:14:37 +00:00
Chuck Tuffli
5374b9e146 bhyve/nvme: Fix Infinite loop in queue processing
In the functions pci_nvme_handle_admin_cmd and pci_nvme_handle_io_cmd
infinite loops are possible in the bhyve process if the sq->tail value
is greater than sq->size.

An attacker could overload the host CPU.

Fix is to validate that doorbell values:
 - Are for a valid (i.e., created) queue
 - Are not the same as the previous value
 - Fit within the available capacity

The emulation will generate an Asynchronous Event Notification (Invalid
Doorbell or Invalid Doorbell Value) if enabled and ignore the doorbell
update.

While in the neighborhood, remove a redundant bounds check.

Reported by:	Synacktiv
MFC after:	1 week
Security:	HYP-14
Sponsored by:	Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46064
2024-10-13 06:58:50 -07:00
Yan-Hao Wang
20bb77c4b9
jls(8): Complete libxo transition
Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41413
2024-10-13 02:21:47 +08:00
Yan-Hao Wang
7d5fd25ab8
lastlogin(8): Complete libxo transition
Reviewed by:	dees
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41414
2024-10-13 02:21:47 +08:00
Yan-Hao Wang
3d1b233e03
sesutil(8): Complete libxo transition
Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41418
2024-10-13 02:21:46 +08:00
Yan-Hao Wang
54ff53d890
ndp(8): Complete libxo transition
Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41417
2024-10-13 02:21:46 +08:00
Yan-Hao Wang
417842f908
arp(8): Complete libxo transition
Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41408
2024-10-13 02:21:45 +08:00
Warner Losh
5d57fad876 acpidump: Print SPCR v3 and v4 fields
This reapplies 593d7a1634 to implement printing of SPCR v3 and SPCR v4
fields after ACPI actble3.h update. ACPIca used different names and
didn't do the weird nesting I did in the prior commit for better
co-existance.

Sponsored by: Netflix
2024-10-11 12:06:33 -06:00
Warner Losh
ca9e31eead Revert "apcidump: Add dumping SPCR"
This reverts commit 593d7a1634:

In preparation for importing new SPCR definitions, back out my hack
since it conflicts with the new definitions.

Sponsored by:		Netflix
2024-10-11 12:06:33 -06:00
Stanislav Shalunov
6cde8f3ef7 lpd: Tighten permissions on /var/run/printer
Exclude group read/write permissions as well. Otherwise, group wheel can
submit things w/o the normal accounting. While group wheel is generally
trusted on the machine, submitting jobs w/o checks is not one of the
functions we document for that group.

PR: 17289
Differential Revision:	https://reviews.freebsd.org/D47040
2024-10-11 09:50:08 -06:00
Ka Ho Ng
50c64df2a1 Revert "libkldelf: add a private library for kernel/kld-related ELF parsing"
Some checks are pending
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-12, /usr/lib/llvm-12/bin, ubuntu-20.04, bmake libarchive-dev clang-12 lld-12, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-12, /usr/lib/llvm-12/bin, ubuntu-20.04, bmake libarchive-dev clang-12 lld-12, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-13, /opt/homebrew/opt/llvm@13/bin, macos-latest, bmake libarchive llvm@13, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-13, /opt/homebrew/opt/llvm@13/bin, macos-latest, bmake libarchive llvm@13, arm64, aarch64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, amd64, amd64) (push) Waiting to run
Cross-build Kernel / ${{ matrix.target_arch }} ${{ matrix.os }} (${{ matrix.compiler }}) (clang-14, /usr/lib/llvm-14/bin, ubuntu-22.04, bmake libarchive-dev clang-14 lld-14, arm64, aarch64) (push) Waiting to run
This reverts commit 0a2cfd653e.
2024-10-08 19:40:20 +00:00
Graham Percival
9fd66e40ca manuals: Fix syntax of list width
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/1455
2024-10-08 16:16:26 -03:00
Baptiste Daroussin
88a198af3c powerd: use nlsysevent if possible
instead of depending on devd and its socket, try to use nlsysevent
instead. This makes powerd independant from devd.

Approved by:		des
Reviewed by:		des
Differential Revission:	https://reviews.freebsd.org/D46972
2024-10-08 08:40:58 +02:00
Ka Ho Ng
0a2cfd653e 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.

kldxref(8) is modified to link against the libkldelf library.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46719
2024-10-08 04:24:07 +00:00
Graham Percival
c801836ff4 manuals: Fix "skipping end of block" .El errors
These were reported by `mandoc -T lint ...` as errors; this commit only
handles unnecessary .El commands.

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/1447
2024-10-07 15:37:47 -03:00
Ed Maste
be9243409d pkg: improve error message
Print the complete list of url that have failed

PR:		281924
Co-authored-by: Baptiste Daroussin <bapt@FreeBSD.org>
Differential Revision: https://reviews.freebsd.org/D46983
2024-10-07 13:05:07 -04:00
Ed Maste
f5c847ae84 pkg: prefer .pkg extension
.pkg is the default extension as of commit c244b1d8a3, falling back to
.txz if not found.

PR:		281924
Reviewed by:	bapt
Fixes: a2aac2f5e5 ("pkg(7): when bootstrapping first search for pkg.bsd file then pkg.txz")
Fixes: c244b1d8a3 ("pkg: settle the uniq extension to .pkg instead of .bsd")
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46977
2024-10-07 12:01:36 -04:00
Chuck Tuffli
b0a24be007 bhyve/nvme: Fix out-of-bounds read in NVMe log page
The function nvme_opc_get_log_page in the file usr.sbin/bhyve/pci_nvme.c
is vulnerable to buffer over-read. The value logoff is user controlled
but never checked against the value of logsize. Thus the difference:
	logsize - logoff
can underflow.

Due to the sc structure layout, an attacker can dump internals fields of
sc and the content of next heap allocation.

Reported by: Synacktiv
Reviewed by:	emaste, jhb
Security: HYP-07
Sponsored by: Alpha-Omega Project, The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46021
2024-10-06 06:50:28 -07:00
Jeremy Faulkner
7d893fce0d sesutil: Fix a typo in an error message
PR:		281658
MFC after:	1 week
2024-10-06 13:22:33 +00:00
Mark Johnston
d9fe718287 makefs: Remove the warning printed when makefs -t zfs is used
We haven't seen bug reports relating to this feature for a while, so
stop printing a warning.

Reviewed by:	cperciva
MFC after:	2 weeks
2024-10-04 15:56:34 +00:00
Warner Losh
593d7a1634 apcidump: Add dumping SPCR
When we find a SPCR (Serial Port Console Redirection) TABLE, print all
the details. This includes support for the recent Revision 3 and
Revision 4 tables, though I've not encountered them in the wild yet, so
that code is untested.

https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table

Sponsored by:		Netflix
2024-10-03 18:01:07 -06:00
Pierre Pronchery
e94a1d6a7f bhyve: improve bounds checks in hda_codec
The function hda_codec_command is vulnerable to buffer over-read, the
payload value is extracted from the command and used as an array index
without any validation.
Fortunately, the payload value is capped at 255, so the information
disclosure is limited and only a small part of .rodata of bhyve binary
can be disclosed.

The risk is low because the leaked information is not sensitive. An
attacker may be able to validate the version of the bhyve binary using
this information disclosure (layout of .rodata information, ex:
jmp_tables) before executing an exploit.

Reported by:	Synacktiv
Reviewed by:	christos, emaste
Security:	HYP-13
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46098
2024-10-03 17:14:11 -04:00
Graham Percival
c013ca2cf7 manuals: Fix typos in -offset for .Bd and .Bl
The intended value is:
    -offset indent
If there's any typo such that the value doesn't match the pre-defined
strings, then the offset is the same width as the value.  So by chance,
"-offset -ident" ended up being a standard-width indent (since the
default indent is 6 chars, and "-ident" also has 6 chars), whereas
"-offset -indent" had a longer indent, and "-offset ident" had a shorter
one.

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/1436
2024-10-03 14:49:31 -03:00
John Baldwin
ad152571b8 bhyve uart: Fix errors from GCC
- Place 'static' before other qualifiers (-Wold-style-declaration)

- Correct the order of arguments to calloc (-Wcalloc-transposed-args)

Reported by:	GCC 14
Fixes:		1f903953fb bhyve: Add raw tcp to uart backend
2024-10-02 17:31:59 -04:00
Takanori Watanabe
f5a04b16b1 acpidump: add 's' option to parse dsdt and ssdt's separately. In some machine, they may not be parsed if they are concatinated into one image.
Reviewed by:           kib
MFC after:              1 week
Differential Revision:  https://reviews.freebsd.org/D46796
2024-10-02 15:36:41 +09:00
Ed Maste
030c387f5d tzsetup: correct timezone symlink target
In chroot mode tzsetup prepended the chroot path to the symlink target,
which is not correct.  Use the same path for the symlink regardless of
chroot mode.

PR:		281332
Reported by:	scf, Herbert J. Skuhra
Reviewed by:	olce
Fixes: 5e16809c95 ("tzsetup: symlink /etc/localtime instead of co...")
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46725
2024-09-30 10:22:34 -04:00
Pierre Pronchery
8934002959 bhyve: avoid buffer overflow in pci_vtcon_control_send
The program copies an input buffer to an output buffer without verifying
that the size of the input buffer is less than the size of the output
buffer, leading to a buffer overflow.

Inside the function pci_vtcon_control_send, the length of the iov buffer
is not validated before copy of the payload.

Reported by:    Synacktiv
Reviewed by:	markj
Security:       HYP-19
Sponsored by:   The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46105
2024-09-30 08:01:28 -04:00
Joyu Liao
f321956d98 nfsd.c: Synchronize error handling
Synchronize the error handling in nfsd. If you check other error
handlings in those same condition blocks, it uses nfsd_exit instead,
which will call killchildren() and call the rpcbind service to do
the service un-mapping.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D46442
2024-09-29 13:11:54 -07:00
Gleb Popov
1df198cf93 usr.sbin/jail/jail.8: Make a reference more accurate
The zfs-jail(8) link is also used in the other place within this man

Approved By: imp
Differential Revision: https://reviews.freebsd.org/D46832
2024-09-29 11:33:14 +03:00
Pierre Pronchery
869d760cb9 bhyve: avoid TOCTOU on iov_len in virtio_vq_recordon()
Avoid a race condition when accessing guest memory, by reading memory
contents only once.

This has also been applied to _vq_record() in
sys/dev/beri/virtio/virtio.c, as per markj@'s suggestion.

Reported by:	Synacktiv
Reviewed by:	markj
Security:	HYP-10
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D45735
2024-09-27 10:20:53 -04:00
Pierre Pronchery
71fa171c64 bhyve: Initialize stack buffer in pci_ahci
In the function ahci_handle_dsm_trim, if the call to read_prdt fails,
the variable buf[512] is used while it contains uninitialized data.

It is easy to make the call to read_prdt fail, for instance if
hdr->prdtl == NULL, the function will return without writing anything in
buf.

In addition, this code could be hardened by checking the value of done
before accessing &buf[done].

Reported by:	Synacktiv
Reviewed by:	markj
Security:	HYP-15
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D46090
2024-09-26 14:06:10 -04:00
Greg Lehey
b7b7800043 Explain the relationship between -p and -Z. 2024-09-26 12:07:02 +10:00
Alexander Ziaee
c7a33fe37d ntp: Improve descriptions in man pages
+ ntpd added to ntp.conf(5) description (search keywords)
+ expand NTP so these pages are shown when `apropos time`
+ "standard" => "reference" for increased consistency
- removed redundant or duplicated search keywords

ntp.org bug:	https://bugs.ntp.org/show_bug.cgi?id=3936
MFC after:	3 days
Reviewed by:	Harlan Stenn <stenn@nwtime.org>
Reviewed by:	Cy Schubert <cy@nwtime.org>
2024-09-25 05:40:17 -07:00
Joseph Mingrone
0a7e5f1f02 tcpdump: Update to 4.99.5
Changes:        https://git.tcpdump.org/tcpdump/blob/4a789712f187e3ac7b2c0044c3a3f8c71b83646e:/CHANGES
Obtained from:  https://www.tcpdump.org/release/tcpdump-4.99.5.tar.xz
Sponsored by:   The FreeBSD Foundation
2024-09-23 20:23:25 +01:00
Alexander Ziaee
f8afe99cc8 efibootmgr: minor cleanup (spdx, typos, see also)
This page was getting pulled into `apropos unix` results due to
arguments being on the same line as a name macro in synopsis.
While here, tag spdx, fold a line slightly better, add loader.efi(8)
to see also and fix it's order.

MFC after:	3 days
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1430
2024-09-22 09:21:39 -06:00
Ed Maste
a305f44d14 bhyve: validate corb->wp to avoid infinite loop
Guests must set HDAC_CORBWP less than corb->size.  Treat invalid values
as an error rather than entering an infinite loop.

Reported by:	Synacktiv
Reviewed by:	markj
Security:	HYP-12
Sponsored by:	The Alpha-Omega Project
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46134
2024-09-22 07:25:02 -04:00
Pierre Pronchery
f505f9a842 bhyve: simplify slot validation in xHCI emulation
This is a follow-up to commit e72d86ad9c ("bhyve: improve input
validation in pci_xhci") -- introducing a helper for slot validation.

Co-authored-by:	John Baldwin <jhb@FreeBSD.org>
Reviewed by:	markj, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46696
2024-09-21 13:36:10 -04:00