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
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
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
Notable upstream pull request merges:
#16598b4e4cbeb2 Always validate checksums for Direct I/O reads
#16603cefef28e9 vdev_id: multi-lun disks & slot num zero pad
#16613ab777f436 Return boolean_t in inline functions of
lib/libspl/include/sys/uio.h
#16616efeb60b86 FreeBSD: ignore some includes when not building kernel
#16617ca0141f32 zpool/zfs: restore -V & --version options
#166327bf525530 zpool/zfs: allow --json wherever -j is allowed
#166357e4be9275 zdb: fix printf format in dump_zap()
#1664048dfe3974 Fallback to strerror() when strerror_l() isn't available
#1665038a04f0a7 freebsd: Use compiler.h from FreeBSD's base's linuxkpi
#16664fba6a9069 zfs_debug: Restore log size limit for userspace
#16665fba6a9069 Fix compile-time warnings caused by duplicate struct
typedefs
#16667b2f6de7b5 zdb: show bp in uberblock dump
Obtained from: OpenZFS
OpenZFS commit: b2f6de7b58
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
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#16660Closes#16665
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#16492Closes#16566Closes#16664
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
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
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
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
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
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
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
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'
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
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
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
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
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
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
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
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
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
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
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
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
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
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