FreeBSD/src aab1ef4sys/kern kern_event.c

kqueue_fork_copy_knote(): zero kn_knlist for the copy before calling knlist_add()

Reported by:    pho, dhw
Fixes:  306c9049c642da6a59a5dc088589605a9aa38b87
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+1-0sys/kern/kern_event.c
+1-01 files

FreeBSD/src 8f34b6bshare/man/man5 src.conf.5

src.conf.5: Regen after MK_CROSS_COMPILER=no change
DeltaFile
+3-1share/man/man5/src.conf.5
+3-11 files

FreeBSD/src 7d82731share/mk src.opts.mk

src.opts.mk: !CROSS_COMPILER implies !LLVM_BINUTILS_BOOTSTRAP

This fixes the build when WITHOUT_CROSS_COMPILER is set.

Reported by: fuz, vishwin
Fixes: 17494c6e6b7d ("build: Boostrap LLVM_BINUTILS for cross-tools")
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D56219
DeltaFile
+1-0share/mk/src.opts.mk
+1-01 files

FreeBSD/src 6630c3aetc/mtree BSD.tests.dist, sbin/tunefs Makefile

tunefs: Add tests

MFC after:      1 week
Reviewed by:    ngie
Differential Revision:  https://reviews.freebsd.org/D56034
DeltaFile
+189-0sbin/tunefs/tests/tunefs_test.sh
+5-0sbin/tunefs/Makefile
+4-0sbin/tunefs/tests/Makefile
+2-0etc/mtree/BSD.tests.dist
+200-04 files

FreeBSD/src c5e79c7sbin/tunefs tunefs.c Makefile

tunefs: Don't lower WARNS

Use casts to silence the alignment warnings instead of potentially
suppressing other legitimate warnings.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D56033
DeltaFile
+3-3sbin/tunefs/tunefs.c
+0-2sbin/tunefs/Makefile
+3-52 files

FreeBSD/src 1a03631contrib/tzcode localtime.c zic.c

tzcode: Update to 2026a

Many thanks to Paul Eggert for adopting most of our adaptations as
optional features upstream in the previous release (2025c).

MFC after:      1 week
Reviewed by:    philip
Differential Revision:  https://reviews.freebsd.org/D55741

(cherry picked from commit ff2c98b30b57b9763e2a6575f729bab676e6c025)
DeltaFile
+1,044-709contrib/tzcode/localtime.c
+470-313contrib/tzcode/zic.c
+224-199contrib/tzcode/tz-art.html
+206-192contrib/tzcode/tz-link.html
+195-188contrib/tzcode/theory.html
+224-156contrib/tzcode/private.h
+2,363-1,75722 files not shown
+3,153-2,23028 files

FreeBSD/src f792f3dcontrib/tzcode localtime.c, lib/libc/gen sysconf.c

tzcode: Fix issues when TZ is an absolute path

* If TZ starts with TZDIR, strip any additional slashes so relname
  does not end up looking like an absolute path.  For instance,
  TZ=/usr/share/zoneinfo//UTC should result in UTC, not /UTC.

* In the setugid case, we were incorrectly passing name rather than
  relname to fstatat().

* Modify the tz_env and tz_env_setugid test cases to exercise both
  of these scenarios.

* Also add test cases for invalid values of TZ, which I wrote
  earlier but forgot to include in a5f14e4f9069.

Reported by:    Paul Eggert <eggert at cs.ucla.edu>
MFC after:      3 days
Fixes:          967a49a21a27 ("Update tzcode to 2025b")
Fixes:          a5f14e4f9069 ("tzcode: Use -00 only for invalid time zones")

    [24 lines not shown]
DeltaFile
+82-8lib/libc/tests/stdtime/detect_tz_changes_test.c
+8-5contrib/tzcode/localtime.c
+1-1lib/libc/gen/sysconf.c
+1-0lib/libc/tests/stdtime/Makefile
+92-144 files

FreeBSD/src ea27af6contrib/tzcode localtime.c

tzcode: Fix early tz change detection

Assume tzdata is not fresh if last_checked is zero, as comparing the
current time to last_checked less than __tz_change_interval after boot
may produce a false negative.

While here, invert the return value from tzdata_is_fresh() to better
match its new name (it was previously called recheck_tzdata(), so zero
for fresh and non-zero for stale made sense, but it doesn't now).

PR:             269207
MFC after:      3 days
Reviewed by:    imp
Differential Revision:  https://reviews.freebsd.org/D53502

(cherry picked from commit a38c2f99f81c2fc35c8ca209931c1c46e3e81023)
DeltaFile
+7-7contrib/tzcode/localtime.c
+7-71 files

FreeBSD/src 58d09e1lib/libc/tests/stdtime detect_tz_changes_test.c

tzcode: Test escape from TZDIR

Test a value of TZ that temporarily escapes from TZDIR (which is not
permitted when setugid) then reenters it.

MFC after:      3 days

(cherry picked from commit cf76bfbb235116702ea1689bf984f200a72d2790)
DeltaFile
+26-13lib/libc/tests/stdtime/detect_tz_changes_test.c
+26-131 files

FreeBSD/src 08d1a7acontrib/tzcode localtime.c asctime.c

tzcode: Drop libc namespace

This hasn't been needed in years and is a maintenance headache.

MFC after:      1 week
Reviewed by:    philip
Differential Revision:  https://reviews.freebsd.org/D52694

(cherry picked from commit d58339f398748b50ff84421e9d81f8f6d94cb949)
DeltaFile
+25-27contrib/tzcode/localtime.c
+0-2contrib/tzcode/asctime.c
+0-2contrib/tzcode/difftime.c
+25-313 files

FreeBSD/src 8a26d25contrib/tzcode localtime.c private.h, include time.h

tzcode: Expose and document offtime() and offtime_r()

Includes diff reduction to upstream version of this patch.

MFC after:      3 days
Sponsored by:   Klara, Inc.
Reviewed by:    philip
Differential Revision:  https://reviews.freebsd.org/D39715

(cherry picked from commit 155290b23f0b503b9db675d6a45f85b189ee1926)
DeltaFile
+33-6lib/libc/stdtime/ctime.3
+1-1contrib/tzcode/localtime.c
+1-1contrib/tzcode/private.h
+2-0include/time.h
+37-84 files

FreeBSD/src cb991falib/libc/tests/stdtime detect_tz_changes_test.c

tzcode: Add a test case for plain issetugid case

This catches a bug in tzcode which incorrectly considers TZDEFAULT as
unsafe as if it came from the environment.

Also deduplicate some repeated code, and fix a missing mode in an
open(2) call with O_CREAT set.

Event:          Oslo Hackathon 202508
Reviewed by:    philip
Differential Revision:  https://reviews.freebsd.org/D52241

(cherry picked from commit 016d3ec239b39895cf19aa62552fc316d7d98045)
DeltaFile
+43-17lib/libc/tests/stdtime/detect_tz_changes_test.c
+43-171 files

FreeBSD/src f6a3075contrib/tzcode localtime.c newctime.3

Update tzcode to 2025b

MFC after:      3 weeks

Differential Revision:  https://reviews.freebsd.org/D52103

(cherry picked from commit 967a49a21a27380ba1c545c746b4f1badabefd77)
DeltaFile
+373-212contrib/tzcode/localtime.c
+76-84contrib/tzcode/newctime.3
+89-53contrib/tzcode/zic.c
+68-54contrib/tzcode/asctime.c
+21-101contrib/tzcode/date.1
+82-37contrib/tzcode/private.h
+709-54114 files not shown
+1,121-75120 files

FreeBSD/src ec60ca6contrib/tzcode localtime.c

tzcode: Limit TZ for setugid programs

The zoneinfo parser can be told to read any file the program can access
by setting TZ to either an absolute path, or a path relative to the
zoneinfo directory.  For setugid programs, we previously had a hack from
OpenBSD which rejects values of TZ deemed unsafe, but that was rather
arbitrary (anything containing a dot, for instance).  Leverage openat()
with AT_RESOLVE_BENEATH instead.

For simplicity, move the TZ change detection code to after we've opened
the file, and stat the file descriptor rather than the name.

Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D52029

(cherry picked from commit b6ea2513f7769ea9d9e4d342777111add2c903b0)
DeltaFile
+45-25contrib/tzcode/localtime.c
+45-251 files

FreeBSD/src f1977dccontrib/tzcode localtime.c

tzcode: Use -00 only for invalid time zones

As of tzcode 2025a, if we are unable to load a time zone, we set tzname
to "-00" to indicate an error.  This penalizes users who simply don't
set TZ or create /etc/localtime as a faster way of setting the time zone
to UTC (pointing /etc/localtime at /usr/share/zoneinfo/UTC forces us to
parse it every time for no real benefit).  To rectify this, use "-00"
only if TZ was set or zoneinit() returned something else than ENOENT.

MFC after:      3 days
Fixes:          967a49a21a27 ("Update tzcode to 2025b")
Reviewed by:    philip
Differential Revision:  https://reviews.freebsd.org/D52680

(cherry picked from commit a5f14e4f9069a8ffed66d923bb0ecf20d8a0e6af)
DeltaFile
+6-2contrib/tzcode/localtime.c
+6-21 files

FreeBSD/src 3e8b9c3contrib/tzcode localtime.c

tzcode: Don't treat TZDEFAULT as tainted

tzset() calls zoneinit() with the FROMENV flag set unconditionally, so
if TZ is unset and we use TZDEFAULT instead, we were still treating it
as if it came from the environment.  Unset the FROMENV flag if name is
null and we switch to TZDEFAULT, or if, after skipping the optional
leading colon, we find that name is identical to TZDEFAULT.

This incorporates upstream change d0e0b00f846c ("Avoid unnecessary
access, stat calls").

Fixes:          b6ea2513f776 ("tzcode: Limit TZ for setugid programs")
Event:          Oslo Hackathon 202508
Reviewed by:    philip
Differential Revision:  https://reviews.freebsd.org/D52240

(cherry picked from commit ca89e15355097e9b57bf4e17a50506e081fe04b3)
DeltaFile
+6-4contrib/tzcode/localtime.c
+6-41 files

FreeBSD/src b3f5166lib/libc/tests/stdtime detect_tz_changes_test.c Makefile

tzcode: Add test case for setugid programs

Fixes:          a6b19979bf13 ("tzcode: Fix TZ for non-setugid programs")
Differential Revision:  https://reviews.freebsd.org/D52124

(cherry picked from commit c6c7c7ac94636a1f705a6f4d6ea74b1e62ad517d)
DeltaFile
+42-11lib/libc/tests/stdtime/detect_tz_changes_test.c
+3-1lib/libc/tests/stdtime/Makefile
+45-122 files

FreeBSD/src e58659acontrib/tzcode localtime.c, lib/libc/tests/stdtime detect_tz_changes_test.c

tzcode: Fix TZ for non-setugid programs

The previous commit had the desired effect for setugid programs, but
broke TZ for everyone else.  I didn't notice because my test cases
swap out /etc/localtime instead of setting TZ, so add a test case
that sets TZ.

Fixes:          b6ea2513f776 ("tzcode: Limit TZ for setugid programs")
Reviewed by:    cy
Differential Revision:  https://reviews.freebsd.org/D52108

(cherry picked from commit a6b19979bf13055da5f24d1f240f2acddb35eeac)
DeltaFile
+42-19lib/libc/tests/stdtime/detect_tz_changes_test.c
+6-5contrib/tzcode/localtime.c
+48-242 files

FreeBSD/src 2a4e0e0lib/libc/tests/stdtime detect_tz_changes_test.c

tzcode: Add a test case for thin jails

Add a test case for a typical thin jail scenario where TZDIR does not
exist and we get our information from /etc/localtime.  This is
technically already covered by the detect_tz_changes test case, but
this new test case is independent of the DETECT_TZ_CHANGES option.

(cherry picked from commit b2f394b90062b9f4aee51de4e5fd7513b3db7362)
DeltaFile
+36-7lib/libc/tests/stdtime/detect_tz_changes_test.c
+36-71 files

FreeBSD/src 2ad6daacontrib/tzcode localtime.c

tzcode: Reduce diff to upstream

Reviewed by:    imp, jhb, emaste
Differential Revision:  https://reviews.freebsd.org/D51997

(cherry picked from commit f5efc804294c6bb24bd6d14bf2fb883a7320956c)
DeltaFile
+167-121contrib/tzcode/localtime.c
+167-1211 files

FreeBSD/src d6bc98acontrib/tzcode localtime.c, lib/libc/stdtime Symbol.map Makefile.inc

libc: Test time zone change detection.

While here, clean the detection code up a bit.

Sponsored by:   Klara, Inc.
Sponsored by:   NetApp, Inc.
Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D51343

(cherry picked from commit 57ee56578cc55b3da9a0dee64b385507be2dc80a)
DeltaFile
+281-0lib/libc/tests/stdtime/detect_tz_changes_test.c
+5-13contrib/tzcode/localtime.c
+6-0lib/libc/stdtime/Symbol.map
+4-1lib/libc/tests/stdtime/Makefile
+4-0tools/build/mk/OptionalObsoleteFiles.inc
+1-0lib/libc/stdtime/Makefile.inc
+301-146 files

FreeBSD/src 9b019b4contrib/tzcode localtime.c zic.c

tzcode: Update to 2026a

Many thanks to Paul Eggert for adopting most of our adaptations as
optional features upstream in the previous release (2025c).

MFC after:      1 week
Reviewed by:    philip
Differential Revision:  https://reviews.freebsd.org/D55741

(cherry picked from commit ff2c98b30b57b9763e2a6575f729bab676e6c025)
DeltaFile
+1,044-709contrib/tzcode/localtime.c
+470-313contrib/tzcode/zic.c
+224-199contrib/tzcode/tz-art.html
+206-192contrib/tzcode/tz-link.html
+195-188contrib/tzcode/theory.html
+224-156contrib/tzcode/private.h
+2,363-1,75722 files not shown
+3,153-2,23028 files

FreeBSD/src cf27580sys/netinet6 nd6_nbr.c nd6.h

nd6: Fix delayed NA for proxy addresses

Delayed proxy addresses need special handling, since
they can use link-local ifa as their source address and
have different link-layer data in their response.

Fixes:          f37fbe30f559
Reviewed by:    glebius, markj
Differential Revision: https://reviews.freebsd.org/D55850
DeltaFile
+52-20sys/netinet6/nd6_nbr.c
+1-0sys/netinet6/nd6.h
+53-202 files

FreeBSD/src d9d7b59sys/netpfil/ipfw/nptv6 nptv6.c

ipfw_nptv6: fix handling the ifaddr removal event

The result of IN6_ARE_MASKED_ADDR_EQUAL() macro is not an integer, so
threat it as a boolean value.

PR:             294114
Reported by:    Peter Much <pmc citylink dinoex sub org>
MFC after:      1 week
DeltaFile
+2-2sys/netpfil/ipfw/nptv6/nptv6.c
+2-21 files

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