Commit graph

23447 commits

Author SHA1 Message Date
Timo Völker
bcb298fa9e sctp, tcp, udp: improve deferred computation of checksums
When the SCTP, TCP, or UDP implementation send a packet, it does not
compute the corresponding checksum but defers that. The network layer
will determine whether the network interface selected for the packet
has the requested capability and computes the checksum in software,
if the selected network interface doesn't have the requested
capability.
Do this not only for packets being sent by the local SCTP, TCP,
and UDP stack, but also when forwarding packets. Furthermore, when
such packets are delivered to a local SCTP, TCP, or UDP stack, do not
compute or validate the checksum, since such packets never have been on
the wire.
This allows to support checksum offloading also in the case of local
virtual machines or jails.
Support for epair, vtnet, and tap interfaces will be added in
separate commits.

Reviewed by:		kp, rgrimes, tuexen, manpages
MFC after:		4 weeks
Differential Revision:	https://reviews.freebsd.org/D51475
2025-08-01 12:09:47 +02:00
Kyle Evans
f61c48f440 kern: rename crsetgroups_fallback, document it in ucred(9)
As of FreeBSD 15.0, crsetgroups() *only* sets supplementary groups,
while crsetgroups_and_egid() will do both using an array of the same
style that previous versions used for crsetgroups() -- i.e., the first
element is the egid, and the remainder are supplementary groups.

Unlike the previous iteration of crsetgroups(), crsetgroups_and_egid()
is less prone to misuse as the caller must provide a default egid to use
in case the array is empty.  This is particularly useful for groups
being set from data provided by userland.

Reviewed by:	olce
Suggested by:	olce
Differential Revision:	https://reviews.freebsd.org/D51647
2025-07-31 19:50:48 -05:00
Rene Ladan
ada5bba476 organization.dot: update list of current portmgr members 2025-07-31 15:45:40 +02:00
Trond Endrestøl
868b5492d1
style.9: Fix "parantheses" typos in the new C++ section
PR:             288564
Fixes:          4b02ad9d50 ("style.9: Add a C++ section")
Sponsored by:   The FreeBSD Foundation (commit)
2025-07-31 12:11:45 +02:00
Kyle Evans
be1f7435ef kern: start tracking cr_gid outside of cr_groups[]
This is the (mostly) kernel side of de-conflating cr_gid and the
supplemental groups.  The pre-existing behavior for getgroups() and
setgroups() is retained to keep the user <-> kernel boundary
functionally the same while we audit use of these syscalls, but we can
remove a lot of the internal special-casing just by reorganizing ucred
like this.

struct xucred has been altered because the cr_gid macro becomes
problematic if ucred has a real cr_gid member but xucred does not.  Most
notably, they both also have cr_groups[] members, so the definition
means that we could easily have situations where we end up using the
first supplemental group as the egid in some places.  We really can't
change the ABI of xucred, so instead we alias the first member to the
`cr_gid` name and maintain the status quo.

This also fixes the Linux setgroups(2)/getgroups(2) implementation to
more cleanly preserve the group set, now that we don't need to special
case cr_groups[0].

__FreeBSD_version bumped for the `struct ucred` ABI break.

For relnotes: downstreams and out-of-tree modules absolutely must fix
any references to cr_groups[0] in their code.  These are almost
exclusively incorrect in the new world, and cr_gid should be used
instead.  There is a cr_gid macro available in earlier FreeBSD versions
that can be used to avoid having version-dependant conditionals to refer
to the effective group id.  Surrounding code may need adjusted if it
peels off the first element of cr_groups and uses the others as the
supplemental groups, since the supplemental groups start at cr_groups[0]
now if &cr_groups[0] != &cr_gid.

Relnotes:	yes (see last paragraph)
Co-authored-by:	olce
Differential Revision:	https://reviews.freebsd.org/D51489
2025-07-30 23:44:11 -05:00
Kevin Bowling
147b90973b Revert "src.opts.mk: Default LLVM_ASSERTIONS off"
Enabling and disabling LLVM assertions changes the ABI. There have
been multiple reports on the freebsd-current@ mailing list of broken
'cc'.

Out of caution, you may wish to do a clean build while crossing this
commit after building the reverted commit if you do not set
LLVM_ASSERTIONS in your src.conf.

Discussed with:	kevans, jrtc27

This reverts commit 9b3055d0d4.
2025-07-30 20:33:52 -07:00
Ed Maste
bf426b859b vt: Remove FONT specification from INDEX files
There is no reason to change the font in order to select a keymap or a
font.

This was done in the syscons(4) era to ensure that a font with the
appropriate character set was used for kbdmap or vidfont's localized
menu, but vt is always UTF-8 and this is no longer necessary.

PR:		235565
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D51640
2025-07-30 17:22:41 -04:00
Ed Maste
74072e9f16 usbhid: Enable by default
Co-authored-by: Emmanuel Vadot <manu@FreeBSD.org>
Reviewed by:	bapt, wulf
Relnotes:	Yes
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45659
2025-07-30 14:31:54 -04:00
Baptiste Daroussin
7b68893ffa krb5: remove libedit from the bootstrap tools
libedit breaks the bootstrap on MacOS and Linux.

Activate libedit only for the regular build not for the bootstrap
tools

While here fix the definition of the dependency chain between
libkrb5ss and libedit (and libtinfow) via src.libnames.mk

Remove a local patch to find the readline compatible header and
find them via proper CFLAGS.
2025-07-29 17:49:44 +02:00
Michael Tuexen
0ded464721 vtnet.4: update description of loader tunables
This is based on the description of sysctl -d.

Reviewed by:		Timo Völker, bcr
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D51604
2025-07-29 09:17:52 +02:00
Michael Tuexen
fe35f275ab mbuf.9: describe checksum offloading for SCTP
This describes the current status of the implementation.
While there, be a bit more precise on how long the checksum
computation is delayed.

Reviewed by:		Timo Völker, bcr
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D51590
2025-07-29 08:52:06 +02:00
Älven
659962f96a New committer (ports): Älven (alven)
PR:		287620
Approved by:	db@ (Mentor, implicit)
2025-07-29 01:04:53 +04:00
John Baldwin
4b02ad9d50 style.9: Add a C++ section
This section adds several style guidelines for C++ in FreeBSD's base
system both enumerating some differences relative to the C KNF style
and addressing some unique C++ idioms not addressed by the existing
KNF style.

This section is not exhaustive but does include an initial set of
guidelines.

Reviewed by:	ivy, emaste
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D50983
2025-07-28 14:31:26 -04:00
Lexi Winter
14f57afb85 bmake: Add a package for bmake and share/mk
bmake along with /usr/share/mk seems to meet the criteria for being in
its own package: it's self-contained and the majority of users (who are
using binary packages) don't need to install it, so it doesn't belong in
FreeBSD-utilities.  Instead, put it in its own package.

Add a dependency on the new package from:

- sendmail (uses make to build its configuration)
- NIS (uses make to build the database).

But not from examples, because while some of the examples do require
make, they are intended as examples rather than something to be used
directly.

Reviewed by:	manu, sjg
Differential Revision:	https://reviews.freebsd.org/D50149
2025-07-28 10:17:36 +01:00
Bojan Novković
cf571e0850 domainset(9): Split domainset validation logic into a separate function
This change splits the validation and 'struct domainset'-filling logic
from kern_cpuset_setdomain into a separate function - domainset_populate.
This function's main use is to validate user-provided domainset(9)
policies and populate a struct domainset before handing it off
to domainset_create. No functional change intended.

Differential Revision:	https://reviews.freebsd.org/D46608
Reviewed by:	markj
2025-07-27 18:31:48 +02:00
Kevin Bowling
9b3055d0d4 src.opts.mk: Default LLVM_ASSERTIONS off
This noticeably slows down the compiler execution and with the move to
pkgbase is one of the remaining differences that cannot be
administratively controlled; pkg kernels and malloc.conf(5) will allow
quickly testing a snapshot in a configuration closer to stable and
release branches.

dim@ notes that you need to set WITH_LLVM_ASSERTIONS in src.conf(5) if
you want to report an issue with LLVM.

Enabling WITH_LLVM_ASSERTIONS is also a consideration for CI and pkg
builders especially tracking main.

Approved by:	dim, kevans
Differential Revision:	https://reviews.freebsd.org/D50388
2025-07-27 01:00:39 -07:00
Kyle Evans
de91e7f0c6 share: man: fix coredumper_register(9)'s init_fn
A last-minute change tweaked the prototype because we can just fetch
the compression format from the compressor, but I missed updating the
manpage to match it.

Fixes:	ce51f79913 ("kern: abstract away the vnode coredumper [..]")
2025-07-26 16:40:50 -05:00
Kyle Evans
ce51f79913 kern: abstract away the vnode coredumper to allow pluggable dumpers
The default and only stock coredumper will continue to be the
traditional vnode dumper, which will dump to a vnode and issue a devctl
notification. With this change, one can write a kmod that injects custom
handling of user coredumps that offers richer behavior, particularly in
case one wants to add more metadata than we can tap out via devd.

The main motivation here is to pave the way for my usercore daemon to be
able to reroute coredumps before they ever touch the disk.  In some
cases they may be discarded and we can avoid the overhead of writing
anything, in others they allow us to capture coredumps that would be
written into an area that's transient in nature (e.g., kyua test work
directories) without having to do more tricks to keep those alive.  My
WIP kmod writes the coredump into a shmfd instead of a vnode, then
installs that into ucored(8) with every read(2) of /dev/ucore.  This
also allows me to capture more metadata reliably before the process and
jail disappear.

Reviewed by:	kib (earlier version), markj
Differential Revision:	https://reviews.freebsd.org/D51338
2025-07-26 16:31:41 -05:00
Kyle Evans
d5bc81e6c7 kern: move the vnode user coredumper out into its own file
This more cleanly contains the bits that are specifically relevant to
dumping coredumps out to a vnode, which will make future changes a bit
easier to review.  This also makes the scope of the relevant sysctls
easier to reason about in the process, as they're not visible outside of
the vnode dumper file -- this will mostly become relevant when we allow
pluggable dumpers.

While we're here, move all of the coredump-related stuff out into its
own kern_ucoredump.c and sys/ucoredump.h.  We have enough that it's
useful to separate it out and de-clutter kern_sig.c and sys/exec.h a
bit.

Reviewed by:	kib, markj (both earlier version)
Differential Revision:	https://reviews.freebsd.org/D51349
2025-07-26 16:31:41 -05:00
Lexi Winter
caddfcd546 share/man: Move many manpages to more correct packages
At the moment, all the manpages in share/man are in the utilities-man
package.  Move some of them to the package they should actually be in,
using the new MANGROUPS feature.

Move all of section 3 to clibs-man.  Although some of these are from
/usr/include/sys rather than libc, you can't practically use them
without libc, and clibs-man is where the libc manpages live already.

Move all of sections 4 and 9 to a new kernel-man package, except for
atf-test-case.4 which goes to tests-man.  atf-test-case.4 is in the
wrong section, but this needs to be fixed upstream.

kernel-man requires special handling in generate-ucl.lua since it's
got a -man suffix but doesn't want the ' (manual pages)' automatic
suffix.  For now, fix this by adding a list of packages that don't
get automatic suffixes.

Reviewed by:	ifreund_freebsdfoundation.org, manu, emaste
Differential Revision:	https://reviews.freebsd.org/D51504
2025-07-25 18:31:26 +01:00
Lexi Winter
5e50b89ddf bsd.man.mk: add MANGROUPS
MANGROUPS allows manpages to be divided into groups with their own
options, analogous to CONFGROUPS.  This is mainly used for installing
manpages into the correct package by setting ${<group>PACKAGE}.

Convert the backward-compatibility variables MAN1..MAN9 into man
groups.

Reviewed by:	sjg
Differential Revision:	https://reviews.freebsd.org/D51490
2025-07-25 18:31:26 +01:00
Lexi Winter
c9868af774 crash.8: update a little
Replace "cannot mount root" (which is no longer a panic) with a brief
description of the mountroot> prompt, and recommend using "system
install media" rather than the fixit floppy.

Remove "timeout table full" entirely since this panic no longer exists.

MFC after:	3 days
Reviewed by:	ziaee
Differential Revision:	https://reviews.freebsd.org/D51512
2025-07-25 18:31:26 +01:00
Eric Joyner
fdefa79abe
ice.4: Update man page
This is a combination of imported information from the out-of-tree
driver's documentation, as well as some all new information:

- Add previously undocumented loader tunables and expand the descriptions
for all of them
- Add references to the iavf and irdma man pages
- Add some documentation for the DDP package (ice_ddp)
- Remove mentions of the ports/packages for the utilities since those are
no longer supported, and update the names of the utilities to match the
names used on the Intel Download Center
- Add information on RDMA and RDMA mirroring sections
- Document QoS capability

And more!

Signed-off-by: Eric Joyner <erj@FreeBSD.org>

Reviewed by:	ziaee@
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1622
Closes:		https://github.com/freebsd/freebsd-src/pull/1622
2025-07-23 17:02:24 -07:00
Rick Macklem
c754cdedb3 named_attribute.7: Add a section for ZFS "sa" attributes
On ZFS, extended attributes with small values
(as in number of bytes) that are created when
xattr is set to "sa" will only be visible via extattr(2)
and not as named attributes.

This man page patch documents the above.

This is a content change.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D51444
2025-07-24 16:03:14 -07:00
Artem Bunichev
4b5ed4ef60 share/termcap: Update entries for st terminal 0.9.2
Although not strictly required, since termino takes priority, we had
obsolete data for the st terminal emulator from 0.8. It won't hurt and
may help some people.

Reviewed by: imp, bapt, markj
Differential Revision: https://reviews.freebsd.org/D51463
2025-07-23 08:36:31 -06:00
Doug Rabson
0fbe9f8ef9 share/examples/oci: Run 'pkg update' with IGNORE_OSVERSION set
This allows the image build to work even if the host's OSVERSION doesn't
match the pkgbase OSVERSION which happens if the host's patch level or
release version isn't the same as pkgbase.

Also fix the image name so that Podman/Buildah will fetch it
automatically, removing the need for users to pull an image and retag it
before using this example.

Reviewed by:		dch
MFC after:		3 days
Differential Revision:	https://reviews.freebsd.org/D50596
2025-07-22 11:46:01 +01:00
Simon J. Gerraty
3717484168 bsd.subdir.mk skip _SUBDIR for DIRDEPS_BUILD
For DIRDEPS_BUILD we want to ignore _SUBDIR regardless of
.MAKE.LEVEL

Reviewed by:	stevek
Differential Revision:	https://reviews.freebsd.org/D51454
2025-07-21 09:11:44 -07:00
Cy Schubert
c7da9fb90b KRB5: Enable MIT KRB5 by default
Set WITH_MITKRB5=yes as the default.

Rebuild all USES=gssapi ports is recommended.

A clean buildworld is required.

Relnotes:	yes
2025-07-21 07:07:22 -07:00
Koichiro Iwao
93c2d7d526 if_gif(4): Support the NOCLAMP flag to change MTU handling for IPv6
The patch was originally written by hrs [1], and later modified by meta
to use named flags instead of generic link-layer flags.

[1] https://reviews.freebsd.org/D45854

PR:		280736
Co-authored-by:	Hiroki Sato <hrs@FreeBSD.org>
Reviewed by:	ae, ziaee, zlei, pauamma
Reported by:	Kazuki Shimizu <kazubu@jtime.net>
Approved by:	pauamma (manpages)
Approved by:	ae
MFC after:	2 weeks
Sponsored by:	Cybertrust Japan
Differential Revision:	https://reviews.freebsd.org/D51297
2025-07-21 22:47:28 +09:00
Aymeric Wibo
46be8a71d5
committers-src: add myself (obiwac@)
Add obiwac@ (myself) as new src committer with mckusick@ and jrm@ as
mentors.

Reviewed by:	mckusick (mentor), jrm (mentor)
Approved by:	mckusick (mentor), jrm (mentor)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D51428
2025-07-20 18:01:59 +02:00
Poul-Henning Kamp
d38b81a7eb Cross ref sa(4) to mtio(4) 2025-07-20 11:11:09 +00:00
Kristof Provost
a86b5a2cba pf.conf.5: add missing commas between subordinate and main clauses
jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.

ok jmc@

Obtained from:	OpenBSD, naddy <naddy@openbsd.org>, 41ce3b17e7
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-07-18 09:33:30 +02:00
Kristof Provost
9123330074 pf.conf.5: Avoid gendered language in man pages when not referring to a specific person.
Rewrite or use singular they.

ok thfr@ sthen@ daniel@ ian@ job@ kmos@ jcs@ ratchov@ phessler@ and
others I'm likely missing on an earlier version.
feedback tj@, feedback and ok jmc@

Obtained from:	OpenBSD, jsg <jsg@openbsd.org>, 25a24f0b58
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-07-18 09:33:29 +02:00
Kristof Provost
da319c4d8c pf.conf.5: update syncookie example
Multiply the number of states in the example adaptive timeout calculation
by 10 so it works with the numbers in the config, which were previously
multiplied.

ok dlg@

Obtained from:	OpenBSD, jmatthew <jmatthew@openbsd.org>, 5642facce3
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-07-18 09:33:29 +02:00
Alexander Ziaee
c4fe5431bd
ufshci.4: Move hardware to HARDWARE
This lets us pull them automatically into the hardware release notes.

Note the beautiful introductory sentence here, this pattern can maybe
improve the relationship between DESCRIPTION introductory sentence and
HARDWARE.

MFC:			never (ufshci does not mfc)
Reviewed by:		0mp, christos, imp
Differential Revision:	https://reviews.freebsd.org/D51379
2025-07-17 16:08:38 -04:00
Alexander Ziaee
7757c54895
mtw.4: Make style consistent with other manuals
Fixes:			c14b016242 (importing if_mtw from OpenBSD)
Reviewed by:		adrian, carlavilla (mentor), jsm, mhorne(mentor)
Differential Revision:	https://reviews.freebsd.org/D48905
2025-07-17 16:02:56 -04:00
Alexander Ziaee
701072154a
snd_uaudio.4: Rework SYNOPSIS, add HARDWARE, SPDX
+ Rework synopsis for consistency, adding sysctls
+ Add a HARDWARE section for HW relnotes
+ tag SPDX

MFC after:		3 days
Reviewed by:		christos, pauamma
Differential Revision:	https://reviews.freebsd.org/D51240
2025-07-17 15:56:09 -04:00
Jaeyoon Choi
93f7ed6ca9 ufshci: add man page
Sponsored by:           Samsung Electronics
Reviewed by:		pauamma_gundo.com, rpokala, imp
Differential Revision:	https://reviews.freebsd.org/D51029
2025-07-16 17:21:07 -06:00
Mateusz Piotrowski
56eb7566c4 md(4): Stop symlinking vn.4 to md.4
We've done the same in the past to the vnconfig.8->mdconfig.8 link in:
    eb5f456981 Remove ancient vnconfig symlink

Reviewed by:	bcr, markj, ziaee
Approved by:	markj (mentor)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D27122
2025-07-16 16:23:41 +02:00
Mateusz Piotrowski
9388c28878 dtrace_fbt.4: Document the DTrace fbt provider
Reported by:	markj
Reviewed by:	christos, markj (earlier version), ziaee
Obtained from:	Mark Johnston, DTrace, FreeBSD Journal, May 2014
Obtained from:	https://wiki.freebsd.org/DTrace/One-Liners
MFC after:	2 weeks
Relnotes:	yes
2025-07-16 12:27:52 +02:00
John Baldwin
221453e31c arch.7: Bump Dd
Fixes:		072f54bf9f ("arch.7: Move i386, powerpc, and powerpcspe to the discontinued arch list")
2025-07-15 15:19:25 -04:00
Michael Proto
9e8c1f9576 /etc/rc.d/pf: Fix for multi-line pf_fallback_rules
Setting multiple pf_fallback_rules in /etc/rc.conf as per the
documentation produces invalid pf syntax due to the lack of echo
quoting $pf_fallback_rules in /etc/rc.d/pf. Adding quotes around
the $pf_fallback_rules echo maintains newlines needed for valid
pfctl syntax. Provided patch resolves the issue

Also updating rc.conf(5) to reflect that multi-line pf_fallback_rules
should not include a trailing backslash (\) as line breaks are
needed when passing rules to pfctl via stdin.

PR:		288197
Reviewed by:	kp
MFC after:	2 weeks
2025-07-15 15:06:27 +02:00
Kristof Provost
2805280f7f pf.conf.5: Markup optional ICMP/ICMP6 codes as such
Only icmp(4)/icmp6(4) types are required for `icmp-type'/`icmp6-type' rules
while codes are optional.

From Martin Vahlensieck < openbsd at academicsolutions dot ch >, thanks!

Obtained from:	OpenBSD, kn <kn@openbsd.org>, 5171218709
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-07-15 09:55:30 +02:00
Kristof Provost
b09707abf9 pf: synproxy should be processing incoming SYN packets only.
issue noticed by sthen@. fix discussed with bluhm@ and procter@

OK bluhm@, kn@, procter@

Obtained from:	OpenBSD, sashan <sashan@openbsd.org>, 4e62cf09d9
Sponsored by:	Rubicon Communications, LLC ("Netgate")
2025-07-15 09:55:28 +02:00
Mateusz Piotrowski
0abee387e1 vnode.9: Fix a typo in sys/tools/vnode_if.awk path name
Fixes:	e018265679 vnode.9: Document vnode_if.awk and vnode_if.src
MFC after:	1 week
2025-07-15 01:44:50 +02:00
Alexander Ziaee
8f480d0075
style.Makefile.5: Remove title macros, tag SPDX
Title macros are discouraged in mdoc(7) because they are not portable.
While here, remove a redundant "file". File is still in the title twice.

MFC after:	3 days
2025-07-14 17:22:14 -04:00
Alexander Ziaee
fbc4e90c5c
nanobsd.8: Shorten title for apropos, tag SPDX
MFC after:	3 days
2025-07-14 17:18:32 -04:00
Mateusz Piotrowski
bdb44a47b7 d.7: Refrain from unnecessary time travel
Fix a typo in the manual's date.

Reported by:	Gary Jennejohn <garyj@gmx.de>
Fixes:		193f2289fc d.7: Document the DTrace scripting language
2025-07-14 20:33:06 +02:00
Ed Maste
a3207059d5 src.conf.5: Regen after retiring some 32-bit architectures
Commit 4a3fb7547e ("powerpc: Disconnect 32-bit powerpc from make
universe") changed the default architecture lists.  i386 hasn't chanaged
as only the kernels are disabled; i386 is still included in
TARGET_MACHINE_LIST.

Sponsored by:	The FreeBSD Foundation
2025-07-14 14:00:21 -04:00
Alexander Ziaee
ab9ee52e84
tracing.7: Shorten doc description for apropos
Shorten document description to fit on one line for the beautification
of apropos results, removing only the search keyword "facilities", which
I think is unlikely to cause discoverability regression.

MFC after:		No (please mfc if mfc'ing tracing.7)
Reviewed by:		0mp, bcr
Differential Revision:	https://reviews.freebsd.org/D51284
2025-07-14 12:42:21 -04:00