Commit Graph

302264 Commits

Author SHA1 Message Date
Lexi Winter 18a870751b krb5: Fix typo "SPDX-License-Idendifier"
sed -e s/SPDX-License-Idendifier/SPDX-License-Identifier/
2025-08-17 22:17:06 +01:00
Vladimir Kondratyev e06d0350ec NOTES: improve HIDRAW_MAKE_UHID_ALIAS description
Reviewed by:	aokblast
Differential Revision:	https://reviews.freebsd.org/D51611
2025-08-18 00:00:45 +03:00
Vladimir Kondratyev 4a04e0a6c7 u2f(4): a HID driver for FIDO/U2F security keys
While FIDO/U2F keys were already supported by the generic uhid(4) and
hidraw(4) drivers, this driver adds some additional features an does
steps to tighten the security of FIDO/U2F access.

- It automatically loads through devd.
- Automatically enables HQ_NO_READAHEAD for FIDO/U2F devices.
- Implements only miminum set of features.
- Do not requires external devfs configuration to set character device
  permissions.
- Names character device as u2f/# to make possible capsicum or any
  other pledge()-style sandboxing.

PR:		265528
Differential Revision:	https://reviews.freebsd.org/D51612
2025-08-18 00:00:45 +03:00
Vladimir Kondratyev 37e3b66466 usbhid(4): Implement USB_GET_DEVICEINFO ioctl
With factoring out of supporting code from ugen(4) driver.
The ioctl is used in FIDO/U2F security key drivers to get
USB product and manufacturer strings.

PR:		264843
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D51609
2025-08-18 00:00:45 +03:00
Vladimir Kondratyev 149b9f26d0 hidraw(4): Rename to uhid if HIDRAW_MAKE_UHID_ALIAS is specified
instead of renaming uhid(4) to hidraw to make easier import of coming
u2f(4) driver which has similar option.

Differential Revision:	https://reviews.freebsd.org/D51608
2025-08-18 00:00:44 +03:00
Vladimir Kondratyev d3d92388a5 sys/conf.h: Add u2f group id to use in coming FIDO/U2F driver
We have already reserved this group ID in /etc/group file.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D51607
2025-08-18 00:00:44 +03:00
Vladimir Kondratyev df6ae0577d hid: Allow serial execution of HID_INTR_START method.
It is required to implement HQ_NO_READAHEAD HID quirk.

Differential revision:	https://reviews.freebsd.org/D51606
2025-08-18 00:00:44 +03:00
Vladimir Kondratyev 7699ec1558 hid: Add HQ_NO_READAHEAD quirk and implement it in usbhid(4)
It disables interrupt emulation on poll-driven buses like USB and
forces aquiring of only one USB frame per read(2) operation.
This avoids an FIDO/U2F issue where IN endpoint data received from
the device right before the file handle is closed, gets lost.

PR:		263995
Reviewed by:	aokblast
Differential revision:	https://reviews.freebsd.org/D51605
2025-08-18 00:00:44 +03:00
Poul-Henning Kamp 6582915c59 tcopy: Fix braino.
Spotted by: Gunther Nikl
2025-08-17 19:38:56 +00:00
Dag-Erling Smørgrav f9ff1e48cc vfs: Assert that st_rdev is NODEV for non-devices
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D51956
2025-08-17 19:29:28 +02:00
Dag-Erling Smørgrav df52ed9f74 ext2fs: Set st_rdev to NODEV when not a device
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D51955
2025-08-17 19:29:27 +02:00
Dag-Erling Smørgrav ccc7f2f202 zfs: Set st_rdev to NODEV, not 0, when not a device
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D51954
2025-08-17 19:29:27 +02:00
Dag-Erling Smørgrav 567e6250c0 vfs: Introduce VN_ISDEV() macro
We frequently need to check if a vnode refers to either a character or
block special, so we might as well have a macro for it.

We somewhat less frequently need to perform similar checks on things
that aren't vnodes (usually a struct vattr *), so add VATTR_ISDEV()
and a generic VTYPE_ISDEV() as well.

Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D51947
2025-08-17 19:29:27 +02:00
Dag-Erling Smørgrav 4eaa7f6662 stat(2): Document the st_rdev field
MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	bcr
Differential Revision:	https://reviews.freebsd.org/D51946
2025-08-17 19:29:27 +02:00
Dag-Erling Smørgrav 8073a5137f getmntpoint: Don't compare st_rdev for non-devices
If the mntfromname of a mountpoint is not a device (e.g. nullfs, tarfs,
procfs) we shouldn't compare st_rdev, as any match will be spurious.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Sponsored by:	NetApp, Inc.
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D51945
2025-08-17 19:29:27 +02:00
Warner Losh d4b59682cb fusefs: Fix a warning in a test
ints can be up to 10 digits, plus NUL. Make the val array 12 to silences
a lame gcc warning (the range of the int is such that we'll never
truncate, but this is a cheap fix).

Sponsored by:		Netflix
2025-08-17 11:13:42 -06:00
Warner Losh edf9a2fae9 jemalloc: don't error out on initializer warning in gcc
gcc doesn't like something about the initializer that comes with
jemalloc. Since it's vendor code, make this warning not an error
for -Werror purposes.

Sponsored by:		Netflix
2025-08-17 11:13:33 -06:00
Konstantin Belousov 054c6e5b2f ufs_times_locked(): style
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2025-08-17 19:21:33 +03:00
Konstantin Belousov 6fd60c4887 ufs: st_rdev is only meaningful for special nodes
Instead of leaking di_db[0] (for regular files this is the index of the
first block of the file), return NODEV when not a special node.

Reported and reviewed by:	des
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D51943
2025-08-17 19:06:44 +03:00
Konstantin Belousov e1a358aa72 Revert "amd64: re-enable la57"
This reverts commit 2abf24b369.
The la57 should be not force-enabled.

Sponsored by:	The FreeBSD Foundation
2025-08-17 16:41:18 +03:00
Gordon Bergling 7ce07c4142 g_part: Fix a few typos in source code comments
- s/partitition/partition/

MFC after:	3 days
2025-08-17 11:30:16 +02:00
Gordon Bergling 4c7b81cfa2 isa: Fix a typo in a source code comment
- s/Monochome/Monochrome/

MFC after:	3 days
2025-08-17 11:28:20 +02:00
Gordon Bergling a3a78bd7a7 udp: Fix a typo in a source code comment
- s/datgram/datagram/

MFC after:	3 days
2025-08-17 11:26:44 +02:00
Gordon Bergling a7818e3420 stand/efi: Fix a typo in a source code comment
- s/externel/external/

MFC after:	3 days
2025-08-17 11:23:45 +02:00
Gordon Bergling 9113e9d687 ice(4): Fix a few typos in source code comments
- s/wit/with/
- s/Recceive/Receive/
- s/convenction/convention/
- s/metaddata/metadata/

Obtained from:	OpenBSD
MFC after: 	3 days
2025-08-17 10:32:24 +02:00
Konstantin Belousov 2abf24b369 amd64: re-enable la57
It benefits KVA. For userspace la57 is disabled by default for quite
some time, to avoid compat issues.

Reviewed by:	alc, imp, olce
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D51929
2025-08-17 11:09:24 +03:00
Gordon Bergling 663061da20 isci(4): Fix a typo in a source code comment
- s/contants/constants/

MFC after:	3 days
2025-08-17 09:33:50 +02:00
Gordon Bergling f066a42505 test/netfibs: Fix a typo in a source code comment
- s/aguments/arguments/

MFC after:	3 days
2025-08-17 09:32:10 +02:00
Gordon Bergling c0367c654a localedef.1: Fix a typo in the manual page
- s/contants/content/

MFC after:	3 days
2025-08-17 09:29:04 +02:00
Gordon Bergling fbf0efd026 services_mkdb(8): Fix a typo in a source code comment
- s/priviledged/privileged/

MFC after:	3 days
2025-08-17 09:26:53 +02:00
Gordon Bergling 333b0490e3 libc: Fix a typo in a source code comment
- s/aguments/arguments/

MFC after:	3 days
2025-08-17 09:24:59 +02:00
Gordon Bergling 74eb496c10 bnxt(4): Fix typos in a comment and a kernel message
- s/priviledged/privileged/

MFC after:	5 days
2025-08-17 09:04:49 +02:00
Gordon Bergling 9c7a9b3ff1 arm: Fix two typos in kernel messages of pmu_fdt.c
- s/interupt/interrupt/

MFC after:	5 days
2025-08-17 09:01:13 +02:00
Lexi Winter c6778f3a44 Makefile.libcompat: Tweak krb5 compat dirs
krb5/util contains both programs and libraries; trying to build that
for compat confuses bsd.prog.mk and results in unwanted files being
created in the source tree.  Remove krb5/util and instead list only
the directories underneath krb5/util which contain libraries.

The libdata change from the diff isn't included; that will be fixed
in a different way.

Fixes:		fb13ae28b2 ("Makefile.libcompat: Add krb5/util")
Reviewed by:	ngie (previous version)
Differential Revision:	https://reviews.freebsd.org/D51937
2025-08-17 02:19:21 +01:00
Colin Percival 31ac42b486 Revert certctl reimplementation and follow-ups
The reimplementation of certctl, while much needed, broke the release
build and 72 hours later corrections are still under review (D51896).

This revert should be reverted once that is ready to land; I just need
this out of the tree temporarily because breakage is interfering with
release engineering for the upcoming 15.0-RELEASE.

Unsquashed reversions:
Revert "etc: add missing mtree entry for certctl tests"
This reverts commit f751757259.
Revert "certctl: Fix bootstrap build"
This reverts commit c989e3cc3d.
Revert "certctl: Reimplement in C"
This reverts commit 81d8827ad8.

With hat:	re@
2025-08-16 17:25:49 -07:00
Igor Ostapenko 939fec44a7 kyua: Improve required_kmods metadata
- Make it platform agnostic
- Separate FreeBSD related code
- Fix tests
- Make it report all non-loaded modules instead of the first occurrence
  only
- Update kyuafile.5 man page

Reviewed by:	ngie
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/kyua/pull/270
2025-08-16 23:19:43 +00:00
Lexi Winter 14b4a3f3ef UPDATING: Add an entry for the libmilter package move 2025-08-16 21:18:28 +01:00
Lexi Winter 9b48774c57 sendmail: Move libmilter to its own package
Many things other than sendmail itself use the milter API, for example
mail/opendkim from ports.  Putting the library in its own package means
those applications don't need to depend on FreeBSD-sendmail.

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D51914
2025-08-16 21:07:57 +01:00
Lexi Winter fb13ae28b2 Makefile.libcompat: Add krb5/util
This fixes missing libraries (libcom_err, libkrb5profile, ...)
for the 32-bit build, since these libraries live in krb5/util.

Reviewed by:	ngie, des
Differential Revision:	https://reviews.freebsd.org/D51926
2025-08-16 21:07:57 +01:00
Jaeyoon Choi 3f94fb8d6a amd64 GENERIC: Add ufshci
Sponsored by:           Samsung Electronics
Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D51507
2025-08-16 12:09:15 -06:00
Jaeyoon Choi 2be8ce8405 ufshci: Add functions for UTP Task Management
This commit adds UTP Task Management Request functions and revisits the
UTR/UTRM construction logic.
It also introduces ufshci_ctrlr_cmd_send_task_mgmt_request(), which
will be used for timeout handling in a follow-up commit.

Test: I temporarily added the code below to the ufshci_ctrlr_start()
function to test it on a Galaxy Book S.
```
static void
ufshci_ctrlr_start(struct ufshci_controller *ctrlr)
{
...
	/* Test: Task Mangement Request */
	ufshci_printf(ctrlr,
	    "Test: Task Mangement Request\n");
	struct ufshci_completion_poll_status status;
	status.done = 0;
	ufshci_ctrlr_cmd_send_task_mgmt_request(ctrlr,
	    ufshci_completion_poll_cb, &status,
	    UFSHCI_TASK_MGMT_FUNCTION_QUERY_TASK, 0, 0, 0);
	ufshci_completion_poll(&status);
	if (status.error) {
		ufshci_printf(ctrlr,
		    "ufshci_ctrlr_cmd_send_task_mgmt_request failed!\n");
		return;
	}
	uint32_t service_response;
	service_response =
	    status.cpl.response_upiu.task_mgmt_response_upiu.output_param1;
	ufshci_printf(ctrlr, "Task Management Service Response = 0x%x\n",
	    service_response);
...
}
```

Sponsored by:		Samsung Electronics
Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D51506
2025-08-16 12:09:15 -06:00
Kyle Evans dd22a6853d Belatedly bump __FreeBSD_version for setgroups/getgroups revisions
9da2fe96ff ("kern: fix setgroups(2) and getgroups(2) [...]") added new
versions of the getgroups(2)/setgroups(2) syscalls.

Requested by:	cperciva
2025-08-16 13:05:28 -05:00
Kyle Evans b81fd3fc8b jail: fix backfilling the "name" for jid-named jails
Using the cfparam variant of add_param() will actually copy the name and
flags from the passed-in param, which I hadn't considered.  We actually
want the name/flags from the "name" param so that we can do variable
expansion against it right after that -- otherwise it cannot be found,
since variable expansion actually searches by name.

While we're here, `jls -e` was the intermediate name for `jls -c` that
never saw the light of the day.  Fix our existence test.

Reviewed by:	jamie
Fixes:	02944d8c49 ("jail: consistently populate the KP_JID [...]")
Differential Revision:	https://reviews.freebsd.org/D51831
2025-08-16 12:39:59 -05:00
Dag-Erling Smørgrav 20f0996700 freebsd-update: Do not fsync
Fsyncing each file we install slows us down significantly and adds
little to no safety.

MFC after:	1 week
PR:		287897
2025-08-16 01:23:36 +02:00
Dag-Erling Smørgrav ef8f3e9131 libkern: Drop incorrect qsort optimization
See 5205b32de3 for details.

PR:		287089
MFC after:	1 week
Reviewed by:	jlduran
Differential Revision:	https://reviews.freebsd.org/D51919
2025-08-16 01:23:35 +02:00
Jessica Clarke 6118587172 rtld-elf: Fix VDSO Obj_Entry mapsize and report in utrace(2)
Subtracing addr is only appropriate for position-dependent objects,
where vaddrbase would also be the same value. For position-independent
objects, like the VDSO (which we already assume due to setting vaddrbase
to 0), the segments start at 0, not addr.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D51924
2025-08-15 23:21:35 +01:00
Warner Losh 69af14a57c jemalloc: Note update in UPDATING and RELNOTES
Sponsored by:		Netflix
2025-08-15 15:57:59 -06:00
Warner Losh c43cad8717 jemalloc: Merge from jemalloc 5.3.0 vendor branch
This brings in a merge from jemalloc 5.3.0. It's almost fully scripted, except:
	Three conflicts resolved by hand:
	include/jemalloc/internal/test_hooks.h	Use the new name
	src/extent.c				Use the new code
	src/jemalloc.c				Use the new code since je_realloc has moved

The script is recorded in FREEBSD-upgrade. The old script did svn
commands that were basically a rebase of our changes. This update has a
series of diff reduction changes before this.

Note: I'd planned on fixing the above three conflicts with commits, but
ran out of time when I did this work in January. I got discouraged when
jemalloc was EOL'd and didn't pick this back up. I did the above by hand
to get this into FreeBSD 15.0

This work is a repeat of the work by Minsoo Choo who did all these
changes and created a pull request. Given the importance of jemalloc, I
audited these changes by redoing them in this series of commits (and
with the script that was checked in). I did this to confince myself and
anybody else in doubt that there was no supply chain attack. The diffs
between this series of commits and Minsoo's work are minor (though the
version skew makes adds some noise). Interested parties can independent
audit each step, I hope. I've listed Minsoo as a co-author since without
his pull request to test again, this wouldn't have been possible.

Thanks to brooks@ for help with getting the jemalloc 3 ABI compat
symbols right.

Co-authored-by: Minsoo Choo <minsoochoo0122@proton.me>
Pull Request: https://github.com/freebsd/freebsd-src/pull/1337
Sponsored by: Netflix
2025-08-15 15:48:34 -06:00
Warner Losh da260ab23f jemalloc: Only replace _pthread_mutex_init_calloc_cb in private namespace
When we're not doing the private namespace remap, we don't need to do
this pragma. This is needed for the bootstrapping path when we import a
new version of jemalloc.

No functional change.

Sponsored by:		Netflix
2025-08-15 15:24:46 -06:00
Warner Losh 6371645df7 jemalloc: Add JEMALLOC_PRIVATE_NAMESPACE for the libc namespace
Gate the namespace dance on this define. This allows us to bootstrap new
versions of jemalloc more easily. One of the steps of import is building
to find what symbols need to be private. When we do that, we don't want
to do this dance.

No functional change.

Sponsored by:		Netflix
2025-08-15 15:24:39 -06:00