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
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
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)
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)
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]
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)
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)
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)
bsdinstall: add a hardening knob for unprivileged kenv access
It makes sense.
Reviewed by: zleei
(cherry picked from commit 6e81fbf5833d43529fd8a253b592af9666b04e8e)
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]
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)
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)
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)
bsdinstall: add a hardening knob for unprivileged kenv access
It makes sense.
Reviewed by: zleei
(cherry picked from commit 6e81fbf5833d43529fd8a253b592af9666b04e8e)
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)
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
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
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
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
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
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