1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-03 09:00:21 +00:00
Commit Graph

293081 Commits

Author SHA1 Message Date
Dag-Erling Smørgrav
b4e4512d46 filemon: Not an option.
MFC after:	3 days
2024-07-31 02:39:32 +02:00
Dimitry Andric
6f25b46721 Fix enum warning in heimdal
This fixes a clang 19 warning:

crypto/heimdal/lib/krb5/deprecated.c:75:17: error: comparison of different enumeration types ('krb5_keytype' (aka 'enum ENCTYPE') and 'enum krb5_keytype_old') [-Werror,-Wenum-compare]
   75 |     if (keytype != KEYTYPE_DES || context->etypes_des == NULL)
      |         ~~~~~~~ ^  ~~~~~~~~~~~

In https://github.com/heimdal/heimdal/commit/3bebbe5323 this was solved
by adding a cast. That commit is rather large, so I'm only applying the
one-liner here.

MFC after:	3 days
2024-07-30 21:24:17 +02:00
Dag-Erling Smørgrav
057453ffdf filemon: Document how to build into the kernel.
MFC after:	3 days
Reviewed by:	olce, imp
Differential Revision:	https://reviews.freebsd.org/D46184
2024-07-30 21:04:30 +02:00
Bojan Novković
d9ce4c0b66 vm_page: Fix inconsistent use of VM_NOFREE_IMPORT_ORDER in vm_page_alloc_nofree_domain
Pass VM_NOFREE_IMPORT_ORDER to vm_phys_alloc_pages instead of
VM_LEVEL_0_ORDER when allocating a higher-order page for
the NOFREE page allocator.

Reported by:	alc
Fixes:	a8693e8
2024-07-30 19:25:37 +02:00
Konstantin Belousov
aff225414b ipsec_accel: consistently provide arguments name in typedefs
Sponsored by:	NVidia networking
2024-07-30 19:52:18 +03:00
Kyle Evans
9333e1cbd0 include: ssp: hide ppoll redirect behind __BSD_VISIBLE
This mirrors ppoll's visibility in sys/poll.h and fixes a build issue
with some _POSIX_C_SOURCE requests due to missing the sigset_t typedef.

Reported by:	eduardo
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield
2024-07-30 11:36:58 -05:00
Ed Maste
5c2bc3db20 Remove "All Rights Reserved" from FreeBSD Foundation copyrights
These ones were unambiguous cases where the Foundation was the only
listed copyright holder.

Sponsored by:	The FreeBSD Foundation
2024-07-30 12:16:36 -04:00
Bojan Novković
1206cf04a7 sys: Bump __FreeBSD_version to mark new malloc(9) flags
This bump is meant to cover the addition of the M_NEVERFREED flag.
2024-07-30 17:38:25 +02:00
Bojan Novković
ddc09a10ea pmap_growkernel: Use VM_ALLOC_NOFREE when allocating pagetable pages
This patch modifies pmap_growkernel in all pmaps to use VM_ALLOC_NOFREE
when allocating new pagetable pages. This should help reduce longterm
fragmentation as these pages are never released after
they are allocated.

Differential Revision:	https://reviews.freebsd.org/D45998
Reviewed by:	alc, markj, kib, mhorne
Tested by:	alc
2024-07-30 17:38:24 +02:00
Bojan Novković
3f32a7e4ee vm: Add a KVA arena for M_NEVERFREED allocations
This patch adds a new KVA arena for separating M_NEVERFREED allocations.
Separating KVAs for pages that are never freed should facilitate
superpage promotion in the kernel.

Differential Revision:	https://reviews.freebsd.org/D45997
Reviewed by:	alc, kib, markj
Tested by:	alc
2024-07-30 17:38:24 +02:00
Bojan Novković
a8693e89e3 vm: Introduce vm_page_alloc_nofree_domain
This patch adds a reservation-aware bump allocator intended for
allocating NOFREE pages. The main goal of this change is to reduce the
long-term fragmentation issues caused by pages that are never freed during runtime.

The `vm_page_alloc_nofree_domain` routine hands out 0-order pages from
a preallocated superpage. Once an active NOFREE superpage fills up, the
routine will try to allocate a new one and discard the old one.
This routine will get invoked whenever VM_ALLOC_NOFREE is passed to
vm_page_alloc_noobj or vm_page_alloc.

Differential Revision:	https://reviews.freebsd.org/D45863
Reviewed by:	alc, kib, markj
Tested by:	alc
2024-07-30 17:38:24 +02:00
Bojan Novković
92b9138991 vm: Introduce VM_ALLOC_NOFREE and PG_NOFREE
This patch adds two additional vm_page flags to distinguish pages that
never get released while the system is running (e.g. UMA_ZONE_NOFREE slabs).

Differential Revision:	https://reviews.freebsd.org/D45970
Reviewed by:	alc, kib, markj
Tested by:	alc
2024-07-30 17:38:24 +02:00
Bojan Novković
78f3e0f6b3 malloc(9): Introduce M_NEVERFREED
This patch adds an additional malloc(9) flag to distinguish allocations
that are never freed during runtime.

Differential Revision:	https://reviews.freebsd.org/D45045
Reviewed by:	alc, kib, markj
Tested by:	alc
2024-07-30 17:38:18 +02:00
Konstantin Belousov
2204a48290 mlx5en: limit reporting eeprom read failure due to unplugged module to verboseboot
Requested by:	gallatin
Sponsored by:	NVIDIA networking
MFC after:	1 week
2024-07-30 18:00:04 +03:00
Konstantin Belousov
e23731db48 mlx5en: add IPSEC_OFFLOAD support
Right now, only IPv4 transport mode, with aes-gcm ESP, is supported.
Driver also cooperates with NAT-T, and obeys socket policies, which
makes IKEd like StrongSwan working.

Sponsored by:	NVIDIA networking
2024-07-30 18:00:04 +03:00
Konstantin Belousov
65f264dcf7 ipsec_offload: indirect two more functions on the ipsec.ko module load
Specifically, ipsec_accel_on_ifdown() and ipsec_accel_drv_sa_lifetime_update()
should be present in kernel for future mlx5en driver to be statically
linkable into the kernel built with IPSEC_HOOKS + IPSEC_OFFLOAD.

Sponsored by:	NVIDIA networking
2024-07-30 17:59:49 +03:00
Mark Johnston
8381e9f49e ithread: Improve synchronization in ithread_destroy()
Previously, to destroy an ithread we would set IT_DEAD in its flags, and
then wake it up if it wasn't already running.  After doing this,
intr_event_destroy() would free the intr_event structure.  However, it
did not wait for the ithread to exit, so it was possible for the ithread
to access the intr_event after it was freed.

This use-after-free happens readily when running the pf tests in
parallel, since they frequently create and destroy VNET jails, and pf
registers several VNET-local swi handlers.

Fix the race by modifying ithread_destroy() to wait until the ithread
has signaled that it is about to exit by setting ie->ie_thread = NULL.
Existing callers of intr_event_destroy() are allowed to sleep.

Reported by:	KASAN
Reviewed by:	kib, jhb
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D45492
2024-07-30 14:37:32 +00:00
Mark Johnston
c122d7ffad ithread: Annotate a branch in ithread_execute_handlers()
No functional change intended.

Reviewed by:	kib, jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45491
2024-07-30 14:37:26 +00:00
Mark Johnston
177624f2f4 intr: Remove dead code from intr_event_remove_handler()
We currently destroy the ithread in intr_event_destroy().  In
preparation for fixing a bug there, remove this dead code and reorganize
a bit to avoid some code duplication.  No functional change intended.

Reviewed by:	kib, jhb
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45490
2024-07-30 14:35:53 +00:00
John Baldwin
8ebacb9daa nvmf_tcp: Correct calculation of number of TTAGs to allocate
The increment of 1 was intended to convert qp->maxr2t from 0's based
to 1 based before multiplying by the queue length.

Sponsored by:	Chelsio Communications
2024-07-30 10:28:54 -04:00
John Baldwin
19c15e41c6 nvmf_tcp: Update R2T accounting stats when aborting command buffers
If a queue pair is destroyed (e.g. due to the TCP connection dropping)
while a host to controller data transfer is in progress, the
pending_r2ts counter can be non-zero.  This can later trigger an
assertion failure when the capsule is freed.  To fix, update the
relevant R2T accounting stats when aborting active command buffers
during queue pair destruction.

Sponsored by:	Chelsio Communications
2024-07-30 10:28:19 -04:00
John Baldwin
6df040ea6e nvmf_tcp: Avoid setting some unused parameters in tcp_allocate_qpair
Specifically, some parameters only apply to either controller or host
queue pairs but not both.

Sponsored by:	Chelsio Communications
2024-07-30 10:27:47 -04:00
John Baldwin
a14de491e0 nvmf_tcp: Use min() to simplify a few statements
Sponsored by:	Chelsio Communications
2024-07-30 10:26:14 -04:00
Michael Tuexen
4d32367a44 Revert "udp: improve handling of cached route"
This reverts commit 7186765300.
Two tests of the test suite are failing. Reverting the change
until it is improved.
2024-07-30 11:46:27 +02:00
Roger Pau Monné
69c47485b5 x86/xen: use UNUSABLE e820 regions for external mappings
Using holes in the memory map to create external mappings (for example grants
or foreign maps) can be dangerous, as the guest might not have enough knowledge
of whether such holes are maybe MMIO of some devices.

Workaround this by using UNUSABLE e820 ranges as scratch space for external
mappings.  The e820 memory map provided to dom0 is based on the native one, but
since PVH dom0 uses second stage translation, the UNUSABLE ranges on the host
memory map doesn't affect it, and we can also guarantee no device MMIO uses
those.

Additionally, any RAM in the e820 not available to dom0 because dom0
memory has been limited on the command line, or because those are in use by
Xen, are converted to UNUSABLE in the dom0 memory map.

Note that domU don't usually have UNUSABLE ranges in their memory maps, and
hence the logic introduced here won't help in avoiding conflicts with MMIO
regions.  However the usage of external mappings on domUs is in general
limited, and the logic introduced here simply won't be helpful to them, but
won't regress the current state.

Sponsored by: Cloud Software Group
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D46123
2024-07-30 09:41:17 +02:00
Roger Pau Monné
baa006f342 xen: introduce a per-arch scratch mapping ranges
The current approach is to create foreign mappings in any unpopulated address
on the memory map.  This however can cause issues, as late-loaded drivers could
then found their MMIO region has been stolen to be used as foreign mapping
scratch space (due to the Xen drivers having started first).

Add a local resource manager to the xenpv bus driver, architectures can add
suitable resources to that resource manager at boot in order to be used in
preference of the generic MMIO resource allocator.

No functional change, as the introduced scratch mapping range is not yet
populated.

Sponsored by: Cloud Software Group
MFC after: 1 week
Reviewed by: Elliott Mitchell <ehem+freebsd@m5p.com>
Differential revision: https://reviews.freebsd.org/D46122
2024-07-30 09:39:38 +02:00
Warner Losh
7cb65be96d stand: Use correct loader needs to be updated code
Use the correct loader code that adds an inactive highlighted menu item
indicating that an update is needed.

My laptop is the only machine that I have a boot menu. I'd debugged the
menu part there, but had all the other changes, including my original
menu code, on my server and hadn't copied it back before pushing.

Fixes: 0eac99f76e
Sponsored by: Netflix
2024-07-29 20:26:11 -06:00
Konstantin Belousov
c4269e63ec exit(3): clarify how to obtain full exit status of the exited process
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-07-30 02:57:34 +03:00
Konstantin Belousov
3f3ec4b99f exit(3): make it thread-safe
It was explained by Rich Felker <dalias@libc.org> on libc-coord.
See https://austingroupbugs.net/view.php?id=1845.

Reviewed by:	imp, markj
Tested by:	antoine (exp-run)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 month
Differential revision:	https://reviews.freebsd.org/D46108
2024-07-30 02:57:34 +03:00
Konstantin Belousov
31f688a26d rtld: avoid division in __thr_map_stacks_exec()
The function is called by rtld with the rtld bind lock write-locked,
when fixing the stack permission during dso load.  Not every ARMv7 CPU
supports the div, which causes the recursive entry into rtld to resolve
the  __aeabi_uidiv symbol, causing self-lock.

Workaround the problem by using roundup2() instead of open-coding less
efficient formula.

Diagnosed by:	mmel
Based on submission by:	John F Carr <jfc@mit.edu>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-07-30 02:57:33 +03:00
Konstantin Belousov
860c4d94ac rtld: add LD_NO_DL_ITERATE_PHDR_AFTER_FORK env var
which makes threaded fork ignore the phdr rtld lock, in particular
allowing the dl_iterate_phdr() to block in callback.  The cost is that
the image started in this mode cannot use dl_iterate_phdr() after fork.

PR:	280318
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-07-30 02:57:33 +03:00
Konstantin Belousov
47315d6d35 rtld: make ld_get_env_var() usable for all rtld source files
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-07-30 02:57:33 +03:00
Konstantin Belousov
bc25bc6850 rtld(1): Spell value as VALUE, not NAME
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2024-07-30 02:57:33 +03:00
Warner Losh
0eac99f76e stand: Add "Loader needs updating" to the first menu item"
When the boot loader version is too old, add a warning to the boot menu
to maybe catch people's attention.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D45890
2024-07-29 16:57:37 -06:00
Warner Losh
a2fd7ae879 stand: Print a warning of the loader is too old
If the loader is < 3.0, print a warning that it's too old and needs to
be upgraded.

Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D45889
2024-07-29 16:57:30 -06:00
Warner Losh
9f7f905075 loader: Bump all versions to 3.0
Each incompatible change we make, we bump the major version. We've not
done the bump in a while, so sync everybody to 3.0. Anything older than
3.0 will be given a warning that their boot loader is too old. We check
only the major version, though, so minor versions can still be bumped
for individual loaders (though I honestly doubt we'll ever need to do
that again).

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D45888
2024-07-29 16:57:22 -06:00
Warner Losh
809edb3636 Revert "loader/lua: Remove workaround for command_error"
This reverts commit 552f3072af.

loader.command_error was added just after 11.2, but appears to not have
been back ported to 11.x. 11.0 was the first lua loader release, so keep
this compat shim until we sort out what to do.

MFC After:		3 days
Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D45883
2024-07-29 16:57:13 -06:00
Warner Losh
522a65a8d9 Revert "loader/lua: Remove compat shim for loader.lua_path"
This reverts commit ab97d42add.

There's too many people in the field with FreeBSD 12.0 loader.efi that
stubbed their toe on upgrading to 14.1 since they'd not updated
loader.efi. While we sort out that mess, add back this workaround.  Can
revisit after 14.2 maybe.

MFC After: 		3 days
Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D45882
2024-07-29 16:57:04 -06:00
Warner Losh
b38a82c77a Revert "loader/lua: Remove pager shim"
This reverts commit 8b9178cd0d.

Really old loader.efi files persist in the field. Revert this to support
it. We need to support this through at least 14.2 now, alas.

MFC After:		3 days
Sponsored by:		Netflix
Reviewed by:		kevans
Differential Revision:	https://reviews.freebsd.org/D45881
2024-07-29 16:56:55 -06:00
Warner Losh
65300ca729 stand: Kill commented out line
This line is no longer needed as fallback, and should have been deleted
in 7870a52598 instead of commented out, but 26 years later, I have a
high degree of confidence that old change was right and we won't need
this line as a fallback.

Sponsored by:		Netflix
Reviewed by:		kevans, jhb
Differential Revision:	https://reviews.freebsd.org/D45880
2024-07-29 16:56:48 -06:00
Warner Losh
8165650389 stand: Remove obsolete junk
We long ago changed newvers.sh to make these comments bogus.  Remove
them since every single one of them is broken after the $FreeBSD$
removal.

Sponsored by:		Netflix
Reviewed by:		kevans, jhb
Differential Revision:	https://reviews.freebsd.org/D45879
2024-07-29 16:56:28 -06:00
Mark O'Donovan
e40474f3de siphash: minor improvements to siphash unit test
Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp, cperciva
Pull Request: https://github.com/freebsd/freebsd-src/pull/1324
2024-07-29 14:44:41 -06:00
Mark O'Donovan
882a725bdf siphash: allow zero values for final & len in SipBuf()
Currently the assert checks for XOR of final and len.
This assert fails when running the unit tests in siphash_test.c.
We need to allow the case where both values are zero.

Signed-off-by: Mark O'Donovan <shiftee@posteo.net>
Reviewed by: imp, cperciva
Pull Request: https://github.com/freebsd/freebsd-src/pull/1324
2024-07-29 14:44:27 -06:00
John Baldwin
0244e0a177 openssl: Add <sys/random.h> include for getrandom()
GCC 14 (but not earlier versions) warns about a missing prototype
for getrandom().  Include <sys/random.h> explicitly to bring in the
prototype rather than depending on a nested include.  While here,
stop defining sysctl_random() since it is no longer used.

Reviewed by:	brooks
Fixes:		838b6caaba openssl: use getrandom(2) instead of probing for getentropy(2)
Differential Revision:	https://reviews.freebsd.org/D45995
2024-07-29 16:38:49 -04:00
Jose Luis Duran
d573295659 pw: Clarify groupadd/groupmod memberlist formats
Clarify in which formats the memberlist for groupadd/groupmod can be
accepted for '-M', '-m', or '-d' flag.

Related commit:	40ab104eaa.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1352
2024-07-29 14:14:14 -06:00
Jose Luis Duran
1c8a45b554 mtree: Fix the sort order in BSD.tests.dist
Reviewed by: imp, emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1351
2024-07-29 14:13:02 -06:00
Jose Luis Duran
68bcf53ea2 mtree: Fix the sort order in BSD.include.dist
Reviewed by: imp, emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1351
2024-07-29 14:12:58 -06:00
Ahmad Khalifa
969484b532 bytgpio: expose PNP info
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1349
2024-07-29 14:09:08 -06:00
Daniel Tameling
5f659bb0b6 test(1): quote closing bracket in error message
If test is called as [ and one forgets to close the bracket, the error
message is currently
[: missing ]

To make it obvious that this is not something printed in brackets,
quote the closing bracket in the message, which is what everybody else
is doing:
[: missing ']'

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1346
2024-07-29 14:08:33 -06:00
Bram
1d551845f3 netstat.1: Clarify -d argument
The man page states that the -d flag can be used to show the dropped
packets. But, the number of dropped input packets are always shown,
independent of the -d flag. This commit clarifies that the -d flag will
add the number of dropped output packets to the output.

MFC after: 3 days
Reviewed by: imp, Alexander Ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/1332
2024-07-29 14:07:11 -06:00