FreeBSD/src bd7032esys/geom/concat g_concat.c, sys/geom/multipath g_multipath.c

GEOM: remove the redundant if statement

g_provider_by_name already skips the leading '/dev/' so these if
statements are redundant. This changes some error messages, but those
aren't parsed. g_concat also calls g_concat_find_disk, but it also skips
/dev/ if present at the start of the string.

Reviewed by: imp, Elliot Mitchell
Pull Request: https://github.com/freebsd/freebsd-src/pull/1793
DeltaFile
+0-3sys/geom/multipath/g_multipath.c
+0-2sys/geom/concat/g_concat.c
+0-2sys/geom/part/g_part.c
+0-2sys/geom/raid/g_raid.c
+0-94 files

FreeBSD/src 9dd78dblib/libc/gdtoa _hldtoa.c _hdtoa.c, lib/libc/tests/stdio printfloat_test.c

libc: prevent incorrect %a/%La rounding at full precision

In __hdtoa() and __hldtoa(), rounding is incorrectly applied when
the requested precision exactly matches the number of significant
hexadecimal digits. In this case, the redux adjustment can trigger
an unintended exponent increment and shift the rounding position
left by one bit. This causes the least significant digit to be
rounded incorrectly.

The fix adds a new condition based on MAX_HEX_DIGITS (derived from
MANT_DIG) so that rounding is performed only when precision is
strictly less than the number of significant digits. This avoids
the unintended shift while preserving correct rounding for other
cases.

A new regression test
(printfloat_test:hexadecimal_rounding_offset_eq_exp) covers both
the binary64 (%.13a) and binary128 (%.28La on arm64) cases that
previously fail, ensuring the bug does not regress.

    [12 lines not shown]
DeltaFile
+13-0lib/libc/tests/stdio/printfloat_test.c
+2-1lib/libc/gdtoa/_hldtoa.c
+2-1lib/libc/gdtoa/_hdtoa.c
+17-23 files

FreeBSD/src 3b6f0edshare/man/man9 taskqueue.9

taskqueue.9: replace ithread(9) with intr_event(9)

Signed-off-by: Miroslav Cimerman <mc at doas.su>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1845
DeltaFile
+1-1share/man/man9/taskqueue.9
+1-11 files

FreeBSD/src c8b87aastand/efi/acpica acpi_detect.c, stand/efi/acpica/include acpi_detect.h

loader: Move ACPI RSDP detection

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1843
DeltaFile
+69-0stand/efi/acpica/acpi_detect.c
+2-40stand/efi/loader/main.c
+41-0stand/efi/acpica/include/acpi_detect.h
+4-0stand/efi/loader/Makefile
+116-404 files

FreeBSD/src da62a29release Makefile, release/scripts pkgbase-stage.lua

release: Pass ABI to pkgbase-stage.lua

We then pass ABI from pkgbase-stage.lua to pkg(8); without this,
cross-building releases with PKGBASE enabled fails with

pkg: wrong architecture: ...
pkg: repository FreeBSD-base contains packages with wrong ABI: ...

MFC after:      1 minute
Discussed with: emaste, jrtc27
Sponsored by:   https://www.patreon.com/c/cperciva

(cherry picked from commit 340e68fd7c0d62cac1f0876b6475a89df5065db5)
DeltaFile
+3-0release/scripts/pkgbase-stage.lua
+1-1release/Makefile
+4-12 files

FreeBSD/src fa9ea99release Makefile

release: CLEANDIRS += pkgdb

This directory gets created by pkgbase-stage.lua.

MFC after:      3 days
Sponsored by:   https://www.patreon.com/c/cperciva
DeltaFile
+1-1release/Makefile
+1-11 files

FreeBSD/src 340e68frelease Makefile, release/scripts pkgbase-stage.lua

release: Pass ABI to pkgbase-stage.lua

We then pass ABI from pkgbase-stage.lua to pkg(8); without this,
cross-building releases with PKGBASE enabled fails with

pkg: wrong architecture: ...
pkg: repository FreeBSD-base contains packages with wrong ABI: ...

MFC after:      1 minute
Discussed with: emaste, jrtc27
Sponsored by:   https://www.patreon.com/c/cperciva
DeltaFile
+3-0release/scripts/pkgbase-stage.lua
+1-1release/Makefile
+4-12 files

FreeBSD/src c065db9contrib/libxo/libxo xo.h xo_encoder.h

contrib/libxo: fix API header files inclusions in C++ source files

C++ source files need `extern "C"` to disable C++ name mangling.

MFC after:      1 week
Reviewed by:    aokblast (previous version), phil, imp (previous version)
Differential Revision:  https://reviews.freebsd.org/D47930

(cherry picked from commit 11ace56fa030185025936c795d5cf7c57b266835)
DeltaFile
+8-0contrib/libxo/libxo/xo.h
+8-0contrib/libxo/libxo/xo_encoder.h
+16-02 files

FreeBSD/src 6faaef2contrib/libxo/libxo xo.h xo_encoder.h

contrib/libxo: fix API header files inclusions in C++ source files

C++ source files need `extern "C"` to disable C++ name mangling.

MFC after:      1 week
Reviewed by:    aokblast (previous version), phil, imp (previous version)
Differential Revision:  https://reviews.freebsd.org/D47930

(cherry picked from commit 11ace56fa030185025936c795d5cf7c57b266835)
DeltaFile
+8-0contrib/libxo/libxo/xo.h
+8-0contrib/libxo/libxo/xo_encoder.h
+16-02 files

FreeBSD/src 5df0b57lib/libsys jail.2, sys/kern kern_jaildesc.c kern_jail.c

MFC jaildesc: remove file-mode-based access controls

Jail descriptors were given a file-like mode, user, and group, for the
purpose of controlling how the descriptor may be used.  This is too far
removed from the file paradigm to make sense.  Remove it in favor of a
better access control method to be added, such as Capsicum.

Also add missing code in jaildesc_fill_kinfo.

Reported by:    crest at rlwinm.de, kib
MFC after:      3 days

(cherry picked from commit d81b337d690c971d60c731494795ee4b81fb929e)
DeltaFile
+25-83sys/kern/kern_jaildesc.c
+9-63sys/kern/kern_jail.c
+0-67lib/libsys/jail.2
+3-5sys/sys/jaildesc.h
+37-2184 files

FreeBSD/src 0c23ee9lib/libjail jail.c, sys/kern kern_jail.c kern_jaildesc.c

MFC jaildesc: fix typo and style(9) violations.

Reported by:    kib
MFC after:      3 days

(cherry picked from commit d8d5324ef5335dd9404db7263be2271610245e10)
DeltaFile
+18-18sys/kern/kern_jail.c
+13-13sys/kern/kern_jaildesc.c
+8-8lib/libjail/jail.c
+39-393 files

FreeBSD/src 595a705lib/libsys jail.2, sys/kern kern_jaildesc.c

MFC jaildesc: replace EBADF with EINVAL

Following fd9e09cb, EBADF is not the suitable error code for a non-
jail descriptor passed to jail_set, jail_get, jail_attach_fd, and
jail_remove_fd.

Reported by:    kib

(cherry picked from commit 16f600dc30b7bb82429660e540da802a1e3f7449)
DeltaFile
+6-20lib/libsys/jail.2
+1-1sys/kern/kern_jaildesc.c
+7-212 files

FreeBSD/src 4ecbb3fsys/kern kern_jaildesc.c

MFC jaildesc: fix a misplaced error check and a spurious finit call

Reported by:    kib

(cherry picked from commit 8ec7a830f10bc0f3b421dfaf6967a1bc996d34fd)
DeltaFile
+2-3sys/kern/kern_jaildesc.c
+2-31 files

FreeBSD/src e75dda3lib/libjail jail.c, sys/kern kern_jail.c

jaildesc: remove desc from the sysctl parameter list

Like lastjid, desc should count as a pseudo-parameter.  The difference
lies entirely in the security.jail.param sysctls, which list all of
the jail parameters.  Since desc opens and returns a file descriptor,
it has no place in such uses as "jls all."  Like lastjid, it's still
recognized by the kernel if passed in/out, and hard-coded into libjail
so it can be recognized there.

MFC after:      3 days
DeltaFile
+9-1lib/libjail/jail.c
+0-1sys/kern/kern_jail.c
+9-22 files

FreeBSD/src 91ea7e2lib/libc/gen getgrouplist.c

libc: fix the _FORTIFY_SOURCE build of getgrouplist(3)

We need <unistd.h> to get our prototype normally, but WARNS in libc is
way too low to surface that.

Additionally, _FORTIFY_SOURCE needs to include <ssp/unistd.h> by way of
<unistd.h> to actually export an implementation of getgrouplist(3).  The
version defined in the .c gets named __ssp_real_getgrouplist() and the
actual implementation comes from the redirect stub in <ssp/unistd.h>,
which basically gets optimized away in the built object because our
__builtin_object_size() check is trivially false when we cannot resolve
any object sizes in this translation unit.

This could be argued as a design flaw in _FORTIFY_SOURCE, but we should
grab <unistd.h> for our prototype anyways so let's kick the can down
the road instead of re-thinking it for 15.0.

Reported by:    Shawn Webb (HardenedBSD)
Fixes:          d3f8ed6066 ("getgrouplist(3): Remove superfluous [...]")
MFC after:      3 days
DeltaFile
+1-0lib/libc/gen/getgrouplist.c
+1-01 files

FreeBSD/src dd32d6bsys/contrib/openzfs/cmd arc_summary zarcsummary, sys/contrib/openzfs/man/man1 arcstat.1 zarcstat.1

zfs: merge openzfs/zfs at 3f4312a0a

Notable upstream pull request merges:
 #17227 d64711c20 Detect a slow raidz child during reads
 #17543 -multiple zfs allow send:raw
 #17717 bc0b5318a Prevent scrubbing a read-only pool
 #17722 cb5f9aa58 FreeBSD: Satisfy ASSERT_VOP_IN_SEQC()
 #17729 3f4312a0a Fix two infinite loops if dmu_prefetch_max set to zero
 #17730 37cd30f71 Fix ddle memleak in ddt_log_load
 #17733 bc8bcfc71 Fix type in dbrrd_closest()
 #17735 9b772f328 Fix time database update calculations

Obtained from:  OpenZFS
OpenZFS commit: 3f4312a0a428624e596bb35ae4806ea0d4d69472
DeltaFile
+0-1,080sys/contrib/openzfs/cmd/arc_summary
+1,073-0sys/contrib/openzfs/cmd/zarcsummary
+0-812sys/contrib/openzfs/cmd/arcstat.in
+805-0sys/contrib/openzfs/cmd/zarcstat.in
+0-429sys/contrib/openzfs/man/man1/arcstat.1
+427-0sys/contrib/openzfs/man/man1/zarcstat.1
+2,305-2,321114 files not shown
+5,589-3,066120 files

FreeBSD/src e0eaabblib/libc/tests/string memcmp_test.c

libc: Have memcmp test what the standard requires

libc's C memcmp currently returns the difference in byte values rather
than just -1/0/1 as the AArch64 assembly implementation, many non-
FreeBSD implementations, and compiler built-in optimizations do.

It is a bug for a user to expect memcmp to return the difference in the
byte values as the compiler is free to inline memcmp() with an
implementation that does not do this.  Change the test to validate only
what the standard requires.

PR:             289084
Reviewed by:    markj, fuz
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52502
DeltaFile
+6-6lib/libc/tests/string/memcmp_test.c
+6-61 files

FreeBSD/src e9e9c91libexec/flua/modules lposix.c

flua: add posix.unistd.execp

This matches the interface of lposix, although I do wonder why they went
with execp rather than execvp for the function name here.

Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D50177

(cherry picked from commit 7080a0c170daf8e4b3f331ec33003b2f8893dc23)
DeltaFile
+57-0libexec/flua/modules/lposix.c
+57-01 files

FreeBSD/src cab4cf2sys/kern kern_event.c

kern/kern_event.c: properly spell COMPAT_FREEBSD32

PR:     289504
Reported by:    Damjan Jovanovic <damjan.jov at gmail.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-1sys/kern/kern_event.c
+1-11 files

FreeBSD/src 3f4312amodule/zfs dmu.c

Fix two infinite loops if dmu_prefetch_max set to zero

Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin at TrueNAS.com>
Closes #17692
Closes #17729
DeltaFile
+4-2module/zfs/dmu.c
+4-21 files

FreeBSD/src 8a4e4c9stand/efi/loader main.c

loader.efi: Properly scope variable

guid here is only used for EFI_ZFS_BOOT, so move the ifdef.

Noticed by: wosch and clang 20
Sponsored by:           Netflix
DeltaFile
+1-1stand/efi/loader/main.c
+1-11 files

FreeBSD/src cbba9f7share/man/man7 build.7

build(7): Document buildenv better

Document the buildenvvars target and the BUILDENV_SHELL variable.

Sponsored by:           Netflix
DeltaFile
+15-1share/man/man7/build.7
+15-11 files

FreeBSD/src 89e9d3crelease release.sh

release.sh: Pass *PKGBASE* through

It helps to get the variable name right...

Fixes:  d4282cfa97d6 ("release.sh: Pass PKGCONF through to make release")
MFC after:      1 minute
Sponsored by:   https://www.patreon.com/c/cperciva

(cherry picked from commit 5f14800ca589d5db923a6dd6e2da9ee0b151209e)
DeltaFile
+1-1release/release.sh
+1-11 files

FreeBSD/src 5f14800release release.sh

release.sh: Pass *PKGBASE* through

It helps to get the variable name right...

Fixes:  d4282cfa97d6 ("release.sh: Pass PKGCONF through to make release")
MFC after:      1 minute
Sponsored by:   https://www.patreon.com/c/cperciva
DeltaFile
+1-1release/release.sh
+1-11 files

FreeBSD/src 02f70f6share/man/man4 epair.4, sys/net if_epair.c

590493c1:
if_epair(4): use ether_gen_addr(9) for stable MAC address

Before this change epair interfaces get a random MAC. This does
not help dhcp/dyndns when an epair gets destroyed/recreated
after restart of a jail.

With this change:
$ sysctl net.link.epair.ether_gen_addr=0
$ ifconfig epair8 create > /dev/null; ifconfig epair8a | grep ether; ifconfig epair8b | grep ether; ifconfig epair8a destroy
        ether 02:cb:78:56:e4:0a
        ether 02:cb:78:56:e4:0b
$ ifconfig epair8 create > /dev/null; ifconfig epair8a | grep ether; ifconfig epair8b | grep ether; ifconfig epair8a destroy
        ether 02:8b:9b:6a:8f:0a
        ether 02:8b:9b:6a:8f:0b

$ sysctl net.link.epair.ether_gen_addr=1
$ ifconfig epair8 create > /dev/null; ifconfig epair8a | grep ether; ifconfig epair8b | grep ether; ifconfig epair8a destroy
        ether 58:9c:fc:10:2b:b4

    [20 lines not shown]
DeltaFile
+31-4sys/net/if_epair.c
+17-5share/man/man4/epair.4
+48-92 files

FreeBSD/src 4403631sys/netpfil/pf pf.c, tests/sys/netpfil/pf nat44.py Makefile

pf: fix possible pd->pcksum NULL deref

Ensure that we always populate pcksum, not just for TCP/UDP/SCTP/ICMP.
We may end up using it (through pf_change_ap()) if we're doing NAT, so
ensure it's available even if it's sometimes just a dummy variable.

Reported-by: syzbot+3e73a7cba8cb6cd46f90 at syzkaller.appspotmail.com
MFC after:      1 week
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit c23eda976a8aad6bbd6c2042fa2ba1f0bc640e19)
DeltaFile
+76-0tests/sys/netpfil/pf/nat44.py
+14-0sys/netpfil/pf/pf.c
+1-0tests/sys/netpfil/pf/Makefile
+91-03 files

FreeBSD/src aacf267share/man/man7 ports.7

ports.7: Fix example of passing variables on the command line

make(1)'s -D flag does not allow for setting the value of the variable.
It just defines the variable and sets its value to 1. In fact, make(1)
treats "=" as just another character in the variable name:

```
$ make -DA=2 -V A  # Output is just an empty line.

$ make -DA=2 -V A=2  # Variable "A=2" is defined and set to "1".
1
```

Fixes:  d25f7d324a9d ports.7: Document DEBUG_FLAGS and the process of debugging ports
MFC after:      3 days

(cherry picked from commit 9365a328596c9f156deaa15fa018b76b3a6e6b18)
DeltaFile
+2-2share/man/man7/ports.7
+2-21 files

FreeBSD/src c7608bcshare/man/man7 ports.7

ports.7: Fix example of passing variables on the command line

make(1)'s -D flag does not allow for setting the value of the variable.
It just defines the variable and sets its value to 1. In fact, make(1)
treats "=" as just another character in the variable name:

```
$ make -DA=2 -V A  # Output is just an empty line.

$ make -DA=2 -V A=2  # Variable "A=2" is defined and set to "1".
1
```

Fixes:  d25f7d324a9d ports.7: Document DEBUG_FLAGS and the process of debugging ports
MFC after:      3 days

(cherry picked from commit 9365a328596c9f156deaa15fa018b76b3a6e6b18)
DeltaFile
+2-2share/man/man7/ports.7
+2-21 files

FreeBSD/src 63bd241sys/kern vfs_subr.c

vfs: denote a bug when dooming vnodes with custom locking primitives

See the added comment.

The entire notion of how vnodes are doomed needs to be reworked, but the
bare minimum would be to have filesystems provide ops for doomed nodes
and keep ->v_data around at least until they are done with it.
DeltaFile
+11-0sys/kern/vfs_subr.c
+11-01 files

FreeBSD/src b98124esys/kern vfs_cache.c

vfs cache: update commentary, no code changes

sdt hotpatching was implemented, thus a remark about usefulnes of doing
it was removed.

Apart from that a bunch of expanded/reworded explanations.

Improvement in terms of the quality of the use the English language
was a non-goal and was most likely not achieved.
DeltaFile
+109-53sys/kern/vfs_cache.c
+109-531 files