Commit graph

290493 commits

Author SHA1 Message Date
Dimitry Andric 5f757f3ff9 Merge llvm-project main llvmorg-18-init-15088-gd14ee76181fb
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-18-init-15088-gd14ee76181fb.

PR:		276104
MFC after:	1 month
2024-04-06 22:11:55 +02:00
Michael Tuexen 3e1c8a35f7 tcp: improve consistency
No functional change intended.

Reported by:		Coverity Scan
CID:			1523781
Reviewed by:		rscheff
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D44645
2024-04-06 10:02:06 +02:00
Michael Tuexen d902c8f55b tcp rack: fix memory corruption
When in rack_output() jumping to the label out, don't write errno into
the log buffer, since the pointer is not initialized.

Reported by:		Coverity Scan
CID:			1523773
Reviewed by:		rscheff
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D44647
2024-04-06 09:55:46 +02:00
Warner Losh ea002c1017 devmatch: Convert command line flags to bools
These are bools, and should have been bools from the start. Make them
bools.

Sponsored by:		Netflix
2024-04-05 16:53:47 -06:00
Warner Losh 03cfd91998 devmatch: Make -a work for all devices
devmatch -a should produce output for all attached devices, but doesn't.

Noticed by:		cperciva
Sponsored by:		Netflix
2024-04-05 16:53:47 -06:00
Warner Losh cfcf475a66 stand: Install gptboot.efi(8)
We need to include bsd.init.mk first when we have man pages in the boot
loader.

Sponsored by:		Netflix
2024-04-05 16:53:47 -06:00
Warner Losh fe83abacd4 nvme: Add my copyright to logpage.c
Reflect the command line refactoring I did, and other changes. git blame
says I'm to blame for ~1/4 of this file.

Sponsored by:		Netflix
2024-04-05 16:53:47 -06:00
Warner Losh 0b8f21e8d1 nvme: Add LPA bits
Add all the bits from the NVMe 2.0 base specification: CMD_EFFECTS to
indicate the commands and effects log page is supported, TELEMETRY to
indicate that the telemetry log pages and protocols are supported,
PERSISTENT_EVENTS to indicate the persistent event log is supported,
LOG_PAGES_PAGE to indicate that various log pages related to log page
and command support are supported: L0, L5, L12, and L13. and
DA4_TELEMETRY to indicate that the DA4 area is supported for telemetry
data.

Sponsored by:		Netflix
2024-04-05 16:53:47 -06:00
Stephen J. Kiernan 3bbe8ed1a7 arm64: Add a CPU reset hook instead of expecting PSCI
Some SoCs do not include a PSCI for power management and defer it to
something else instead. Add a CPU reset hook to account for this, and
use it in the psci driver.

Reviewed by:	andrew
Obtained from:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D44535
2024-04-05 17:37:15 -04:00
Stephen J. Kiernan 1b60bbfe65 arm64: Separate serror handler to EL1H and EL0 versions.
In order to ensure the registers are saved and restored properly for
the exception level, we need separate handlers serror at each of
EL1H and EL0.

Reviewed by:	andrew
Differential Revision:	https://reviews.freebsd.org/D44630
2024-04-05 15:22:11 -04:00
Collin Funk 8268a31bcc which: Use size_t instead of ssize_t for pathlen
The "pathlen" variable is the return value of strlen(3) and is then
passed as an argument to malloc(3) and memcpy(3). The size_t type
matches the prototype for these functions. The size_t type is unsigned
so it can fit larger $PATH values than ssize_t. However, in practice
ssize_t should be larger enough so this change is just for clarity.

Signed-off-by: Collin Funk <collin.funk1@gmail.com>

MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1113
2024-04-05 14:30:31 -04:00
Lexi Winter da2b732288 arm64: add CPU part identifiers for Apple M1 and M2
Part numbers are sourced from Linux (arch/arm64/include/asm/cputype.h).

MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1144
2024-04-05 14:18:32 -04:00
Zhenlei Huang 317cc829ee LinuxKPI: Remove the temporary variable fileid from the macro request_module
The variable fileid stores the result from kern_kldload() but never gets
used. Since the third parameter `*fileid` of kern_kldload() can be NULL,
this unused variable can be safely removed.

No functional change intended.

Reviewed by:	emaste, bz, #linuxkpi
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44583
2024-04-06 00:26:09 +08:00
Michael Tuexen 681711b77c uipc_socket: handle socket buffer locks in sopeeloff
PR:			278171
Reviewed by:		markj
Fixes:			a4fc41423f ("sockets: enable protocol specific socket buffers")
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D44640
2024-04-05 18:20:19 +02:00
Michael Tuexen 7df0ef5f48 tcp rack: fix sending
In rack_output(), idle is used as a boolean variable. So don't use it
as an int and don't clear it afterwards.
This avoids setting idle to false, when it is not intended.

Reported by:		olivier
Reviewed by:		rrs, rscheff
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D44610
2024-04-05 17:47:03 +02:00
Dimitry Andric aaabed1dea Merge commit eb8f379567e8 from llvm-project (by Florian Hahn):
[DSE] Remove malloc from EarliestEscapeInfo before removing. (#84157)

  Not removing the malloc from earliest escape info leaves stale entries
  in the cache.

  Fixes https://github.com/llvm/llvm-project/issues/84051.

  PR: https://github.com/llvm/llvm-project/pull/84157

This fixes a crash in clang (usually a bus error, but can also be
another memory error) when compiling the science/siconos port.

PR:		278174
Reported by:	yuri
MFC after:	3 days
2024-04-05 17:44:49 +02:00
Mark Johnston fd56d24725 tarfs.5: Provide some guidance on zstd frame sizes
Reviewed by:	des, emaste
MFC after:	2 weeks
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D44636
2024-04-05 11:43:58 -04:00
Michael Tuexen 60bc195745 tcp bblog: cleanup
Remove redundant checks and improve error checking.

Reported by:		Coverity Scan
CID:			1523780
Reviewed by:		rscheff
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D44616
2024-04-05 17:36:40 +02:00
Michael Tuexen aaaa01c0c8 tcp hpts: initialize variable
Ensure that  tv.tv_sec is zero in all code paths.

Reported by:		Coverity Scan
CID:			1527724
Reviewed by:		rscheff
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D44584
2024-04-05 17:30:31 +02:00
Konstantin Belousov f1519a8229 acpidump: add Foundation copyright
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-04-05 18:17:55 +03:00
Konstantin Belousov 6d789b6126 acpidump: dump AMD IVRS table describing IOMMU layout
Reviewed by:	markj
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44634
2024-04-05 18:17:55 +03:00
Konstantin Belousov 969a4b8be5 acpidump: add printfield() helper
Reviewed by:	markj
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44634
2024-04-05 18:17:55 +03:00
Konstantin Belousov 29a6b72775 acpidump: bump WARNS to 6
and disable warnings about unused function args coming from the vendor
acpi headers.

Reviewed by:	markj
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44634
2024-04-05 18:17:55 +03:00
Konstantin Belousov 4262ad56a0 acpidump: the acpi_get_fadt_revision() argument is unused
everywhere except i386.

Reviewed by:	markj
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44634
2024-04-05 18:17:55 +03:00
Konstantin Belousov de937ecb75 acpidump: silent the warning about unaligned uuid
The field comes from the ACPI NFIT table and must be already properly
aligned by BIOS (at least so is written in the spec).

Reviewed by:	markj
Sponsored by:	Advanced Micro Devices (AMD)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44634
2024-04-05 18:17:55 +03:00
Mark Johnston a0895e394d tarfs: Implement VOP_BMAP
This lets tarfs provide readahead/behind hints to the VFS, which helps
memory-mapped I/O performance, important when running faulting in
executables out of a tarfs mount as one might if tarfs is used to back
the root filesystem, for example.  The improvement is particularly
noticeable when the backing tarball is zstd-compressed.

The implementation simply returns the extent of the virtual block
containing the target offset, clamped by the maximum I/O size.  This is
perhaps simplistic; it effectively just chooses values that would
correspond to a single VOP_READ call in tarfs_read_file().

Reviewed by:	des, kib
MFC after:	1 month
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D44626
2024-04-05 11:14:36 -04:00
Mark Johnston 663a704a58 VOP_BMAP.9: Typo
MFC after:	1 week
Sponsored by:	Klara, Inc.
2024-04-05 11:14:28 -04:00
Konstantin Belousov 235436d631 stop_all_proc(): skip traced or signal-stoped processes
Since thread_single(SINGLE_ALLPROC) ignores them since 9241ebc796,
and there is not much we can do for the debugger-controlled process.

Noted by:	olce
Reviewed by:	markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D44638
2024-04-05 17:52:39 +03:00
Juraj Lutter bb4e55242e Add OpenBSD 7.5 to bsd-family-tree
Summary: Add OpenBSD 7.5 to bsd-family-tree

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D44643
2024-04-05 15:33:48 +02:00
Christos Margiolis c0d8f58629 Revert "sound: Get rid of snd_clone and use DEVFS_CDEVPRIV(9)"
This reverts commit dc831e93ba.

After several reports in the mailing lists, this commit breaks
pulseaudio. Revert until the issue is resolved.
2024-04-05 12:33:41 +02:00
Christos Margiolis 365067e98e Revert "sound: Implement asynchronous device detach"
This reverts commit 9eff58c6d5.

We are reverting dc831e93ba ("sound: Get rid of snd_clone and use
DEVFS_CDEVPRIV(9)"), so revert this commit as well since it depends
dc831e93ba.
2024-04-05 12:33:23 +02:00
Xin LI 5ffb19ac36 Backport export of lzma_mt_block_size symbol.
This restores binary compatibility against liblzma 5.6.0 library.

PR:		278127
MFC after:	3 days
2024-04-04 23:39:33 -07:00
Xin LI 2f9cd13d6c Revert "MFV: xz 5.6.0"
This commit reverts 8db56defa7,
rolling back the vendor import of xz 5.6.0 and restoring the
package to version 5.4.5.

The revert was not directly due to the attack (CVE-2024-3094):
our import process have removed the test cases and build scripts
that would have enabled the attack. However, reverting would
help to reduce potential confusion and false positives from
security scanners that assess risk based solely on version
numbers.

Another commit will follow to restore binary compatibility with
the liblzma 5.6.0 library by making the previously private
symbol (lzma_mt_block_size) public.

PR:		278127
MFC after:	3 days
2024-04-04 23:39:23 -07:00
Justin Hibbits fcace5ab08 powerpc/booke: Reserve KVA for minidump working area
This was already handled for the AIM64 pmaps, so add the same to
Book-E64 pmap.
2024-04-04 19:03:27 -04:00
Mark Johnston 8eb21b4ff0 tmpfs tests: Remove an xfail annotation
This test passes after commit 08f3d5b60c ("copy_file_range: Call
vn_rdwr() at least once").

PR:		274615
MFC after:	1 month
2024-04-04 17:04:30 -04:00
Mark Johnston 08f3d5b60c copy_file_range: Call vn_rdwr() at least once
This ensures that we invoke VOP_READ on the input file even if it's
empty, which in turn helps ensure that filesystems update the atime of
the file.

PR:		274615
Reviewed by:	olce, rmacklem, kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D43524
2024-04-04 17:03:07 -04:00
Alan Somers c1326c01df fusefs: correct a comment
[skip ci]

MFC after:	1 week
Sponsored by:	Axcient
2024-04-04 14:18:56 -06:00
Mark Johnston d1801babad tarfs.5: Document the importance of zstd framing
Reviewed by:	des, kib
MFC after:	1 week
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D44628
2024-04-04 10:54:25 -04:00
Mark Johnston 91eca18551 tarfs: Inherit mnt_iosize_max from the lower vnode
There is no obvious reason to use a value smaller than that.

Reviewed by:	des, kib
MFC after:	1 week
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D44627
2024-04-04 10:54:06 -04:00
Dag-Erling Smørgrav bee7cf9e97 ln: Improve link(1) variant of ln(1).
* Give link(1) its own usage message.
* Use getprogname(3) instead of rolling our own.
* Verify that the target file does not already exist.
* Add tests specific to link(1).

MFC after:	3 days
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44635
2024-04-04 16:14:50 +02:00
Dag-Erling Smørgrav 8311bc5f17 tmpfs: Improve file time tests.
* The empty test case no longer fails because 89f1dcb3eb causes empty
  files to bypass the bug.
* The bug still exists, so add a test case which exercises it.
* While here, tighten up some of the checks.

A similar patch has been submitted upstream.

PR:		274615
X-MFC-With:	89f1dcb3eb
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D44609
2024-04-04 15:40:54 +02:00
Kristof Provost 4848eb3af2 tcpdump: cope with incorrect packet lengths
It's possible for the capture buffer to be smaller than indicated by the
header length. However, pfsync_print() only took the header length into
account. As a result we could read outside of the buffer.

Check that we have at least the expected amount of data before we start
parsing.

PR:		278034
MFC after:	2 weeks
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D44580
2024-04-04 10:07:05 +02:00
Stephen J. Kiernan 41956c13f9 include: Ensure security/audit/audit.h gets staged properly.
There is a conflict between bsm/audit.h and security/audit/audit.h due
to the way that staging is being set up using .PATH to point to the
full directory and the leaf files being specified in the list. Due to
this, the bsm/audit.h was getting staged as both bsm/audit.h and
security/audit/audit.h since the sys/bsm directory is listed first in
the .PATH list.

Use sys/security in the .PATH instead of sys/security/audit and specify
the audit header files as audit/<name>.h. This ensures that we get the
correct audit.h stanged for security/audit/audit.h.

Reviewed by:	sjg
Obtained from:	Juniper Networks, Inc.
2024-04-03 20:26:33 -04:00
Stephen J. Kiernan 112783ebbc userboot: allow for overriding the version file location
Use ?= when assigning VERSION_FILE

Reviewed by:	imp
Obtained from:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D44624
2024-04-03 19:09:43 -04:00
Michael Tuexen 6b454da6bb tcp: address a warning
t_state is an unsigned variable, so no need for testing that it is
non-negative.

Reported by:		Coverity Scan
CID:			1390885
Reviewed by:		glebius
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D44619
2024-04-04 00:14:59 +02:00
Stephen J. Kiernan 13ab9fa09b kernel: Add options for MAC_DEBUG and MAC_VERIEXEC_DEBUG 2024-04-03 16:05:25 -04:00
Mark Johnston 3b795e641d sdt: Use designated initializers for various definitions
No functional change intended.

MFC after:	1 week
2024-04-03 15:21:38 -04:00
Yan-Hao Wang 1caa5d0861
efitable(8): Complete libxo transition
Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41411
2024-04-04 02:32:00 +08:00
Yan-Hao Wang c7bdc25d41
savecore(8): Complete libxo transition
Reviewed by:	des
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D41392
2024-04-04 02:28:30 +08:00
Mark Johnston d627293f03 ddb: Fix format string errors in db_pprint.c
Reported by:	bapt
Fixes:	aada453dcb ("ddb: Properly pretty-print non-labeled enum values")
2024-04-03 14:14:13 -04:00