HardenedBSD/src ee4b14c. RELNOTES, lib Makefile

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+1-16share/man/man5/src.conf.5
+1-7usr.bin/gzip/Makefile
+2-3lib/Makefile
+0-4tools/build/options/WITHOUT_BZIP2
+4-0RELNOTES
+0-2share/mk/src.opts.mk
+8-321 files not shown
+8-337 files

HardenedBSD/src 6f1191f. RELNOTES, lib Makefile

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+1-16share/man/man5/src.conf.5
+1-7usr.bin/gzip/Makefile
+2-3lib/Makefile
+0-4tools/build/options/WITHOUT_BZIP2
+4-0RELNOTES
+0-2share/mk/src.opts.mk
+8-321 files not shown
+8-337 files

HardenedBSD/src 1bcba71sys/kern sys_timerfd.c, sys/sys time.h

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+1,347-0tests/sys/kern/timerfd.c
+27-17sys/kern/sys_timerfd.c
+21-0sys/sys/time.h
+2-0tests/sys/kern/Makefile
+1,397-174 files

HardenedBSD/src c484a2dtests/sys/kern timerfd.c Makefile

timerfd: Add tests

Take Jan Kokemuller's timerfd tests from the epoll-shim project,
stripping out code that isn't directly related to FreeBSD.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D55789
MFC after:              2 weeks

(cherry picked from commit 834c1ba793d900b791e19ff449b1e0b96fb494a0)
DeltaFile
+1,318-0tests/sys/kern/timerfd.c
+3-0tests/sys/kern/Makefile
+1,321-02 files

HardenedBSD/src 0b7e325tests/sys/kern timerfd.c Makefile

timerfd: Expect periodic timer performance failures

The current timerfd implementation fails to correctly count events on a
nanosecond callout interval. The timerfd__periodic_timer_performance
test detects this and reports failure.

Mark this test as an expected failure so it isn't flagged by CI. A link
to the bug report is attached to the test for reference.

While we're here, clean up some minor style and Make issues.

Fixes:          834c1ba793d9 ("timerfd: Add tests")
MFC after:      1 week

(cherry picked from commit cb692380f1e05ffc4184877844e93051f24ed302)
DeltaFile
+2-3tests/sys/kern/timerfd.c
+0-1tests/sys/kern/Makefile
+2-42 files

HardenedBSD/src 53c01dfsys/kern sys_timerfd.c

timerfd: Use saturating sbintime conversions

Some timerfd consumers set expirations with timespec tv_sec components
larger than 2^31 - 1. In such cases, converting that timespec to
sbintime results in data loss or sign flip, yielding a shorter
expiration than desired.

To avoid this problem, use saturating timespec-to-sbintime conversion
functions. These will clamp the converted sbintime to SBT_MAX under
circumstances where the normal conversion functions would overflow.

Saturating conversions still result in data loss, but the consequences
are less severe, causing problems only after SBT_MAX (~68 years) of
system uptime elapses.

Reviewed by:            imp
Differential Revision:  https://reviews.freebsd.org/D55792
MFC after:              2 weeks

(cherry picked from commit 0e8f351be7935729bf67dc1b7aa4d178cf154931)
DeltaFile
+5-5sys/kern/sys_timerfd.c
+5-51 files

HardenedBSD/src 6a5176asys/kern sys_timerfd.c

timerfd: Wake up on discontinuous jump

If a discontinous realtime clock change occurs and sets any TFD_JUMPED
bits on the timerfd, then wake up waiting readers. This fixes failures
from the timerfd_root__clock_change_notification test case.

MFC after: 2 weeks

(cherry picked from commit b11fba41265ae132acfb05587a6dbf60334d3279)
DeltaFile
+11-3sys/kern/sys_timerfd.c
+11-31 files

HardenedBSD/src 7f087edsys/sys time.h

sys/time: Add saturating sbt conversions

When converting from timespec to sbintime, the timespec's 64-bit tv_sec
component is shifted to the left 32 bits, causing any information in the
upper 32 bits to be lost.

This data loss during conversion can turn timespecs with very large
tv_sec counters into sbintimes that represent much smaller time
durations.

Add tstosbt_sat() and tvtosbt_sat(), which are saturating versions of
tstosbt and tvtosbt. With these routines, any overflow resulting from
the conversion is clamped to [-SBT_MAX - 1, SBT_MAX].

Reviewed by:            imp, markj
Differential Revision:  https://reviews.freebsd.org/D55791
MFC after:              2 weeks

(cherry picked from commit e3799530b3ba38567f8052b9e107884609fc71ea)
DeltaFile
+21-0sys/sys/time.h
+21-01 files

HardenedBSD/src 9d71069sys/kern sys_timerfd.c

timerfd: Suppress kqueue readability after jump read

Do not report EVFILT_READ after reading a discontinuous clock jump.
This makes the kqueue filter consistent with Linux epoll behavior
and timerfd_poll(), which already checks tfd_jumped != TFD_READ before
reporting POLLIN.

MFC after: 2 weeks

(cherry picked from commit 33345b8834859cf1ad7f1256f3a34b4a7c83e8e8)
DeltaFile
+1-1sys/kern/sys_timerfd.c
+1-11 files

HardenedBSD/src 2d10377tests/sys/kern timerfd.c

timerfd: Guard expected performance failure

During the timerfd__periodic_timer_performance test, only expect
failures when the expiration count is less than 400000000. This
prevents the test from being reported as a true failure in environments
where scheduling latency is high enough to delay timerfd wakeups.

Fixes:          cb692380f1e0 ("timerfd: Expect periodic timer ...")
MFC after:      1 week

(cherry picked from commit 4b16ff49bf4bf875997fe4c80a0afc0d440b7aac)
DeltaFile
+2-1tests/sys/kern/timerfd.c
+2-11 files

HardenedBSD/src 9b78538sys/kern sys_timerfd.c, tests/sys/kern timerfd.c

timerfd: Fix interval callout scheduling

When a timerfd interval callout misses its scheduled activation time, a
differential is calculated based on the actual activation time and the
scheduled activation time. This differential is divided by the timerfd's
interval time and the quotient is added to the timerfd's counter.

Before this change, the next callout was scheduled to activate at:
scheduled activation time + timerfd interval.

This change fixes the scheduling of the next callout to activate at:
actual activation time + timerfd interval - remainder.

Reviewed by:            markj
Differential Revision:  https://reviews.freebsd.org/D55790
MFC after:              2 weeks

(cherry picked from commit 85c0f1a87da1fd1eb3e646e86f70e630c48da91a)
DeltaFile
+29-0tests/sys/kern/timerfd.c
+13-11sys/kern/sys_timerfd.c
+42-112 files

HardenedBSD/src 2d843b7. RELNOTES

RELNOTES: Document WITHOUT_BZIP2* removal
DeltaFile
+4-0RELNOTES
+4-01 files

HardenedBSD/src ab92575share/man/man5 src.conf.5, share/mk src.opts.mk

Remove WITHOUT_BZIP2, WITHOUT_BZIP2_SUPPORT

WITHOUT_BZIP2_SUPPORT only affects a single binary, gzip(1); it doesn't
remove bzip2 support from other bits (e.g., libarchive) and there are
no similar options for gzip, xz or zstd.

WITHOUT_BZIP2 has not done anything at all since it was first added
in 2007.

MFC after:      never
Discussed on:   arch@
Reviewed by:    imp, des, adrian, delphij, emaste
Differential Revision:  https://reviews.freebsd.org/D56148
Sponsored by:           https://www.patreon.com/bsdivy
DeltaFile
+1-16share/man/man5/src.conf.5
+1-7usr.bin/gzip/Makefile
+0-4tools/build/options/WITHOUT_BZIP2
+0-2share/mk/src.opts.mk
+0-1tools/build/options/WITHOUT_BZIP2_SUPPORT
+2-305 files

HardenedBSD/src b13d706lib Makefile

libauditd: Don't build if WITHOUT_AUDIT is set

When WITHOUT_AUDIT is set, nothing is built that uses this library,
so don't build the library.  This avoids building the FreeBSD-audit
package when WITHOUT_AUDIT is set.

MFC after:      never
Reviewed by:    csjp, imp, emaste
Differential Revision:  https://reviews.freebsd.org/D56157
Sponsored by:           https://www.patreon.com/bsdivy
DeltaFile
+1-1lib/Makefile
+1-11 files

HardenedBSD/src baa7a87lib Makefile

libsamplerate: Only build when virtual_oss is built

Gate libsamplerate behind MK_CUSE and MK_SOUND, like virtual_oss.
Nothing else uses this library, so there's no point building it
if we aren't building virtual_oss.

This avoids building a useless FreeBSD-sound package containing
only this library when WITHOUT_SOUND is set.

MFC after:      1 week
Reviewed by:    christos, emaste
Differential Revision:  https://reviews.freebsd.org/D56164
Sponsored by:           https://www.patreon.com/bsdivy
DeltaFile
+1-2lib/Makefile
+1-21 files

HardenedBSD/src 1e0a465contrib/libucl/include ucl.h ucl++.h, contrib/libucl/src ucl_util.c ucl_parser.c

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+1,012-999contrib/libucl/src/ucl_util.c
+701-690contrib/libucl/src/ucl_parser.c
+556-620contrib/libucl/src/ucl_msgpack.c
+346-349contrib/libucl/src/ucl_schema.c
+347-334contrib/libucl/include/ucl.h
+301-264contrib/libucl/include/ucl++.h
+3,263-3,25646 files not shown
+5,007-4,61252 files

HardenedBSD/src ce3f554contrib/libucl/include ucl.h ucl++.h, contrib/libucl/src ucl_util.c ucl_parser.c

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+1,012-999contrib/libucl/src/ucl_util.c
+701-690contrib/libucl/src/ucl_parser.c
+556-620contrib/libucl/src/ucl_msgpack.c
+346-349contrib/libucl/src/ucl_schema.c
+347-334contrib/libucl/include/ucl.h
+301-264contrib/libucl/include/ucl++.h
+3,263-3,25646 files not shown
+5,007-4,61252 files

HardenedBSD/src abda442contrib/libucl/include ucl.h ucl++.h, contrib/libucl/src ucl_util.c ucl_parser.c

contrib/libucl:  Import libucl 0.9.3

Differential Revision: https://reviews.freebsd.org/D54583
Approved by: bapt
MFC after:  3 days

Changelog: https://github.com/vstakhov/libucl/releases/tag/0.9.3
DeltaFile
+1,012-999contrib/libucl/src/ucl_util.c
+701-690contrib/libucl/src/ucl_parser.c
+556-620contrib/libucl/src/ucl_msgpack.c
+346-349contrib/libucl/src/ucl_schema.c
+347-334contrib/libucl/include/ucl.h
+301-264contrib/libucl/include/ucl++.h
+3,263-3,25626 files not shown
+4,731-4,57932 files

HardenedBSD/src b7b485elib/libc/gen posix_spawn.3

posix_spawn_file_action_addopen.3: ignoring close failure is now approved

Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
MFC after:      3 days
Differential revision:  https://reviews.freebsd.org/D56222
DeltaFile
+4-2lib/libc/gen/posix_spawn.3
+4-21 files

HardenedBSD/src 7caa711. ObsoleteFiles.inc, include spawn.h

posix_spawn: actions chdir and fchdir are now required by POSIX

Drop the _np suffix.

Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56222
DeltaFile
+17-12lib/libc/gen/posix_spawn_file_actions_addopen.3
+5-0lib/libc/gen/posix_spawn.c
+4-0include/spawn.h
+2-2lib/libc/gen/Makefile.inc
+2-2lib/libc/gen/posix_spawn.3
+4-0ObsoleteFiles.inc
+34-161 files not shown
+36-167 files

HardenedBSD/src e56858fcontrib/netbsd-tests/lib/libc/gen/posix_spawn t_fileactions.c

posix_spawn test: switch to POSIX spelling for addchdir and addfchdir

Reviewed by:    dim
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56222
DeltaFile
+2-2contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_fileactions.c
+2-21 files

HardenedBSD/src 4b862c7share/man/man4 splash.4, stand/common gfx_fb.c bootstrap.h

splash: add shutdown splash

This commit adds a shutdown splash to the existing kernel startup splash(4)
screen feature. It can be customized by providing a PNG image to the
shutdown_splash directive loader.conf(5).

Sponsored by:   Defenso
MFC after:      2 weeks
Reviewed by:    vexeduxr, ziaee, manu
Differential Revision:  https://reviews.freebsd.org/D55140
DeltaFile
+19-1sys/dev/vt/vt_core.c
+16-4stand/common/gfx_fb.c
+11-3share/man/man4/splash.4
+6-1stand/efi/loader/bootinfo.c
+5-0sys/kern/subr_module.c
+3-1stand/common/bootstrap.h
+60-102 files not shown
+64-118 files

HardenedBSD/src b3d6829sys/kern subr_module.c

subr_module: account for MODINFOMD_EFI_ARCH

Fixes:          b538d4911004ca541507166b8ec9689d2e87d1aa
MFC after:      2 weeks
DeltaFile
+8-0sys/kern/subr_module.c
+8-01 files

HardenedBSD/src 8ef0093lib/libsysdecode netlink.c Makefile, usr.bin/truss syscalls.c

truss: add support for decoding Netlink messages

Netlink usage is growing in FreeBSD. This patch adds support to
`truss(1)` to decode Netlink headers in sendmsg/recvmsg calls, making
debugging network configuration tools significantly easier.

Changes:

libsysdecode: Add `sysdecode_netlink()` to parse struct `nlmsghdr`.
truss: Detect `AF_NETLINK` sockets and decode the message payload.

Reviewed by:    kp
Signed-off-by:  Ishan Agrawal <iagrawal9990 at gmail.com>
Github PR:      https://github.com/freebsd/freebsd-src/pull/1950
DeltaFile
+94-0lib/libsysdecode/netlink.c
+66-1usr.bin/truss/syscalls.c
+1-1lib/libsysdecode/Makefile
+1-0lib/libsysdecode/sysdecode.h
+162-24 files

HardenedBSD/src 71ba188lib/libsys mq_open.2, release/packages/ucl kyua-all.ucl ncurses-all.ucl

Merge remote-tracking branch 'origin/hardened/current/master' into hardened/current/cross-dso-cfi
DeltaFile
+29-31release/packages/ucl/kyua-all.ucl
+24-2release/packages/ucl/ncurses-all.ucl
+22-1lib/libsys/mq_open.2
+1-1sbin/tunefs/tunefs.c
+76-354 files

HardenedBSD/src 615e1f5lib/libsys mq_open.2, release/packages/ucl kyua-all.ucl ncurses-all.ucl

Merge branch 'freebsd/current/main' into hardened/current/master
DeltaFile
+29-31release/packages/ucl/kyua-all.ucl
+24-2release/packages/ucl/ncurses-all.ucl
+22-1lib/libsys/mq_open.2
+1-1sbin/tunefs/tunefs.c
+76-354 files

HardenedBSD/src 16cf93fetc/mtree BSD.usr.dist, sys/dev/ena ena_netmap.c ena.c

Merge branch 'freebsd/15-stable/main' into hardened/15-stable/main
DeltaFile
+5-3sys/dev/ena/ena_netmap.c
+2-3sys/dev/ena/ena.c
+1-2sys/dev/ena/ena_rss.h
+1-1sys/dev/ena/ena.h
+0-2etc/mtree/BSD.usr.dist
+9-115 files

HardenedBSD/src 3e9f4fdlib/libsys mq_open.2

mq_open(2): document sysctl limit EINVAL and ENFILE conditions

Document two missing error conditions for mq_open(2):

- EINVAL: returned when mq_maxmsg exceeds kern.mqueue.maxmsg or
  mq_msgsize exceeds kern.mqueue.maxmsgsize.
- ENFILE: add kern.mqueue.maxmq sysctl name to the existing entry.

PR:             243209
Reviewed by:    mhorne
MFC after:      1 week
Signed-off-by:  Kit Dallege <xaum.io at gmail.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2098
DeltaFile
+22-1lib/libsys/mq_open.2
+22-11 files

HardenedBSD/src 1059899sys/dev/ena ena_netmap.c

ena: Verify that an ENA ring is in netmap only in native mode

netmap operates in two modes:
1) Emulated - netmap handling is done by the network stack, the
NIC driver operates transparently to netmap.
2) Native - netmap management is done by the NIC driver.

When checking whether a specific ENA ring is running in netmap
mode, only the following checks were done:
1. IFCAP_NETMAP - Check whether netmap capability is enabled on
the device.
2. NKR_NETMAP_ON - Check whether netmap is actively using this
ring.

The above checks implied that the netmap mode is native and the
ENA driver needs to handle the netmap logic.
The code was missing an explicit check on whether native mode
is actually on (NAF_NATIVE).
This led to a case where though emulated mode was used and

    [19 lines not shown]
DeltaFile
+5-3sys/dev/ena/ena_netmap.c
+5-31 files

HardenedBSD/src 3a01651sys/dev/ena ena.c ena_rss.h

ena: Minor changes

1. Move parenthesis to correct place in switch and fix include order
2. Add comment at the end of an ifdef for clarity
3. Change include order.

Reviewed by: cperciva
Differential Revision: https://reviews.freebsd.org/D55696
Sponsored by: Amazon, Inc.

(cherry picked from commit 2667a8454cff5896c7b467c78cd4ace5ad40f5eb)
DeltaFile
+2-3sys/dev/ena/ena.c
+1-2sys/dev/ena/ena_rss.h
+3-52 files