]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
2 months agocsh: Use HOST_CC when compiling hostprog used by csh build
Stephen J. Kiernan [Wed, 27 Mar 2024 21:31:40 +0000 (17:31 -0400)]
csh: Use HOST_CC when compiling hostprog used by csh build

The "gethost" program should be built with the host compiler.

Obtained from: Juniper Networks, Inc.
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D44537

2 months agosys.mk: Define HOST_CC as CC by default.
Stephen J. Kiernan [Wed, 27 Mar 2024 21:25:28 +0000 (17:25 -0400)]
sys.mk: Define HOST_CC as CC by default.

This allows for setting a different compiler for building hostprogs
when cross compiling.

Obtained from: Juniper Networks, Inc.
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D44536

2 months agobsdinstall: draw attention to new network config options
Mike Karels [Wed, 27 Mar 2024 20:10:43 +0000 (15:10 -0500)]
bsdinstall: draw attention to new network config options

The network configuration options have changed in bsdinstall, with
an Auto option to proceed directly to DHCP and IPv6 autoconfig (which
is the default) as well as Manual (the old mode).  For users like me
that were used to hitting return automatically to select an interface,
but want manual configuration, attempt to call out the difference:
Change the menu caption to say "Please select a network interface
and configuration mode:" and not just an interface.

Reviewed by: jrtc27

2 months agoarm64: Delete stale comment
Jessica Clarke [Wed, 27 Mar 2024 19:43:38 +0000 (15:43 -0400)]
arm64: Delete stale comment

Fixes: 078a69abcbb8 ("Use a uint64_t to store the arm64 mpidr")

2 months agosockets: define shutdown(2) constants in cpp namespace
Gleb Smirnoff [Wed, 27 Mar 2024 19:19:44 +0000 (12:19 -0700)]
sockets: define shutdown(2) constants in cpp namespace

There is software that uses SHUT_RD, SHUT_WR as preprocessor defines and
its build was broken by enum declaration.  Keep the enum, but provide
defines to propagate the constants to cpp namespace.

PR: 277994
PR: 277995
Fixes: c3276e02beab825824e3147b31af33af66298430

2 months agodma.conf: Fix typo
Mikael Urankar [Wed, 27 Mar 2024 09:36:33 +0000 (10:36 +0100)]
dma.conf: Fix typo

Pull Request: https://github.com/freebsd/freebsd-src/pull/1150

2 months agotools/git: ensure git-arc is more platform indepdendent
Mina Galić [Wed, 27 Mar 2024 13:53:39 +0000 (09:53 -0400)]
tools/git: ensure git-arc is more platform indepdendent

Summary:
Linux systems' tail doesn't have `-r`.
Instead, we can use git's own `--reverse` sorting for `rev-list`s.

Reviewed by: markj, imp, jhibbits
Differential Revision: https://reviews.freebsd.org/D39975

2 months agotcp bblog: use correct length
Michael Tuexen [Wed, 27 Mar 2024 13:31:48 +0000 (14:31 +0100)]
tcp bblog: use correct length

The length of tldl_reason is TCP_LOG_REASON_LEN, not TCP_LOG_ID_LEN.
No functional change intended.
Reported by: Coverity Scan
CID: 1418074
CID: 1418276
Reviewed by: glebius, rscheff
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D44510

2 months agoinstall: Prefer strsnvis() to strsvis().
Dag-Erling Smørgrav [Wed, 27 Mar 2024 10:03:59 +0000 (11:03 +0100)]
install: Prefer strsnvis() to strsvis().

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D44514

2 months agoln: Add a test case for ln -sfF.
Dag-Erling Smørgrav [Wed, 27 Mar 2024 10:03:56 +0000 (11:03 +0100)]
ln: Add a test case for ln -sfF.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude, asomers
Differential Revision: https://reviews.freebsd.org/D44513

2 months agoln: Clean up and simplify tests.
Dag-Erling Smørgrav [Wed, 27 Mar 2024 10:03:52 +0000 (11:03 +0100)]
ln: Clean up and simplify tests.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D44512

2 months agoln: Use stdbool, style nits.
Dag-Erling Smørgrav [Wed, 27 Mar 2024 10:03:49 +0000 (11:03 +0100)]
ln: Use stdbool, style nits.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: imp, allanjude
Differential Revision: https://reviews.freebsd.org/D44511

2 months agotouch: Add unit tests.
Dag-Erling Smørgrav [Wed, 27 Mar 2024 10:03:45 +0000 (11:03 +0100)]
touch: Add unit tests.

MFC after: 1 week
Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D44505

2 months agotouch: Allow setting the timestamp to -1.
Dag-Erling Smørgrav [Wed, 27 Mar 2024 10:03:40 +0000 (11:03 +0100)]
touch: Allow setting the timestamp to -1.

Note that VFS internally interprets a timestamp of -1 as “do not set”,
so this has no effect, but at least touch won't incorrectly reject the
given date / time (1969-12-31 23:59:59 UTC) as invalid.

While here, fix some style issues.

MFC after: 1 week
Reviewed by: allanjude
Differential Revision: https://reviews.freebsd.org/D44504

2 months agolibc: Improve description of mktime() / timegm().
Dag-Erling Smørgrav [Wed, 27 Mar 2024 10:03:37 +0000 (11:03 +0100)]
libc: Improve description of mktime() / timegm().

* Mention that mktime() and timegm() set errno on failure.
* Correctly determining whether mktime() / timegm() succeeded with
  arbitrary input (where -1 can be a valid result) is non-trivial.
  Document the recommended procedure.

PR: 277863
MFC after: 1 week
Reviewed by: pauamma_gundo.com, gbe
Differential Revision: https://reviews.freebsd.org/D44503

2 months agodiff: Integrate libdiff from OpenBSD GoT.
Dag-Erling Smørgrav [Wed, 27 Mar 2024 10:03:33 +0000 (11:03 +0100)]
diff: Integrate libdiff from OpenBSD GoT.

This adds support for two new diff algorithms, Myers diff and Patience
diff.

These algorithms perform a different form of search compared to the
classic Stone algorithm and support escapes when worst case scenarios
are encountered.

Add the -A flag to allow selection of the algorithm, but default to
using the new Myers diff implementation.

The libdiff implementation currently only supports a subset of input and
output options supported by diff.  When these options are used, but the
algorithm is not selected, automatically fallback to the classic Stone
algorithm until support for these modes can be added.

Based on work originally done by thj@ with contributions from kevans@.

Sponsored by: Klara, Inc.
Reviewed by: thj
Differential Revision: https://reviews.freebsd.org/D44302

2 months agolibdiff: Improve function prototype detection.
Dag-Erling Smørgrav [Wed, 27 Mar 2024 10:03:29 +0000 (11:03 +0100)]
libdiff: Improve function prototype detection.

- Recognize ObjC methods.
- Start searching within the leading context.

Sponsored by: Klara, Inc.
Reviewed by: thj
Differential Revision: https://reviews.freebsd.org/D44301

2 months agopkgbase: remove post-install script for kernel
Baptiste Daroussin [Wed, 27 Mar 2024 08:06:35 +0000 (09:06 +0100)]
pkgbase: remove post-install script for kernel

the hint file is now directly packages within the package itself.

Reported by: jhb

2 months agokern linker: Make linker_file_add_dependency() void
Zhenlei Huang [Wed, 27 Mar 2024 04:02:32 +0000 (12:02 +0800)]
kern linker: Make linker_file_add_dependency() void

The only possible return value has been zero since cee9542d51f0.

No functional change intended.

Reviewed by: dfr
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44507

2 months agoepoch(9): Remove the under-development note
Ka Ho Ng [Tue, 26 Mar 2024 14:38:41 +0000 (10:38 -0400)]
epoch(9): Remove the under-development note

There has not been planned changes so far to the interface. Remove the
section as it may not be relevant anymore.

Sponsored by: Juniper Networks, Inc.
Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D44501

2 months agonetmap: Address errors on memory free in netmap_generic
Tom Jones [Tue, 26 Mar 2024 09:52:07 +0000 (09:52 +0000)]
netmap: Address errors on memory free in netmap_generic

netmap_generic keeps a pool of mbufs for handling transfers, these mbufs
have an external buffer attached to them.

If some cases other parts of the network stack can chain these mbufs,
when this happens the normal pool destructor function can end up
free'ing the pool mbufs twice:

- A first time if a pool mbuf has been chained with another mbuf when
  its chain is freed
- A second time when its entry in the pool is freed

Additionally, if other parts of the stack demote a pool mbuf its
interface reference will be cleared. In this case we deference a NULL
pointer when trying to free the mbuf through the destructor. Store a
reference to the adapter in ext_arg1 with the destructor callback so we
can find the correct adapter when free'ing a pool mbuf.

This change enables using netmap with epair interfaces.

Reviewed By: vmaffione
MFC after: 1 week
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44371

2 months agokern linker: Do not touch userrefs of the kernel file
Zhenlei Huang [Tue, 26 Mar 2024 08:47:02 +0000 (16:47 +0800)]
kern linker: Do not touch userrefs of the kernel file

A nonzero `userrefs` of a linker file indicates that the file, either
loaded from kldload(2) or preloaded, can be unloaded via kldunload(2).
As for the kernel file, it can be unloaded by the loader but should not
be after initialization.

This change fixes regression from d9ce8a41eac9 which incidentally
increases `userrefs` of the kernel file.

Reviewed by: dfr, dab, jhb
Fixes: d9ce8a41eac9 kern_linker: Handle module-loading failures in preloaded .ko files
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D42530

2 months agokern linker: Do not unload a module if it has dependants
Zhenlei Huang [Tue, 26 Mar 2024 03:55:45 +0000 (11:55 +0800)]
kern linker: Do not unload a module if it has dependants

Despite the name, linker_file_unload() will drop a reference and return
success when the module file has dependants, i.e. it has more than one
reference. When user request to unload such modules then the kernel
should reject unambiguously and immediately.

PR: 274986
Reviewed by: dfr, dab, jhb
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D42527

2 months agoamd64: initialize td_frame stack area for init(8) main thread
Konstantin Belousov [Mon, 25 Mar 2024 12:10:43 +0000 (14:10 +0200)]
amd64: initialize td_frame stack area for init(8) main thread

Unitialized td_frame mostly does not matter since all registers are
overwritten on exec to activate init(8).  Except PSL_T bit from the
%rflags which might leak into fresh init as garbage, causing spurious
SIGTRAPs delivered to init until first syscall is executed.

Reviewed by: emaste, jhb, jhibbits
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44498

2 months agox86: test the right CPUID bit when checking for XSAVEOPT support
Konstantin Belousov [Mon, 25 Mar 2024 10:34:06 +0000 (12:34 +0200)]
x86: test the right CPUID bit when checking for XSAVEOPT support

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44497

2 months agobsdlabel: add BUGS section documenting 8 partition limit
Ed Maste [Mon, 25 Mar 2024 22:25:05 +0000 (18:25 -0400)]
bsdlabel: add BUGS section documenting 8 partition limit

PR: 276517

2 months agolibfetch: parse scheme://domain:/ correctly
Ka Ho Ng [Mon, 25 Mar 2024 20:10:42 +0000 (16:10 -0400)]
libfetch: parse scheme://domain:/ correctly

This improves URL-parsing compability with cURL, and unbreaks parsing of
similar kinds of URLs after commit 8d9de5b10a24.

Sponsored by: Juniper Networks, Inc.
Reviewed by: des
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44493

2 months agoboot0: remove reference to fdisk
Ed Maste [Wed, 24 Jan 2024 15:13:08 +0000 (10:13 -0500)]
boot0: remove reference to fdisk

fdisk is obsolete and there is no need to mention a specific tool used
to update the partition table.  Just refer to it as the MBR partition
table.

Sponsored by: The FreeBSD Foundation

2 months agobsdlabel: emit deprecation notice when run
Ed Maste [Wed, 24 Jan 2024 19:33:35 +0000 (14:33 -0500)]
bsdlabel: emit deprecation notice when run

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Reision: https://reviews.freebsd.org/D43586

2 months agobsdlabel: add deprecation notice
Ed Maste [Tue, 23 Jan 2024 18:04:43 +0000 (13:04 -0500)]
bsdlabel: add deprecation notice

gpart is the preferred tool for managing partitions of all types,
including BSD disklabels.

Note that this is only about bsdlabel/disklabel, the tool -- there is no
current plan to remove support for MBR or BSD disk labels from the
kernel or from gpart.

Reviewed by: imp, olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43563

2 months agoRemove a reference to xrpu from timetc.h
Josef 'Jeff' Sipek [Mon, 25 Mar 2024 17:50:50 +0000 (11:50 -0600)]
Remove a reference to xrpu from timetc.h

It was removed in 2007, so doesn't make a good example.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44462

2 months agocertctl: Revert to symlinks.
Mark Peek [Mon, 25 Mar 2024 15:58:46 +0000 (16:58 +0100)]
certctl: Revert to symlinks.

Unfortunately tar will not be able to extract base.txz to a system where
/etc and /usr are not on the same filesystem if the certificates are
hard links.

PR: 277828
Reviewed by: mp
Differential Revision: https://reviews.freebsd.org/D44496

2 months agosleep: Overhaul.
Dag-Erling Smørgrav [Mon, 25 Mar 2024 15:58:31 +0000 (16:58 +0100)]
sleep: Overhaul.

Program:

* Add a dummy getopt(3) loop to handle `--`.
* Move interval parsing out into a separate function.
* Print a diagnostic for every invalid interval.
* Check for NaN and infinity.
* Improve bounds checks.

Manual page:

* Miscellaneous markup fixes.
* Reword DESCRIPTION section.
* Move text about GNU compatibility to STANDARDS section.
* Convert examples from csh to sh.

Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D44471

2 months agopfsync: cope with multiple pending plus messages
Kristof Provost [Sun, 24 Mar 2024 15:08:52 +0000 (16:08 +0100)]
pfsync: cope with multiple pending plus messages

It's possible for pfsync to add a plus message when one is already queued.
Append both, rather than overwriting the already pending one.

MFC after: 1 week

2 months agopfsync: fix use of invalidated stack variable
Kristof Provost [Sun, 24 Mar 2024 08:46:31 +0000 (09:46 +0100)]
pfsync: fix use of invalidated stack variable

Calls to pfsync_send_plus() pass pointers to stack variables.
If pfsync_sendout() then fails it retains the pointer to these stack
variables, accesing them later.

Allocate a buffer and copy the data instead, so that we can retain the
pointer safely.

Reported by: CI KASAN, markj
MFC after: 1 week

2 months agopf: fix use-after-free
Kristof Provost [Sat, 23 Mar 2024 16:02:50 +0000 (17:02 +0100)]
pf: fix use-after-free

If we fragment the packet in pf_route() the first transmitted packet
will free the pf_mtag we have stored in pf_pdesc (pd). Ensure we
update that pointer for every packet to avoid using a freed pointer in
pf_dummynet_route().

Reported by: CI KASAN, markj
MFC after: 1 week

2 months agonetpfil tests: disable ICMPv6 rate limiting in the test jail
Gleb Smirnoff [Mon, 25 Mar 2024 02:54:34 +0000 (19:54 -0700)]
netpfil tests: disable ICMPv6 rate limiting in the test jail

The dummynet test uses flood ping as source of traffic, so the rate
limiting of ICMP replies broke the test.

Fixes: 32aeee8ce7e72738fff236ccd5629d55035458f8

2 months agoicmp: allow zero value for ICMP limits
Gleb Smirnoff [Mon, 25 Mar 2024 02:52:03 +0000 (19:52 -0700)]
icmp: allow zero value for ICMP limits

Zero means limit is disabled, so the value doesn't need to be checked
against jitter value.

Fixes: ac44739fd834f51cacb26485a4140fd482e20150
Fixes: a03aff88a14448c3084a0384082ec996d7213897

2 months agoefibootmgr: allow -u as a valid option
Mark Peek [Sun, 24 Mar 2024 19:37:12 +0000 (12:37 -0700)]
efibootmgr: allow -u as a valid option

PR: 277907
Reported by: vsasjason@gmail.com
MFC after: 1 week

2 months agousr.bin/calendar/calendars: Add myself as a committer
Rainer Hurling [Sun, 24 Mar 2024 18:57:27 +0000 (19:57 +0100)]
usr.bin/calendar/calendars: Add myself as a committer

2 months agoarm64: fix free queue and reservation configuration for 16KB pages
Eliot Solomon [Sat, 18 Nov 2023 21:13:21 +0000 (15:13 -0600)]
arm64: fix free queue and reservation configuration for 16KB pages

Correctly configure the free page queues and the reservation size when
the base page size is 16KB.  In particular, the reservation size was
less than the L2 Block size, making L2 promotions and mappings all but
impossible.

Reviewed by: markj
Tested by: gallatin
Differential Revision: https://reviews.freebsd.org/D42737

2 months agoicmp6: bring rate limiting on a par with IPv4
Gleb Smirnoff [Sun, 24 Mar 2024 16:13:23 +0000 (09:13 -0700)]
icmp6: bring rate limiting on a par with IPv4

Use counter_ratecheck() instead of racy and slow ppsratecheck. Use a
separate counter for every currently known type of ICMPv6. Provide logging
of ratelimit events. Provide jitter to counter open UDP port detection.

Reviewed by: tuexen, zlei
Differential Revision: https://reviews.freebsd.org/D44482

2 months agoicmp6: move ICMPv6 related tunables to the files where they are used
Gleb Smirnoff [Sun, 24 Mar 2024 16:13:23 +0000 (09:13 -0700)]
icmp6: move ICMPv6 related tunables to the files where they are used

Most of them can be declared as static after the move out of in6_proto.c.
Keeping sysctl(9) declarations with their text descriptions next to the
variable declaration create self-documenting code.  There should be no
functional changes.

Differential Revision: https://reviews.freebsd.org/D44481

2 months agoicmp6: rate limit our echo replies
Gleb Smirnoff [Sun, 24 Mar 2024 16:13:23 +0000 (09:13 -0700)]
icmp6: rate limit our echo replies

The generation of ICMP6_ECHO_REPLY bypasses icmp6_error(), thus rate
limit was not applied.

Reviewed by: tuexen, zlei
Differential Revision: https://reviews.freebsd.org/D44480

2 months agoicmp6: make icmp6_ratelimit() responsible to update the stats counter
Gleb Smirnoff [Sun, 24 Mar 2024 16:13:23 +0000 (09:13 -0700)]
icmp6: make icmp6_ratelimit() responsible to update the stats counter

Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D44479

2 months agoicmp: improve ICMP limit jitter
Gleb Smirnoff [Sun, 24 Mar 2024 16:13:23 +0000 (09:13 -0700)]
icmp: improve ICMP limit jitter

Instead of fixing up invalid values set by a user in badport_bandlim()
which is a fast path function, provide a sysctl handler
sysctl_icmplim_and_jitter(), that will check that jitter is less than the
limit.

Provide jitter initilization function icmplim_new_jitter() used at boot,
in the sysctl handler and when we actually hit the limit.  This also fixes
no jitter on a fresh booted system until first limit hit.

Instead of CVE number provide link the the actual paper that explains what
and why we are doing here.  The CVE number isn't very informative, it will
just tell you what RedHat version you need to upgrade to.

Reviewed by: kp, tuexen, zlei
Differential Revision: https://reviews.freebsd.org/D44478

2 months agoicmp: when logging ICMP ratelimiting message use correct jitter value
Gleb Smirnoff [Sun, 24 Mar 2024 16:13:23 +0000 (09:13 -0700)]
icmp: when logging ICMP ratelimiting message use correct jitter value

The limiting of the very last second has been done using certain jitter
value.  We update the jitter for the next second.  But the logging should
report the jitter before the change.

Reviewed by: kp, tuexen, zlei
Differential Revision: https://reviews.freebsd.org/D44477

2 months agoicmp: hide icmp_bandlimit_uninit() under VIMAGE
Gleb Smirnoff [Sun, 24 Mar 2024 16:13:23 +0000 (09:13 -0700)]
icmp: hide icmp_bandlimit_uninit() under VIMAGE

The uninitialization may be executed only on a kernel with VIMAGE.

Reviewed by: kp, tuexen, zlei
Differential Revision: https://reviews.freebsd.org/D44476

2 months agoicmp: do not store per-VNET identical array of strings
Gleb Smirnoff [Sun, 24 Mar 2024 16:13:23 +0000 (09:13 -0700)]
icmp: do not store per-VNET identical array of strings

We need per-VNET struct counter_rate, but we don't need per-VNET set of
const char *.  Also, identical word "response" can go into the format
string instead of being stored 7 times.

Reviewed by: kp, zlei, tuexen
Differential Revision: https://reviews.freebsd.org/D44475

2 months agoacpi_hpet: Make use of enum for vm_guest to improve readability
Zhenlei Huang [Sun, 24 Mar 2024 15:31:22 +0000 (23:31 +0800)]
acpi_hpet: Make use of enum for vm_guest to improve readability

No functional change intended.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D44402

2 months agomem.4: Correct the HISTORY section
Gordon Bergling [Sun, 24 Mar 2024 05:10:39 +0000 (06:10 +0100)]
mem.4: Correct the HISTORY section

The history section (added in CSRG) claimed both first appeared in v6.
Looking at the manuals in the TUHS archive, /dev/mem was in v1
and /dev/kmem was introduced in v5.

Reviewed by: imp
Obtained from: OpenBSD
MFC after: 5 days
Differential Revision: https://reviews.freebsd.org/D44486

2 months agounionfs: implement VOP_UNP_* and remove special VSOCK vnode handling
Jason A. Harmening [Sat, 3 Feb 2024 17:17:58 +0000 (11:17 -0600)]
unionfs: implement VOP_UNP_* and remove special VSOCK vnode handling

unionfs has a bunch of clunky special-case code to avoid creating
unionfs wrapper vnodes for AF_UNIX sockets.  This was added in 2008
to address PR 118346, but in the intervening years the VOP_UNP_*
operations have been added to provide a clean interface to allow
sockets to work in the presence of stacked filesystems.

PR: 275871
Reviewed by: kib (prior version), olce
Tested by: Karlo Miličević <karlo98.m@gmail.com>
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D44288

2 months agocxgbe.4: Remove double word
Gordon Bergling [Sat, 23 Mar 2024 17:00:57 +0000 (18:00 +0100)]
cxgbe.4: Remove double word

- s/of of/of/

MFC after: 3 days

2 months agointr_event.9: Remove double word
Gordon Bergling [Sat, 23 Mar 2024 16:57:37 +0000 (17:57 +0100)]
intr_event.9: Remove double word

- s/of of/of/

MFC after: 3 days

2 months agotests/netinet: fix UDP I/O test build
Gleb Smirnoff [Sat, 23 Mar 2024 16:21:13 +0000 (09:21 -0700)]
tests/netinet: fix UDP I/O test build

Fixes: 8d3d9ca8bd3db284f6ae671f1e816ba2822f0988

2 months agoxdr(3): Fix a few typos in source code comments
Gordon Bergling [Sat, 23 Mar 2024 07:43:41 +0000 (08:43 +0100)]
xdr(3): Fix a few typos in source code comments

- s/reoutines/routines/
- s/paraemters/parameters/

Obtained from: NetBSD
MFC after: 3 days

2 months agoshare/man/man9/Makefile: fix buildworld
Antoine Brodin [Sat, 23 Mar 2024 07:17:59 +0000 (07:17 +0000)]
share/man/man9/Makefile: fix buildworld

2 months agocdevpriv(9): document devfs_foreach_cdevpriv()
Konstantin Belousov [Sat, 23 Mar 2024 06:48:57 +0000 (08:48 +0200)]
cdevpriv(9): document devfs_foreach_cdevpriv()

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

2 months agocdevpriv(9): add iterator
Konstantin Belousov [Fri, 22 Mar 2024 02:58:00 +0000 (04:58 +0200)]
cdevpriv(9): add iterator

Reviewed by: christos
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44469

2 months agosoreceive_dgram: use M_WAITOK when we don't hold any locks
Gleb Smirnoff [Sat, 23 Mar 2024 05:44:16 +0000 (22:44 -0700)]
soreceive_dgram: use M_WAITOK when we don't hold any locks

2 months agosoreceive_dgram: assert that a datagram has control or data
Gleb Smirnoff [Sat, 23 Mar 2024 05:44:16 +0000 (22:44 -0700)]
soreceive_dgram: assert that a datagram has control or data

2 months agong_ksocket: use new macros to lock socket buffers
Gleb Smirnoff [Sat, 23 Mar 2024 05:44:16 +0000 (22:44 -0700)]
ng_ksocket: use new macros to lock socket buffers

2 months agotests/netgraph: start ng_ksocket(4) tests
Gleb Smirnoff [Sat, 23 Mar 2024 05:44:16 +0000 (22:44 -0700)]
tests/netgraph: start ng_ksocket(4) tests

The ng_ksocket(4) functionality is very fragile as it interfaces with
kernel socket code in unusual way.  It definitely needs a test suite.
Start one with a test that tests UDP over IPv4.

2 months agotests/netinet: add UDP socket I/O tests
Gleb Smirnoff [Sat, 23 Mar 2024 05:44:16 +0000 (22:44 -0700)]
tests/netinet: add UDP socket I/O tests

Start a file that would collect tests for I/O functionality of a UDP
socket, targeted on how a socket interacts with userland rather than with
wire side of the protocol.

First version tests that MSG_TRUNC and MSG_PEEK are working correctly.

2 months agotests/netgraph: mark all tests as required_user="root"
Gleb Smirnoff [Sat, 23 Mar 2024 02:50:33 +0000 (19:50 -0700)]
tests/netgraph: mark all tests as required_user="root"

Any netgraph operation requires root priveleges.  Some tests in the
directory already mark themselves with 'atf_tc_set_md_var(conf,
"require.user", "root");' which creates a lot of pasted code.  Some tests
don't mark self.  For this particular directory a blanket metadata setting
in the Makefile is acceptable, imho.

2 months agonvmecontrol: Display additional Fabrics-related fields for cdata
John Baldwin [Sat, 23 Mar 2024 00:25:07 +0000 (17:25 -0700)]
nvmecontrol: Display additional Fabrics-related fields for cdata

Some of these fields are specific to Fabrics controllers (such as the
size of capsules) while other fields are shared with PCI-e
controllers, but are more relevant for Fabrics controllers (such as
KeepAlive timer properties).

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44449

2 months agonvme: Add NVMe over Fabrics fields to nvme_controller_data
John Baldwin [Sat, 23 Mar 2024 00:24:52 +0000 (17:24 -0700)]
nvme: Add NVMe over Fabrics fields to nvme_controller_data

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44448

2 months agonvme: Add constants for the Controller Attributes field in cdata
John Baldwin [Sat, 23 Mar 2024 00:24:31 +0000 (17:24 -0700)]
nvme: Add constants for the Controller Attributes field in cdata

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44447

2 months agonvme: Add constants and types for the discovery log page
John Baldwin [Sat, 23 Mar 2024 00:24:18 +0000 (17:24 -0700)]
nvme: Add constants and types for the discovery log page

This is used in NVMe over Fabrics to enumerate a list of available
controllers.

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44446

2 months agonvme: Add constants for fields in AER completion dword 0
John Baldwin [Sat, 23 Mar 2024 00:24:06 +0000 (17:24 -0700)]
nvme: Add constants for fields in AER completion dword 0

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44445

2 months agonvme: Add constants for the extended data for Get Log Page command flag
John Baldwin [Sat, 23 Mar 2024 00:23:46 +0000 (17:23 -0700)]
nvme: Add constants for the extended data for Get Log Page command flag

nvme(4) doesn't check this flag, but Fabrics implementations may need
to set this flag in the log page attributes cdata field.

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44444

2 months agonvme: Add constants for the PSDT field in cdw0
John Baldwin [Sat, 23 Mar 2024 00:23:24 +0000 (17:23 -0700)]
nvme: Add constants for the PSDT field in cdw0

This is not used in nvme(4) but is used in NVMe over Fabrics
transports which use SGLs to describe buffers instead of PRPs.

While here, adjust the shift value for the FUSE field to be relative
to the 'fuse' member of 'struct nvme_command'.

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44443

2 months agonvme: Add SGL structure and constants for use in NVMe commands
John Baldwin [Sat, 23 Mar 2024 00:23:09 +0000 (17:23 -0700)]
nvme: Add SGL structure and constants for use in NVMe commands

Fabrics capsules use an SGL structure instead of prp1/2 addresses to
describe the data buffer used for a command.  The SGL structure is
added to a union with the existing prp1/2 fields.

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44442

2 months agonvme: Export constants for min and max queue sizes
John Baldwin [Sat, 23 Mar 2024 00:21:20 +0000 (17:21 -0700)]
nvme: Export constants for min and max queue sizes

These are useful for NVMe over Fabrics.

Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D44441

2 months agoman9: mlink for counter_ratecheck(9)
Gleb Smirnoff [Fri, 22 Mar 2024 21:36:54 +0000 (14:36 -0700)]
man9: mlink for counter_ratecheck(9)

2 months agortld: reduce debug messages after fix on big-endian hosts
Stefan Eßer [Fri, 22 Mar 2024 20:54:11 +0000 (21:54 +0100)]
rtld: reduce debug messages after fix on big-endian hosts

Remove a debug message that had been added to support the debugging
of a mis-detection of the hint files endianness on powerpc64.

MFC after: 3 days

2 months agoccdconfig: reference gpart rather than fdisk and disklabel
Ed Maste [Tue, 23 Jan 2024 18:23:44 +0000 (13:23 -0500)]
ccdconfig: reference gpart rather than fdisk and disklabel

fdisk and disklabel are legacy tools for legacy disk partitioning
schemes.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43564

2 months agocloudinit: fix creation of cloudinit ready VMs
Baptiste Daroussin [Fri, 22 Mar 2024 16:58:48 +0000 (17:58 +0100)]
cloudinit: fix creation of cloudinit ready VMs

The framework do not support multiple format images, so this last minute
addition of qcow2 format was clearly not a good idea.

while here fix a typo

Reported by: cperciva

2 months agokern_ctf.c: fix linking with nooptions DDB
Mitchell Horne [Fri, 22 Mar 2024 16:26:00 +0000 (13:26 -0300)]
kern_ctf.c: fix linking with nooptions DDB

!DDB builds don't include the db_ctf_lookup_typename() symbol, so this
is a stop-gap to fix linking of the MINIMAL kernel config.

Reported by: bapt
Fixes: c21bc6f3c242 ("ddb: Add CTF-based pretty printing")

2 months agorights.4: add note about rights not being simple bitmasks
Ed Maste [Fri, 22 Mar 2024 13:47:57 +0000 (09:47 -0400)]
rights.4: add note about rights not being simple bitmasks

PR: 277057
Reviewed by: oshogbo, asomers
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44473

2 months agortld: fix check for endianess of elf hints file
Michael Tuexen [Fri, 22 Mar 2024 13:50:25 +0000 (14:50 +0100)]
rtld: fix check for endianess of elf hints file

Don't check if the elf hints file is in host byte order, but check
if it is in little endian by looking at the magic number.
This fixes rtld on big endian platforms.
Reviewed by: se, kib (prior version of the patch)
Fixes: 7b77d37a561b ("rtld-elf: support either byte-order of hints")
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D44472

2 months agobuild: add -Wswitch to clang for more consistency with gcc
Richard Scheffenegger [Thu, 21 Mar 2024 21:47:39 +0000 (22:47 +0100)]
build: add -Wswitch to clang for more consistency with gcc

gcc12 and gcc13 appear to include Wswitch with Wall, while
clang doesn't. For switch() statements on enum, this forces
the use of at least a default: clause, in adherance with style(9).

Reviewed By: emaste
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D44092

2 months agotcp: no data on SYN segments unless doing TFO
Michael Tuexen [Fri, 22 Mar 2024 10:12:56 +0000 (11:12 +0100)]
tcp: no data on SYN segments unless doing TFO

Ensure that there is no data on SYN segments unless doing TFO.
This check is already in RACK and BBR.

Reported by: glebius
Reviewed by: rscheff
MFC after: 1 week
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D44384

2 months agolibpfctl: fix incorrect labels copy
Kristof Provost [Fri, 22 Mar 2024 03:21:50 +0000 (04:21 +0100)]
libpfctl: fix incorrect labels copy

We copied the entire parsed_labels struct, including the counter to a
field that was only big enough for the labels (so not the counter).

PR: 277875
MFC after: 1 week

2 months agoif_ovpn tests: test large packets in IPv6 tunnel
Kristof Provost [Thu, 21 Mar 2024 07:38:45 +0000 (08:38 +0100)]
if_ovpn tests: test large packets in IPv6 tunnel

There's a report of MTU issues over IPv6 DCO tunnels.
Extend the 4in6 test to send a series of pings with different sizes, as
well as transfer a large file.

No issues were found, but we may as well extend the test case.

PR: 276838

2 months agoarm/nvidia: Fix DTS build
Emmanuel Vadot [Fri, 22 Mar 2024 06:49:54 +0000 (07:49 +0100)]
arm/nvidia: Fix DTS build

We need to include the DTS with the full path now that it changed.

Fixes: f126890ac538 ("Import device-tree files from Linux 6.5")
Sponsored by: Beckhoff Automation GmbH & Co. KG

2 months agoddb: Fix format string errors in db_pprint.c
Mark Johnston [Fri, 22 Mar 2024 06:11:03 +0000 (02:11 -0400)]
ddb: Fix format string errors in db_pprint.c

For some reason, db_expr_t is defined as "long" on 64-bit platforms and
"int" on others.  When printing values of this type, simply cast them to
long to suppress compilation errors on 32-bit systems.

Reviewed by: bnovkov
Fixes: c21bc6f3c242 ("ddb: Add CTF-based pretty printing")

2 months agoarm64/vmm: Exclude more sanitizer compiler flags from certain files
Mark Johnston [Fri, 22 Mar 2024 04:19:11 +0000 (00:19 -0400)]
arm64/vmm: Exclude more sanitizer compiler flags from certain files

Reported by: rscheff
Fixes: 47e073941f4e ("Import the kernel parts of bhyve/arm64")

2 months agoddb: Add CTF-based pretty printing
Bojan Novković [Fri, 22 Mar 2024 03:01:34 +0000 (04:01 +0100)]
ddb: Add CTF-based pretty printing

Add basic CTF support and a CTF-powered pretty-printer to ddb.

The db_ctf.* files expose a basic interface for fetching type
data for ELF symbols, interacting with the CTF string table,
and translating type identifiers to type data.

The db_pprint.c file uses those interfaces to implement
a pretty-printer for all kernel ELF symbols.
The pretty-printer works with symbol names and arbitrary addresses:
pprint struct thread 0xffffffff8194ad90

Pretty-printing currently only works after the root filesystem
gets mounted because the CTF info is not available during
early boot.

Differential Revision: https://reviews.freebsd.org/D37899
Approved by: markj (mentor)

2 months agoriscv: remove more riscv64sf support
Brooks Davis [Thu, 21 Mar 2024 23:46:28 +0000 (23:46 +0000)]
riscv: remove more riscv64sf support

Remove a few more bits of riscv64sf support in libc and libm.

Reduce floating point ABI checks to requiring double hard float.

Reviewed by: imp, jhb
Fixes: 1ca12bd927d7 Remove the riscv64sf architecture.
Differential Revision: https://reviews.freebsd.org/D44334

2 months agomsun/riscv: expose fe{disable,enable}except
Brooks Davis [Thu, 21 Mar 2024 23:45:53 +0000 (23:45 +0000)]
msun/riscv: expose fe{disable,enable}except

This is required for GCC to build.

PR: 272759
Reported by: dgilbert@eicat.ca
Submitted by: jrtc27
Differential Revision: https://reviews.freebsd.org/D44333

2 months agoSlightly reorganize libclang_rt Makefile again
Dimitry Andric [Thu, 21 Mar 2024 20:44:46 +0000 (21:44 +0100)]
Slightly reorganize libclang_rt Makefile again

Make a separate .elif section for MACHINE_ARCH==powerpc, and subdivide
the MACHINE_CPUARCH values under it. If at some point more sanitizer
libraries become available for powerpc CPU architectures, they can be
added before the "nothing for other powerpc yet" case. Similar for the
MACHINE_ARCH==arm case.

PR: 262706
Fixes: e77a1bb27574
MFC after: 3 days

2 months agodts: Fix arm dts path
Emmanuel Vadot [Thu, 21 Mar 2024 20:06:12 +0000 (21:06 +0100)]
dts: Fix arm dts path

Linux 6.5 moved to a vendor-based subdirectory for arm DTS, change
our Makefiles accordingly.

Sponsored by: Beckhoff Automation GmbH & Co. KG

2 months agoImport device-tree files from Linux 6.5
Emmanuel Vadot [Thu, 21 Mar 2024 20:10:18 +0000 (21:10 +0100)]
Import device-tree files from Linux 6.5

Sponsored by:   Beckhoff Automation GmbH & Co. KG

2 months agolibsysdecode use MKTABLES_INCLUDEDIR
Simon J. Gerraty [Thu, 21 Mar 2024 18:55:56 +0000 (11:55 -0700)]
libsysdecode use MKTABLES_INCLUDEDIR

We do not conflate SYSROOT with STAGE_ROOT/DESTDIR during
DIRDEPS_BUILD

Make sure mktables looks in the right place.

Reviewed by: stevek
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D44415

2 months agoassert.3: Update manual page based on mandoc -Tlint
Christopher Davidson [Tue, 5 Mar 2024 03:39:52 +0000 (22:39 -0500)]
assert.3: Update manual page based on mandoc -Tlint

Execute the mandoc -Tlint option on assert(3). This results in two areas
of updates:

Remove invalid Rs block
Remove invalid Re block

Reviewed by: mhorne
MFC after: 3 days
Pull Request: https://github.com/freebsd/freebsd-src/pull/1132

2 months agoFix building of several libclang_rt libraries for powerpc64 and powerp64le
Dimitry Andric [Thu, 21 Mar 2024 13:53:36 +0000 (14:53 +0100)]
Fix building of several libclang_rt libraries for powerpc64 and powerp64le

I reorganized the libclang_rt Makefile in e77a1bb27574 to make it more
readable and maintainable, but the check for 32-bit powerpc was wrong.
This caused almost no libclang_rt libraries to be built for powerpc64
and powerpc64le.

PR: 262706
Reported by: tuexen
Fixes: e77a1bb27574
MFC after: 3 days

2 months agortld-elf: add some debug print statements
Stefan Eßer [Thu, 21 Mar 2024 15:31:49 +0000 (16:31 +0100)]
rtld-elf: add some debug print statements

The byte-order independent code has been reported to fail on powerpc64.
Add some more debug statements to help identify the parametrs used and
to verify the correct operation of the byte-swap macros used..

2 months agokassert.h: update MPASS definition commentary
Mitchell Horne [Thu, 21 Mar 2024 15:21:41 +0000 (12:21 -0300)]
kassert.h: update MPASS definition commentary

We now have a detailed man page describing both MPASS and KASSERT. Give
a warning that careless use of MPASS can result in inadequate assertion
messages, and point to the MPASS(9) page which describes this.

While here add a comment above the KASSERT definitions pointing to the
man page.

Suggested by: bz
Reviewed by: emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44438

2 months agoKASSERT(9): describe history of MPASS
Mitchell Horne [Thu, 21 Mar 2024 15:21:04 +0000 (12:21 -0300)]
KASSERT(9): describe history of MPASS

The macro originates from BSD/OS, with a different etymology than what
is presented. Add a brief HISTORY section to capture this.

Reviewed by: emaste
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44439