Martin Matuska [Tue, 16 Apr 2024 21:39:31 +0000 (23:39 +0200)]
libarchive: merge from vendor branch
Libarchive 3.7.3
New features:
#1941 uudecode filter: support file name and file mode in raw mode
#1943 7-zip reader: translate Windows permissions into UNIX
permissions
#1962 zstd filter now supports the "long" write option
#2012 add trailing letter b to bsdtar(1) substitute pattern
#2031 PCRE2 support
#2054 add support for long options "--group" and "--owner" to tar(1)
Security fixes:
#2101 Fix possible vulnerability in tar error reporting introduced
in f27c173
Important bugfixes:
#1974 ISO9660: preserve the natural order of links
#2105 rar5: fix infinite loop if during rar5 decompression the last
block produced no data
#2027 xz filter: fix incorrect eof at the end of an lzip member
#2043 zip: fix end-of-data marker processing when decompressing zip
archives
Brooks Davis [Tue, 16 Apr 2024 17:04:16 +0000 (18:04 +0100)]
libcxxrt: don't export nonexistant symbols
Remove version entries that we don't build.
Add an arm specific Version.map and for other targets run the files
through sed to handle int vs long in new and delete.
Ideally we'd use the SYMBOL_MAPS functionality to preprocess with cpp,
but it doesn't currently handle C++ symbols so be annoyingly duplicative
for now.
Brooks Davis [Tue, 16 Apr 2024 17:03:21 +0000 (18:03 +0100)]
libgcc_s: only export 128-bit int APIs when available
These interfaces are only compiled when the platform supports 128-bit
ints. Use a CRT_HAS_128BIT guard similar to the one used in the
compiler_rt sources.
Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D44323
Brooks Davis [Tue, 16 Apr 2024 17:02:14 +0000 (18:02 +0100)]
librpcsec_gss: don't export non-existant symbols
rpc_gss_mesh_to_oid was never implemented.
This doesn't seem to be any reason why we would need to export the _stub
functions, but it's also a little unclear to me why the linker thinks
they aren't present. Perhaps they should be static.
Notable upstream pull request merges:
#15784 90ba19eb7b Do no use .cfi_negate_ra_state within the assembly
on Arm64
#15942 b6bbaa8372 Give a better message from 'zpool get' with invalid
pool name
#15943 ca678bc0bc Makefile.bsd: sort and cleanup source file list
#15953 fa480fe5ba zinject: show more device fault fields
#15983 30c4eba4ea Fix panics when truncating/deleting files
#15992 99741bde59 zvol: use multiple taskq
#16015 a100a195fa Add support for zfs mount -R <filesystem>
#16022 5e5fd0a178 Speculative prefetch for reordered requests
#16040 997f85b4d3 L2ARC: Relax locking during write
#16042 b12738182c Improve dbuf_read() error reporting
#16051 a9a4290173 xdr: header cleanup
#16052 eeca9a91d6 Fix read errors race after block cloning
#16057 aa5445c28b Remove db_state DB_NOFILL checks from syncing context
#16061 76d1dde94c zinject: inject device errors into ioctls
#16072 9e63631dea Small fix to prefetch ranges aggregation
#16077 44f337be30 Illumos#16463 zfs_ioc_recv leaks nvlist
#16085 4725e543be zinject: "no-op" error injection
#16086 c6da985e28 Add the BTI elf note to the AArch64 SHA2 assembly
Ed Maste [Tue, 16 Apr 2024 15:41:05 +0000 (11:41 -0400)]
mfc-candidates: fix output order with incorrect commit dates
Previously we obtained the list of MFC candidate hashes (i.e., those
commits only in the mfc-from branch), removed the already-merged
commits based on "cherry picked from" commit message entries, and then
printed the list sorted by commit time. This is usually the correct
order, but it is not when commits have non-monotonically-increasing
commit times. This is unfortunately the case for a number of commits in
our tree. This made it difficult to merge some groups of dependent
commits in the correct order.
Instead, leave the from-list in git rev-parse order, and move the
matching logic to a new lua script.
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44808
Brooks Davis [Tue, 16 Apr 2024 16:48:07 +0000 (17:48 +0100)]
libsys: add a libsys.h
This declares an API for libsys which currently consists of
__sys_<foo>() declarations for system call stubs and function pointer
typedefs of the form __sys_<foo>_t. The vast majority of the
implementation resides in a generated _libsys.h which ensures that all
system call stub declarations match syscalls.master.
Brooks Davis [Tue, 16 Apr 2024 16:48:07 +0000 (17:48 +0100)]
makesyscalls: generate core libsys header
Create a header covering most of the "stable" libsys interfaces.
Specifically __sys_<foo> syscall stubs and __sys_<foo>_t typedefs for
those interfaces.
Ed Maste [Tue, 16 Apr 2024 14:19:14 +0000 (10:19 -0400)]
mergemaster: postpone removal to FreeBSD 15
Mergemaster has been deprecated for quite some time, but was not
removed prior to FreeBSD 14.0. Update the deprecation notice in the man
page to reflect this.
PR: 274967
Reported by: naddy
Sponsored by: The FreeBSD Foundation
Ed Maste [Mon, 25 Mar 2024 20:25:23 +0000 (16:25 -0400)]
tzsetup: be explicit about *timezone* abbreviation
During the install process tzsetup asks a question like
Does the abbreviation `EDT' look reasonable?
The installer asks lots of questions, some that relate to the previous
screen or topic and some that do not. A new user installed FreeBSD for
the first time and was confused by this question, not realizing that it
was asking whether the abbreviation is correct for the selected
timezone.
Reviewed by: bapt, brooks, imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44500
Roger Pau Monné [Tue, 5 Mar 2024 13:15:03 +0000 (14:15 +0100)]
x86/xen: fix accounted interrupt time
The current addition to the interrupt nesting level in
xen_arch_intr_handle_upcall() needs to be compensated in
xen_intr_handle_upcall(), otherwise interrupts dispatched by the upcall handler
end up seeing a td_intr_nesting_level of 2 or more, which makes them assume
there's been an interrupt nesting.
Such extra interrupt nesting count lead to statclock() reporting idle time as
interrupt, as the call from interrupt context will always be seen as a nested
one (td->td_intr_nesting_level >= 2) due to the nesting count increase done by
both xen_arch_intr_handle_upcall() and intr_execute_handlers().
Fix this by adjusting the nested interrupt count before dispatching interrupts
from xen_intr_handle_upcall().
PR: 277231
Reported by: Matthew Grooms <mgrooms@shrew.net> Fixes: af610cabf1f4 ('xen/intr: adjust xen_intr_handle_upcall() to match driver filter')
Sponsored by: Cloud Software Group
Reviewed by: Elliott Mitchell <ehem+freebsd@m5p.com>
Do no use .cfi_negate_ra_state within the assembly on Arm64
Compiling openzfs on aarch64 with gcc-8 and gcc-9 is failing currently.
See issue #14965 for deeper context.
On platforms without pointer authentication, .cfi_negate_ra_state can be
defined to a no-op:
https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/aarch64-tdep.c#l1413
I have tested this on Arm64 FreeBSD 13.2 and AlmaLinux-8.
Andrew Turner [Mon, 15 Apr 2024 20:53:39 +0000 (21:53 +0100)]
Add the BTI elf note to the AArch64 SHA2 assembly
On ELF platforms there is a note to specify when an application or
library supports BTI. When linking one of these the linker needs
all input object files to have the note. If not it will not include
it in the output file.
Normally the compiler would generate it, but for assembly files we
need to do it our selves.
Add the note to the aarch64 sha256 and sha512 assembly files.
Tested by building with BTI enabled and using the -zbti-report=error
flag to lld that makes it an error if the note is missing.
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Andrew Turner <andrew.turner4@arm.com>
Closes #16086
Rob N [Mon, 15 Apr 2024 20:52:20 +0000 (06:52 +1000)]
zinject: "no-op" error injection
When injected, this causes the matching IO to appear to succeed, but the
actual work is never submitted to the physical device. This can be used
to simulate a write-back cache servicing a write, but the backing device
has failed and the cache cannot complete the operation in the
background.
Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16085
Rob N [Mon, 15 Apr 2024 20:44:12 +0000 (06:44 +1000)]
zts: allow running a single test by name only
Specifying a single test is kind of a hassle, because the full relative
path under the test suite dir has to be included, but it's not always
clear what that path even is.
This change allows `-t` to take the name of a single test instead of a
full path. If the value has no `/` characters, we search for a file of
that name under the test root, and if found, use that as the full test
path instead.
Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Akash B <akash-b@hpe.com> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16088
Brooks Davis [Mon, 15 Apr 2024 16:55:07 +0000 (17:55 +0100)]
sys/acl.h: reduce header pollution
In commit d1dfd921774f0 the acl allocator was switched from malloc(9) to
uma(9) and done in a way required vm/uma.h and prerequisites. This added
considerable header pollution to sys/sysproto.h. The uma details were
hidden in commit b998d381f2868, but the header pollution remained. Add
less broad includes as required to keep the header self contained.
Brooks Davis [Mon, 15 Apr 2024 16:54:28 +0000 (17:54 +0100)]
sysproto.h: sys/acl.h -> sys/types.h
In sysproto.h, stop including sys/acl.h as syscall defintions now use
__acl* types from sys/_types.h. Add sys/types.h to provide types
previously provided by sys/param.h (via sys/acl.h).
Brooks Davis [Mon, 15 Apr 2024 16:53:05 +0000 (17:53 +0100)]
Reduce reliance on sys/sysproto.h pollution
Add sys/errno.h, sys/malloc.h, sys/queue.h, and vm/uma.h as needed.
sys/sysproto.h currently includes sys/acl.h which currently includes
sys/param.h, sys/queue.h, and vm/uma.h which in turn bring in
sys/errno.h sys/malloc.h.
Bjoern A. Zeeb [Tue, 28 Nov 2023 19:09:07 +0000 (19:09 +0000)]
git/mfc-candidates.sh: allow comments in exclude file
As branches ages, the list of unmerged or unmergable changes may grow
longer. In some cases it is helpful to group and or annotate them
in an exclude file. Filtering out lines starting with "#" allows adding
comment lines to aid tracking.
Bjoern A. Zeeb [Fri, 16 Feb 2024 21:14:02 +0000 (21:14 +0000)]
LinuxKPI: 802.11: disable early queue wakeup workaround; better classify
We used to call lkpi_wake_tx_queues() for all queues early on in order
to make sure they are ready. Turns out whatever logic in iwlwifi
startup is working correctly these days under LinuxKPI so this is no
longer needed. As the comment indicated the "workaround" did not
always work. Disable it for now.
The second part of the improvement is to properly classify Non-QOS
non-data frames (mgmt and ctl frames for now, unless we have to be
even more careful in the future about certain sub-types) as TID 7/VO.
Contrary to net80211 we must not promote PAE frames.
PR: 274382
MFC after: 3 day
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43944
Bjoern A. Zeeb [Mon, 5 Feb 2024 14:48:08 +0000 (14:48 +0000)]
net80211: amrr_init: change order of commands
First run the KASSERT before trying to do the free operation.
Better for reporting and debugging.
Add a guard setting the value to NULL afterwards. NULL pointers
are a lot easier to test for.
MFC after: 3 days
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43751
Bjoern A. Zeeb [Sun, 18 Feb 2024 18:07:00 +0000 (18:07 +0000)]
LinuxKPI: 802.11: remove unneeded re-lookup in lkpi_80211_txq_tx_one()
Given we are passed the lsta in as a function argument there is no
need to re-lookup the sta by ni and possibly not find it.
We know the sta and ni from the lsta and whether it is uploaded to
firmware or not we can check directly from the local lsta flag.
MFC after: 3 days
Reviewed by: cc
Differential Revision: https://reviews.freebsd.org/D43965
Merge commit 37b7207651b4 from llvm-project (by zhongyunde@huawei.com):
[SimplifyCFG] Fix crash when there is unreachable large index (#88616)
The large case index out of scope is dead code, but it is still be
created for TableContents in SwitchLookupTable::SwitchLookupTable,
so make sure the table size after growing should not get smaller.
A newer version of iwlwifi requires a return value from napi_schedule();
unclear if the function always should have been bool. Add the bool to test
based on the napi_schedule_prep() result.
Also add napi_is_scheduled() for rtw89.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste (previous version)
Differential Revision: https://reviews.freebsd.org/D44591
Michael Zhilin [Sat, 13 Apr 2024 09:59:24 +0000 (12:59 +0300)]
snd_hda: fix "duplicated free" on module unloading
This is trivial fix of hdacc_detach to avoid duplicated free on snd_hda
unloading.
The first try of detaching (kldunload) may results into "device busy" error,
but codec->fgs is freed by detach. Second try attempts to free codec->fgs again
and system panicks.
Here is example:
pcm0: unregister: channel pcm0:virtual:dsp0.vp0 busy (pid 3428)
pulseaudio[3428] [oss] module-oss.c: DSP shutdown.
pcm0: detached
hdaa0: detached
panic: Duplicate free of 0xfffff80412ee7d20 from zone 0xfffffe006bc0ba00
(malloc-32) slab 0xfffff80412ee7fc8(105)
cpuid = 6
time = 1712999565
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0202f859e0
vpanic() at vpanic+0x135/frame 0xfffffe0202f85b10
panic() at panic+0x43/frame 0xfffffe0202f85b70
uma_dbg_free() at uma_dbg_free+0x105/frame 0xfffffe0202f85b90
uma_zfree_arg() at uma_zfree_arg+0x95/frame 0xfffffe0202f85be0
free() at free+0xa1/frame 0xfffffe0202f85c20
hdacc_detach() at hdacc_detach+0x2f/frame 0xfffffe0202f85c40
device_detach() at device_detach+0x197/frame 0xfffffe0202f85c80
devclass_driver_deleted() at devclass_driver_deleted+0x66/frame 0xfffffe0202f85c
devclass_delete_driver() at devclass_delete_driver+0x81/frame 0xfffffe0202f85d00
driver_module_handler() at driver_module_handler+0xff/frame 0xfffffe0202f85d50
module_unload() at module_unload+0x32/frame 0xfffffe0202f85d70
linker_file_unload() at linker_file_unload+0x1eb/frame 0xfffffe0202f85db0
kern_kldunload() at kern_kldunload+0x18e/frame 0xfffffe0202f85e00
amd64_syscall() at amd64_syscall+0x153/frame 0xfffffe0202f85f30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe0202f85f30
MFC after: 3 days
Reviewed by: markj, christos
Differential Revision: https://reviews.freebsd.org/D44778
Sponsored by: Postgres Professional
Colin Percival [Sun, 14 Apr 2024 22:31:26 +0000 (15:31 -0700)]
release: Build dvd image before staging pkgs
This missing dependency is only visible with -jN (which was otherwise
broken until recently) and only when building DVD images (which aren't
included in weekly snapshots and thereby slipped past testing).
John Baldwin [Sat, 13 Apr 2024 21:16:01 +0000 (14:16 -0700)]
release: Use the ABI of the target release to fetch packages
- Point --rootdir at the installed destdir in the dvd tree. This
causes pkg to determine the ABI from the installed destdir instead
of the host's binaries. Previously the result was that packages
for the host's ABI were always downloaded breaking cross-releases
(e.g. arm64 releases built on an amd64 host included amd64
packages on the DVD ISO image rather than arm64 packages). This
also handles version mismatches, and I tested this by cross-building
a 15.x arm64 release on a 14.x amd64 host.
- As a result, pkg now does a chdir(3) to the rootdir before running,
so the -o argument to fetch needs to be updated to be relative to
rootdir instead of the CWD as make runs.
- Add a new ROOTDIR variable to limit references to "dvd" to one
place. Ideally ROOTDIR would be an argument to this script so
that it didn't really know about the dvd layout at all.
- While here, simplify creation of symlinks by just using a longer
path to the link name instead of using 'cd' in the shell before
invoking ln(1). Also use ln -sf to create the pkg.pkg symlink
rather than rm + ln.
People get confused when some software (VirtualBox, etc) does not work as
expected (or at all) after a major upgrade.
We have a nice way to deal with this when using sources, namely including
PORTS_MODULES in /etc/make.conf, but we lack something similar for binary
updates.
This patch retrieves a list of kernel modules installed from packages and
advises the user to recompile from ports to avoid problems.
sanitizers: mark __elf_aux_vector as weak, to allow linking without libsys
After libsys was introduced, linking sanitized programs started failing
with:
# c++ -fsanitize=address main.cc
ld: error: undefined symbol: __elf_aux_vector
>>> referenced by sanitizer_linux_libcdep.cpp:950 (/usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp:950)
>>> sanitizer_linux_libcdep.o:(__sanitizer::ReExec()) in archive /usr/lib/clang/17/lib/freebsd/libclang_rt.asan-x86_64.a
c++: error: linker command failed with exit code 1 (use -v to see invocation)
Mark __elf_aux_vector as weak in the internal sanitizer declaration, so
the linker will accept it at link time. The dynamic linker will then
take care of the symbol at run time.
tests/unix_stream: test that send(2) of zero bytes is successful
Put this simple test into an existing file. We don't have a designated
file for all unix/stream tests. There is extensive unix_seqpacket_test,
but (at least right now) unix/seqpacket is not a superset of unix/stream,
but a different implementation. We have one file that does one test for
unix/stream - unix_socketpair_test. So rename it to unix_stream and start
collecting all unix/stream tests in it.
John Baldwin [Sun, 14 Apr 2024 02:12:07 +0000 (19:12 -0700)]
x86 NOTES: Move shared options from amd/i386 NOTES to x86 NOTES
While here, reorder some of the entries using headers more aligned
with sys/conf/NOTES. Also add a pointer from the amd64/i386 NOTES
files to x86 NOTES.
The "extra" ACPI device drivers were only present in i386 NOTES
previously.
John Baldwin [Sun, 14 Apr 2024 02:10:44 +0000 (19:10 -0700)]
i386: Use DEV_HYPERV to enable HyperV APIC vector
This avoids requiring both 'device hyperv' and 'options HYPERV' for
kernel configs. Instead, just 'device hyperv' can now be used
matching the kernel configuration used for amd64.
The snd_clone framework does not exist as of e8c0d15a64fadb4a330f2da7244becaac161bb70 ("sound: Get rid of snd_clone
and use DEVFS_CDEVPRIV(9)"), so remove leftover references to it from
unit.c.
Sponsored by: The FreeBSD Foundation
MFC after: 2 months
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44758
kldxref: Prefer sys/cdefs.h __unreachable over the builtin
The __builtin_unreachable macro provided by Clang and GCC is a hint to
the compiler used for optimization. The programs work fine even if the
compiler doesn't support it. The sys/cdefs.h has had __unreachable for
9 years (commit 732b31de5d9244bd1cc98192e09ee1881e9f55e9). It expands
to the builtin if it is available. In the rare case that it is
unsupported it expands to a null statement so compilation does not
fail.
daemon: Prefer sys/cdefs.h __unreachable over the builtin
The __builtin_unreachable macro provided by Clang and GCC is a hint to
the compiler used for optimization. The programs work fine even if the
compiler doesn't support it. The sys/cdefs.h has had __unreachable for
9 years (commit 732b31de5d9244bd1cc98192e09ee1881e9f55e9). It expands
to the builtin if it is available. In the rare case that it is
unsupported it expands to a null statement so compilation does not
fail.
nproc: Prefer sys/cdefs.h __unreachable over the builtin
The __builtin_unreachable macro provided by Clang and GCC is a hint to
the compiler used for optimization. The programs work fine even if the
compiler doesn't support it. The sys/cdefs.h has had __unreachable for
9 years (commit 732b31de5d9244bd1cc98192e09ee1881e9f55e9). It expands
to the builtin if it is available. In the rare case that it is
unsupported it expands to a null statement so compilation does not
fail.
John Baldwin [Fri, 12 Apr 2024 21:35:23 +0000 (14:35 -0700)]
defaults/rc.conf: Remove /usr/lib32 from ldconfig32_paths
Commit 99132daf6f70cb0cc969c555d3612547fa3cf1db prepends /usr/lib32 to
the list of paths in ldconfig32_paths since it is a standard library
path in ld-elf32.so.1. Remove /usr/lib32 from the value in rc.conf so
that it is not listed twice.
Reviewed by: olce, kib
Sponsored by: University of Cambridge, Google, Inc.
Differential Revision: https://reviews.freebsd.org/D44752
These constants are GNU libc extensions that are likely to be adopted
by the next POSIX revision [1]. The definitions can be verified in
a PARI-GP shell session:
Put these behind __BSD_VISIBLE || __XSI_VISIBLE >= 800 to future-proof
these changes. They shouldn't be defined at lower levels of XSI, but don't
have other XSI 800 stuff in place yet.
Colin Percival [Fri, 12 Apr 2024 17:42:05 +0000 (10:42 -0700)]
release: Randomize powerpc boot block file name
With parallel builds enabled, we can end up building multiple ISOs at
once, which causes problems if mkisoimages.sh uses a consistent file
name "/tmp/hfs-boot-block".