Commit graph

291016 commits

Author SHA1 Message Date
Brooks Davis 80ffc7398b libsys/arm: make vfork less of an outlier
Following the pattern of other architectures, make __sys_vfork the main
symbol and _vfork and vfork weak aliases.  This avoids the need to
special case vfork in the generated list of symbols.

Differential Revision:	https://reviews.freebsd.org/D44330
2024-04-22 21:28:51 +01:00
Brooks Davis 5ffb5c849c openssl: don't export nonexistant symbols
These are all OpenSSL 1.1.0 and 1.1.1 symbols that aren't present in our
OpenSSL 3.0 builds.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D44249
2024-04-22 21:28:51 +01:00
Brooks Davis e5700dab1e src.conf.5: rebuild after WITH_NVME changes
WITH_NVME is no longer marked broken on armv7, riscv64, or powerpc.

Fixes:		2fda3ab0ac WITH_NVME: Remove from broken.
Differential Revision:	https://reviews.freebsd.org/D44850
2024-04-22 21:28:27 +01:00
Brooks Davis 7448408656 Make __libsys_interposing_slot libsys only
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44881
2024-04-22 21:28:26 +01:00
Brooks Davis 672464f756 libthr: always use __libc_interposing_slot()
Use __libc_interposing_slot() in favor of __libsys_interposing_slot() so
that the interposing interface is entierly between libc and libthr with
libsys only involved as an implementation detail.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D44880
2024-04-22 21:28:26 +01:00
Alan Somers 3acf3feaa8 geli: add a read-only kern.geom.eli.use_uma_bytes sysctl
It reports the value of the g_eli_alloc_sz variable.  Allocations of
this size or less will use UMA.  Larger allocations will use malloc.
Since malloc is slower, it is useful for users to know this variable so
they can avoid such allocations.  For example, ZFS users can set
vfs.zfs.vdev.aggregation_limit to this value.

MFC after:	1 week
Sponsored by:	Axcient
Reviewed by:	markj, imp
Differential Revision: https://reviews.freebsd.org/D44904
2024-04-22 13:20:03 -06:00
Joseph Mingrone 5cafc38f11
adduser: Fix a syntax error
Reported by:	Jose Luis Duran <jlduran@gmail.com>
Fixes:		b37333899b
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44871
2024-04-22 16:06:38 -03:00
Dimitry Andric 911a6479e1 libcxxrt: define SHLIBDIR before including bsd.own.mk
Otherwise bsd.own.mk overrides it, causing libcxxrt.so.1 to be
erroneously installed into /usr/lib.

Also add an ObsoleteFiles.inc entry, for removing the bad copy.

Reported by:	Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Fixes:		da77a1b4f0
2024-04-22 20:46:45 +02:00
Ed Maste 76a8625bc7 mfc-candidates: use stable/14 as default MFC-to branch
This tool is typically invoked from within a working tree containing the
desired MFC target branch, which is detected automatically.  It also has
a default for when it is invoked from elsewhere.  Switch the default to
the most recent branch, stable/14.

Sponsored by:	The FreeBSD Foundation
2024-04-22 13:57:17 -04:00
Mark Johnston 7a7063cc54 thread: Add a missing include of asan.h
I didn't notice this during testing because invariants-enabled kernels
implicitly include asan.h via kassert.h.

Reported by:	Lexi Winter <lexi@le-Fay.org>
Fixes:		800da341bc ("thread: Simplify sanitizer integration with thread creation")
2024-04-22 13:07:53 -04:00
Lexi Winter ef84dd8f49 if_bridge: clean up INET/INET6 handling
The if_bridge contains several instances of:

	if (AF_INET code ...
	#ifdef INET6
	    AF_INET6 code ...
	#endif
	) {
		...

Clean this up by adding a couple of macros at the top of the file that
are conditionally defined based on whether INET and/or INET6 are enabled,
which makes the code more readable and easier to maintain.

No functional change intended.

Reviewed by:	zlei, markj
MFC after:	1 week
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1191
2024-04-22 12:01:27 -04:00
Mark Johnston 7f7b4926a7 ng_hci: Add sockaddr validation to sendto()
ng_btsocket_hci_raw_send() wasn't verifying that the destination address
specified by sendto() is large enough to fill a struct sockaddr_hci.
Thus, when copying the socket address into an mbuf,
ng_btsocket_hci_raw_send() may read past the end of the input sockaddr
while copying.

In practice this is effectively harmless since
ng_btsocket_hci_raw_output() only uses the address to identify a
netgraph node.

Reported by:	Oliver Sieber <oliver@secfault-security.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2024-04-22 11:48:00 -04:00
Mark Johnston 800da341bc thread: Simplify sanitizer integration with thread creation
fork() may allocate a new thread in one of two ways: from UMA, or cached
in a freed proc that was just allocated from UMA.  In either case, KASAN
and KMSAN need to initialize some state; in particular they need to
initialize the shadow mapping of the new thread's stack.

This is done differently between KASAN and KMSAN, which is confusing.
This patch improves things a bit:
- Add a new thread_recycle() function, which moves all kernel stack
  handling out of kern_fork.c, since it doesn't really belong there.
- Then, thread_alloc_stack() has only one local caller, so just inline
  it.
- Avoid redundant shadow stack initialization: thread_alloc()
  initializes the KMSAN shadow stack (via kmsan_thread_alloc()) even
  through vm_thread_new() already did that.
- Add kasan_thread_alloc(), for consistency with kmsan_thread_alloc().

No functional change intended.

Reviewed by:	khng
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44891
2024-04-22 11:46:59 -04:00
Doug Moore dd03eafacb riscv: create a convenience composite macro
Define PTE_TO_VM_PAGE to compose the PHYS_TO_VM_PAGE and PTE_TO_PHYS
macros. Use it where appropriate, and drop some variables that it
makes unnecessary.

Reviewed by:	jhb (previous version)
Differential Revision:	https://reviews.freebsd.org/D44700
2024-04-21 18:36:00 -05:00
HP van Braam 10e0c34bf8 Enable L1SS handling on RPI4 pcib
Thanks to @kevans91 for pointing me in the right direction. FreeBSD had
the same bug as Linux (see
https://bugzilla.kernel.org/show_bug.cgi?id=217276) where the ultimate
solution was to honor the brcm,enable-l1ss FDT property.

In current versions of the dtb files this property has been added by
default.

Without this on many, many pcie addin cards the pcib will Serror when
trying to assert the clreq# pin on the pcie bus. Many cards do not have
these hooked up.

PR:		260131, 277638, 277605
Reviewed-by:	emaste
Signed-off-by: HP van Braam <hp@tmm.cx>
Pull-request: https://github.com/freebsd/freebsd-src/pull/1179
2024-04-21 18:34:05 -04:00
Dimitry Andric 0ab121e9f9 Add a few missed libclang_rt files to ObsoleteFiles.inc
PR:		276104
Reported by:	Mark Millard <marklmi@yahoo.com>
MFC after:	3 days
2024-04-21 23:32:22 +02:00
Enji Cooper 572948d00d Revert "OpenSSL: use the upstream provided version.map files for the fips/legacy providers"
This change is still under review and should not have been merged
directly to main (yet).

This is a case and point for using `push.default` to nothing instead of
matching or simple.

This reverts commit 42ce242e35.
2024-04-21 09:58:31 -07:00
Enji Cooper 42ce242e35 OpenSSL: use the upstream provided version.map files for the fips/legacy providers
This change introduces a static copy of the fips and legacy linker version maps
generated by the OpenSSL 3.0.13 build process.

This unbreaks the fips and legacy providers by not exposing unnecessary
symbols from the fips/legacy provider shared objects shared with other
providers (base, default) and libcrypto.

More discussion:

Prior to this change, loading the fips provider indirectly from a
FreeBSD 14.0-CURRENT and 15.0-CURRENT host would result in a
process-wide deadlock when invoking select OpenSSL APIs
(CONF_modules_load* in this particular example).

Speaking with the upstream maintainers [1], it became obvious that
the FreeBSD base system was incorrectly building/linking the fips
provider, resulting in a symbol collision at runtime, and thus a
process-wide deadlock in specific circumstances. The fips provider
would deadlock when trying to acquire a write lock on internal
structures which should have only been available to the base and
default providers, as certain preprocessor ifdefs only allow specific
internal calls to be made with the base and default providers.

1. https://github.com/openssl/openssl/issues/24202

Differential Revision:	https://reviews.freebsd.org/D44892
2024-04-21 09:35:19 -07:00
Enji Cooper b571bcea54 bsd.subdir.mk: improve SUBDIR.${MK_FOO} advice
- Remove superfluous whitespace by removing trailing whitespace
  before `\` (line continuation character)
- Quote `SUBDIR.` to clarify the fact that this is a variable
  reference--not the end of a sentence.
2024-04-21 09:30:09 -07:00
Ed Maste 793745fad8 mfc-candidates: move pretty printing into lua
d51c590023 moved the MFC hash matching logic into a lua utility
script but left the output formatting in the shell script. Simplify this
slightly by just printing the formatted output from lua.

Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D44836
2024-04-21 10:10:57 -04:00
Andriy Gapon b9827c007a Revert "dtrace: make 'ring' and 'fill' policies imply 'noswitch' flag"
This reverts commit e92491d95f.

The general idea looked good to me.  In particular, it allowed to save
some memory and avoid memory allocation failures when a large buffer
size was requested along with ring and fill policies.

But I didn't take into account that the second, supposedly unused
buffer, was actually used as the scratch buffer.  The scratch buffer is
used as a temporary space for DTrace subroutines like copyin, copyinstr,
and alloca.

I think that the change can be fixed by allocating a separate smaller
buffer for the scratch buffer, but that fix would require more work than
I am able to do now.  Hence the revert.

Reported by:	Domagoj Stolfa
Diagnosed by:	Domagoj Stolfa, markj
MFC after:	immediately
2024-04-21 15:17:08 +03:00
Gordon Bergling 26f6c148bc freescale: Fix a typo in a source code comment
- s/cant/can't/

MFC after:	3 days
2024-04-21 09:52:14 +02:00
Gordon Bergling 9576fc16ca uipc_domain: Fix a typo in a source code comment
- s/cant/can't/

MFC after:	3 days
2024-04-21 09:51:14 +02:00
Gordon Bergling c0a01ee83d geom(4): Fix a typo in a source code comment
- s/cant/can't/

MFC after:	3 days
2024-04-21 09:49:44 +02:00
Gordon Bergling 026520a5f2 wtap: Fix typos in kernel messages
- s/cant/can't/

MFC after:	1 week
2024-04-21 09:47:24 +02:00
Gordon Bergling 8b5c5cae92 vmm(4): Fix a typo in a kernel message
- s/cant/can't/

MFC after:	1 week
2024-04-21 09:44:18 +02:00
Kyle Evans 9dcf39575e ahc(4)/ahd(4): fix target mode on ARM
One of the comments in ahc_execute_scb() notes that the CAM direction is
actually w.r.t. the initiator.  As a consequence, all of our sync ops
end up being wrong because the direction is flipped from that of the
transfer.  Fix it to do proper invalidation and avoid spewing random
garbage out on the SCSI bus.

Reported and tested by:	HP van Braam <hp@tmm.cx>
Reviewed by:	imp, mav
Differential Revision:	https://reviews.freebsd.org/D44860
2024-04-20 22:04:04 -05:00
Kyle Evans b5e0cc2fa4 ahc(4): resolve some minor nits
In ahc_init(), qoutfifo is already assigned to effectively the same
value a couple lines up, except in the first assignment it uses the
proper definition; keep the more descriptive assignment.

ahc_targetcmd_offset() gets the offset wrong entirely; as per the
area of ahc_init() this diff also touches, targetcmds is laid out first
in the shared map and it's followed by the qoutfifo.  As a result, we'd
generally be getting negative offsets here.  We can't actually do a
partial sync anyways, so there was no consequence to getting this wrong.

Reviewed by:	imp, mav
Differential Revision:	https://reviews.freebsd.org/D44859
2024-04-20 22:04:04 -05:00
Dag-Erling Smørgrav b37333899b adduser: A few more improvements.
MFC after:	1 week
Reviewed by:	jrm
Differential Revision:	https://reviews.freebsd.org/D44871
2024-04-20 21:35:32 +02:00
Stefan Eßer 6815606c82 ldconfig: fix man-page - duplicate dot at end of sentence
Reported by:	gbe
2024-04-20 19:49:10 +02:00
Mark Johnston 955f213fa2 graid3: Fix teardown in g_raid3_try_destroy()
Commit 33cb9b3c3a replaced a g_raid3_destroy_device() call with a
g_raid3_free_device() call, which was incorrect and could lead to a
panic if a RAID3 GEOM failed to start (e.g., due to missing disks).

Reported by:	graid3 tests
Fixes:		33cb9b3c3a ("graid3: Fix teardown races")
MFC after:	3 days
Sponsored by:	Klara, Inc.
2024-04-20 12:04:57 -04:00
Mark Johnston c0f1323241 wg tests: Add a simple regression test case for netmap support
MFC after:	1 month
Sponsored by:	Klara, Inc.
Sponsored by:	Zenarmor
2024-04-20 12:04:42 -04:00
Mark Johnston bf454ca88b wg: Add netmap support
When in netmap (emulated) mode, wireguard interfaces prepend or strip a
dummy ethernet header when interfacing with netmap.  The netmap
application thus sees unencrypted, de-encapsulated frames with a fixed
header.

In this mode, netmap hooks the if_input and if_transmit routines of the
ifnet.  Packets from the host TX ring are handled by wg_if_input(),
which simply hands them to the netisr layer; packets which would
otherwise be tunneled are intercepted in wg_output() and placed in the
host RX ring.

The "physical" TX ring is processed by wg_transmit(), which behaves
identically to wg_output() when netmap is not enabled, and packets
appear in the "physical" RX ring by hooking wg_deliver_in().

Reviewed by:	vmaffione
MFC after:	1 month
Sponsored by:	Klara, Inc.
Sponsored by:	Zenarmor
Differential Revision:	https://reviews.freebsd.org/D43460
2024-04-20 12:04:42 -04:00
Alexander Motin 278d695094 libpmc: Import AMD Zen 4 PMU events
MFC after:	1 week
2024-04-20 11:54:04 -04:00
Dimitry Andric dfa39133b3 Merge llvm-project release/18.x llvmorg-18.1.4-0-ge6c3289804a6
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project release/18.x llvmorg-18.1.4-0-ge6c3289804a6.

PR:		276104
MFC after:	3 days
2024-04-20 16:02:57 +02:00
Konstantin Belousov 8d74737035 rtld(1): minor clarification for LD_STATIC_TLS_EXTRA
Also properly style the paragraph.

Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2024-04-20 16:50:27 +03:00
Gordon Bergling fa3b320668 ds1307(4): Fix a typo in a source code comment
- s/slighly/slightly/

MFC after:	1 week
2024-04-20 14:14:21 +02:00
Gordon Bergling e6c45f377d i386: Fix a typo in a source code comment
- s/slighly/slightly/

MFC after:	1 week
2024-04-20 14:13:33 +02:00
Gordon Bergling 1bbdcf62d3 safe(4): Remove a double word in a source code comment
- s/of of/of/

MFC after:	3 days
2024-04-20 14:12:23 +02:00
Gordon Bergling 604511f84a usb(4): Remove a double word in a source code comment
- s/of of/of/

MFC after:	3 days
2024-04-20 14:10:59 +02:00
Gordon Bergling d2747968c0 bhnd(4): Remove a double word in a source code comment
- s/of of/of/

MFC after:	3 days
2024-04-20 14:09:18 +02:00
Gordon Bergling 1ff65c57e3 NOTES: Remove a double word in comment
- s/of of/of/

MFC after:	3 days
2024-04-20 14:08:04 +02:00
Gordon Bergling 516e591db1 arm64: Remove a double word in a source code comment
- s/of of/of/

MFC after:	3 days
2024-04-20 14:06:53 +02:00
Gordon Bergling cf5d9c4124 sys: Remove two double words in source code comments
- s/of of/of/

MFC after:	5 days
2024-04-20 14:04:31 +02:00
Gordon Bergling e1e149ad8a mwlstats: Fix a typo in an error message
- s/the the/the/

MFC after:	5 days
2024-04-20 14:02:54 +02:00
Gordon Bergling 68b9eb9185 ifconfig(8): Fix two typos in source code comments
- s/the the/the/

MFC after:	3 days
2024-04-20 14:01:23 +02:00
Gordon Bergling bbef63ec27 timerfd.2: Remove a double word
- s/is is/is/

MFC after:	3 days
2024-04-20 11:31:25 +02:00
Gordon Bergling 742f4b7758 tarfs(5): Grammar fix for a source code comment
- s/the the/of the/

MFC after:i	3 days
2024-04-20 11:21:54 +02:00
Gordon Bergling 6573ce292f nvmecontrol(8): Remove a double word in a source code comment
- s/the the/the/

MFC after:	3 days
2024-04-20 11:18:59 +02:00
Gordon Bergling 5235e9d646 binmiscctl.8: Remove a double word
- s/the the/the/

MFC after:	3 days
2024-04-20 11:15:20 +02:00