HardenedBSD/src 93f0af4. Makefile.inc1, share/man/man4 jedec_dimm.4 smbus.4

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+5-1share/man/man4/jedec_dimm.4
+2-1share/man/man4/smbus.4
+2-1share/mk/bsd.sys.mk
+1-1Makefile.inc1
+10-44 files

HardenedBSD/src 10f6093. Makefile.inc1, share/man/man4 jedec_dimm.4 smbus.4

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+5-1share/man/man4/jedec_dimm.4
+2-1share/mk/bsd.sys.mk
+2-1share/man/man4/smbus.4
+1-1Makefile.inc1
+10-44 files

HardenedBSD/src 9c0bedbsys/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.

    [6 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 c17271fsys/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

(cherry picked from commit 710ec409dffed3306ced253bba85dbdc7758510b)
DeltaFile
+2-2sys/crypto/chacha20/chacha.c
+2-21 files

HardenedBSD/src bc17408contrib/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

(cherry picked from commit 667259b392ec0a86d066ccc6ba0f4025b3d2a083)
DeltaFile
+1-1contrib/ncurses/progs/infocmp.c
+1-11 files

HardenedBSD/src 7d02433sys/compat/linux linux_timer.c

compat: linux: use appropriate variables for copying out old timers

We copyout &l_oval but do the conversions into &l_val, leaving us with
stack garbage.  A build with an LLVM21 cross-toolchain seems to catch
this.

Reported by:    Florian Limberger <flo purplekraken com>
Reviewed by:    markj
Fixes:          a1fd2911ddb06 ("linux(4): Implement timer_settime64 syscall.")
MFC after:      3 days
Differential Revision: https://reviews.freebsd.org/D52985

(cherry picked from commit 541a98d7e28a8e4697ac2fa78dd4c4203c2c3a9c)
DeltaFile
+2-2sys/compat/linux/linux_timer.c
+2-21 files

HardenedBSD/src 2198726share/mk bsd.sys.mk

bsd.sys.mk: suppress some new clang 21 warnings for C++

Otherwise, these lead to many -Werror warnings in libc++ headers, due to
our use of -Wsystem-headers, which is not officially supported upstream:

Suppress -Wc++20-extensions, due to:

    /usr/include/c++/v1/__algorithm/simd_utils.h:96:50: error: explicit template parameter list for lambdas is a C++20 extension [-Werror,-Wc++20-extensions]
       96 | inline constexpr size_t __simd_vector_size_v = []<bool _False = false>() -> size_t {
          |                                                  ^

Suppress -Wc++23-lambda-attributes, due to:

    /usr/include/c++/v1/__format/format_functions.h:462:32: error: an attribute specifier sequence in this position is a C++23 extension [-Werror,-Wc++23-lambda-attributes]
      462 |   if (bool __is_identity = [&] [[__gnu__::__pure__]] // Make sure the compiler knows this call can be eliminated
          |                                ^

Suppress -Wnullability-completeness, due to:


    [7 lines not shown]
DeltaFile
+5-0share/mk/bsd.sys.mk
+5-01 files

HardenedBSD/src b93a331bin/sh options.h, bin/test test.c

sh: avoid warnings about too-long initializer strings

Mark `optletter` and `t_op::op_text` as `__non_string`, to avoid
warnings from clang 21 similar to:

    bin/sh/options.h:77:36: error: initializer-string for character array is too long, array size is 19 but initializer has size 20 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
       77 | const char optletter[NSHORTOPTS] = "efIimnsxvVECabupTPh";
          |                                    ^~~~~~~~~~~~~~~~~~~~~
    bin/test/test.c:153:3: error: initializer-string for character array is too long, array size is 2 but initializer has size 3 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
      153 |         {"==",  STREQ},
          |          ^~~~

MFC after:      3 days
Reviewed by:    jilles
Differential Revision: https://reviews.freebsd.org/D54362

(cherry picked from commit e6546807f4c1a8a6a6fa53fceab7b8c80e3ed802)
DeltaFile
+1-1bin/sh/options.h
+1-1bin/test/test.c
+2-22 files

HardenedBSD/src 7c6a0batools/build/mk OptionalObsoleteFiles.inc

OptionalObsoleteFiles.inc: fix up WITH_LLVM_LINK_STATIC_LIBRARIES cases

In commit cf1eaaf41cef I added the WITH_LLVM_LINK_STATIC_LIBRARIES
src.conf(5) build knob, which also affects OptionalObsoleteFiles.inc.

However, the checks were incorrect: when WITH_LLVM_LINK_STATIC_LIBRARIES
is active, the OLD_LIBS libprivatellvm.so.19, libprivateclang.so.19 and
libprivatelldb.so.19 should always be cleaned up.

Fixes:          cf1eaaf41cef
MFC after:      1 week

(cherry picked from commit 160077a4d75186a979f28f0778259c66d8cac8be)
DeltaFile
+6-6tools/build/mk/OptionalObsoleteFiles.inc
+6-61 files

HardenedBSD/src ded12d6lib/clang/libclang Makefile, lib/clang/liblldb Makefile

src.conf: Add WITH_LLVM_LINK_STATIC_LIBRARIES build knob

In commit 2e47f35be5dc libllvm, libclang and liblldb were converted into
private shared libraries. This allowed clang, lld, lldb, and other llvm
tools to be linked against these shared libraries, which makes them
smaller and avoids duplication.

However, this also comes at the cost of some performance, since the
dynamic libraries are quite large, and contain lots of long symbols
(mangled C++ identifiers).

Add a WITH_LLVM_LINK_STATIC_LIBRARIES build knob that can be used to go
back to the previous behavior: libllvm, libclang and liblldb are built
as internal static libraries, i.e. only available during buildworld, and
fully linked into the various executables such as clang, lld, etc.

PR:             287447
Reviewed by:    emaste
MFC after:      1 week

    [3 lines not shown]
DeltaFile
+12-1lib/clang/liblldb/Makefile
+8-3tools/build/mk/OptionalObsoleteFiles.inc
+4-5lib/clang/libllvm/Makefile
+8-1share/man/man5/src.conf.5
+4-4lib/clang/libclang/Makefile
+6-0tools/build/options/WITH_LLVM_LINK_STATIC_LIBRARIES
+42-147 files not shown
+61-1713 files

HardenedBSD/src 62a7fdcshare/mk bsd.sys.mk

bsd.sys.mk: suppress another gcc warning for libc++

Similar to base 63d1c3c43690, suppress -Wc++20-extensions for gcc.
Otherwise libc++ headers will lead to many -Werror warnings, due to our
use of -Wsystem-headers, which is not officially supported upstream.

MFC after:      3 days
DeltaFile
+2-1share/mk/bsd.sys.mk
+2-11 files

HardenedBSD/src a6afa19. Makefile.inc1

Makefile.inc1: Indicate that no-clean builds are on by default

PR:             292130
DeltaFile
+1-1Makefile.inc1
+1-11 files

HardenedBSD/src f70c605sbin/ipfw ipfw.8

MFC: ipfw.8: document how to delete nat configuration instance

(cherry picked from commit e51047118cb1d15abe8077a5b47b8063fa364ad9)
DeltaFile
+15-1sbin/ipfw/ipfw.8
+15-11 files

HardenedBSD/src b52347fshare/man/man4 jedec_dimm.4 smbus.4

jdec_dimm(4): add a reference to smbmsg(8) to jedec_dimm(4) and smbus(4)

Add a cross reference to smbmsg(8) which is useful for discovering local
devices and difficult to find otherwise.

PR: 247749
Reviewed by: pauamma at gundo.com
Differential Review: https://reviews.freebsd.org/D40839
DeltaFile
+5-1share/man/man4/jedec_dimm.4
+2-1share/man/man4/smbus.4
+7-22 files

HardenedBSD/src 1d0d0a8sbin/ipfw ipfw.8

ipfw.8: fix documentation bug for setmark

A mark set with "setmark" keyword is intended to be "sticky"
and documented as such but in fact it is not yet,
as current implementation lacks "sticky" feature
and its implementation will be not MFC'd, most probably.

Correct the manual page until the implementation improved.

Discussed with: Boris Lytochkin <lytboris at gmail.com> (author)

(cherry picked from commit a7b8a5d37bcb0009297962137bfb6c6570e5af12)
(cherry picked from commit 9fdf49e8a501047b61a615ab1b4b133159ad76e1)
DeltaFile
+6-2sbin/ipfw/ipfw.8
+6-21 files

HardenedBSD/src cb9c8e9share/examples/kld/khelp h_example.c

khelp: make the module compile again

PR:             291165
MFC after:      1 week

(cherry picked from commit 27554189e5122d780dd295b1a1a81f15f459accb)
DeltaFile
+2-0share/examples/kld/khelp/h_example.c
+2-01 files

HardenedBSD/src 45935a4sys/dev/sound sndstat.c dummy.c, sys/dev/sound/midi midi.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+0-1,456sys/dev/sound/pcm/sndstat.c
+1,454-0sys/dev/sound/sndstat.c
+81-314sys/dev/sound/midi/midi.c
+16-36sys/dev/sound/pcm/feeder_rate.c
+48-2sys/dev/sound/dummy.c
+42-0sys/dev/sound/sndstat.h
+1,641-1,80836 files not shown
+1,751-2,00942 files

HardenedBSD/src 6ffcf5fsys/dev/sound sndstat.c dummy.c, sys/dev/sound/midi midi.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+0-1,456sys/dev/sound/pcm/sndstat.c
+1,454-0sys/dev/sound/sndstat.c
+81-314sys/dev/sound/midi/midi.c
+16-36sys/dev/sound/pcm/feeder_rate.c
+48-2sys/dev/sound/dummy.c
+42-0sys/dev/sound/sndstat.h
+1,641-1,80836 files not shown
+1,751-2,00942 files

HardenedBSD/src 8c7a7d7sys/conf files

sys/conf/files: Fix sndstat path

Reported by:    CI
Fixes:          bafa8c951d8c ("sound: Move sndstat out of pcm/")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-1sys/conf/files
+1-11 files

HardenedBSD/src 0794365sys/dev/sound/pcm channel.c channel.h

sound: Merge chn_intr() with chn_intr_locked()

There is no scenario where chn_intr() is called with the channel lock
already held.

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    kib, markj
Differential Revision:  https://reviews.freebsd.org/D53854
DeltaFile
+2-18sys/dev/sound/pcm/channel.c
+0-1sys/dev/sound/pcm/channel.h
+2-192 files

HardenedBSD/src c234740sys/dev/sound/usb uaudio.c

snd_uaudio: Do not use pcm_channel->lock to protect uaudio_chan

This is a layering violation, but it also makes the control flow
confusing; snd_uaudio(4) should have its own lock to protect its
structures.

Fixes:          5cc34a83e1 ("Revert "sound: Merge chn_intr() with chn_intr_locked()"")
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D54102
DeltaFile
+12-15sys/dev/sound/usb/uaudio.c
+12-151 files

HardenedBSD/src a9c3bb3sys/dev/sound/midi midi.c

sound: Retire unused snd_midi->name

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+0-1sys/dev/sound/midi/midi.c
+0-11 files

HardenedBSD/src fd1312dsys/dev/sound/midi mpu401.c

sound: Allocate mpu401 with M_WAITOK

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-4sys/dev/sound/midi/mpu401.c
+1-41 files

HardenedBSD/src 3094c5esys/dev/sound/midi mpu401.c

sound: Make mpu_if definitions static

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+3-3sys/dev/sound/midi/mpu401.c
+3-31 files

HardenedBSD/src e3b57cesys/dev/sound/midi mpu401.c mpu_if.m

sound: Retire mpu_callbackp()

It is the exact same as mpu_callback().

No functional changed intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+0-8sys/dev/sound/midi/mpu401.c
+0-6sys/dev/sound/midi/mpu_if.m
+1-1sys/dev/sound/midi/midi.c
+1-153 files

HardenedBSD/src 2aa1666sys/dev/sound sndstat.c sndstat.h, sys/dev/sound/pcm sound.c

sound: Take device type into account in sndstat

sndstat will be extended to work with MIDI devices as well, so separate
functionality based on the device type.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54141
DeltaFile
+40-44sys/dev/sound/sndstat.c
+6-1sys/dev/sound/sndstat.h
+1-1sys/dev/sound/pcm/sound.c
+47-463 files

HardenedBSD/src 7922512sys/dev/sound/pci hdsp-pcm.c hdspe-pcm.c, sys/dev/sound/pcm feeder_rate.c buffer.c

sound: Do not check for NULL before free()

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54174
DeltaFile
+12-25sys/dev/sound/pcm/feeder_rate.c
+6-13sys/dev/sound/pcm/buffer.c
+4-8sys/dev/sound/pci/hdsp-pcm.c
+4-8sys/dev/sound/pci/hdspe-pcm.c
+2-4sys/dev/sound/pci/envy24ht.c
+2-4sys/dev/sound/usb/uaudio.c
+30-6214 files not shown
+47-9520 files

HardenedBSD/src c288595sys/dev/sound/midi midi.c

sound: Retire MIDI_DEBUG

Better logging will be implemented.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-39sys/dev/sound/midi/midi.c
+1-391 files

HardenedBSD/src bafa8c9sys/dev/sound sndstat.c sndstat.h, sys/dev/sound/pcm sndstat.c sound.h

sound: Move sndstat out of pcm/

Needed by follow-up patches that will add sndstat support for midi/

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D54140
DeltaFile
+1,458-0sys/dev/sound/sndstat.c
+0-1,456sys/dev/sound/pcm/sndstat.c
+37-0sys/dev/sound/sndstat.h
+0-4sys/dev/sound/pcm/sound.h
+2-1sys/modules/sound/sound/Makefile
+1-0sys/dev/sound/pcm/sound.c
+1,498-1,4616 files

HardenedBSD/src 3f8a85asys/dev/sound/midi midiq.h

sound: Get rid of unused MIDIQ macros

No functional change intended.

Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+0-2sys/dev/sound/midi/midiq.h
+0-21 files