1
0
mirror of https://git.FreeBSD.org/src.git synced 2026-06-02 11:24:32 +00:00
Commit Graph

307139 Commits

Author SHA1 Message Date
Colin Percival 6881fd278d pkg-stage.sh: Add ext2 and ntfs
Having these packages available on release media may help users who
need to sneakernet other packages (e.g. firmware) from systems running
Linux or Windows.

Suggested by:	vladlen, ziaee
MFC after:	3 days
2026-02-21 16:41:02 -08:00
Alexander Ziaee 456ae98208 ufs_disk_close.3: Correct include header macro
This manual used the library macro to mark up a header file, causing
pollution in the apropos database for libraries, as well as omission
from the apropos database for headers. This also renders differently,
enclosing the header in angle brackets.

MFC after:	3 days
2026-02-21 19:14:01 -05:00
Aymeric Wibo 98ffaae49f libc: Roll {l,ll,imax}abs(3) manpages into just abs(3)
No need to have 4 separate manpages for these functions. Use opportunity
to change parameter names in the source from j -> i to reflect the name
used in POSIX. (The ISO C standard uses j but i is a better name
anyway.)

Reviewed by:	des, rpokala
Approved by:	rpokala
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55361
2026-02-22 00:22:05 +01:00
Aymeric Wibo 637a8ec157 stdckdint.3: Fix standard in comment
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55360
2026-02-22 00:20:19 +01:00
Aymeric Wibo c242bf1b70 libc: Roll {l,ll,imax}div(3) manpages into just div(3)
No need to have 4 separate manpages for these functions.

Reviewed by:	ziaee, rpokala, des
Approved by:	rpokala, des
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D55360
2026-02-22 00:19:25 +01:00
Dag-Erling Smørgrav d57dee7ab6 lpr: Add deprecation notice
These programs require elevated privileges to work and have not seen
regular maintenance in decades.  Unless someone steps up and overhauls
them, we will have to remove them before 16.0.  Better-maintained
alternatives are available in ports (print/cups, sysutils/LPRng).

MFC after:	3 days
2026-02-21 22:26:51 +01:00
Dag-Erling Smørgrav d4f6cb7542 build: Move all of lp under LPR option
* Tag related directories with package=lp

* Make the examples/printing directory conditional on MK_LPR

* Make the hosts.lpd(5) manual page conditional on MK_LPR

MFC after:	3 days
2026-02-21 22:25:49 +01:00
Lexi Winter 7965c93e4d packages: Don't create empty packages
If a package plist only contains directories, but no files, do not
create the package.

This fixes an issue where setting "package=foo" in mtree causes the
"foo" package to always be created, even if nothing else installs in
that package, because the mtree entry is always added to the plist.

This most often happens:

* With architecture-specific directories, because mtree can't install
  a directory conditionally based on architecture, and

* With packages that are completely empty when a particular src.conf
  knob is disabled, because mtree will still create the directories.

Although it's theoretically possible that we might want to create a
package that only contains directories, there are no such packages
today.

MFC after:	2 weeks (stable/15 only)
Reviewed by:	manu, des
Differential Revision:	https://reviews.freebsd.org/D55412
Sponsored by:	https://www.patreon.com/bsdivy
2026-02-21 20:21:59 +00:00
Mark Johnston fa77660a3c pipe: Avoid unnecessary priv_check() calls in pipespace_new()
Running out of pipe map KVA is a rare case, so reorder checks
accordingly, presuming that calling priv_check() is more expensive than
the calculation.  In particular, priv_check() might not be cheap to
evaluate if MAC hooks are installed.

Reviewed by:	olce, kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D55378
2026-02-21 16:28:49 +00:00
Mark Johnston 0fa6ce2556 sysctl: Avoid calling priv_check() unnecessarily
After commit 7d1d9cc440 we only serialize large sysctl requests for
non-root users, but we should avoid calling priv_check() unless the
request actually is large, as that's not the common case.  In
particular, priv_check() might not be cheap to evaluate if MAC hooks are
installed.

Reviewed by:	olce, kib
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D55377
2026-02-21 16:16:32 +00:00
Warner Losh 80950a079b CONTRIBUTING.md: Github to Phabricator move adivce
When moving from Github to Phabricator, request that the original github
pull request be closed with the URL of the Phab. This cuts down on
clutter and helps us track things better.

Sponsored by:		Netflix
2026-02-21 08:30:26 -07:00
Toomas Soome 23605a8e51 loader.efi: efi_redirect_exceptions does use uninitialized pointer
loader_idt.rd_base is not set when we are attempting to bcopy(),
resulting to data stored to page 0 and therefore corrupting it.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D55180
2026-02-21 17:27:35 +02:00
Toomas Soome f2186bbd63 loader.efi: free_tables() appears to free tss_pa twice.
we check and reset loader_gdt_pa, but use FreePages(tss_pa).

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D55179
2026-02-21 17:20:54 +02:00
Christos Margiolis 3deae7b786 sound: Detect unsupported formats
This way we can avoid edge-cases like
8af6aee96e ("virtual_oss(8): Remove
floating point formats from preference list").

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D55403
2026-02-21 12:36:58 +01:00
Konstantin Belousov 5c8af592f6 procctl(PROC_REAP_KILL): align error reporting with pgkill(2)
ESRCH from cr_cansignal() means that the target process should be not
visible to the initiator.  So do not report pids with ESRCH result.

Noted by:	markj
Reviewed by:	markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55341
2026-02-21 11:45:47 +02:00
Konstantin Belousov 0e67c3f675 reap_kill_subtree_once(): reap_kill_proc_work() might drop proctree_lock
Due to this, restart the iteration over the p_reapsiblings if the lock
was dropped.

Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55288
2026-02-21 11:45:47 +02:00
Konstantin Belousov be140717a0 procctl(PROC_REAP_KILL): use pgrp pg_killsx sx to sync with fork
PROC_REAP_KILL must guarantee that all reaper descendants are signalled.
In particular, it must ensure that forked but not yet fully linked
descendants cannot escape killing. Currently, proc_reap() fullfils the
guarantee by single-threading stopping the target process, which moves
the target to the userspace boundary, so the target cannot fork while
the signal is sent.

Single-threading has undesirable effect of sometimes terminating sleeps
with EINTR.

Since the time that the bug with PROC_REAP_KILL was fixed, we grow
the pg_killsx mechanism that is similarly used by the process group
signalling to ensure that no member of the process group escapes.
Reuse pg_killsx for PROC_REAP_KILL as well.

Besides the functional change of no longer causing spurious EINTR, not
single-threading the target means that we no longer need to delegate the
work to the taskqueue.

PR:	290844
Reported by:	bdrewery
Reviewed by:	des, markj
Tested by:	des, pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D55288
2026-02-21 11:45:47 +02:00
Toomas Soome dc11af08a4 loader.efi: tss_pa setup seems to be flawed in trap.c
since sd_lobase is 24 bits, we would need to shift 24 bits, not 16.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D55178
2026-02-21 10:49:34 +02:00
Toomas Soome 503374af39 fix typo in efi/loader/arch/amd64/trap.c
Rename grap_faults to grab_faults

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D55177
2026-02-21 10:40:48 +02:00
Xin LI e2abec625b MFV: less v692. 2026-02-20 21:33:50 -08:00
Enji Cooper e20e26e4e2 asmc: code style modernization and minor cleanups
- Allow `ASMC_DEBUG` to be treated as a variadic macro.
- Add ellipses around `sizeof(..)` calls.
- Reindent some of the lines to better follow style(9) with line
  wrapping.

A number of other clang-format changes were not taken as they are not
compatible with style(9).

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D55394
2026-02-20 21:29:36 -08:00
Xin LI 4be8b0bdec Vendor import of less v692. vendor/less/v692 2026-02-20 21:19:41 -08:00
Dag-Erling Smørgrav b5d570e711 libfetch: Gracefully skip unsupported protocols
If socket() fails because the address family or protocol is unsupported,
just continue with the next address.

MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55407
2026-02-21 02:18:18 +01:00
Dag-Erling Smørgrav afbdcd402b libfetch: Fail hard if interrupted while connecting
This fixes an issue where the first address that DNS returns is blocked
by a packet filter, so we hang for a while, then the user hits Ctrl-C,
interrupting connect(2), whereupon we move on to the next address, get
a connection, request the file, and return to fetch(1), which sees that
SIGINT was caught and bails.

Note that we make no attempt to enforce fetchTimeout in the connection
phase, and never have.  It's feasible, but non-trivial, so we'll leave
it as an exercise for future us.

PR:		293312
MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55406
2026-02-21 02:18:15 +01:00
Dag-Erling Smørgrav 1b7c4d29fd libfetch: Clean up fetch_info usage
* Provide a wrapper for the common if (verbose) fetch_info(...) idiom.

* Replace remaining instances of fprintf(stderr, ...) with fetch_info().

* Fix a few style nits.

MFC after:	1 week
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D55405
2026-02-21 02:18:11 +01:00
Enji Cooper d1f1402dff libnetbsd: import __CTASSERT(..) macros
These compile-time assert macros are similar to `Static_assert` on FreeBSD.

These macros are in use in newer versions of `contrib/netbsd-tests`.

Obtained from:	https://github.com/NetBSD/src (c26cc77b3a0b26b95a2)
MFC after:	1 week
2026-02-20 14:45:06 -08:00
Michael Tuexen e1886559ea tcp: improve validation of received TCP over UDP packets
Reviewed by:		glebius, pouria
MFC after:		3 days
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D55410
2026-02-20 22:21:37 +01:00
John Baldwin 1602f0013b nvmf: Limit the default I/O queue size to 128 entries
Previously the size defaulted to the maximum supported size reported
by the remote host.  The value of 128 matches the default on Linux and
avoids excessive resource usage for I/O queues.

Sponsored by:	Chelsio Communications
2026-02-20 15:39:02 -05:00
John Baldwin 0788e7c40d ctld: Honor the default maximum I/O queue size for NVMeoF controllers
<dev/nvmf.h> exports a constant to set the default maximum I/O queue
size which is used by ctl(4) if an explicit size is not set.  This
value was chosen to match Linux's default, but it also avoids
excessive resource usage for I/O queues.

ctld was using the absolute maxium size as the default instead.

Sponsored by:	Chelsio Communications
2026-02-20 15:38:18 -05:00
Christos Longros 102fed041d src.conf.5: Fix "incompatibility" typo
MFC after:	3 days
Reviewed by:	ziaee
Signed-off-by:	Christos Longros <chris.longros@gmail.com>
Closes:		https://github.com/freebsd/freebsd-src/pull/2035
2026-02-20 12:20:31 -05:00
Pouria Mousavizadeh Tehrani 49fa0079cf gre tests: Fix gcc warnings on gre netlink tests
Avoid using `snl_add_msg_attr_ip` for now and directly use
`snl_add_msg_attr_ip4` to silence gcc warnings.

Fixes: e1e18cc12e
Differential Revision: https://reviews.freebsd.org/D54443
2026-02-20 20:15:13 +03:30
Tuukka Pasanen 499d0f04f5 bhyve: Add SPDX-License-Identifier tag
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
2026-02-20 10:34:50 -05:00
Aaron LI 89d7b30c65 i386,amd64: Explicitly set ECX=0 in do_cpuid() to be future-proof
In principle, do_cpuid() should only be used for CPUID leaves without
sub-leaves.  Even accessing sub-leaf zero (ECX=0), one must use
cpuid_count(ax, 0) rather than cpuid(ax).

However, one might assume do_cpuid(ax) is equivalent to
cpuid_count(ax, 0), but the old do_cpuid() did not initialize ECX before
executing the CPUID instruction.  If ECX contained a non-zero value, the
instruction could return unexpected results, potentially leading to
subtle and hard-to-debug issues, especially in ported code.

To be future-proof and to help port code, adjust do_cpuid(ax) to be
cpuid_count(ax, 0) to explicitly set ECX=0.

It's believed that this change does not fix any real bugs in FreeBSD.

See also the DragonFly commit:
https://github.com/DragonFlyBSD/DragonFlyBSD/commit/0087a1d163488a57787a9a6431dd94070b1988d4

Signed-off-by: Aaron LI <aly@aaronly.me>
Reviewed by: kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/2027
2026-02-20 10:26:20 -05:00
Tuukka Pasanen 836ac98993 fstyp: Add SPDX-License-Identifier tags
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
2026-02-20 09:04:34 -05:00
Olivier Certner f1b93fc50f hwpstate_amd(4): Fix punctuation in 'desired_performance' knob's description
To be consistent with that of the others.

No functional change.

Sponsored by:   The FreeBSD Foundation
2026-02-20 11:12:54 +01:00
Olivier Certner 953b9164c3 cpufreq(4): cpufreq_levels_sysctl(): Remove always false NULL test
'sc->levels_buf' is initialized with malloc(M_WAITOK), so can never be
NULL.  Another sysctl handler function (cpufreq_curr_sysctl()) already
relies on that.

MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
2026-02-20 11:12:53 +01:00
Olivier Certner 80d32a6b1d hwpstate_amd(4): CPPC: Switch the default to maximum performance
Set controls to maximum performance to avoid regressions now that CPPC
is activated by default and to match what the P-state support does.

Relnotes:       yes
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55253
2026-02-20 11:12:53 +01:00
Olivier Certner b69a396de2 hwpstate_amd(4): CPPC: Allow attaching even if CAPABILITY_1 cannot be read
If that MSR cannot be read, we fallback to defaults specified by the
ACPI specification, as we are already doing when the minimum and maximum
values in there look bogus.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55252
2026-02-20 11:12:53 +01:00
Olivier Certner 7f36d7a950 hwpstate_amd(4): Consistency of cached CPPC_REQUEST value
If writing to the CPPC_REQUEST MSR fails, make sure we do not set the
softc's 'cppc.request' field to the intended new value.  Both
set_cppc_request_cb() and enable_cppc_cb() were changed to this effect.

In case enable_cppc_cb() could not read CPPC_REQUEST, mark that through
a new softc flag, HWPFL_CPPC_REQUEST_NOT_READ, so that we do not keep
and use a wrong value when the content of CPPC_REQUEST is read/written
through sysctl(9) knobs, but instead retry reading the MSR (this is the
purpose of the new get_cppc_request() sub-function).

When setting CPPC_REQUEST has failed, distinguish the case where it
could not be read at all from the case where it could not be written, by
respectively returning EIO and EOPNOTSUPP in these cases.  The previous
return value of EFAULT was confusing as sysctl(3) documents it as
happening if the passed arguments are invalid.

While here, add some herald comment before sysctl_cppc_dump_handler()
clarifying that the intent of this function is to always query the
hardware directly, bypassing any cached value in the softc.

Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D55251
2026-02-20 11:12:48 +01:00
Pouria Mousavizadeh Tehrani 1635ba9061 gre tests: Add required_kmods to gre netlink test
Fixes: e1e18cc12e
Differential Revision: https://reviews.freebsd.org/D54443
2026-02-20 11:20:20 +03:30
Enji Cooper ef1cde5103 chore: asmc: use designated initializers in macros
This code cleanup makes it easier for human readers to understand what each
of the fields actually represents, as well as makes it easier to modify
what the macros actually do under the covers, without introducing
potential human errors.

No functional change intended.

MFC after:	1 week
2026-02-19 22:35:16 -08:00
Enji Cooper 90edc16166 asmc: use symbolic names with the MacPro3,1 model
Use `ASMC_LIGHT_FUNCS_DISABLED` and `ASMC_SMS_FUNCS_DISABLED` instead of
the unrolled versions of the macros.

This makes it easier to adjust the underlying macros/fields for
`struct asmc_model`.

No functional change intended.

MFC after:	1 week
2026-02-19 22:25:00 -08:00
Enji Cooper 7b862cf8a2 asmc: use ASMC_FAN_FUNCS2 with the Macmini4,1
The Macmini4,1 model does not have "fansafespeed" support. This issue
typically manifests with messages like so:

```
asmc0: asmc_key_read for key F0Sf failed 10 times, giving up
```

Swap out `ASMC_FAN_FUNCS` with `ASMC_FAN_FUNCS2` to explicitly drop
"fansafespeed" checks in the driver for the model as it doesn't support
that hardware feature.

MFC after:	1 week
Reported by:	@probonopd
Closes:		https://github.com/helloSystem/ISO/issues/357
2026-02-19 22:04:25 -08:00
Chuck Tuffli 10d5404adb bhyve: fix USB mouse requests
USB HCI requests may not include HCI transfer block structures (i.e.,
xfer->data[] == NULL), but in several places, the USB mouse emulation
code assumes one will exist. This can lead to a NULL pointer dereference
and a SEGV in the bhyve process as observed via experiments with an
Ubuntu guest and PyUSB code. Note that many of the cases processing
other request types already checked for data == NULL.

While in the neighborhood, fix a typo in the loop iterating over the
usb_data_xfer_block array which used the wrong variable to check for
valid data (idx vs. i).

Reported by: danmcd@edgecast.io
Obtained from: SmartOS
MFC after: 1 week
Relnotes: yes

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D54661
2026-02-19 14:27:49 -08:00
Siva Mahadevan c721ceeb3e syslogd/tests: use kern.features to detect INET support
This fixes INET feature detection with kernel configs
that do not include the kern.conftxt sysctl, such as
riscv64 currently[0].

[0] https://ci.freebsd.org/view/Test/job/FreeBSD-main-riscv64-test/16514/testReport/usr.sbin.syslogd/syslogd_forwarded_format_test/O_flag_bsd_forwarded_legacy/

Reviewed by:	markj
Approved by:	emaste (mentor)
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D55383
2026-02-19 15:53:26 -05:00
Siva Mahadevan 1e649491b8 riscv: GENERIC: enable KERN_TLS
This unskips 585 sys/kern/ktls_test testcases[0] in CI. All 585 tests currently pass.

[0] https://ci.freebsd.org/view/Test/job/FreeBSD-main-riscv64-test/16514/testReport/sys.kern/

Approved by:		emaste (mentor)
MFC after:		3 days
Sponsored by:		The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D55376
2026-02-19 15:10:02 -05:00
Hayzam Sherif 818971cc40 bhyve: Fix unchecked stream I/O in RFB handler
Convert rfb_send_* helpers to return status codes and check their
results. Add missing checks for stream_read() and stream_write() returns
during the handshake in rfb_handle() to avoid acting on failed I/O.

Signed-off-by:  Hayzam Sherif <hayzam@gmail.com>

Reviewed by:	markj
MFC after:	2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D55343
2026-02-19 19:24:07 +00:00
Artem Bunichev c8191c3d61 OptionalObsoleteFiles: Don't mark /usr/lib/debug/boot directory obsolete
The intent of the currect code is to ignore anything under
/usr/lib/debug/boot/*.  But we also should make sure that
/usr/lib/debug/boot directory is also ignored and is not marked
obsolete.  If we don't do that, `make DBATCH_DELETE_OLD_FILES
delete-old` will try to rmdir(1) this directory, which will cause an
error, since /usr/lib/debug/boot may have nested directories like
kernel/ and modules/.

Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D55077
2026-02-19 19:09:56 +00:00
Mark Johnston 3a0c63a7e0 vmm.4: Fix width
Reported by:	ziaee
Fixes:		d26c8ae527 ("vmm.4: Add information on VM access control")
2026-02-19 17:20:17 +00:00
Mark Johnston 83cf9b52e9 RELNOTES: Document some recent vmm changes 2026-02-19 17:16:59 +00:00