FreeBSD/src 436f7fc.github/workflows cross-bootstrap-tools.yml

.github: support all stable branches

If this eventually poses a problem for unsupported branches we can fix
them directly.

Sponsored by:   Innovate UK

Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D53838

(cherry picked from commit 1e189279576497498cafad6f8c0a36a377b786a3)
DeltaFile
+1-1.github/workflows/cross-bootstrap-tools.yml
+1-11 files

FreeBSD/src e510b48.github/workflows cross-bootstrap-tools.yml

.github: support all stable branches

If this eventually poses a problem for unsupported branches we can fix
them directly.

Sponsored by:   Innovate UK

Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D53838

(cherry picked from commit 1e189279576497498cafad6f8c0a36a377b786a3)
DeltaFile
+1-1.github/workflows/cross-bootstrap-tools.yml
+1-11 files

FreeBSD/src 36963d2.github/workflows cross-bootstrap-tools.yml

.github: support all stable branches

If this eventually poses a problem for unsupported branches we can fix
them directly.

Sponsored by:   Innovate UK

Reviewed by:    emaste
Differential Revision:  https://reviews.freebsd.org/D53838

(cherry picked from commit 1e189279576497498cafad6f8c0a36a377b786a3)
DeltaFile
+1-1.github/workflows/cross-bootstrap-tools.yml
+1-11 files

FreeBSD/src 0602b91tools/build Makefile, tools/build/cross-build/include/mac string.h

cross-build: Provide mempcpy when building on macOS

We could patch the tzcode config to not use it, but it's simple to
provide an implementation of it and avoid spreading cross-build
bootstrapping special cases.

Fixes:          ff2c98b30b57 ("tzcode: Update to 2026a")
MFC after:      1 week

(cherry picked from commit 47402c9422ec6c9ba76d96414f5a08bd35a9e1fd)
DeltaFile
+3-0tools/build/Makefile
+2-0tools/build/cross-build/include/mac/string.h
+5-02 files

FreeBSD/src 2bc5bc1tools/build Makefile, tools/build/cross-build/include/mac string.h

cross-build: Provide mempcpy when building on macOS

We could patch the tzcode config to not use it, but it's simple to
provide an implementation of it and avoid spreading cross-build
bootstrapping special cases.

Fixes:          ff2c98b30b57 ("tzcode: Update to 2026a")
MFC after:      1 week

(cherry picked from commit 47402c9422ec6c9ba76d96414f5a08bd35a9e1fd)
DeltaFile
+3-0tools/build/Makefile
+2-0tools/build/cross-build/include/mac/string.h
+5-02 files

FreeBSD/src db9fd99tools/build Makefile, tools/build/cross-build/include/mac string.h

cross-build: Provide mempcpy when building on macOS

We could patch the tzcode config to not use it, but it's simple to
provide an implementation of it and avoid spreading cross-build
bootstrapping special cases.

Fixes:          ff2c98b30b57 ("tzcode: Update to 2026a")
MFC after:      1 week

(cherry picked from commit 47402c9422ec6c9ba76d96414f5a08bd35a9e1fd)
DeltaFile
+7-0tools/build/Makefile
+2-0tools/build/cross-build/include/mac/string.h
+9-02 files

FreeBSD/src 0d995efusr.sbin/syslogd syslogd.c

syslogd: Allow killing when in foreground

Normally, syslogd reacts only to SIGTERM, and ignores SIGINT and SIGQUIT
unless in debug mode.  Extend that to also apply when running in the
foreground.

MFC after:      1 week
Reviewed by:    jfree
Differential Revision:  https://reviews.freebsd.org/D55886

(cherry picked from commit 828de702ada854b5f09f447ba06e4e08e976ba07)
DeltaFile
+2-2usr.sbin/syslogd/syslogd.c
+2-21 files

FreeBSD/src bc249f6usr.sbin/syslogd syslogd.c

syslogd: Allow killing when in foreground

Normally, syslogd reacts only to SIGTERM, and ignores SIGINT and SIGQUIT
unless in debug mode.  Extend that to also apply when running in the
foreground.

MFC after:      1 week
Reviewed by:    jfree
Differential Revision:  https://reviews.freebsd.org/D55886

(cherry picked from commit 828de702ada854b5f09f447ba06e4e08e976ba07)
DeltaFile
+2-2usr.sbin/syslogd/syslogd.c
+2-21 files

FreeBSD/src 25b35dcusr.sbin/syslogd syslogd.c

syslogd: Allow killing when in foreground

Normally, syslogd reacts only to SIGTERM, and ignores SIGINT and SIGQUIT
unless in debug mode.  Extend that to also apply when running in the
foreground.  Take this opportunity to comment the event loop.

MFC after:      1 week
Reviewed by:    jfree
Differential Revision:  https://reviews.freebsd.org/D55886

(cherry picked from commit 828de702ada854b5f09f447ba06e4e08e976ba07)
DeltaFile
+8-2usr.sbin/syslogd/syslogd.c
+8-21 files

FreeBSD/src c7e5e96contrib/file/magic/Magdir filesystems

file: Parse some UFS2 flags

This allows libmagic to recognize the FS_DOSOFTDEP, FS_SUJ, FS_GJOURNAL,
FS_ACLS, and FS_NFS4ACLS flags on a UFS2 file system.

Accepted upstream as 482259e5e952.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56010

(cherry picked from commit fa03f93e8829a7689101303fbe9fb06654ca14ed)
DeltaFile
+5-0contrib/file/magic/Magdir/filesystems
+5-01 files

FreeBSD/src bc735d8usr.bin/m4 eval.c look.c

m4: Misc style fixes

MFC after:      1 week

Reviewed by:    fuz
Differential Revision:  https://reviews.freebsd.org/D55794

(cherry picked from commit 41474e78c493184f023723d1f86539e07bb01b92)
DeltaFile
+9-9usr.bin/m4/eval.c
+9-8usr.bin/m4/look.c
+5-7usr.bin/m4/misc.c
+2-3usr.bin/m4/main.c
+1-1usr.bin/m4/expr.c
+1-1usr.bin/m4/mdef.h
+27-296 files

FreeBSD/src a6eda8dusr.bin/m4 eval.c mdef.h

m4: Stop abbreviating builtin names

* Stop abbreviating macro names half-randomly to 8 chars, this is no
  longer 1990.

* Likewise for function names (in particular use doindex for a function
  that is notably different from the classic index function).

* Rename a few things for more fidelity: eval is the builtin name, not
  expr and your maketemp/mkstemp conform to mkstemp semantics for better
  security.

* Rewrap a few comments that were ludicrously short.

No functional changes except improved accuracy of some error messages.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55793

(cherry picked from commit f8f6f1cbd576ab5f15cef178cc05251365652f74)
DeltaFile
+86-98usr.bin/m4/eval.c
+44-44usr.bin/m4/mdef.h
+33-32usr.bin/m4/main.c
+3-3usr.bin/m4/look.c
+1-1usr.bin/m4/misc.c
+1-1usr.bin/m4/extern.h
+168-1796 files

FreeBSD/src e4755b9usr.bin/m4 eval.c mdef.h

m4: Stop abbreviating builtin names

* Stop abbreviating macro names half-randomly to 8 chars, this is no
  longer 1990.

* Likewise for function names (in particular use doindex for a function
  that is notably different from the classic index function).

* Rename a few things for more fidelity: eval is the builtin name, not
  expr and your maketemp/mkstemp conform to mkstemp semantics for better
  security.

* Rewrap a few comments that were ludicrously short.

No functional changes except improved accuracy of some error messages.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55793

(cherry picked from commit f8f6f1cbd576ab5f15cef178cc05251365652f74)
DeltaFile
+86-98usr.bin/m4/eval.c
+44-44usr.bin/m4/mdef.h
+33-32usr.bin/m4/main.c
+3-3usr.bin/m4/look.c
+1-1usr.bin/m4/extern.h
+1-1usr.bin/m4/misc.c
+168-1796 files

FreeBSD/src 3396afbusr.bin/m4 eval.c look.c

m4: Misc style fixes

MFC after:      1 week

Reviewed by:    fuz
Differential Revision:  https://reviews.freebsd.org/D55794

(cherry picked from commit 41474e78c493184f023723d1f86539e07bb01b92)
DeltaFile
+9-9usr.bin/m4/eval.c
+9-8usr.bin/m4/look.c
+5-7usr.bin/m4/misc.c
+2-3usr.bin/m4/main.c
+1-1usr.bin/m4/mdef.h
+1-1usr.bin/m4/expr.c
+27-296 files

FreeBSD/src f0ca30bcontrib/file/magic/Magdir filesystems

file: Parse some UFS2 flags

This allows libmagic to recognize the FS_DOSOFTDEP, FS_SUJ, FS_GJOURNAL,
FS_ACLS, and FS_NFS4ACLS flags on a UFS2 file system.

Accepted upstream as 482259e5e952.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56010

(cherry picked from commit fa03f93e8829a7689101303fbe9fb06654ca14ed)
DeltaFile
+5-0contrib/file/magic/Magdir/filesystems
+5-01 files

FreeBSD/src 3ef2921usr.bin/m4 eval.c look.c

m4: Misc style fixes

MFC after:      1 week

Reviewed by:    fuz
Differential Revision:  https://reviews.freebsd.org/D55794

(cherry picked from commit 41474e78c493184f023723d1f86539e07bb01b92)
DeltaFile
+9-9usr.bin/m4/eval.c
+9-8usr.bin/m4/look.c
+5-7usr.bin/m4/misc.c
+2-3usr.bin/m4/main.c
+1-1usr.bin/m4/mdef.h
+1-1usr.bin/m4/expr.c
+27-296 files

FreeBSD/src 0d2454fcontrib/file/magic/Magdir filesystems

file: Parse some UFS2 flags

This allows libmagic to recognize the FS_DOSOFTDEP, FS_SUJ, FS_GJOURNAL,
FS_ACLS, and FS_NFS4ACLS flags on a UFS2 file system.

Accepted upstream as 482259e5e952.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56010

(cherry picked from commit fa03f93e8829a7689101303fbe9fb06654ca14ed)
DeltaFile
+5-0contrib/file/magic/Magdir/filesystems
+5-01 files

FreeBSD/src b195333usr.bin/m4 eval.c mdef.h

m4: Stop abbreviating builtin names

* Stop abbreviating macro names half-randomly to 8 chars, this is no
  longer 1990.

* Likewise for function names (in particular use doindex for a function
  that is notably different from the classic index function).

* Rename a few things for more fidelity: eval is the builtin name, not
  expr and your maketemp/mkstemp conform to mkstemp semantics for better
  security.

* Rewrap a few comments that were ludicrously short.

No functional changes except improved accuracy of some error messages.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D55793

(cherry picked from commit f8f6f1cbd576ab5f15cef178cc05251365652f74)
DeltaFile
+86-98usr.bin/m4/eval.c
+44-44usr.bin/m4/mdef.h
+33-32usr.bin/m4/main.c
+3-3usr.bin/m4/look.c
+1-1usr.bin/m4/extern.h
+1-1usr.bin/m4/misc.c
+168-1796 files

FreeBSD/src ed71162lib/libc/amd64/string strrchr.S

libc/amd64/strrchr.S: rewrite and fix scalar implementation

The original scalar implementation of strrchr() had incorrect
logic that failed if the character searched for was the NUL
character.  It was also possibly affected by the issue fixed
in 3d8ef251a for strchrnul().

Rewrite the function with logic that actually works.  We defer
checking for the character until after we have checked for NUL.
When we encounter the final NUL byte, we mask out the characters
beyond the tail before checking for a match.

This bug only affects users running on amd64 with ARCHLEVEL=scalar
(cf. simd(7)).  The default configuration is not affected.

The bug was unfortunately not caught by the unit test inherited
from NetBSD.  An extended unit test catching the issue is proposed
in D56037.


    [9 lines not shown]
DeltaFile
+26-52lib/libc/amd64/string/strrchr.S
+26-521 files

FreeBSD/src 81114fflib/libc/amd64/string strrchr.S

libc/amd64/strrchr.S: rewrite and fix scalar implementation

The original scalar implementation of strrchr() had incorrect
logic that failed if the character searched for was the NUL
character.  It was also possibly affected by the issue fixed
in 3d8ef251a for strchrnul().

Rewrite the function with logic that actually works.  We defer
checking for the character until after we have checked for NUL.
When we encounter the final NUL byte, we mask out the characters
beyond the tail before checking for a match.

This bug only affects users running on amd64 with ARCHLEVEL=scalar
(cf. simd(7)).  The default configuration is not affected.

The bug was unfortunately not caught by the unit test inherited
from NetBSD.  An extended unit test catching the issue is proposed
in D56037.


    [9 lines not shown]
DeltaFile
+26-52lib/libc/amd64/string/strrchr.S
+26-521 files

FreeBSD/src 59e9a4clib/libc/gen posix_spawn.3

posix_spawn.3: fix formatting of xref

Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
DeltaFile
+1-1lib/libc/gen/posix_spawn.3
+1-11 files

FreeBSD/src db9bbe1lib/libsys procctl.2

procctl.2: Align list indentation

Remove 81 lines of whitespace at default manual rendering width.

MFC after: 3 days
DeltaFile
+24-24lib/libsys/procctl.2
+24-241 files

FreeBSD/src 7225259libexec/rtld-elf/tests dlopen_hash_test.c Makefile

rtld: add test for dlopen("#dirfd/path")

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:   https://reviews.freebsd.org/D56152
DeltaFile
+45-0libexec/rtld-elf/tests/dlopen_hash_test.c
+1-0libexec/rtld-elf/tests/Makefile
+46-02 files

FreeBSD/src ffbf3felib/libc/gen dlopen.3, libexec/rtld-elf rtld.c

rtld: allow dlopen("#<number>/<path>")

When a specially formatted path is passed to dlopen(), of the form
  #number/path
and the number is the valid dirfd file descriptor listed in the
LD_LIBRARY_FDS, interpret it as a relative path name against dirfd
number.

This complements the result returned from dladdr() for such objects
in dli_fname.

Reviewed by:    markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56152
DeltaFile
+54-3libexec/rtld-elf/rtld.c
+14-0lib/libc/gen/dlopen.3
+68-32 files

FreeBSD/src 51db69csys/kern kern_event.c

kqueue: assert that kqueue knote lists own the knotes

Reviewed by:    kevans, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56212
DeltaFile
+12-2sys/kern/kern_event.c
+12-21 files

FreeBSD/src de344ffsys/amd64/amd64 exec_machdep.c

amd64 sendsig(): explicitly copy registers from trapframe to ucontext

(cherry picked from commit 7d1285e904aa76ac821ac2a6a8eb61be598f0e88)
DeltaFile
+28-1sys/amd64/amd64/exec_machdep.c
+28-11 files

FreeBSD/src a91b307libexec/rtld-elf/tests set_var_test.c Makefile

rtld: add a test for rtld_set_var (with LIBRARY_PATH_FDS)

PR:     294054

(cherry picked from commit 9f16078b5f8c44d5718ecc940ab0b4ed5a1877a5)
DeltaFile
+38-0libexec/rtld-elf/tests/set_var_test.c
+1-0libexec/rtld-elf/tests/Makefile
+39-02 files

FreeBSD/src 5002c46sys/x86/isa atpic.c icu.h

x86: move the NUM_ISA_IRQS symbol from atpic.c into x86/isa/icu.h

(cherry picked from commit 5f08cdc1fb62d157b6086b3ea844287e81e3c45d)
DeltaFile
+0-2sys/x86/isa/atpic.c
+2-0sys/x86/isa/icu.h
+2-22 files

FreeBSD/src 1e4debclibexec/rtld-elf rtld.c

rtld: properly handle update of several vars in rtld_set_var()

(cherry picked from commit b9f046d941c4dbd0e4fc634827ada6e7cf6a6bcf)
DeltaFile
+152-36libexec/rtld-elf/rtld.c
+152-361 files

FreeBSD/src 60b2eb9libexec/rtld-elf rtld.c

rtld: check for overflow in parse_integer()

(cherry picked from commit 7cfffe25da3fbc2db4bcf073ff2d240f84233973)
DeltaFile
+4-0libexec/rtld-elf/rtld.c
+4-01 files