HardenedBSD/src 03b193econtrib/ncurses/progs infocmp.c, sys/contrib/openzfs/include/os/freebsd/spl/sys cmn_err.h kmem.h

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+8-8sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h
+2-2sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem.h
+2-2sys/crypto/chacha20/chacha.c
+2-2sys/contrib/openzfs/include/sys/spa.h
+1-1contrib/ncurses/progs/infocmp.c
+1-1sys/contrib/openzfs/include/sys/vdev.h
+16-161 files not shown
+17-177 files

HardenedBSD/src b66d62esys/contrib/openzfs/include/os/freebsd/spl/sys cmn_err.h kmem.h, sys/contrib/openzfs/include/sys spa.h vdev.h

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+8-8sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h
+2-2sys/contrib/openzfs/include/sys/spa.h
+2-2sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem.h
+2-2sys/crypto/chacha20/chacha.c
+1-1sys/contrib/openzfs/include/sys/vdev.h
+1-1sys/contrib/openzfs/include/sys/zfs_debug.h
+16-161 files not shown
+17-177 files

HardenedBSD/src bcd9ea8sys/contrib/openzfs/include/os/freebsd/spl/sys cmn_err.h kmem.h, sys/contrib/openzfs/include/sys spa.h vdev.h

zfs: rename several printf attribute declarations to __printf__

For kernel builds, we redefine `__printf__` to `__freebsd_kprintf__`, to
support FreeBSD kernel printf(9) extensions with clang.

In OpenZFS various printf related functions are declared with
__attribute__((format(printf, X, Y))), so these won't work with the
above redefinition. With clang 21 and higher, this leads to errors
similar to:

    sys/contrib/openzfs/module/zfs/spa_misc.c:414:38: error: passing 'printf' format string where 'freebsd_kprintf' format string is expected [-Werror,-Wformat]
      414 |         (void) vsnprintf(buf, sizeof (buf), fmt, adx);
          |                                             ^

Since attribute names can always be spelled with leading and trailing
double underscores, rename these instances.

Note that in FreeBSD proper we usually use `__printflike` from
<sys/cdefs.h>, but that does not apply to OpenZFS.

    [4 lines not shown]
DeltaFile
+8-8sys/contrib/openzfs/include/os/freebsd/spl/sys/cmn_err.h
+2-2sys/contrib/openzfs/include/os/freebsd/spl/sys/kmem.h
+2-2sys/contrib/openzfs/include/sys/spa.h
+1-1sys/contrib/openzfs/include/sys/vdev.h
+1-1sys/contrib/openzfs/include/sys/zfs_debug.h
+14-145 files

HardenedBSD/src 667259bcontrib/ncurses/progs infocmp.c

ncurses: avoid warnings about too-long initializer strings

Increase the size of `assoc::from` to 8 bytes, to avoid warnings from
clang 21 similar to:

    contrib/ncurses/progs/infocmp.c:702:10: error: initializer-string for character array is too long, array size is 4 but initializer has size 5 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
      702 |     DATA("\033[2J", "ED2"),     /* clear page */
          |          ^~~~~~~~~
    contrib/ncurses/progs/infocmp.c:716:10: error: initializer-string for character array is too long, array size is 4 but initializer has size 5 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
      716 |     DATA("\033[!p", "DECSTR"),  /* soft reset */
          |          ^~~~~~~~~

Reviewed by:    markj
Obtained from:  https://invisible-island.net/archives/ncurses/6.5/ncurses-6.5-20241207.patch.gz
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D54371
DeltaFile
+1-1contrib/ncurses/progs/infocmp.c
+1-11 files

HardenedBSD/src 710ec40sys/crypto/chacha20 chacha.c

crypto: avoid warnings about too-long initializer strings

Mark `sigma` and `tau` as `__non_string`, to avoid warnings from clang
21 similar to:

    sys/crypto/chacha20/chacha.c:53:31: error: initializer-string for character array is too long, array size is 16 but initializer has size 17 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
       53 | static const char sigma[16] = "expand 32-byte k";
          |                               ^~~~~~~~~~~~~~~~~~
    sys/crypto/chacha20/chacha.c:54:29: error: initializer-string for character array is too long, array size is 16 but initializer has size 17 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
       54 | static const char tau[16] = "expand 16-byte k";
          |                             ^~~~~~~~~~~~~~~~~~

MFC after:      3 days
Reviewed by:    markj
Differential Revision: https://reviews.freebsd.org/D54364
DeltaFile
+2-2sys/crypto/chacha20/chacha.c
+2-21 files

HardenedBSD/src 1f62835lib/libsys ioctl.2, share/man/man5 src.conf.5

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+39-25sys/vm/vm_object.c
+30-14sys/vm/vm_map.c
+4-4share/man/man5/src.conf.5
+7-1sys/vm/vm_object.h
+3-3tools/build/options/WITH_REPRODUCIBLE_PATHS
+4-1lib/libsys/ioctl.2
+87-488 files not shown
+94-5514 files

HardenedBSD/src 86758c5sys/vm vm_object.c vm_map.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+39-25sys/vm/vm_object.c
+30-14sys/vm/vm_map.c
+7-1sys/vm/vm_object.h
+76-403 files

HardenedBSD/src 436b566contrib/xz ChangeLog THANKS, contrib/xz/src/common my_landlock.h

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+1,586-0contrib/xz/ChangeLog
+226-208contrib/xz/THANKS
+34-45contrib/xz/src/liblzma/common/stream_decoder_mt.c
+72-0contrib/xz/src/xz/hardware.c
+44-1contrib/xz/src/common/my_landlock.h
+18-20contrib/xz/src/liblzma/api/lzma/container.h
+1,980-27427 files not shown
+2,088-34233 files

HardenedBSD/src b9028a7contrib/xz ChangeLog THANKS, contrib/xz/src/common my_landlock.h

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+1,586-0contrib/xz/ChangeLog
+226-208contrib/xz/THANKS
+34-45contrib/xz/src/liblzma/common/stream_decoder_mt.c
+72-0contrib/xz/src/xz/hardware.c
+44-1contrib/xz/src/common/my_landlock.h
+18-20contrib/xz/src/liblzma/api/lzma/container.h
+1,980-27427 files not shown
+2,088-34233 files

HardenedBSD/src 353ba3bsys/vm vm_object.c

vm_object_coalesce(): do not account holes twice

alc wrote:
Suppose that the object is OBJ_ONEMAPPING and that we, in fact,
have a single mapping to it. Then, we punch a hole in that mapping.
vm_map_entry_delete() only subtracts from the object's charge when
we shrink the size of the object. Now, suppose that we perform
mmap(MAP_ANON) to reallocate some of the hole. Aren't we going to add to
the charge here, even though vm_map_entry_delete() never subtracted from
the charge for the hole that was created?

Only account the change in the charged object size that was added to it.

Noted by:       alc
Reviewed by:    alc, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54263
DeltaFile
+7-4sys/vm/vm_object.c
+7-41 files

HardenedBSD/src 7685aaesys/vm vm_map.c vm_object.c

vm_object_coalesce(): return swap reservation back if overcharged

It is possible for both vm_map_insert() and vm_object_coalesce() to charge
both for the same region.  The issue is that vm_map_insert() must charge
in advance to ensure that the mapping would not exceed the swap limit,
but then the coalesce might decide to extend the object, and already
(partially) backs the mapped region.

Handle this by passing to vm_object_coalesce() exact information about
the charging mode of the extending range 'not charging', 'charged' using
flags instead of simple boolean.  In vm_object_coalesce(), detect
overcharge and undo it if needed.

Note that this relies on vm_object_coalesce() call being the last action
in vm_map_insert() before extending the previous map entry.

Reported and tested by: pho
Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation

    [2 lines not shown]
DeltaFile
+30-14sys/vm/vm_map.c
+31-10sys/vm/vm_object.c
+7-1sys/vm/vm_object.h
+68-253 files

HardenedBSD/src e7053d9sys/vm vm_object.c

vm_object_coalesce(): simplify common expression

Add the next_end variable to replace commonly occuring the
next_pindex + next_size expression.

Suggested by:   alc
Reviewed by:    alc, markj
Tested by:      pho
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54263
DeltaFile
+7-6sys/vm/vm_object.c
+7-61 files

HardenedBSD/src efcb109sys/vm vm_object.c

vm_object_coalesce(): remove commented out code

Reviewed by:    alc, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D54263
DeltaFile
+1-12sys/vm/vm_object.c
+1-121 files

HardenedBSD/src 07700b0contrib/xz ChangeLog THANKS, contrib/xz/src/common my_landlock.h

MFV 762f11d98d5cd57ebbe85c36e9e86a557a91fe4e: xz 5.8.2.

(cherry picked from commit ae12432049e7873ab3912643ae5d08297b8cbc49)
DeltaFile
+1,586-0contrib/xz/ChangeLog
+226-208contrib/xz/THANKS
+34-45contrib/xz/src/liblzma/common/stream_decoder_mt.c
+72-0contrib/xz/src/xz/hardware.c
+44-1contrib/xz/src/common/my_landlock.h
+18-20contrib/xz/src/liblzma/api/lzma/container.h
+1,980-27427 files not shown
+2,088-34233 files

HardenedBSD/src 4e48e50contrib/xz ChangeLog THANKS, contrib/xz/src/common my_landlock.h

MFV 762f11d98d5cd57ebbe85c36e9e86a557a91fe4e: xz 5.8.2.

(cherry picked from commit ae12432049e7873ab3912643ae5d08297b8cbc49)
DeltaFile
+1,586-0contrib/xz/ChangeLog
+226-208contrib/xz/THANKS
+34-45contrib/xz/src/liblzma/common/stream_decoder_mt.c
+72-0contrib/xz/src/xz/hardware.c
+44-1contrib/xz/src/common/my_landlock.h
+18-20contrib/xz/src/liblzma/api/lzma/container.h
+1,980-27427 files not shown
+2,088-34233 files

HardenedBSD/src 00b5225share/mk src.opts.mk bsd.opts.mk

HBSD: Resolve merge conflicts

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+0-4share/mk/src.opts.mk
+0-4share/mk/bsd.opts.mk
+0-82 files

HardenedBSD/src 2d2e068contrib/kyua/doc kyua-test.1.in, lib/libsys ioctl.2

Merge remote-tracking branch 'origin/freebsd/current/main' into hardened/current/master

Conflicts:
        share/mk/bsd.opts.mk (unresolved)
        share/mk/src.opts.mk (unresolved)
DeltaFile
+4-4share/man/man5/src.conf.5
+3-3tools/build/options/WITH_REPRODUCIBLE_PATHS
+4-1lib/libsys/ioctl.2
+5-0share/mk/bsd.opts.mk
+3-0share/mk/src.opts.mk
+1-1contrib/kyua/doc/kyua-test.1.in
+20-95 files not shown
+25-1411 files

HardenedBSD/src 2b5f033sys/compat/linuxkpi/common/include/linux compiler.h, sys/sys cdefs.h

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+13-0sys/sys/cdefs.h
+2-0sys/compat/linuxkpi/common/include/linux/compiler.h
+15-02 files

HardenedBSD/src 85e0cdesys/sys cdefs.h

cdefs: Add __deprecated1 which accepts a message as an argument

This message will be included in any warning issued by the compiler
for use of the deprecated function.

Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D47701

(cherry picked from commit 6da04bcff9efedeae7d4046553002b9e3b2bc24f)
DeltaFile
+1-0sys/sys/cdefs.h
+1-01 files

HardenedBSD/src 4ff445dsys/compat/linuxkpi/common/include/linux compiler.h, sys/sys cdefs.h

cdefs: Add __deprecated

Add __deprecated decorator. This is for a deprecated interface. copystr
is tagged with this today in copy(9), but don't actually provide it or
use it. copystr is a #define so adding it will have to wait.

LinuxKPI was defining this away completely in compiler.h. Since this is
shared between Linux KPI consumers and OpenZFS, if it's already defined,
use the FreeBSD sys/cdefs.h version, otherwise define it away. For
OpenZFS this will retain it, while for Linux KPI it will tend to drop it
(I think always, but I didn't look at everything).

Sponsored by:           Netflix
Reviewed by:            jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D46137

(cherry picked from commit 16672453f12586703f1c51d909bd1900691bf884)
DeltaFile
+2-0sys/compat/linuxkpi/common/include/linux/compiler.h
+1-0sys/sys/cdefs.h
+3-02 files

HardenedBSD/src c4290c3sys/sys cdefs.h

sys/cdefs.h: add __noexcept and __noexcept_if

These macros provide the C++11 noexcept and noexcept(...) keywords if
we're compiling in a C++11 environment.  Otherwise, they expand to an
empty string.

This will be used to add the required noexcept specifier to several libc
functions as required in C++11.

MFC after:      2 weeks

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1085

(cherry picked from commit 02b0d4b688cc4deb14cb6e7534a2a4958e48b753)
DeltaFile
+11-0sys/sys/cdefs.h
+11-01 files

HardenedBSD/src 8e95158share/man/man5 src.conf.5, tools/build/options WITH_REPRODUCIBLE_PATHS

Fix typo in tools/build/options/WITH_REPRODUCIBLE_PATHS

Fixes:          faeaa25f5624
DeltaFile
+4-4share/man/man5/src.conf.5
+3-3tools/build/options/WITH_REPRODUCIBLE_PATHS
+7-72 files

HardenedBSD/src 660416fshare/mk bsd.opts.mk src.opts.mk

Move MK_REPRODUCIBLE_PATHS to bsd.opts.mk

In commit faeaa25f5624 MK_REPRODUCIBLE_PATHS was introduced, but some
ports that include bsd.debug.mk then started to fail with:

    make: /usr/share/mk/bsd.debug.mk:19: Variable "MK_REPRODUCIBLE_PATHS" is undefined
            in /usr/share/mk/bsd.lib.mk:525
            in /wrkdirs/usr/ports/devel/libsysinfo/work/libsysinfo-0.0.3/Makefile:16
    make: Fatal errors encountered -- cannot continue

This is because bsd.debug.mk includes bsd.opts.mk, not src.opts.mk. Move
the MK_REPRODUCIBLE_PATHS option to bsd.opts.mk to fix this.

Reviewed by:    imp, emaste
Fixes:          faeaa25f5624
DeltaFile
+1-0share/mk/bsd.opts.mk
+0-1share/mk/src.opts.mk
+1-12 files

HardenedBSD/src bbaa7d6contrib/kyua/doc kyua-report.1.in kyua-test.1.in

kyua manuals: Correct --results-file short form

PR:             290647
Ref:            kyua/cli/common.cpp#104
MFC after:      3 days
Reviewed by:    ziaee
Closes:         https://github.com/freebsd/kyua/issues/267
DeltaFile
+1-1contrib/kyua/doc/kyua-report.1.in
+1-1contrib/kyua/doc/kyua-test.1.in
+1-1contrib/kyua/doc/kyua-db-migrate.1.in
+1-1contrib/kyua/doc/kyua-db-exec.1.in
+1-1contrib/kyua/doc/kyua-report-html.1.in
+1-1contrib/kyua/doc/kyua-report-junit.1.in
+6-66 files

HardenedBSD/src 4a28869usr.sbin/unbound/daemon Makefile

HBSD: Disable SafeStack for the Unbound daemon

When Unbound is built with SafeStack, attempts to kill the running
daemon process with SIGTERM does not kill the process. Instead, the
daemon stops responding.

Signed-off-by:  Shawn Webb <shawn.webb at hardenedbsd.org>
Reported-by:    @northboot
issue:          #110
MFC-to:         15-STABLE
(cherry picked from commit ee472934f961f24a1c4dee56e7bd8dbb0e50ce13)
Signed-off-by: Shawn Webb <shawn.webb at hardenedbsd.org>
DeltaFile
+1-0usr.sbin/unbound/daemon/Makefile
+1-01 files

HardenedBSD/src e2afbc4lib/libsys ioctl.2

ioctl.2: Mention EACCES

ioctls can fail with EACCES, see sys/kern/tty.c

PR:                     239504
MFC after:              3 days
Reviewed by:            ziaee
Reported by:            Brennan Vincent <brennan at umanwizard.com>
Differential Revision:  https://reviews.freebsd.org/D49072
DeltaFile
+4-1lib/libsys/ioctl.2
+4-11 files

HardenedBSD/src d42db81lib/geom/part geom_part.c, lib/libc/gen uexterr_format.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+72-14lib/libc/stdlib/Makefile.inc
+79-6sys/compat/linuxkpi/common/src/linux_80211.c
+64-7lib/libc/gen/uexterr_format.c
+40-29lib/geom/part/geom_part.c
+68-0lib/libc/stdlib/tdestroy.c
+65-0lib/libc/tests/stdlib/tsearch_test.c
+388-5626 files not shown
+571-9132 files

HardenedBSD/src f7c490alib/geom/part geom_part.c, lib/libc/stdlib Makefile.inc tdestroy.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+72-14lib/libc/stdlib/Makefile.inc
+40-29lib/geom/part/geom_part.c
+68-0lib/libc/stdlib/tdestroy.c
+65-0lib/libc/tests/stdlib/tsearch_test.c
+23-2lib/libc/stdlib/tsearch.3
+6-1share/man/man4/cpuctl.4
+274-469 files not shown
+289-5215 files

HardenedBSD/src 5a0dc64sys/dev/dpaa2 dpaa2_ni.c, usr.sbin/bhyve bhyve_config.5 bhyve.8

Merge branch 'freebsd/14-stable/main' into hardened/14-stable/master
DeltaFile
+45-7sys/dev/dpaa2/dpaa2_ni.c
+17-12usr.sbin/bhyve/bhyve_config.5
+2-1usr.sbin/bhyve/bhyve.8
+64-203 files

HardenedBSD/src 9197a68sys/dev/dpaa2 dpaa2_ni.c, sys/dev/netmap netmap_mem2.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+45-7sys/dev/dpaa2/dpaa2_ni.c
+19-15sys/dev/netmap/netmap_mem2.c
+27-6sys/netpfil/pf/pf_ioctl.c
+31-0tests/sys/kern/inotify_test.c
+17-12usr.sbin/bhyve/bhyve_config.5
+9-6sys/netpfil/pf/if_pfsync.c
+148-4610 files not shown
+173-6916 files