Commit Graph

295068 Commits

Author SHA1 Message Date
Poul-Henning Kamp
f50d2fced2 Give usbdump a '-u' option for unbuffered output. 2024-10-21 11:21:05 +00:00
Edward Tomasz Napierala
31eec6fe1a linux: support IUTF8
Make Linuxulator support the recently added IUTF8 termios(4) flag.

Reviewed By:	dchagin, emaste, imp
Differential Revision:	https://reviews.freebsd.org/D44525
2024-10-21 08:22:50 +00:00
Robert Wing
525a177c16 mkuzip: drop support for executable uzip images
A uzip image has a 128-byte header, historically, this header could be
executed as a shell script to mount the uzip image to a user provided
mountpoint.

The embedded shell commands only work for uzip images that were created
with zlib or zstd compression that contained an ISO-9660 file system.
Given the limited space available in the uzip header, it is not
practical to extend this feature to include other file systems or to
provide sensible error handling and error messages to the user.
For these reasons, abandon the embedded shell script in the uzip image
header.

To maintain backwards compatibility, the shebang and shell must reside
in the 128-byte header.

This change of behavior is documented in mkuzip(8) and an example
has been provided for creating/mounting uzip images.

PR: 276174
2024-10-20 22:45:09 -08:00
Doug Moore
d2d0d6cb47 subr_pctrie: fix a comment
A comment used least > instead of greatest <.  Fix it.
2024-10-20 21:46:30 -05:00
Kyle Evans
096c39fae4 tests: kern: add some porch(1)-based tty tests
If sysutils/porch is installed, we'll do some basic testing of tty
behavior.  The existing tests primarily cover ICANON-related processing
and corner cases that have been fixed somewhat recently, but I
anticipate growing this out a bit in due time.

Reviewed by:	ngie
Differential Revision:	https://reviews.freebsd.org/D46806
2024-10-20 20:32:31 -05:00
Kyle Evans
44f736c385 mk: add PLAIN_TESTS_PORCH support
porch(1), available via sysutils/porch, is an expect(1)-like program
that uses lua instead of tcl for scripting.  Imminent use will be to
execute tests of tty canonicalization to ensure we don't regress some of
the corner cases we've fixed, but tests for other interactive programs
are being considered as well.

PLAIN_TESTS_PORCH is being introduced primarily to get the metadata
right without writing it out for every single test; required_programs
ensures that we skip the tests if the port is not installed.

Reviewed by:	0mp (previous version), ngie
Differential Revision:	https://reviews.freebsd.org/D46805
2024-10-20 20:32:31 -05:00
Martin Matuska
87bf66d4a7 zfs: merge openzfs/zfs@b2f6de7b5
Notable upstream pull request merges:
 #16598 b4e4cbeb2 Always validate checksums for Direct I/O reads
 #16603 cefef28e9 vdev_id: multi-lun disks & slot num zero pad
 #16613 ab777f436 Return boolean_t in inline functions of
                  lib/libspl/include/sys/uio.h
 #16616 efeb60b86 FreeBSD: ignore some includes when not building kernel
 #16617 ca0141f32 zpool/zfs: restore -V & --version options
 #16632 7bf525530 zpool/zfs: allow --json wherever -j is allowed
 #16635 7e4be9275 zdb: fix printf format in dump_zap()
 #16640 48dfe3974 Fallback to strerror() when strerror_l() isn't available
 #16650 38a04f0a7 freebsd: Use compiler.h from FreeBSD's base's linuxkpi
 #16664 fba6a9069 zfs_debug: Restore log size limit for userspace
 #16665 fba6a9069 Fix compile-time warnings caused by duplicate struct
                  typedefs
 #16667 b2f6de7b5 zdb: show bp in uberblock dump

Obtained from:	OpenZFS
OpenZFS commit:	b2f6de7b58
2024-10-20 21:26:56 +02:00
Rob Norris
b2f6de7b58
zdb: show bp in uberblock dump
Just another useful nugget of info in times of strife.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #16667
2024-10-20 10:01:49 -07:00
Konstantin Belousov
6244b9dc4a la57: explain how the trampoline works
Reviewed by:	markj, imp (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
Differential revision:	https://reviews.freebsd.org/D47208
2024-10-20 20:00:23 +03:00
Tomohiro Kusumi
a9851ea3dd
Fix compile-time warnings caused by duplicate struct typedefs
Some compiler/versions warn these typedefs according to #16660.

The platform specific header sys/abd_os.h shouldn't define or use abd_t,
as it's defined in its non-platform specific consumer sys/abd.h.
Do the same as what FreeBSD header does.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Closes #16660 
Closes #16665
2024-10-20 09:43:16 -07:00
Alexander Motin
fba6a90696
zfs_debug: Restore log size limit for userspace
For some reason it was dropped when split from kernel, that makes
raidz_test to accumulate in RAM up to 100GB of logs we don't need.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by:  Rob Norris <robn@despairlabs.com>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by:	Alexander Motin <mav@FreeBSD.org>
Sponsored by:	iXsystems, Inc.
Closes #16492
Closes #16566
Closes #16664
2024-10-20 09:39:05 -07:00
Rob Norris
b85c564161 libspl/backtrace: comment and harden libunwind backtracer
This is the sort of code that we get right once and never look at again.
Anyone reading this code is already likely in the middle of a debugging
nightmare, and then they have a wall of manual string construction and
an unfamiliar and idiosyncratic library to deal with. So, comment the
whole thing to try to make it clear what's going on.

In pursuit of the above, I've added return checks to some of the
libunwind calls, fixed the frame loop to not skip the "top" frame
(however unseful it may be), and fix a couple of calls to
spl_bt_u64_to_hex_str() which requested 18 digits instead of 16.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #16653
2024-10-20 09:36:02 -07:00
Rob Norris
2596a75306 libspl/backtrace: rename and document hex conversion function
Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #16653
2024-10-20 09:36:00 -07:00
Rob Norris
c7e47b3d9a libspl/backtrace: helper macros for output
My eyes are going blurry looking at all those write calls. This is much
nicer.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Close #16653
2024-10-20 09:35:55 -07:00
Rob Norris
0a001f3088 libspl/backtrace: dump registers in libunwind backtraces
More useful stuff, especially when trying to follow a disassembly.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #16653
2024-10-20 09:35:43 -07:00
Mark Johnston
eaab882600 Revert "Reapply "sbin/ping: allow normal users to specify larger packets""
The value of MAXPAYLOAD in the re-applied commit is not right.  Back
this out until it's had a proper review.

This reverts commit b88df1e893.

Requested by:	maxim, glebius
2024-10-20 15:52:28 +00:00
Mark Johnston
3dc6188294 cdefs: Use __has_feature to gate the definition of __nosanitize*
clang 12 does not implement the coverage sanitizer, and the build fails
when __attribute__((no_sanitize("coverage"))) is used.

Try to work around the problem by giving __nosanitize* a non-trivial
definition only when the corresponding sanitizer is actually enabled in
the build.

Tested by reading disassembly of pmap_update_strided() and pmap_enter()
in a kernel compiled with "options COVERAGE", and similar sanity checks
for the other sanitizers.  I also test-booted KASAN and KMSAN kernels in
amd64 bhyve.

Suggested by:	jrtc27
Reviewed by:	imp
Fixes:		a78bacf3b0 ("cdefs: Add __nosanitizecoverage")
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47193
2024-10-20 14:25:30 +00:00
Zhenlei Huang
1c95ec17ca ifconfig: Fix wrong indentation for the status of pfsync(4)
The leading tab is always required, regardless of the configuration of
`syncdev` or `syncpeer`, as `maxupd`, `defer` and `version` all require
it.

Reviewed by:	kp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47112
2024-10-20 22:06:33 +08:00
Martin Matuska
bd66c1b43e libarchive: merge from vendor branch
Libarchive 3.7.7

Security fixes:
 #2158 rpm: calculate huge header sizes correctly
 #2160 util: fix out of boundary access in mktemp functions
 #2168 uu: stop processing if lines are too long
 #2174 lzop: prevent integer overflow
 #2172 rar4: protect copy_from_lzss_window_to_unp() (CVE-2024-20696)
 #2175 unzip: unify EOF handling
 #2179 rar4: fix out of boundary access with large files
 #2203 rar4: fix OOB access with unicode filenames
 #2210 rar4: add boundary checks to rgb filter
 #2248 rar4: fix OOB in delta filter
 #2249 rar4: fix OOB in audio filter
 #2256 fix multiple vulnerabilities identified by SAST
 #2258 cpio: ignore out-of-range gid/uid/size/ino and harden AFIO parsing
 #2265 rar5: clear 'data ready' cache on window buffer reallocs
 #2269 rar4: fix CVE-2024-26256 (CVE-2024-26256)
 #2330 iso: be more cautious about parsing ISO-9660 timestamps
 #2343 tar: clean up linkpath between entries
 #2364 tar: don't crash on truncated tar archives
 #2366 gzip: prevent a hang when processing a malformed gzip inside a gzip
 #2377 tar: fix two leaks in tar header parsing

Important bugfixes:
 #2096 rar5: report encrypted entries
 #2150 xar: fix another infinite loop and expat error handling
 #2173 shar: check strdup return value
 #2161 lha: fix integer truncation on 32-bit systems
 #2338 tar: fix memory leaks when processing symlinks or parsing pax headers
 #2245 7zip: fix issue when skipping first file in 7zip archive that
       is a multiple of 65536 bytes
 #2252 7-zip: read/write symlink paths as UTF-8
 #2259 rar5: don't try to read rediculously long names
 #2290 ar: fix archive entries having no type
 #2360 tar: fix truncation of entry pathnames in specific archives

CVE:		CVE-2024-20696, CVE-2024-26256
PR:		282047 (exp-run)
MFC after:	1 week
2024-10-20 10:24:02 +02:00
Enji Cooper
5ca8c28cd8 contrib/googletest: update from 1.14.0 to 1.15.2
The changes between the two versions can be found in this diff of the
two release tags:
https://github.com/google/googletest/compare/v1.14.0...v1.15.2

One notable change is that GoogleTest 1.15.x now officially requires
C++-14 (1.14.x required C++-11).

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47197

Merge commit '14f7077fed7d82046bdcbe347004132f08aba886'
2024-10-19 18:54:01 -07:00
Enji Cooper
0077477f21 tests/sys/fs/fusefs: include iomanip header
io.cc relies on `std::setw(..)`, which is exported by the iomanip C++
header. Newer versions of GoogleTest don't export this header, so add
the explicit include.

This unbreaks the build with GoogleTest 1.15.2.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47194
2024-10-19 18:50:48 -07:00
Doug Moore
6d42d5dbdd vm_glue: use vm_page_alloc_domain_after
Drop the function vm_page_alloc_domain, used only in
vm_thread_stack_back, and replace it with vm_page_alloc_domain_after
there, with the extra mpred argument either computed on the first
iteration or retrieved from previous iterations. Define a function
vm_page_mpred() for computing that first mpred argument.

Reviewed by:	bnovkov
Differential Revision:	https://reviews.freebsd.org/D47054
2024-10-19 15:22:20 -05:00
Ed Maste
92cd5abb64 membarrier: man page improvements
Reported by:	fernape (in D46967)
Fixes: 1fc766e3b4 ("membarrier: Add manual page")
Sponsored by:	The FreeBSD Foundation
2024-10-19 16:18:18 -04:00
Warner Losh
ef48b2954e stand: Fix defaults file
Currently, quotes in a comment lead to mal-formed lines warnings. Remove
the quotes since it doesn't matter. The underlying bug likely should be
fixed, but since stability week is neigh, workaround this.

Fixes:			7df3e400ea
Sponsored by:		Netflix
Reviewed by:		bcran
Differential Revision:	https://reviews.freebsd.org/D47201
2024-10-19 12:53:41 -06:00
Christos Margiolis
53314e34d5 mididump(1): Use nitems()
Reported by:	kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D47191
2024-10-19 16:34:27 +02:00
Christos Margiolis
feb9ba2993 mididump(1): Use LIBADD instead of LDFLAGS
Reported by:	kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D47190
2024-10-19 16:34:20 +02:00
Christos Margiolis
6e24259590 RELNOTES: Add mididump(1)
Sponsored by:	The FreeBSD Foundation
2024-10-19 16:29:33 +02:00
Mark Johnston
f4e35c044c bus: Set the current VNET in device_attach()
Some drivers, in particular anything which creates an ifnet during
attach, need to have the current VNET set, as if_attach_internal() and
its callees access VNET-global variables.

device_probe_and_attach() handles this, but this is not the only way to
arrive in DEVICE_ATTACH.  In particular, bus drivers may invoke
device_attach() directly, as does devctl2's DEV_ENABLE ioctl handler.
So, set the current VNET in device_attach() instead.

I believe it is always safe to use vnet0, as devctl2 ioctls are not
permitted within a jail.

PR:		282168
Reviewed by:	zlei, kevans, bz, imp, glebius
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47174
2024-10-19 13:03:56 +00:00
John-Mark Gurney
4ad443a106
they have been not true since 2012. 2024-10-18 21:52:51 -07:00
Enji Cooper
1e5e331b1d Correct mergeinfo from 1.14.0 import
This will help ensure that future vendor updates for this component will
be more seamless.

Suggested by:	jtrc27
Fixes:		28f6c2f292
2024-10-18 19:10:07 -07:00
Enji Cooper
92c5681cc3 Revert "Add 'origin/googletest/' from commit '8ef491440fcaec96f899d73e08873426c78583a4'"
I used the wrong prefix for googletest; try again.

This reverts commit a52d355b54, reversing
changes made to bcf81d7794.
2024-10-18 19:07:19 -07:00
Enji Cooper
a52d355b54 Add 'origin/googletest/' from commit '8ef491440fcaec96f899d73e08873426c78583a4'
This helps bootstrap the mergeinfo so future googletest imports can be
done more easily.

Suggested by:	jrtc27
Fixes:	28f6c2f292

git-subtree-dir: origin/googletest
git-subtree-mainline: bcf81d7794
git-subtree-split: 8ef491440f
2024-10-18 19:04:12 -07:00
Enji Cooper
bcf81d7794 contrib/googletest: correct mergeinfo from 1.14.0 import 2024-10-18 18:11:03 -07:00
Enji Cooper
ba23ab2168 Update the expat version referenced in libbsdxml.3
This change updates the version of expat referenced from 2.6.0 to 2.6.3,
correcting documentation post-ffd294a1f4c23863c3e515d16dce31d5509bcb01.

Bump .Dd for the change.

MFC with:	ffd294a1f4
Differential Revision:	https://reviews.freebsd.org/D46865
2024-10-18 17:44:42 -07:00
Jessica Clarke
9684658e35 libc/csu: Unify INIT_RELOCS across architectures
Some architectures don't need any arguments, whilst others need auxargs,
which they get by passing in env thanks to INIT_RELOCS referencing the
local variable in __libc_start1(_gcrt) by name. This is unnecessarily
confusing, fragile (one has to look at INIT_IRELOCS's definition to see
that it uses env) and duplicates code between architectures.

Instead, implement it more like rtld-elf. Each architecture provides an
ifunc_init that takes the auxargs directly, and those that don't need it
can just ignore it.

Reviewed by:	kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D47188
2024-10-19 00:48:52 +01:00
Gleb Smirnoff
b8007cfdb7 mididump: fix gcc build 2024-10-18 14:38:04 -07:00
Kyle Evans
8306900075 cross-build: fix missing <sys/md4.h> the proper way
Add it to tools/build/Makefile with a short note of where it's needed,
rather than hamfistedly copying it into the tools/build hierarchy.

Reported by:	jrtc27
Reviewed by:	jrtc27
Fixes:	aad507854e ("Fix the cross-build after recent commits")
Differential Revision:	https://reviews.freebsd.org/D46854
2024-10-18 15:53:15 -05:00
Jessica Clarke
0bdf2535d4 tools/build/cross-build: Don't include sys/uio.h from linux limits.h
This creates a circular dependency for OpenZFS's libspl in sys/uio.h,
and it shouldn't be needed since the system limits.h already defines
IOV_MAX, so delete it, and unconditionally assert that to be the case.
Otherwise the re-include of libspl's sys/uio.h tries to use PAGESIZE
before it has been defined by OpenZFS's own sys/param.h.

Fixes:		7a7741af18 ("zfs: merge openzfs/zfs@b10992582")
MFC after:	1 week
2024-10-18 21:39:37 +01:00
Gleb Smirnoff
b75e32a466 ipmi: fix powerpc build
Fixes:	366d6a424e
2024-10-18 13:30:44 -07:00
Ka Ho Ng
599c4399e9 libkldelf: use warnx instead of printf
Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46893
2024-10-18 20:21:44 +00:00
Ka Ho Ng
43628a31e3 libkldelf: add elf_lookup_symbol function
The elf_lookup_symbol function looks up the symbol with a given symbol
name. A pointer to the GElf_Sym of the symbol is returned if the symbol
exists in the opened ELF file.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D46764
2024-10-18 20:21:44 +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
Gleb Smirnoff
366d6a424e ipmi: remove timeout from the ipmi_driver_request method
Driver requests are done with stack allocated request.  The request is
put on the tailq and then we msleep(9) until kernel process processes it.
If we timeout from this sleep, the kernel process may still read the
request from our stack, which may already be reused by some other code.

Make this sleep unbound and rely on the kernel process that does all its
I/O with timouts and will eventually wake us up.

Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D47179
2024-10-18 12:30:09 -07:00
Konstantin Belousov
3b2cf9381e amd64: do not pass -z rodynamic to ld.bfd when building vdso
Apparently newer versions of binutils complain instead of silently
ignoring the unknown -z option.

Reported by:	bz
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D47176
2024-10-18 21:48:56 +03:00
Jessica Clarke
d41a40f484 depend-cleanup.sh: Clean up after riscv static binary IFUNC addition
reloc.c is conditionally included by libc_start1.c so existing builds
don't feature it in the .depend file and won't know they need to rebuild
libc_start1.c.

MFC after:	1 week
2024-10-18 19:15:30 +01:00
Jessica Clarke
1363acbf25 libc/csu: Support IFUNCs on riscv
When adding support to rtld-elf I neglected the fact that static
binaries can have IFUNCs. Add support for this too.

Fixes:		729d2b16b7 ("rtld-elf: Support IFUNCs on riscv")
MFC after:	1 week
2024-10-18 19:14:58 +01:00
Gleb Smirnoff
994a82a019 tcp: garbage collect unused macros
Fixes:	d40c0d47cd
2024-10-18 10:35:38 -07:00
Igor Ostapenko
8829d4cb09 pf tests: Lower chances of false positives for mbuf:inet6_in_mbuf_len
Reviewed by:	kp
Approved by:	kp (mentor)
Differential Revision:	https://reviews.freebsd.org/D47175
2024-10-18 16:24:11 +00:00
Cy Schubert
0c2af19e78 unbound: Remove testcode and testdata
The testcode and testdata directories are not used by FreeBSD.
Remove them.

MFC after:	1 week
2024-10-18 07:14:41 -07:00
Cy Schubert
46d2f61818 unbound: Vendor import 1.22.0
Release notes at
	https://nlnetlabs.nl/news/2024/Oct/17/unbound-1.22.0-released/

MFC after:	1 week

Merge commit '0a6d797cf6eb751d7eb613900cd19803e05d905f' into main
2024-10-18 07:14:21 -07:00