freebsd-dev/sbin/dump
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
..
cache.c
dump.8 dump(8): clarify the recommended use of cache and snapshots 2020-12-28 21:56:58 +00:00
dump.h Clean up global variable declarations in the dump and restore 2020-04-04 00:56:56 +00:00
dumprmt.c Clean up global variable declarations in the dump and restore 2020-04-04 00:56:56 +00:00
itime.c Clean up global variable declarations in the dump and restore 2020-04-04 00:56:56 +00:00
main.c Remove #define _KERNEL hacks from libprocstat 2021-02-21 11:38:21 +02:00
Makefile Move dumpdates creation to CONFS= 2018-07-26 16:45:25 +00:00
Makefile.depend
optr.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
pathnames.h Clean up global variable declarations in the dump and restore 2020-04-04 00:56:56 +00:00
tape.c Clean up some function and variable names. 2020-06-23 21:11:40 +00:00
traverse.c ufs: Rework shortlink handling to avoid subobject overflows 2022-01-02 20:55:36 +00:00
unctime.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00