Commit Graph

5405 Commits

Author SHA1 Message Date
Peter Holm
2d4b1f4b8c stress2: Added a syzkaller reproducer. Enable all reaper tests 2022-06-14 06:59:32 +02:00
Dimitry Andric
56f451bb3b Merge llvm-project release/14.x llvmorg-14.0.5-0-gc12386ae247c
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14.0.5-0-gc12386ae247c, aka 14.0.5 release.

PR:		261742
MFC after:	3 days
2022-06-12 20:53:16 +02:00
Peter Holm
f71b232f31 stress2: Added an explanation to failure mode 2022-06-12 11:52:55 +02:00
Ed Maste
e3709cfe6a Add SPLIT_KERNEL_DEBUG knob
Prior to 9b6edf364e WITHOUT_KERNEL_SYMBOLS split kernel debug data
into standalone debug files at build time, but did not install those
files.  As of 9b6edf364e it stopped splitting the debug data, leaving
it in the kernel and modules (the default kernel configs include
DEBUG=-g).

Revert 9b6edf364e and introduce a new build-time SPLIT_KERNEL_DEBUG
knob, as some people rely on the pre-9b6edf364eb0 WITHOUT_KERNEL_SYMBOLS
behaviour and that was imp's original intent.

PR:		264433
Reviewed by:	eugen, imp
MFC after:	3 weeks
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35437
2022-06-08 17:14:46 -04:00
Ed Maste
92fc5822a8 Clarify WITHOUT_KERNEL_SYMBOLS description
Debug data is enabled via `makeoptions DEBUG=-g` in the kernel config
file (e.g. GENERIC).

If debug data is enabled and WITHOUT_KERNEL_SYMBOLS is set then debug
data is included in the kernel and module files.

PR:		264433
Discussed with:	markj
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-06-07 11:33:12 -04:00
Dimitry Andric
5e383e3603 Add more old clang files to (Optional)ObsoleteFiles.inc
There were a few more libclang_rt libraries added recently, but not yet
listed in the ObsoleteFiles.inc lists.

MFC after:	3 days
2022-06-05 22:45:52 +02:00
Dimitry Andric
809922b010 Update rest of llvm-project build glue for 14.0.4
I completely forgot about updating the generated llvm-project config
files, which also contain version numbers, etc. Sorry for the churn.

PR:		261742
Fixes:		ab9d54731f
MFC after:	3 days
2022-06-05 18:39:43 +02:00
Peter Holm
368852d672 stress2: Updated the exclude list and sorted it 2022-06-01 10:03:23 +02:00
Peter Holm
e14e0a1632 stress2: Added syzkaller reproducers 2022-06-01 10:02:08 +02:00
Peter Holm
4d0adee4e6 stress2: Added procctl(2) PROC_REAP_KILL regression tests 2022-06-01 09:58:28 +02:00
Mark Johnston
f7f387730e src.conf.5: Update the WITHOUT_ZFS description
... to take into account programs and libraries which might implement
some ZFS-specific features without being exclusive to ZFS.

Reviewed by:	emaste
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35337
2022-05-30 10:45:57 -04:00
Dimitry Andric
7b6f5ebef6 Add several sanitizer ignore lists under /usr/lib/clang
Some of the sanitizers from compiler-rt can use ignore lists, which are
loosely modeled on valgrind's example. Upstream provides default lists
for AddressSanitizer, CFI, and MemorySanitizer, so install these in the
expected location, /usr/lib/clang/14.0.3/share.

Reviewed by:	emaste
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D35338
2022-05-28 15:46:38 +02:00
Peter Holm
4581e8e9a2 stress2: Added a syzkaler reproducer 2022-05-27 15:05:33 +02:00
Mateusz Piotrowski
9e4cd857ac Remove referenes to net.inet.tcp.local_slowstart_flightsize
Fixes:	9ec4a4cca5 Remove the ss_fltsz and ss_fltsz_local
2022-05-24 16:04:57 +02:00
Mateusz Piotrowski
af33f52b6c Remove remaining net.tcp.inflight* references from src
Fixes:	d8b03e05a9 The inflight bandwidth limiter was removed in
r212765.
2022-05-24 15:49:03 +02:00
Dimitry Andric
3a9a9c0ca4 Merge llvm-project release/14.x llvmorg-14.0.3-0-g1f9140064dfb
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14.0.3-0-g1f9140064dfb.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:46:42 +02:00
Dimitry Andric
1fd87a682a Merge llvm-project main llvmorg-14-init-18294-gdb01b123d012
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-18294-gdb01b123d012, the last commit before
the upstream release/14.x branch was created.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:44:47 +02:00
Dimitry Andric
04eeddc0aa Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:44:34 +02:00
Dimitry Andric
4824e7fd18 Merge llvm-project main llvmorg-14-init-11187-g222442ec2d71
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-11187-g222442ec2d71.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:43:49 +02:00
Dimitry Andric
5e801ac66d Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:43:32 +02:00
Peter Holm
13aacd0c0c stress2: Added a test scenario 2022-05-08 09:54:54 +02:00
Joseph Mingrone
4b3bf90900
mfc-candidates.sh: Set default target branch for ports
Approved by:	emaste, jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D35096
2022-05-04 16:43:20 -03:00
Ed Maste
729ee78911 Remove stray .Pp from WITH_LOADER_EFI_SECUREBOOT description
MFC after:	3 days
Fixes:		13ea0450a9 ("Extend libsecureboot(old libve) to...")
Sponsored by:	The FreeBSD Foundation
2022-05-02 15:43:36 -04:00
Ed Maste
b7f53cdcf8 Update UNIFIED_OBJDIR descriptions
src.conf(5) previously stated they would be removed before FreeBSD 12.0,
but that did not happen.  Change it to "a future version of FreeBSD."

Also pick up LOADER_KBOOT change (enabled on x86) in src.conf regen.

Reported by:	jhb
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-05-02 14:02:31 -04:00
Ed Maste
60b08330a5 Correct markup in WITH_/WITHOUT_UNIFIED_OBJDIR descriptions
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2022-04-30 15:40:49 -04:00
Ed Maste
f768ecf247 Update WITH_PROFILE description as it is yet removed
GCC still wants to link against (for example) libc_p.a when -pg is in
use, and it's unclear when and how this will be addressed.  Change the
WITH_PROFILE option description to claim that it may be removed from an
unspecified future version of FreeBSD, rather than FreeBSD 14.

Reported by:	Steve Kargl
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2022-04-30 15:35:01 -04:00
Peter Holm
014a2b1a11 stress2: Fixed cleanup path error 2022-04-29 10:55:26 +02:00
Ed Maste
1a50bf77af Add a tool to find MFC candidates
usage: mfc-candidates.sh [-ah] [-f from_branch] [-t to_branch]
    [-u user] [-X exclude_file] [path ...]

This tool compares git commit hashes that are in from_branch and not in
to_branch with hashes listed in "cherry picked from" lines, finding
commits that may be MFC candidates.  By default it searches for commits
by ${USER} but that can be overridden with -u for a specific user or -a
for all.

gonzo@'s MFC tracker is a web application that presents this sort of
information in a more convenient way, and unlike this script it tracks
"MFC After" status and timing.  However, it is sometimes useful to be
able to perform an offline search against a local repo.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34208
2022-04-28 14:02:26 -04:00
Peter Holm
8a5c1f58dd stress2: Added a regression test 2022-04-28 09:41:27 +02:00
Peter Holm
29acff870b stress2: Added a syzkaller reproducer 2022-04-22 06:20:14 +02:00
Baptiste Daroussin
e87ec409fa locales: Update to CLDR 41.0 and Unicode 14.0
Relnotes:	yes
2022-04-21 14:16:40 +02:00
Peter Holm
af333da506 Added a test to the exclude list 2022-04-16 09:15:00 +02:00
Peter Holm
eaa3e829f0 stress2: Added a regression test 2022-04-16 09:14:36 +02:00
Peter Holm
1346766f60 stress2: Permanently disable disruptive tests 2022-04-14 06:57:24 +02:00
Ed Maste
4294299843 nanobsd: update ssh config files after 1323ec5712
Sponsored by:	The FreeBSD Foundation
2022-04-13 17:04:51 -04:00
Peter Holm
2f0baec1ec stress2: Fix cleanup after test run 2022-04-13 11:07:49 +02:00
Peter Holm
b06e3f990d stress2: Added comment 2022-04-13 11:04:36 +02:00
Peter Holm
4523edbeae stress2: Remove working tests from the exclude list 2022-04-13 11:03:32 +02:00
Peter Holm
40b97c41bc stress2: Add new write(2) test. Remove sctp.sh after problem fixed 2022-04-06 07:25:17 +02:00
Peter Holm
b5c60bb85b stress2: Added a write(2) fuzz test scenario 2022-04-06 07:24:42 +02:00
Peter Holm
7c1baa8ab3 stress2: Added a syzkaller reproducer 2022-04-05 10:47:27 +02:00
Peter Holm
88b3e65fcf stress2: Added a test to the exclude file 2022-04-03 11:12:24 +02:00
Ed Maste
7bfe5e4515 Apply some style(9) to pthread tests
Reported by:	kib
Fixes:		ef135466f8 ("Clean up warnings in pthread tests")
Sponsored by:	The FreeBSD Foundation
2022-03-31 21:37:57 -04:00
Gordon Bergling
eec4f5c034 pkgbase: Fix a typo in a source code comment
- s/begining/beginning/

MFC after:	3 days
2022-03-28 19:33:25 +02:00
Peter Holm
7afec5182a stress2: Enable four quota tests, which now seems to run without issues 2022-03-28 10:44:51 +02:00
Mateusz Guzik
abb5b512bb depend-cleanup.sh: Handle libc bcmp.c moving back to bcmp.S on amd64 2022-03-26 09:11:31 +00:00
John Baldwin
45c4ff15e3 depend-cleanup.sh: Handle libc bcmp.S moving to bcmp.c on amd64.
Reviewed by:	emaste
Fixes:		5fc3cc2713 ("amd64: make bcmp in libc just call memcmp")
Differential Revision:	https://reviews.freebsd.org/D34676
2022-03-25 11:03:18 -07:00
Brooks Davis
44b36b80f5 test-includes: improve portability
FreeBSD's shell permits [^bar] to match characters not in [bar] like
common regular expressions. This is non-portable and '!' should be
used in place of '^' for portability.

Reported by:	Nathaniel Wesley Filardo
Issue:		https://github.com/CTSRD-CHERI/cheribsd/issues/1321
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D34597
2022-03-22 20:23:22 +00:00
Peter Holm
314ebfa2e9 stress2: Limit console warnings 2022-03-18 07:34:07 +01:00
Peter Holm
bfdcd042bc stress2: Remove the memory disk after the fsck, not before 2022-03-18 07:28:58 +01:00
Mateusz Piotrowski
5ffaf7957f tools/tools/README: Remove tinybsd entry
Fixes:	0c7a642ae8 tinybsd: Remove
2022-03-15 13:06:53 +01:00
Peter Holm
0977ebb071 stress2: A unmount of a unionfs file system may return EBUSY. 2022-03-15 10:24:55 +01:00
Peter Holm
9e8fbb95b3 stress2: A unmount of a unionfs file system may return EBUSY. 2022-03-15 09:35:22 +01:00
Hans Petter Selasky
16346e1401 usbtest: Fix issue when multiple devices are sharing same USB vendor and product ID.
When there are multiple devices sharing the same USB vendor and product ID,
the wrong device may be selected. Fix this by also matching the bus and
device address, ugen<X>.<Y> .

MFC after:	1 week
Sponsored by:	NVIDIA Networking
2022-03-13 15:18:17 +01:00
Peter Holm
fa99b3cf87 stress2: Fix typo in exclude names 2022-03-08 11:29:17 +01:00
Peter Holm
221c6f86f0 stress2: Exclude a few test. 2022-03-08 11:20:51 +01:00
Mark Johnston
2d5d2a986c ctf: Import ctf.h from OpenBSD
Use it instead of the existing ctf.h from OpenSolaris.  This makes it
easier to use CTF in the core kernel, and to extend the CTF format to
support wider type IDs.

The imported ctf.h is modified to depend only on _types.h, and also to
provide macros which use the "parent" bit of a type ID to refer to types
in a parent CTF container.

No functional change intended.

Reviewed by:	Domagoj Stolfa, emaste
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34358
2022-03-07 10:43:18 -05:00
Peter Holm
2051171287 stress2: Added a new test scenario checing for a long fsck_ffs runtime 2022-03-04 12:06:45 +01:00
Peter Holm
70cb626635 stress2: Reworked and cleaned up this test scenaio. 2022-03-03 14:29:18 +01:00
Jessica Clarke
17160f21ef install-boot.sh: Avoid - in function names for POSIX compatibility
FreeBSD sh supports this but other common POSIX shells do not; in
particular, dash does not, unlike bash and zsh. This allows the script
to be used on non-FreeBSD systems for release media building.

Reviewed by:	emaste, brooks
Differential Revision:	https://reviews.freebsd.org/D34000
2022-02-28 22:37:21 +00:00
Warner Losh
5e2de1c116 test-includes: temporarily add back net/pfvar.h
net/pfvar.h is installed unconditionally, but depends on files that are
installed conditionally. Until that can be sorted out, temporarily add
this back to badfiles.inc to cope with MK_PF=no failing.

Sponsored by:		Netflix
2022-02-23 17:56:02 -07:00
Peter Holm
1408672965 stress2: Added cleanup on error 2022-02-22 12:07:45 +01:00
Ed Maste
ef135466f8 Clean up warnings in pthread tests
I intend to move these into lib/libthr/tests/ and connect to kyua.  This
is a first step to address warnings emitted when building using standard
make infrastructure.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34306
2022-02-16 16:28:31 -05:00
Peter Holm
87000c893c stress2: Finish work on two gunion(8) test scenarios 2022-02-16 10:20:39 +01:00
Mark Johnston
99589993ce git-arc: Fix review title matching
Properly handle the case where the title of one commit is a suffix or
prefix of the title of a second commit, and one wishes to create reviews
for both.

Reported by:	chuck
2022-02-14 10:06:47 -05:00
Peter Holm
91f821f8e4 stress2: Add a fsck_ffs regression test scenario 2022-02-13 10:49:58 +01:00
Kirk McKusick
6fbbb48063 stress2: Added a tool to zero out a superblock check hash. 2022-02-13 10:47:20 +01:00
Peter Holm
f0000eb41d stress2: Added a regression test
PR:     261707
2022-02-11 09:47:25 +01:00
Jose Luis Duran
0853415963 nanobsd: Recursively copy fat partition
We have a directory structure for the FAT partition now with EFI and DTC
overlays, so we need to recursively copy it.

Differential Revision: https://reviews.freebsd.org/D34241
2022-02-10 12:43:19 -07:00
John Baldwin
c00d345665 Install unwind.h into /usr/include
Install headers from LLVM's libunwind in place of the headers from
libcxxrt and allow C applications to use the library.

As part of this, remove include/unwind.h and switch libthr over to
using the installed unwind.h.

Reviewed by:	dim, emaste
MFC after:	10 days
Differential Revision: https://reviews.freebsd.org/D34065
2022-02-10 19:00:32 +01:00
Warner Losh
5ae6cc0011 test-includes: Simplify $OBJDIR requirements
s=/=_=g in tested names so that all the objects live in $OBJDIR. This is
more robust than depending on side effects of auto OBJDIR features and
should fix buildworld issues some people have seen.

Suggested by:	sjg@
Sponsored by:	Netflix
2022-02-08 17:23:43 -07:00
Peter Holm
675758f7c2 stress2: Updated test with problem found and mark it as a "no run" 2022-02-08 07:51:35 +01:00
Warner Losh
c00673ea1e nanobsd: Stop copying ubldr
manu@ removed support for loading ubldr* from uboot last year. No need
to copy them to the image. This may be needed for some 32-bit platforms
in theory, but those platforms weren't ever the target for nanobsd that
I'm aware of. Should there be platforms where this is used, we can add
it to building those platforms.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D34191
2022-02-07 13:15:03 -07:00
Wolfram Schneider
e515b9b44c update external URL 2022-02-05 20:04:00 +00:00
Peter Holm
28e0b888fe stress2: Fix compiler warnings 2022-02-05 09:51:11 +01:00
Peter Holm
8d72c409cd stress2: Fix "set but not used [-Wunused-but-set-variable]" warnings 2022-02-03 11:52:38 +01:00
Peter Holm
656194f140 stress2: Finish work on a unionfs test scenario. Enable three unionfs tests 2022-02-03 08:04:56 +01:00
Peter Holm
612d42e5dc stress2: Added a regresson test
Submitted by: Andriy Gapon <avg@FreeBSD.org>
2022-01-28 12:23:22 +01:00
Mark Johnston
ddf312e8d7 tools/build: Fix the error message used when a host tool is not present
MFC after:	1 week
2022-01-26 15:34:21 -05:00
John Baldwin
4f0e50b293 atsectl: Remove.
This was used in the BERI Altera DE4 that ran CHERI MIPS.

Approved by:	brooks
2022-01-24 16:40:02 -08:00
Ed Maste
6f6fbfa3a8 Remove quotes around Makefile .error/.warn/.info strings
The text after .error et al is emitted verbatim.

Reviewed by:	sjg
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33904
2022-01-22 14:03:07 -05:00
Stefan Eßer
f89afaa148 port_conflicts_check.lua: revert commit 82bfeeff10
An enhanced version of this script has been committed to the ports
repository as /usr/ports/Tools/scripts/port_conflicts_check.lua.
2022-01-22 13:08:15 +01:00
John Baldwin
77da558ceb check/delete-old: Auto-generate lib32 entries for libraries.
- Add usr/lib32/libfoo.so.N for lib/libfoo.so.N.

- Add usr/lib32/foo for usr/lib/foo.

- Treat casper libraries special since they are installed to
  /usr/lib32 instead of /usr/lib32/casper and thus map
  usr/lib/casper/foo to usr/lib32/foo.

Note that OLD_DIRS and MOVED_LIBS entries are not duplicated, only
OLD_FILES and OLD_LIBS.

Reviewed by:	imp, emaste
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33324
2022-01-20 14:09:57 -08:00
John Baldwin
c96dfb2156 Rework documentation of OLD_*.
- Be more explicit in the difference between OLD_DIRS and OLD_FILES
  (the former is only in delete-old-libs whereas the latter is in
  delete-old).

- Document that debug symbols in /usr/lib/debug/ for files in
  OLD_FILES and OLD_LIBS are removed as well.

Reviewed by:	emaste
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33847
2022-01-20 12:46:29 -08:00
Peter Holm
90c5fd4875 stress2: Added a regression test 2022-01-16 07:48:55 +01:00
Peter Holm
5691cbec52 stress2: Added one more unionfs test 2022-01-16 07:33:45 +01:00
Peter Holm
3266a0c5d5 stress2: Added a new unionfs test scenario 2022-01-15 10:21:29 +01:00
Stefan Eßer
82bfeeff10 tools/portconflicts/port_conflicts_check.lua: detect port conflicts
This tool can be used to detect install conflicts (ports/packages that
conflict with each other because of identically named files).

MFC after:	3 days
2022-01-13 22:36:09 +01:00
Peter Holm
b1ddfd080a stress2: Updated the exclude list 2022-01-13 08:08:33 +01:00
Peter Holm
48031e6caf stress2: Added two new tests 2022-01-13 08:08:05 +01:00
Peter Holm
6b0ab59570 stress2: Added timeout to test. Added cleanup. 2022-01-13 08:07:25 +01:00
Jason A. Harmening
a565cc81c0 unionfs: add stress2 scenarios for write references
Add some test cases, based on the existing nullfs10 scenario, to
ensure that unionfs write references are propagated between the
unionfs and underlying vnodes, including unionfs copy-on-write
operations

Reviewed by: kib (prior version), markj, pho
Differential Revision: https://reviews.freebsd.org/D33729
2022-01-11 18:44:03 -08:00
John Baldwin
ebc1c24695 Remove redundant OLD_FILES entries for debug symbols.
Entries for foo.debug files matching an existing entry in OLD_FILES or
OLD_LIBS are unnecessary as they are auto-generated.

Reviewed by:	imp, emaste
Sponsored by:	The University of Cambridge, Google Inc.
Differential Revision:	https://reviews.freebsd.org/D33777
2022-01-11 11:38:45 -08:00
Andriy Gapon
7e8ed296e1 schedgraph.py: port to Python 3
The change does not preserve compatibility with Python 2.7.

MFC after:	4 weeks
Differential Revision:	https://reviews.freebsd.org/D33626
2022-01-11 15:32:39 +02:00
Peter Holm
bf48a958ad stress2: Aded two msdos FS fuzzer tests 2022-01-08 07:11:10 +01:00
Warner Losh
ef1b9270da net/if_pfsync.h: Add back to bad files
This file does not build for WITHOUT_PF sometimes. Looking at various
ways to cope (it exposes other issues too), but in the mean time just
add it back here to unbreak WITHOUT_PF in some scenarios.

Sponsored by:		Netflix
2022-01-07 09:39:13 -07:00
John Baldwin
78beb051a2 cryptocheck: Add aliases for algs with multiple key sizes.
Previously algorithms such as AES-CBC would provide an algorithm
without a key size for the smallest key size and additional algorithms
with an explicit key size, e.g. "aes-cbc" (128 bits), "aes-cbc192",
and "aes-cbc256".

Instead, always make the key size name explicit and reuse the
"generic" name to request running tests against all of the key sizes.
For example, for AES-CBC this means "aes-cbc128" is now the name of
the variant with a 128-bit key and "aes-cbc" runs tests of AES-CBC
with all three key sizes.

This makes it easier to run tests on all combinations of ciphers like
AES-GCM or AES-CCM with -z in a single invocation.

Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33759
2022-01-06 14:46:50 -08:00
Peter Holm
dfc383201f stress2: Added new test cases 2022-01-05 10:27:29 +01:00
Kristof Provost
aa70361d86 headers: make a few more headers self-contained
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2022-01-03 10:12:30 +01:00
Jessica Clarke
5b13fa7987 ufs: Rework shortlink handling to avoid subobject overflows
Shortlinks occupy the space of both di_db and di_ib when used. However,
everywhere that wants to read or write a shortlink takes a pointer do
di_db and promptly runs off the end of it into di_ib. This is fine on
most architectures, if a little dodgy. However, on CHERI, the compiler
can optionally restrict the bounds on pointers to subobjects to just
that subobject, in order to mitigate intra-object buffer overflows, and
this is enabled in CheriBSD's pure-capability kernels.

Instead, clean this up by inserting a union such that a new di_shortlink
can be added with the right size and element type, avoiding the need to
cast and allowing the use of the DIP macro to access the field. This
also mirrors how the ext2fs code implements extents support, with the
exact same structure other than having a uint32_t i_data[] instead of a
char di_shortlink[].

Reviewed by:	mckusick, jhb
Differential Revision:	https://reviews.freebsd.org/D33650
2022-01-02 20:55:36 +00:00