FreeBSD/src bf1529dsys/netlink netlink_generic.c

netlink: fix LINT-NOVIMAGE build

Include the required header for securelevel_ge()

Fixes:          9933bdcb1264 ("pf: only allow a subset of netlink calls when securelevel is set")
Sponsored by:   Rubicon Communications, LLC ("Netgate")

(cherry picked from commit 3103d39cd99f0a49414f907459d8fd3c11dc36b8)
DeltaFile
+1-0sys/netlink/netlink_generic.c
+1-01 files

FreeBSD/src 6d3401cusr.sbin/ctladm/tests port.sh

ctladm tests: Only use allowed chars in IQN

_ isn't part of the allowed IQN format, but - is.

None functional change.

Reviewed by:            asomers, ngie
Approved by:            asomers (mentor)
Sponsored by:           ConnectWise
Differential Revision:  https://reviews.freebsd.org/D56557

(cherry picked from commit 51b65c6af2e19f1e944c67aa2b5252cd9dc9e2f7)
DeltaFile
+5-5usr.sbin/ctladm/tests/port.sh
+5-51 files

FreeBSD/src 09db364contrib/openbsm/bsm libbsm.h, contrib/openbsm/libbsm bsm_io.c bsm_token.c

Fix memory corruption bugs in BSM record parsing

fetch_newgroups_tok(3): clamp group count to AUDIT_MAX_GROUPS before the
loop to prevent a stack buffer overflow when a crafted record specifies
more than 16 groups.

fetch_execarg_tok(3), fetch_execenv_tok(3): add a bounds check at the
top of the string-walking loop to prevent an out-of-bounds read when the
previous string's nul byte is the last byte of the record buffer.

fetch_sock_unix_tok(3): clamp the memchr search length to the number of
bytes remaining in the buffer to prevent an out-of-bounds read on short
tokens. Also clamp slen to sizeof(path) to prevent a one-byte overflow
when no nul byte is found within the path data.

fetch_socket_tok: fix copy-paste error where the remote address was
written into l_addr instead of r_addr.
Previously reported by: @haginara


    [13 lines not shown]
DeltaFile
+44-6contrib/openbsm/libbsm/bsm_io.c
+8-2contrib/openbsm/bsm/libbsm.h
+1-1contrib/openbsm/libbsm/bsm_token.c
+53-93 files

FreeBSD/src 14dfca7share/man/man4 mac_seeotheruids.4, sys/security/mac_seeotheruids mac_seeotheruids.c

mac_seeotheruids: allow specificgid to be a list of groups

The specificgid functionality has historically allowed only a single
group to be exempt, but in practice one might want a few services to
be exempt for reasons.  From a security perspective, we probably don't
want to encourage unrelated users to be grouped together solely for
this purpose, as that creates one point of shared access that could be
used for nefarious purposes.

Normalize the group list as we do cr_groups to allow for linear matching
rather than quadratic, we just need to account for the differences in
FreeBSD 15.0+ where cr_groups is entirely supplementary groups vs.
earlier versions, where cr_groups[0] is the egid and the rest is
sorted.

Reviewed by:    csjp, des (earlier version)
Sponsored by:   Klara, Inc.

(cherry picked from commit b675ff8eedc9ac93cdf1cfe33185b7a1a027df37)
DeltaFile
+164-10sys/security/mac_seeotheruids/mac_seeotheruids.c
+2-2share/man/man4/mac_seeotheruids.4
+166-122 files

FreeBSD/src 2b8d6e4share/man/man4 mac_seeotheruids.4, sys/security/mac_seeotheruids mac_seeotheruids.c

mac_seeotheruids: allow specificgid to be a list of groups

The specificgid functionality has historically allowed only a single
group to be exempt, but in practice one might want a few services to
be exempt for reasons.  From a security perspective, we probably don't
want to encourage unrelated users to be grouped together solely for
this purpose, as that creates one point of shared access that could be
used for nefarious purposes.

Normalize the group list as we do cr_groups to allow for linear matching
rather than quadratic, we just need to account for the differences in
FreeBSD 15.0+ where cr_groups is entirely supplementary groups vs.
earlier versions, where cr_groups[0] is the egid and the rest is
sorted.

Reviewed by:    csjp, des (earlier version)
Sponsored by:   Klara, Inc.

(cherry picked from commit b675ff8eedc9ac93cdf1cfe33185b7a1a027df37)
DeltaFile
+164-10sys/security/mac_seeotheruids/mac_seeotheruids.c
+2-2share/man/man4/mac_seeotheruids.4
+166-122 files

FreeBSD/src b9414a1contrib/openbsm/bsm libbsm.h, contrib/openbsm/libbsm bsm_io.c bsm_token.c

Fix memory corruption bugs in BSM record parsing

fetch_newgroups_tok(3): clamp group count to AUDIT_MAX_GROUPS before the
loop to prevent a stack buffer overflow when a crafted record specifies
more than 16 groups.

fetch_execarg_tok(3), fetch_execenv_tok(3): add a bounds check at the
top of the string-walking loop to prevent an out-of-bounds read when the
previous string's nul byte is the last byte of the record buffer.

fetch_sock_unix_tok(3): clamp the memchr search length to the number of
bytes remaining in the buffer to prevent an out-of-bounds read on short
tokens. Also clamp slen to sizeof(path) to prevent a one-byte overflow
when no nul byte is found within the path data.

fetch_socket_tok: fix copy-paste error where the remote address was
written into l_addr instead of r_addr.
Previously reported by: @haginara


    [13 lines not shown]
DeltaFile
+44-6contrib/openbsm/libbsm/bsm_io.c
+8-2contrib/openbsm/bsm/libbsm.h
+1-1contrib/openbsm/libbsm/bsm_token.c
+53-93 files

FreeBSD/src 91bfba0usr.sbin/cron/cron cron.8 database.c

cron: log when a crontab path is too long

Log via syslog when snprintf truncates the crontab path, instead of
silently skipping the entry.

Signed-off-by:  Christos Longros <chris.longros at gmail.com>
Reviewed by:    bcr, kevans
Differential Revision:  https://reviews.freebsd.org/D56235
DeltaFile
+9-2usr.sbin/cron/cron/cron.8
+4-2usr.sbin/cron/cron/database.c
+13-42 files

FreeBSD/src 2c2ec6btests/sys/arch/amd64 int0x80.c Makefile

tests/sys/arch/amd64: add a program to check INT $0x80 behavior on amd64

Requested and reviewed by:      markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D56654
DeltaFile
+94-0tests/sys/arch/amd64/int0x80.c
+7-0tests/sys/arch/amd64/Makefile
+101-02 files

FreeBSD/src 454322clib/libifconfig libifconfig_bridge.c

libifconfig: Skip bridge VLAN config for span members

bridge(4) doesn't support BRDGGIFVLANSET for span members, which
means if a span interface is configured, libifconfig will fail to
fetch bridge members.  Skip this for IFBIF_SPAN members.

PR:     292634
MFC after:      3 days
Reported by:    Emrion <kmachine at free.fr>
Reviewed by:    pouria, zlei
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56694
DeltaFile
+5-0lib/libifconfig/libifconfig_bridge.c
+5-01 files

FreeBSD/src 76de408usr.sbin/efibootmgr efibootmgr.c efibootmgr.8

efibootmgr: Show attributes, category and optional data when verbose

Also rework a bit the way device path are displayed for consistency.

Signed-off-by:  stephane.rochoy at stormshield.eu
Reviewed by:    imp
Sponsored by:   Stormshield
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2167
DeltaFile
+60-11usr.sbin/efibootmgr/efibootmgr.c
+1-1usr.sbin/efibootmgr/efibootmgr.8
+61-122 files

FreeBSD/src 48363f3lib/libefivar efiutil.c efivar.h, usr.sbin/efibootmgr Makefile

efivar: Move dump functions into libefivar

To allow their use by efibootmgr.

Signed-off-by:  stephane.rochoy at stormshield.eu
Reviewed by:    imp
Sponsored by:   Stormshield
Pull-Request:   https://github.com/freebsd/freebsd-src/pull/2167
DeltaFile
+193-0lib/libefivar/efiutil.c
+0-190usr.sbin/efivar/efiutil.c
+0-35usr.sbin/efivar/efiutil.h
+10-0lib/libefivar/efivar.h
+4-5usr.sbin/efivar/efivar.c
+3-4usr.sbin/efibootmgr/Makefile
+210-2343 files not shown
+212-2369 files

FreeBSD/src d9c0594usr.sbin/ctld ctld.cc kernel.cc

ctld: kernel-sourced portal groups are not dummies

The current and historical versions of ctld would flag our initial set
of kernel ports as dummies, because their portal groups were empty since
portals come from the configuration on-disk.

As a result, we would never try to remove a kernel port at startup that
didn't exist in the configuration (possibly a feature if you wanted
concurrent ctld(8)), and we would always try to port->kernel_add() on
ports in the configuration (even if they actually did have an existing
kernel port).

Flag these portal groups as kernel groups so that we avoid trying to add
ports that already exist.  It may be the case that the kernel_remove()
loop in conf::apply() needs to do something other than the current
`oldport->is_dummy()` to avoid removing ports that it isn't supposed to
be managing, but that wuld also seem to apply to LUNs that would be
removed today.


    [2 lines not shown]
DeltaFile
+15-0usr.sbin/ctld/ctld.cc
+4-0usr.sbin/ctld/kernel.cc
+2-0usr.sbin/ctld/ctld.hh
+21-03 files

FreeBSD/src fe9d81dlib/libiscsiutil log.c

libiscsiutil: preserve errno across warning logs

Various calls in the implementation can clobber errno; preserve it for
the caller since none of these will bubble up pass/fail to simplify
some future error handling in ctld.

Reviewed by:    jhb
Differential Revision:  https://reviews.freebsd.org/D56539
DeltaFile
+3-1lib/libiscsiutil/log.c
+3-11 files

FreeBSD/src 44d33eausr.sbin/bsdinstall/scripts rootpass

bsdinstall: fix root password prompt with backslashes

Use "read -r" to set the root password in "bsdinstall rootpass" to
prevent issues with passwords containing one or more backslash
characters.

PR:             294781
Discussed with: tuexen, crest
Approved by:    khorben
MFC after:      3 days
Event:          Wiesbaden Hackathon 202604

(cherry picked from commit 1566386b90d34dea7f30a0e6b511e178bd0d50b8)
DeltaFile
+2-2usr.sbin/bsdinstall/scripts/rootpass
+2-21 files

FreeBSD/src 66f55b9stand/powerpc/boot1.chrp boot1.c

boot1.chrp: Improve comment for the SLOF hack

Since this original comment was written, the actual issue in SLOF
was diagnosed and documented in commit 424089a0fc, which fixed it
for loader(8).  Update the comment in boot1 to be more informative
to future readers.

MFC after:      3 days
Reviewed by:    jhibbits, adrian
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56470

(cherry picked from commit eb0279550d52962241b4178101cd7f7d732eb682)
DeltaFile
+5-8stand/powerpc/boot1.chrp/boot1.c
+5-81 files

FreeBSD/src 4429630. Makefile.inc1

Makefile.inc1: Only copy locales to INSTALLTMP on FreeBSD

Makefile.inc1 copies locales to ${INSTALLTMP} to avoid issues when
running make installworld on a live system.  However, this can break
on non-FreeBSD systems, e.g. on openSUSE where /usr/share/locales
has mode 0555, which means after we copy it, we can't delete it,
so the build fails.

Since this functionality is only useful when installing over a
live system, disable it when the build host is not FreeBSD.

MFC after:      2 weeks
Reviewed by:    kevans, emaste
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56677
DeltaFile
+9-2Makefile.inc1
+9-21 files

FreeBSD/src d1c176frelease/packages create-sets.sh

packages: Make create-sets.sh more robust

Use ${PKG_CMD} rather than bare 'pkg' to fix the build when pkg is
not in the tools path.  Provide a default in case it's not set for
some reason (e.g., running the script by hand).

Since set -- $(...) does not trigger an exit from set -e if the
command fails, this failure was silent and resulted in sets not
being built correctly if we failed to run pkg.  Use a temporary
variable, which does trigger set -e, to fail correctly.

MFC after:      2 weeks
Reviewed by:    sjg
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56676
DeltaFile
+4-1release/packages/create-sets.sh
+4-11 files

FreeBSD/src 7970815lib/clang Makefile.inc lldb.pre.mk, lib/clang/liblldb Makefile

llvm: Move libprivatelldb to the lldb package

Set PACKAGE=lldb in lldb.pre.mk rather than in individual Makefiles;
change lib/clang/Makefile.inc from PACKAGE=clang to PACKAGE?=clang to
avoid overwriting it.

This is safe to MFC to stable/15 since the moved library will be
picked up automatically by pkg.

MFC after:      2 weeks
Reviewed by:    emaste
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56674
DeltaFile
+1-1lib/clang/Makefile.inc
+2-0lib/clang/lldb.pre.mk
+0-1lib/clang/liblldb/Makefile
+0-1usr.bin/clang/lldb-server/Makefile
+0-1usr.bin/clang/lldb/Makefile
+3-45 files

FreeBSD/src c4b244alibexec/rc/rc.d Makefile, packages Makefile.powerpc Makefile.arm

acpi: Remove userland bits on non-ACPI platforms

ACPI is only supported on amd64, arm64 and i386.  Don't install the
power_profile rc script or devd configuration on other platforms.

This avoids creating a useless FreeBSD-acpi package on those platforms.

MFC after:      2 weeks
Reviewed by:    imp
Sponsored by:   https://www.patreon.com/bsdivy
Differential Revision:  https://reviews.freebsd.org/D56650
DeltaFile
+0-17packages/Makefile.powerpc
+0-17packages/Makefile.arm
+0-6packages/acpi/Makefile
+4-0tools/build/mk/OptionalObsoleteFiles.inc
+3-0sbin/devd/Makefile
+3-0libexec/rc/rc.d/Makefile
+10-401 files not shown
+10-417 files

FreeBSD/src cb0e3a5contrib/openresolv resolvconf.in resolvconf.8.in

contrib/openresolv: MFV openresolv 3.17.4

Reviewed by:    pfg
Approved by:    lwhsu (mentor)
Differential Revision:  https://reviews.freebsd.org/D56269
DeltaFile
+770-237contrib/openresolv/resolvconf.in
+141-85contrib/openresolv/resolvconf.8.in
+142-40contrib/openresolv/resolvconf.conf.5.in
+159-0contrib/openresolv/resolvectl.in
+96-0contrib/openresolv/systemd-resolved.in
+57-25contrib/openresolv/libc.in
+1,365-38711 files not shown
+1,514-42717 files

FreeBSD/src e139a49contrib/smart libsmart.c freebsd_dev.c

Revert "Vendor import of smart at 1.0.2"

This reverts commit 68e5b71517e947b4e3f349c970af362b47b45f27.
DeltaFile
+0-1,359contrib/smart/libsmart.c
+0-828contrib/smart/freebsd_dev.c
+0-334contrib/smart/smart.c
+0-245contrib/smart/smart.8
+0-174contrib/smart/libsmart.h
+0-158contrib/smart/libsmart_desc.c
+0-3,09810 files not shown
+0-3,36116 files

FreeBSD/src 39f4882sys/dev/hwpmc hwpmc_ibs.c hwpmc_amd.c

hwpmc: Add IBS capability control policy

Reject unsupported AMD IBS and PMU control bits before programming the
MSRs.

Initialize IBS fetch/op allow masks from CPUID feature bits and validate
user-provided IBS control values against those masks. Keep the
load-latency filter dependency on L3MissOnly, but avoid decoding fields
that are already constrained by the mask.

Apply the same reserved-bit policy to the AMD PMU raw-config path by
checking core, L3, and data fabric configs against subclass-specific
masks.

Fix the IBS CPUID feature bit definitions used by the policy.

Reviewed by:    mhorne, Ali Mashtizadeh <ali at mashtizadeh.com>
Sponsored by:   AMD
Signed-off-by:  Andre Silva <andasilv at amd.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2140
DeltaFile
+79-2sys/dev/hwpmc/hwpmc_ibs.c
+48-3sys/dev/hwpmc/hwpmc_amd.c
+22-0sys/dev/hwpmc/hwpmc_amd.h
+16-4sys/dev/hwpmc/hwpmc_ibs.h
+165-94 files

FreeBSD/src 146b30bsys/dev/hwpmc hwpmc_amd.c hwpmc_ibs.c

hwpmc: Add extra_mask sysctls per counter type

Expose kern.hwpmc.{ibs_fetch,ibs_op,amd_core,amd_l3,amd_df}_extra_mask
as RWTUN uint64s that OR into the CPUID-derived allow mask at
validation time. Default 0, so the strict policy applies unless an
administrator opts bits back in — intended for testing the wrmsr_safe
path in PR #2157.

Reviewed by:    mhorne, Ali Mashtizadeh <ali at mashtizadeh.com>
Sponsored by:   AMD
Signed-off-by:  Andre Silva <andasilv at amd.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2140
DeltaFile
+22-3sys/dev/hwpmc/hwpmc_amd.c
+17-1sys/dev/hwpmc/hwpmc_ibs.c
+39-42 files

FreeBSD/src a9a562alib/libc/gen exterr_cat_filenames.h, sys/dev/hwpmc hwpmc_ibs.c

hwpmc_ibs: Add external error handling

Add EXTERR_CAT_HWPMC_IBS to the external error categories and replace generic
EINVAL returns in ibs_allocate_pmc() with EXTERROR() calls that provide
detailed error messages.

This will be augmented with additional cases in the near future.

Reviewed by:    mhorne
Sponsored by:   AMD
Signed-off-by:  Andre Silva <andasilv at amd.com>
Pull Request:   https://github.com/freebsd/freebsd-src/pull/2134
DeltaFile
+8-3sys/dev/hwpmc/hwpmc_ibs.c
+1-0lib/libc/gen/exterr_cat_filenames.h
+1-0sys/sys/exterr_cat.h
+10-33 files

FreeBSD/src d5db883share/man/man7 groups.7

group.7: spell priority
DeltaFile
+1-1share/man/man7/groups.7
+1-11 files

FreeBSD/src c165079lib/libc/stdlib reallocarray.3

reallocarray.3: Fix formatting
DeltaFile
+1-1lib/libc/stdlib/reallocarray.3
+1-11 files

FreeBSD/src 41c5a4atests/sys/net if_wg.sh

sys.net.if_wg.wg_key_peerdev_makeshared: Add require metadata

Add require.user root and require.kmods if_wg to
wg_key_peerdev_makeshared_head(), consistent with the other wg tests.

Without if_wg.ko causes ifconfig wg create to fail with EINVAL.  The
test also needs root to create jails.

Sponsored by:   The FreeBSD Foundation
DeltaFile
+2-1tests/sys/net/if_wg.sh
+2-11 files

FreeBSD/src 68e5b71contrib/smart libsmart.c freebsd_dev.c

Vendor import of smart at 1.0.2

smart/diskhealth is a command line application to monitor disk health
from a storage device via SMART.

Reviewed by:    fuz, jrm
Relnotes:       yes
Differential Revision:  https://reviews.freebsd.org/D56638
DeltaFile
+1,359-0contrib/smart/libsmart.c
+828-0contrib/smart/freebsd_dev.c
+334-0contrib/smart/smart.c
+245-0contrib/smart/smart.8
+174-0contrib/smart/libsmart.h
+158-0contrib/smart/libsmart_desc.c
+3,098-010 files not shown
+3,361-016 files

FreeBSD/src 5ed26c2usr.sbin/bsdinstall/scripts auto

bsdinstall: Improve auto-partition message

Manually tuning ZFS for systems with <8GB ram hasn't been necessary at
least since the switch to OpenZFS. We have users reporting using 1GB RAM
with no manual tuning/issues. Further, the page this links to is a stale
wiki page, which is causing complaints. Remove this misleading note and
replace it with a similar message for UFS. While here, reword that note
to be a bit clearer.

PR:                     287719
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D50971
DeltaFile
+2-2usr.sbin/bsdinstall/scripts/auto
+2-21 files

FreeBSD/src ab98fd3share/man/man7 build.7

build.7: Explain update-packages repo signing

MFC after:              3 days
Reported by:            kevans
Reviewed by:            kevans, ngie
Differential Revision:  https://reviews.freebsd.org/D56607
DeltaFile
+10-1share/man/man7/build.7
+10-11 files