FreeBSD/src b551cb0sys/kern vfs_subr.c

During shutdown, announce each file system as it's unmounted.

But only if debug.bootverbose=1.

MFC after:      2 weeks
Sponsored by:   ConnectWise
DeltaFile
+18-1sys/kern/vfs_subr.c
+18-11 files

FreeBSD/src 9aff62dusr.bin/fortune/datfiles freebsd-tips

freebsd-tips: documentation inside the bugs

Reviewed by:    ziaee
Event:          Berlin Hackathon 202609
DeltaFile
+4-0usr.bin/fortune/datfiles/freebsd-tips
+4-01 files

FreeBSD/src d1c0714sbin/bectl bectl.8, sbin/ipfw ipfw.8

manpages: Fix author e-mail address formatting

 - consistently use Mt request within Aq.  This makes author
   e-mail addresses clickable in many frontends.
 - @freebsd.org -> @FreeBSD.org
 - (user at host.tld) -> Aq Mt user at host.tld

Event:          Berlin Hackathon 202609
MFC after:      3 days
Reviewed by:    ziaee
Differential Revision:  https://reviews.freebsd.org/D59410
DeltaFile
+7-7sys/netinet/libalias/libalias.3
+3-3stand/forth/beastie.4th.8
+3-3sbin/bectl/bectl.8
+3-2sbin/ipfw/ipfw.8
+2-2usr.sbin/bhyve/bhyve.8
+2-2stand/efi/gptboot/gptboot.efi.8
+20-1967 files not shown
+99-9873 files

FreeBSD/src 5b10c3ctests/sys/kern Makefile

tty_pts: reduce/correct libatf-c linkage

ATF_TESTS_C automatically adds the appropriate library to LDADD --
there's no need to manually append the same library.

MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59411
DeltaFile
+1-2tests/sys/kern/Makefile
+1-21 files

FreeBSD/src f656bdesys/dev/usb/controller xhci.h xhci.c

xhci: Only reset the data toggle value when the USB stack asks for it

The previous patch assumes that we don't want to reset toggle bit in
STOPPED_STEP. However, a device can explicitly call
usbd_clear_data_toggle if necessary. As a result, instead of not
dropping the bit unconditionally, we added a field in xhci to specify
that we want to drop it, so that usbd_clear_data_toggle can handle it
correctly.

Reported by:    oh
Reviewed by:    kevans
Tested by:      oh
Fixes:          28d85db46b48 ("xhci: Do not drop and add bits in xhci")

(cherry picked from commit 0f59df83869d3734a33d96b01381823e6a3ef3ff)
DeltaFile
+18-5sys/dev/usb/controller/xhci.c
+1-0sys/dev/usb/controller/xhci.h
+19-52 files

FreeBSD/src 96dfa56sys/dev/usb/controller xhci.h xhci.c

xhci: Only reset the data toggle value when the USB stack asks for it

The previous patch assumes that we don't want to reset toggle bit in
STOPPED_STEP. However, a device can explicitly call
usbd_clear_data_toggle if necessary. As a result, instead of not
dropping the bit unconditionally, we added a field in xhci to specify
that we want to drop it, so that usbd_clear_data_toggle can handle it
correctly.

Reported by:    oh
Reviewed by:    kevans
Tested by:      oh
Fixes:          28d85db46b48 ("xhci: Do not drop and add bits in xhci")

(cherry picked from commit 0f59df83869d3734a33d96b01381823e6a3ef3ff)
DeltaFile
+18-5sys/dev/usb/controller/xhci.c
+1-0sys/dev/usb/controller/xhci.h
+19-52 files

FreeBSD/src 885b048usr.sbin/pw pw_user.c

pw: simplify group lookup in usermod

MFC After:      1 week
DeltaFile
+1-3usr.sbin/pw/pw_user.c
+1-31 files

FreeBSD/src dc052bcstand/efi/boot1 zfs_module.c, stand/libsa/zfs zfs.c zfsimpl.c

stand: set st_dev/st_ino in the loader's ZFS stat for veriexec

The loader's ZFS implementation never set st_dev or st_ino in
zfs_dnode_stat(). With an uninitialized struct stat, veriexec's device
comparison in lib/libsecureboot/veopen.c read stack garbage and skipped
the matching manifest entry, failing with a spurious "no entry" on ZFS
root under UEFI Secure Boot.

Rather than zeroing the device (which would break veriexec's ability to
tell apart the same path on different datasets), populate st_dev and
st_ino with the same intrinsic identifiers the kernel uses:

- st_dev = the dataset's ds_fsid_guid (as the kernel does via
  dmu_objset_fsid_guid()/dsl_dataset_fsid_guid()), already read in
  zfs_mount_dataset() and now propagated through struct zfsmount.
- st_ino = the object number resolved in zfs_lookup(), propagated
  through struct file (the loader's equivalent of the kernel's z_id).

dev_t and ino_t are 64-bit on FreeBSD, so both are assigned directly

    [15 lines not shown]
DeltaFile
+48-6stand/libsa/zfs/zfsimpl.c
+5-3stand/libsa/zfs/zfs.c
+3-2stand/efi/boot1/zfs_module.c
+56-113 files

FreeBSD/src 4337e2bsys/dev/usb/controller xhci.c

usb: xhci: allow up to 1s for SET_ADDRESS

Some devices take a little longer, and the spec doesn't really seem to
mandate a maximum.  The common path in usbd_req_set_address() has
already been bumped to 1s and I have a headset (Logitech H390) that does
need a little bit longer, so let's match it in xhci.

Reviewed by:    aokblast

(cherry picked from commit 135df778543123a7dea08553c78da1b51a6b3098)
DeltaFile
+1-1sys/dev/usb/controller/xhci.c
+1-11 files

FreeBSD/src 7399eb4sys/kern kern_environment.c

kern: fix oversight in security.bsd.unprivileged_kenv_read

It was intended that one could close the hole back in loader, but the
sysctl was actually not marked TUNABLE.  The hardening menu option thus
did nothing, because we wouldn't read the value from kenv.

Reported by:    markj
Fixes:  6e81fbf5833d ("bsdinstall: add a hardening knob [...]")
Fixes:  4fd518fcb2bb ("kern: add a security knob to disable [...]")

(cherry picked from commit 8befc9e8b194d874d00239568584552279bebddd)
DeltaFile
+1-1sys/kern/kern_environment.c
+1-11 files

FreeBSD/src 1cfebc9usr.sbin/prometheus_sysctl_exporter prometheus_sysctl_exporter.8 prometheus_sysctl_exporter.c

prometheus_sysctl_exporter: don't abort on bad labels

We can probaby consider these kernel bugs, in which case asserting is
not the most helpful thing we can do.  Let's emit the necessary details
to stderr and exit non-zero to aid debugging these without completely
blocking the ability to export all of the well-formed metrics.

Reviewed by:    rew

(cherry picked from commit 4f42ec2f38ee4a4eba8f3298e7968f0523f87aa0)
DeltaFile
+40-14usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c
+6-1usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.8
+46-152 files

FreeBSD/src b8370f5usr.sbin/bsdinstall/scripts hardening

bsdinstall: add a hardening knob for unprivileged kenv access

It makes sense.

Reviewed by:    zleei

(cherry picked from commit 6e81fbf5833d43529fd8a253b592af9666b04e8e)
DeltaFile
+4-0usr.sbin/bsdinstall/scripts/hardening
+4-01 files

FreeBSD/src 6b1371fstand/efi/boot1 zfs_module.c, stand/libsa/zfs zfs.c zfsimpl.c

stand: set st_dev/st_ino in the loader's ZFS stat for veriexec

The loader's ZFS implementation never set st_dev or st_ino in
zfs_dnode_stat(). With an uninitialized struct stat, veriexec's device
comparison in lib/libsecureboot/veopen.c read stack garbage and skipped
the matching manifest entry, failing with a spurious "no entry" on ZFS
root under UEFI Secure Boot.

Rather than zeroing the device (which would break veriexec's ability to
tell apart the same path on different datasets), populate st_dev and
st_ino with the same intrinsic identifiers the kernel uses:

- st_dev = the dataset's ds_fsid_guid (as the kernel does via
  dmu_objset_fsid_guid()/dsl_dataset_fsid_guid()), already read in
  zfs_mount_dataset() and now propagated through struct zfsmount.
- st_ino = the object number resolved in zfs_lookup(), propagated
  through struct file (the loader's equivalent of the kernel's z_id).

dev_t and ino_t are 64-bit on FreeBSD, so both are assigned directly

    [15 lines not shown]
DeltaFile
+48-6stand/libsa/zfs/zfsimpl.c
+5-3stand/libsa/zfs/zfs.c
+3-2stand/efi/boot1/zfs_module.c
+56-113 files

FreeBSD/src 8db4de3sys/dev/usb/controller xhci.c

usb: xhci: allow up to 1s for SET_ADDRESS

Some devices take a little longer, and the spec doesn't really seem to
mandate a maximum.  The common path in usbd_req_set_address() has
already been bumped to 1s and I have a headset (Logitech H390) that does
need a little bit longer, so let's match it in xhci.

Reviewed by:    aokblast

(cherry picked from commit 135df778543123a7dea08553c78da1b51a6b3098)
DeltaFile
+1-1sys/dev/usb/controller/xhci.c
+1-11 files

FreeBSD/src 48c56b5sys/kern kern_environment.c

kern: fix oversight in security.bsd.unprivileged_kenv_read

It was intended that one could close the hole back in loader, but the
sysctl was actually not marked TUNABLE.  The hardening menu option thus
did nothing, because we wouldn't read the value from kenv.

Reported by:    markj
Fixes:  6e81fbf5833d ("bsdinstall: add a hardening knob [...]")
Fixes:  4fd518fcb2bb ("kern: add a security knob to disable [...]")

(cherry picked from commit 8befc9e8b194d874d00239568584552279bebddd)
DeltaFile
+1-1sys/kern/kern_environment.c
+1-11 files

FreeBSD/src 8d227fcusr.sbin/prometheus_sysctl_exporter prometheus_sysctl_exporter.8 prometheus_sysctl_exporter.c

prometheus_sysctl_exporter: don't abort on bad labels

We can probaby consider these kernel bugs, in which case asserting is
not the most helpful thing we can do.  Let's emit the necessary details
to stderr and exit non-zero to aid debugging these without completely
blocking the ability to export all of the well-formed metrics.

Reviewed by:    rew

(cherry picked from commit 4f42ec2f38ee4a4eba8f3298e7968f0523f87aa0)
DeltaFile
+40-14usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.c
+6-1usr.sbin/prometheus_sysctl_exporter/prometheus_sysctl_exporter.8
+46-152 files

FreeBSD/src 240bea9usr.sbin/bsdinstall/scripts hardening

bsdinstall: add a hardening knob for unprivileged kenv access

It makes sense.

Reviewed by:    zleei

(cherry picked from commit 6e81fbf5833d43529fd8a253b592af9666b04e8e)
DeltaFile
+4-0usr.sbin/bsdinstall/scripts/hardening
+4-01 files

FreeBSD/src 61c27edusr.bin/mkimg mkimg.c, usr.bin/mkimg/tests Makefile mkimg_offset_test.sh

mkimg: Restore offset support for the SIZE partition form

Commit 50c1240ebfaf moved the offset parsing into the PART_KIND_FILE case of
the switch, leaving PART_KIND_SIZE with no offset handling.
The offset was then silently ignored, so "-p efi::$size:$start" as used by
release/${ARCH}/mkisoimages.sh packed the ESP immediately after the preceding
partition.

Parse the offset outside the switch so both forms honour it.

Add tests covering absolute and relative offsets in both forms.

Reviewed by:    jrtc27, bsdimp, jlduran
Approved by:    jlduran, bsdimp
Sponsored by:   Netflix
Assisted-by:    Claude Code (Opus 5)
DeltaFile
+227-0usr.bin/mkimg/tests/mkimg_offset_test.sh
+12-8usr.bin/mkimg/mkimg.c
+1-0usr.bin/mkimg/tests/Makefile
+240-83 files

FreeBSD/src 619d092stand/userboot userboot.h, stand/userboot/userboot main.c

iuserboot: bump the interface to v6, add an accept_interpreter callback

If an explicit loader wasn't requested, then bhyveload(8) maintains a
/boot handle that it can use for swapping to a different flavor.  This
means that we expose all of the host /boot to the sandbox for the
duration of script execution.

Add a callback to ack that we're OK with the interpreter so that
bhyveload(8) can release the bootfd.  This is worth doing because it's
prior to guest script execution, so we're still running a reasonably
untainted process.

Reviewed by:    imp, jhb
Differential Revision:  https://reviews.freebsd.org/D58771
DeltaFile
+18-5usr.sbin/bhyveload/bhyveload.c
+12-0stand/userboot/userboot.h
+2-0stand/userboot/userboot/main.c
+32-53 files

FreeBSD/src c0c7b56sys/dev/ntsync ntsync.c

ntsync(4): do not double-free the alert event when a dup was detected for WAIT_ALL

Reported by:    Andrew Griffiths <andrew at calif.io>
Reported by:    Chris Jarrett-Davies <chrisjd at openai.com>
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
DeltaFile
+2-0sys/dev/ntsync/ntsync.c
+2-01 files

FreeBSD/src 6b6aa45usr.sbin/pw pw_user.c, usr.sbin/pw/tests pw_userdel_test.sh

pw: fix at job removal when deleting a user

rmat() used stat() with a path relative to the current working
directory, so it never found the job files in /var/at/jobs and the
at(1) jobs of a deleted user were never removed.

ef7d0eb9489f also broke it by introducing a typo: /usr/sbin/atrm instead
of /usr/bin/artm.

Use fstatat() with the directory fd to stat the job files relative to
the at jobs directory, and unlinkat() them directly instead of spawning
atrm.

Those changes allow us to make it works with pw -R.

MFC After:      1 week
DeltaFile
+29-0usr.sbin/pw/tests/pw_userdel_test.sh
+13-14usr.sbin/pw/pw_user.c
+42-142 files

FreeBSD/src ba39177usr.sbin/pw pw_user.c, usr.sbin/pw/tests pw_userdel_test.sh

pw: remove crontab with unlinkat instead of spawning crontab

crontab -r only unlinks the crontab file, so spawn it directly with
unlinkat() relative to conf.rootfd.  This also makes the crontab
removal work with pw -R.

MFC After:      1 week
DeltaFile
+5-21usr.sbin/pw/pw_user.c
+18-0usr.sbin/pw/tests/pw_userdel_test.sh
+23-212 files

FreeBSD/src cd575d5usr.sbin/pw pw_group.c

pw: fix error message in grp_set_passwd to use correct fd

MFC After:      1 week
DeltaFile
+1-1usr.sbin/pw/pw_group.c
+1-11 files

FreeBSD/src 1ccf807usr.sbin/pw pw_user.c, usr.sbin/pw/tests pw_userdel_test.sh

pw: remove mail file with unlinkat instead of building a path

This is consistent with how at jobs and crontabs are removed.

MFC After:      1 week
DeltaFile
+16-0usr.sbin/pw/tests/pw_userdel_test.sh
+7-4usr.sbin/pw/pw_user.c
+23-42 files

FreeBSD/src 5f5a165usr.sbin/pw pw_user.c

pw: cleanup

No functional change intended.

MFC After:      1 week
DeltaFile
+21-22usr.sbin/pw/pw_user.c
+21-221 files

FreeBSD/src cc79017sys/netinet6 nd6.h

nd6: Fix a typo on MAX_NEIGHBOR_ADVERTISEMENT comment

Fixes:  7f3b46fe54f1 ("ndp: Add support for Gratuitous Neighbor...")
DeltaFile
+1-1sys/netinet6/nd6.h
+1-11 files

FreeBSD/src e1d903bsys/kern vfs_bio.c

buf: Avoid calling bufdomain() on newly initialized bufs

bufinit() inserts newly initialized bufs into the QUEUE_EMPTY queue, at
which point they haven't yet been assigned a domain.  Thus, bufdomain()
returns &bdomain[-1], which trips the array-bounds sanitizer.

This is harmless since we don't use the result in that case, but let's
avoid the invalid access to begin with.  This is sufficient to let an
amd64 kernel boot to a login prompt with -fsanitize=array-bounds
configured.

Reported by:    Andrew Griffiths <andrew at calif.io>
Reviewed by:    rlibby, kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D59381
DeltaFile
+4-4sys/kern/vfs_bio.c
+4-41 files

FreeBSD/src 2350f75usr.sbin/pw pw.c, usr.sbin/pw/tests Makefile pw_test.sh

pw: check -M, -V and -R input to avoid dereferencing argv[2]

MFC After: 1 week
DeltaFile
+20-0usr.sbin/pw/tests/pw_test.sh
+8-0usr.sbin/pw/pw.c
+2-1usr.sbin/pw/tests/Makefile
+30-13 files

FreeBSD/src 92e8a76usr.sbin/pw pw_utils.c pw_user.c, usr.sbin/pw/tests Makefile pw_useradd_test.sh

pw: use _PWDASH pseudo-fd for "-" in pw_checkfd

pw_checkfd() returned the character "-" (45) for the "-" argument,
which was ambiguous with a real file descriptor.

MFC After:      1 week
DeltaFile
+107-0usr.sbin/pw/tests/pw_unit_test.c
+35-0usr.sbin/pw/tests/pw_useradd_test.sh
+9-1usr.sbin/pw/tests/Makefile
+3-3usr.sbin/pw/pw_user.c
+3-3usr.sbin/pw/pw_group.c
+1-1usr.sbin/pw/pw_utils.c
+158-81 files not shown
+159-87 files

FreeBSD/src e3767e1sys/netpfil/pf pf.c

pf: Fix uninitialised action when dropping bad TTL ND packets

Approved by:    kp
Sponsored by:   InnoGames GmbH
Differential Revision:  https://reviews.freebsd.org/D58755
DeltaFile
+1-0sys/netpfil/pf/pf.c
+1-01 files