FreeBSD/src 8c9a919release/powerpc mkisoimages.sh

release: Fix typo in powerpc mkisoimages.sh

"[ n foo ]" is an error and should have been "[ -n foo ]".

Fortunately the only ill effect was to result in garbage in /tmp/ when
creating powerpc ISO images.

Fixes:  6c3e01bf8578 ("release: Randomize powerpc boot block file name")
MFC after:      3 days
Sponsored by:   https://www.patreon.com/cperciva
DeltaFile
+1-1release/powerpc/mkisoimages.sh
+1-11 files

FreeBSD/src b050bfarelease Makefile

release: Pass ABI to running pkgbase-stage on dvd

I did this for disc1 but forgot to amend the dvd invocation.

Fixes:  340e68fd7c0d ("release: Pass ABI to pkgbase-stage.lua")
MFC after:      3 days
Sponsored by:   https://www.patreon.com/cperciva
DeltaFile
+1-1release/Makefile
+1-11 files

FreeBSD/src 34a006econtrib/llvm-project/libcxx/include/__memory uninitialized_algorithms.h

libc++: silence -Wnontrivial-memaccess warning with newer clang

Apply part of LLVM commit 71315698c91d0cda054b903da0594ca6f072c350 to
silence the -Wnontrivial-memaccess warning that is triggered any time
this function is instantiated by user code. This fixes another
buildworld failure with Clang HEAD.

Original commit message:
[clang] Warn about memset/memcpy to NonTriviallyCopyable types (#111434)
This implements a warning that's similar to what GCC does in that
context: both memcpy and memset require their first and second operand
to be trivially copyable, let's warn if that's not the case.

Reviewed by:    emaste, dim
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52534
DeltaFile
+2-1contrib/llvm-project/libcxx/include/__memory/uninitialized_algorithms.h
+2-11 files

FreeBSD/src 086ce46contrib/llvm-project/libcxx/include/__functional binary_function.h unary_function.h, contrib/llvm-project/libcxx/include/__memory allocator_traits.h

libc++: Fix deprecation warnings with latest clang

Latest clang has become more strict in diagnosing deprecated decls, so
pull in LLVM commit 9feac2cbd0d80927ce9a8b4c3e810d2b81802d55.

Original commit message:
[libc++] Improve deprecated diagnostic guards.

Recent Clang-21 builds improved the deprecated diagnotics. This
uncovered missing guards in libc++ internally.

Reviewed by:    dim
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52531
DeltaFile
+2-3contrib/llvm-project/libcxx/include/__functional/binary_function.h
+2-3contrib/llvm-project/libcxx/include/__functional/unary_function.h
+2-0contrib/llvm-project/libcxx/include/__functional/weak_result_type.h
+2-0contrib/llvm-project/libcxx/include/__memory/allocator_traits.h
+8-64 files

FreeBSD/src dee76cfcontrib/llvm-project/libcxx/include tuple

libc++: avoid use of deprecated __reference_binds_to_temporary

This was removed in upstream libc++ in commit
437ad06f762ab07d89badecdd20627db200b98d3, but as this does not apply
cleanly to the current repository, I am applying the equivalent change
in a minimally invasive way. This is needed to build with latest clang
HEAD as of today.

Reviewed by:    dim
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52530
DeltaFile
+3-1contrib/llvm-project/libcxx/include/tuple
+3-11 files

FreeBSD/src d61c75fcontrib/llvm-project/libcxx/include/__type_traits is_trivially_relocatable.h

libc++: avoid use of deprecated builtin

This pulls in LLVM commit accfbd4cb327411ad66c0109ba1841482b871967 to
avoid the use of __libcpp_is_trivially_relocatable.
This fixes building FreeBSD libc++ with clang HEAD as of today.

Original commit message:
[libc++] Replace __is_trivially_relocatable by is_trivially_copyable (#124970)

The __is_trivially_relocatable builtin has semantics that do not
correspond to any current or future notion of trivial relocation.
Furthermore, it currently leads to incorrect optimizations for some
types on supported compilers:
- Clang on Windows where types with non-trivial destructors get
  incorrectly optimized
- AppleClang where types with non-trivial move constructors get
  incorrectly optimized

Until there is an agreed upon and bugfree implementation of what it

    [7 lines not shown]
DeltaFile
+5-3contrib/llvm-project/libcxx/include/__type_traits/is_trivially_relocatable.h
+5-31 files

FreeBSD/src 969be39sys/net if_ovpn.c

if_ovpn.c: fix use of uninitialized variable

In case we use OVPN_CIPHER_ALG_NONE, the memcpy will attempt to copy 0
bytes from an uninitialized pointer. While the memcpy() implementation
will treat this as a no-op and not actually dereferece the undefined
variable it is still undefined behaviour to the compiler and should be
fixed. Found by building with clang HEAD

Reviewed by:    kp
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52543
DeltaFile
+4-2sys/net/if_ovpn.c
+4-21 files

FreeBSD/src 90234b9sys/riscv/include ieeefp.h

riscv: Provide prototypes for fpgetmask/fpsetmask

These functions are stubs that do nothing but are called by some software
and not providing them results in implicit function declaration errors.
This was missed in D25740.

Reviewed by:    #riscv, mhorne
MFC after:      1 week
Differential Revision: https://reviews.freebsd.org/D52035
DeltaFile
+5-0sys/riscv/include/ieeefp.h
+5-01 files

FreeBSD/src e1bc42csys/dev/e1000 if_em.c

e1000: fix/complete merge of previous two commits

When fixing the conflicts caused by gallatin's commit and the reviewed
patch, I missed this location because it didn't exist when gallatin did
their change.

Obtained from: Juniper Networks, Inc.
DeltaFile
+2-1sys/dev/e1000/if_em.c
+2-11 files

FreeBSD/src 27699e3tools/boot universe.sh

boot/universe.sh: toggle LOADER_BIOS_TEXTONLY

Build without LOADER_BIOS_TEXTONLY since it is now the default.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D52559
DeltaFile
+2-2tools/boot/universe.sh
+2-21 files

FreeBSD/src 8302f09sys/riscv/riscv timer.c

riscv timer: fix interrupt handling.

Based on the spec the STIP bit of SIP register is read-only.

To clear STIP bit from supervisor we have to do an SBI call to firmware.
Upon reception of SBI request, the machine-mode firmware clears the STIP
bit in the MIP register.

This fixes operation on Codasip A730.

Reviewed by:    mhorne
Differential Revision:  https://reviews.freebsd.org/D49487

(cherry picked from commit 6d58c670060a17817fa0c8ebf4e7543c3d2b4523)
DeltaFile
+2-2sys/riscv/riscv/timer.c
+2-21 files

FreeBSD/src 8501828sys/riscv/riscv timer.c

riscv: Fix SSTC extension support

From the SSTC spec:
"If the stimecmp (supervisor-mode timer compare) register is implemented,
then STIP is read-only in mip and reflects the supervisor-level timer
interrupt signal resulting from stimecmp. This timer interrupt signal
is cleared by writing stimecmp with a value greater than the current time
value."

This fixes operation in Spike with sstc extension enabled.
Example:
  spike --isa RV64IMAFDCH_zicntr_zihpm_sstc

Reviewed by:    mhorne
Differential Revision:  https://reviews.freebsd.org/D45226

(cherry picked from commit ddd0d4f4cd65341a07bb3bb833dee7982018fd60)
DeltaFile
+5-2sys/riscv/riscv/timer.c
+5-21 files

FreeBSD/src 31eaa01sys/riscv/riscv timer.c

riscv timer: fix interrupt handling.

Based on the spec the STIP bit of SIP register is read-only.

To clear STIP bit from supervisor we have to do an SBI call to firmware.
Upon reception of SBI request, the machine-mode firmware clears the STIP
bit in the MIP register.

This fixes operation on Codasip A730.

Reviewed by:    mhorne
Differential Revision:  https://reviews.freebsd.org/D49487

(cherry picked from commit 6d58c670060a17817fa0c8ebf4e7543c3d2b4523)
DeltaFile
+2-2sys/riscv/riscv/timer.c
+2-21 files

FreeBSD/src 4efc1b2sys/riscv/riscv timer.c

riscv: Fix SSTC extension support

From the SSTC spec:
"If the stimecmp (supervisor-mode timer compare) register is implemented,
then STIP is read-only in mip and reflects the supervisor-level timer
interrupt signal resulting from stimecmp. This timer interrupt signal
is cleared by writing stimecmp with a value greater than the current time
value."

This fixes operation in Spike with sstc extension enabled.
Example:
  spike --isa RV64IMAFDCH_zicntr_zihpm_sstc

Reviewed by:    mhorne
Differential Revision:  https://reviews.freebsd.org/D45226

(cherry picked from commit ddd0d4f4cd65341a07bb3bb833dee7982018fd60)
DeltaFile
+5-2sys/riscv/riscv/timer.c
+5-21 files

FreeBSD/src 6d83ae1share/man/man4 Makefile, share/man/man9 Makefile

share/man/man[49]: Set PACKAGE=kernel-man

When MANSPLITPKG is disabled (which is now the default), the kernel
manpages in sections 4 and 9 are installed in the -kernel package
instead of the -kernel-man package, because bsd.man.mk doesn't add
the -man suffix.

Since we already have handling for kernel-man in generate-ucl.lua,
set PACKAGE=kernel-man to make sure they're always in the right
package.

To avoid creating -kernel-man-man when WITH_MANSPLITPKG is enabled,
add some logic to bsd.man.mk (suggested by kevans) to avoid adding
the -man suffix if the package already has a -man suffix, and while
here, ensure ${__group}PACKAGE is always defined.

MFC after:      3 seconds
Reviewed by:    des, bapt
Differential Revision:  https://reviews.freebsd.org/D52525
DeltaFile
+4-3share/mk/bsd.man.mk
+1-1share/man/man4/Makefile
+1-1share/man/man9/Makefile
+6-53 files

FreeBSD/src a75c3c2share/man/man4 Makefile

udbc(4): connect to build

Reviewed by:    thj
MFC with:       d566b6a70bcbc329e8c690464043401fa8bdd49f
Sponsored by:   The FreeBSD Foundation
DeltaFile
+1-0share/man/man4/Makefile
+1-01 files

FreeBSD/src 18fd144sbin/ifconfig ifconfig.8 ifconfig.c

ifconfig: Enter jail as soon as possible

Some options (in particular, -g) are processed immediately upon being
parsed.  This will produce the wrong result in combination with -j since
we only attach to the jail after we're done parsing arguments.  Solve
this by attaching to the jail immediately when -j is encountered.  The
downside is that e.g. `ifconfig -j foo -j bar` would previously attach
to jail “bar”, whereas now it will attempt to attach to jail “foo”, and
if successful, attempt to attach to jail “bar” within jail “foo”.  This
may be considered a feature.

PR:             289134
MFC after:      1 week
Reviewed by:    zlei
Differential Revision:  https://reviews.freebsd.org/D52501
DeltaFile
+20-20sbin/ifconfig/ifconfig.8
+8-14sbin/ifconfig/ifconfig.c
+0-1sbin/ifconfig/ifconfig.h
+28-353 files

FreeBSD/src e8b5025sys/dev/sound/pcm dsp.c channel.h

sound: Honor CHN_F_NBIO

If the device is opened with O_NONBLOCK, even though we check for it in
order to set CHN_F_NBIO, the subsequent chn_reset() calls will clear all
flags, except those set in CHN_F_RESET, which does not include
CHN_F_NBIO.

Add CHN_F_NBIO to CHN_F_RESET. Additionally, because primary channels
can be reused, make sure we do not unintentionally keep CHN_F_NBIO set
if the channel is re-opened, but without O_NONBLOCK.

PR:             289441
MFC after:      2 days
Reviewed by:    christos, markj
Differential Revision:  https://reviews.freebsd.org/D52493
DeltaFile
+2-2sys/dev/sound/pcm/dsp.c
+1-1sys/dev/sound/pcm/channel.h
+3-32 files

FreeBSD/src 246d7e9sys/kern kern_jail.c, sys/security/audit audit_syscalls.c

jail: Optionally allow audit session state to be configured in a jail

Currently it is impossible for a privileged, jailed process to set audit
session state.  This can result in suprising audit event misattribution.
For example, suppose a user ssh'es into a jail and restarts a service;
normally, sshd sets audit state such that events generated by the SSH
session are attributed to the newly authenticated user, but in a jail,
the corresponding setaudit(2) call fails, so events are attributed to
the user who had started sshd in the jail (typically the user who had
started the jail itself by some means).

While this behaviour is reasonable, administrators might want to trust
the jailed sshd to reset audit state, such that the authenticated user
appears in audit logs.  Add a jail knob to enable this.  Add a simple
regression test.

Reviewed by:    kevans, jamie
MFC after:      1 week
Sponsored by:   Modirum MDPay

    [2 lines not shown]
DeltaFile
+20-0usr.sbin/jail/tests/jail_basic_test.sh
+15-4usr.sbin/jail/jail.8
+12-1sys/kern/kern_jail.c
+0-12sys/security/audit/audit_syscalls.c
+2-1sys/sys/jail.h
+49-185 files

FreeBSD/src cd02a8asys/netinet6 ip6_input.c, tools/regression/sockets/udp_pingpong udp_pingpong.c

ip6: add SO_BINTIME support

This adds support for obtaining timestamps from IPv6 packets using the
SO_BINTIME socket option, bringing it in parity with IPv4 behavior.

Enable testing the SO_BINTIME option in the relevant (manual) regression
test.

PR:             289423
Reviewed by:    markj
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D52504
DeltaFile
+37-18sys/netinet6/ip6_input.c
+3-5tools/regression/sockets/udp_pingpong/udp_pingpong.c
+40-232 files

FreeBSD/src b0469fasys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: 802.11: avoid recursive wiphy lock

When freeing the last reference of the net80211 node the net80211
node_free() code may directly call into the crypto code to delete
the keys.  While we still holding the wiphy lock this would lead to
a recursion on the non-recursive wiphy lock.  Defer freeing the
reference until we are back under the net80211 com lock.

Reported by:    Mark Phillips (mark freebsdfoundation.org) on 15.0-ALPHA1

(cherry picked from commit 3c38dce87ecd2c87744e4b7ff1904ee841f88a47)
DeltaFile
+36-18sys/compat/linuxkpi/common/src/linux_80211.c
+36-181 files

FreeBSD/src f20a09esys/compat/linuxkpi/common/include/linux device.h, sys/compat/linuxkpi/common/src linux_devres.c

LinuxKPI: devres: divorce dem_kfree from lkpi_devm_kmalloc_release

dem_kfree() is called from all over the place and should actually
do something;  contrary to lkpi_devm_kmalloc_release() it can also
take a const void *.  We have to __DECONST() that though as the
entire devres framework does otherwise not take a const argument.

This was discovered during the rtw89 upadte to 6.16.

Sponsored by:   The FreeBSD Foundation (initially)
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52082

(cherry picked from commit 4ab64e34911ab06e567caaf07ed18f7770a61cc8)
DeltaFile
+25-1sys/compat/linuxkpi/common/src/linux_devres.c
+3-2sys/compat/linuxkpi/common/include/linux/device.h
+28-32 files

FreeBSD/src 88122c8sys/compat/linuxkpi/common/include/linux math64.h

LinuxKPI: maths64: implement roundup_u64()

Needed by a wifi driver update.

Sponsored by:   The FreeBSD Foundation (initially)
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52080

(cherry picked from commit 2a44e10edb13e6b2be7fa2814b418a6959cb1171)
DeltaFile
+6-0sys/compat/linuxkpi/common/include/linux/math64.h
+6-01 files

FreeBSD/src 3753913sys/compat/linuxkpi/common/include/kunit static_stub.h, sys/compat/linuxkpi/dummy/include/kunit test-bug.h skbuff.h

LinuxKPI: kunit: add static_stub.h and more dummy headers

These came up during a wifi driver update.

Sponsored by:   The FreeBSD Foundation (initially)
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52079

(cherry picked from commit 7c473933624f701263a83da526cac680b1ca69ed)
DeltaFile
+15-0sys/compat/linuxkpi/common/include/kunit/static_stub.h
+0-0sys/compat/linuxkpi/dummy/include/kunit/test-bug.h
+0-0sys/compat/linuxkpi/dummy/include/kunit/skbuff.h
+0-0sys/compat/linuxkpi/dummy/include/kunit/test.h
+15-04 files

FreeBSD/src cd2bd8bsys/compat/linuxkpi/common/include/linux overflow.h

LinuxKPI: sync overflow.h from Linux v6.16

It seems overflow.h wsa imported directly from Linux in 3208d4ad2b8320a.
Update the file to the newer version as needed for wireless driver updates.

Sponsored by:   The FreeBSD Foundation (initially)
Obtained from:  git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
                038d61fd642278 (tag: v6.16)
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52078

(cherry picked from commit 70c508e691de1ed0f70b4a6f0773bfb5d627050d)
DeltaFile
+157-31sys/compat/linuxkpi/common/include/linux/overflow.h
+157-311 files

FreeBSD/src 310885bsys/compat/linuxkpi/common/include/linux compiler.h

LinuxKPI: add __struct_size

Use __builtin_object_size() by default.
If __builtin_dynamic_object_size() is available use that instead.

I would hope that in a future version we can remove the conditional
checks but in order to be able to MFC this without checking all
compiler versions simply keep it this way for now.

Sponsored by:   The FreeBSD Foundation (initially)
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52077

(cherry picked from commit ff5bcb742899f8398ccb1b9e292b2e5aeeb7fedb)
DeltaFile
+6-0sys/compat/linuxkpi/common/include/linux/compiler.h
+6-01 files

FreeBSD/src 4d5a78csys/compat/linuxkpi/common/include/linux cleanup.h rcupdate.h

LinuxKPI: add DEFINE_LOCK_GUARD_0 for rcu

This adds guard support for non-real-types like rcu locking meaning
that we need to keep the lock state separately ourselves.  _T is still
special and needs to be updated.  Given it may not be used it needs
an __unused attribute (we are using the LinuxKPI __maybe_unused which
indeed is more expressive in this case).

Sponsored by:   The FreeBSD Foundation (initially)
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52076

(cherry picked from commit 3f48a0fe53ca7e001852f4a406c1bdfab1cd2f6d)
DeltaFile
+35-0sys/compat/linuxkpi/common/include/linux/cleanup.h
+4-1sys/compat/linuxkpi/common/include/linux/rcupdate.h
+39-12 files

FreeBSD/src 830cc67sys/compat/linuxkpi/common/include/linux cleanup.h slab.h

LinuxKPI: cleanup: implement __free() and DEFINE_FREE(); use for kfree()

A wifi driver update needs this.

Sponsored by:   The FreeBSD Foundation (initially)
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52075

(cherry picked from commit 39e9290d890b2aa07b68f2fe956b96e5df9a1da2)
DeltaFile
+13-1sys/compat/linuxkpi/common/include/linux/cleanup.h
+4-0sys/compat/linuxkpi/common/include/linux/slab.h
+17-12 files

FreeBSD/src 8819856sys/compat/linuxkpi/common/include/linux timer.h, sys/compat/linuxkpi/common/src linux_compat.c

LinuxKPI: timer KPI *_timer -> timer_*

del_timer() got renamed to timer_delete() approximately in Linux 6.2
(similar for *_sync and likely others).
Keep the old functions as compat; unclear when we can gc them.
We should also re-define them with a linuxkpi_ prefix to avoid possible
conflicts in the future if we do a full pass over this at some point.

Sponsored by:   The FreeBSD Foundation (intiially)
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52074

(cherry picked from commit 5cb64a1d3fe75526fb879ef4dce5860bbb4e4aea)
DeltaFile
+14-2sys/compat/linuxkpi/common/include/linux/timer.h
+2-9sys/compat/linuxkpi/common/src/linux_compat.c
+16-112 files

FreeBSD/src 352be5bsys/compat/linuxkpi/common/include/linux timer.h, sys/compat/linuxkpi/common/src linux_80211.c

LinuxKPI: rename from_timer() to timer_container_of()

With Linux 6.16 from_timer() got renamed to timer_container_of(); add
the LINUXKPI_VERSION check with a default to the current version.
Update all in-tree consumers (apart from wireless drivers managed
otherwise).

Sponsored by:   The FreeBSD Foundation (initially)
Reviewed by:    dumbbell
Differential Revision:  https://reviews.freebsd.org/D52073

(cherry picked from commit 81cb7c4c8e7bc4951c77fe64a63a847ed6abee38)
DeltaFile
+5-0sys/compat/linuxkpi/common/include/linux/timer.h
+2-2sys/dev/irdma/irdma_utils.c
+1-1sys/dev/irdma/irdma_cm.c
+1-1sys/compat/linuxkpi/common/src/linux_80211.c
+1-1sys/dev/qat/qat_common/adf_gen4_timer.c
+10-55 files