Commit Graph

282785 Commits

Author SHA1 Message Date
John Baldwin
10172ce32c Stop stripping 'sf' suffixes from architecture names.
riscv64sf was the only architecture with an 'sf' suffix.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D39497
2023-04-12 11:11:02 -07:00
John Baldwin
d27cc06838 src.conf.5: Regen after removal of riscv64sf. 2023-04-12 11:10:37 -07:00
John Baldwin
1ca12bd927 Remove the riscv64sf architecture.
Reviewed by:	jrtc27, arichardson, br, kp, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D39496
2023-04-12 11:09:27 -07:00
Ed Maste
29e3a06510 rtld: fix SysV hash function overflow
Quoting from https://maskray.me/blog/2023-04-12-elf-hash-function:

The System V Application Binary Interface (generic ABI) specifies the
ELF object file format. When producing an output executable or shared
object needing a dynamic symbol table (.dynsym), a linker generates a
.hash section with type SHT_HASH to hold a symbol hash table. A DT_HASH
tag is produced to hold the address of .hash.

The function is supposed to return a value no larger than 0x0fffffff.
Unfortunately, there is a bug. When unsigned long consists of more than
32 bits, the return value may be larger than UINT32_MAX. For instance,
elf_hash((const unsigned char *)"\xff\x0f\x0f\x0f\x0f\x0f\x12") returns
0x100000002, which is clearly unintended, as the function should behave
the same way regardless of whether long represents a 32-bit integer or
a 64-bit integer.

Reviewed by:	kib, Fangrui Song
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39517
2023-04-12 12:44:34 -04:00
Ed Maste
87443cb6c6 rtld: reindent and style(9) elf_hash()
In preparation for an upcoming change (D39517).

Sponsored by:	The FreeBSD Foundation
2023-04-12 12:43:36 -04:00
Michael Tuexen
2ba2849c82 tcp: fix typo in comment
Reported by:	cc
MFC after:	1 week
Sponsored by:	Netflix, Inc.
2023-04-12 18:08:21 +02:00
Michael Tuexen
c687f21add tcp: make net.inet.tcp.functions_default vnet specific
Reviewed by:		cc, rrs
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D39516
2023-04-12 18:04:27 +02:00
Randall Stewart
1073f41657 tcp_lro: When processing compressed acks lets support the new early wake feature for rack.
During compressed ack and mbuf queuing we determine if we need to wake up. A
new function was added that is optional to the tfb so that the stack itself can also
be asked if a wakeup should happen. This helps compensate for late hpts calls.

Reviewed by: tuexen
Sponsored by: Netflix Inc
Differential Revision:https://reviews.freebsd.org/D39502
2023-04-12 11:35:14 -04:00
Mark Johnston
b4f1582f3b netisr: Purge another reference to NETISR_EPAIR
Fixes:	03276e338a ("netisr: Remove the now-unused NETISR_EPAIR queue index")
MFC after:	1 week
2023-04-12 10:27:00 -04:00
Andrew Turner
421516f25e Create pmap_mask_set_locked on arm64
Create a locked version of pmap_mask_set. We will need this for BTI
support.

Sponsored by:	Arm Ltd
2023-04-12 13:10:13 +01:00
Michael Tuexen
73c48d9d8f tcp: fix deregistering stacks when vnets are used
This fixes a bug where stacks could not be deregistered when
end points in the non-default vnet are using it.

Reviewed by:		glebius, zlei
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D39514
2023-04-12 10:52:53 +02:00
Corvin Köhne
305edaa479
bhyve: add QEMU_FWCFG_INDEX_MAX_CPUS item
Requested-by:		coreboot
Reviewed by:		<If someone else reviewed your modification.>
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39315
2023-04-12 09:35:33 +02:00
Corvin Köhne
b6e67875a3
bhyve: add hook for PCI header of passthru devices
Most register of the PCI header are either constant values or require
emulation anyway. The command and status register are the only exception which
require hardware access. So, we're adding an emulation handler for all
other register.

As this emulation handler will be reused by some future features like
GPU passthrough, we directly export it.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33010
2023-04-12 09:22:24 +02:00
Corvin Köhne
931bb7bf1c
bhyve: define array to protect passthru regs
GPU passthrough requires a special handling of some PCI config register.
Therefore, we need a flexible approach for implementing it. Adding an
array of handler meets this condition.

Start by using the default handler for all accesses to the PCI config
space. In upcoming commits, we can start to split the default handler
into several handler for each register that requires emulation.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39291
2023-04-12 09:22:19 +02:00
Corvin Köhne
e976464a50
bhyve: allow device specific DSDT entries
This feature will be used by future commits to implement a device
specific method (_DSM) for TPM devices.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39321
2023-04-12 08:33:47 +02:00
Corvin Köhne
ab34ea4711
bhyve: check for errors when writing device specific DSDT entries
At the moment, this function can't fail. This behaviour will change in
the future. In preparation to that, convert the return type to int in
order to be able to check for errors.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39422
2023-04-12 08:33:29 +02:00
Corvin Köhne
0926566f6f
bhyve: allow building device specific ACPI tables
Some ACPI devices require a device specific acpi table. E.g. a TPM2
device requires a TPM2 table. Use the acpi_device_emul struct to define
such a device specific table.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39320
2023-04-12 08:27:04 +02:00
Zhenlei Huang
c3c5e6c3e6 tarfs: Use the existing CTLFLAG_RWTUN flag definition
Use it when possible, instead of separated flags.

No functional change intended.

Reviewed by:	hselasky, erj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D39466
2023-04-12 12:20:38 +08:00
Zhenlei Huang
deac4c7f07 iicbus(4): Use the existing CTLFLAG_RWTUN flag definition
Use it when possible, instead of separated flags.

No functional change intended.

Reviewed by:	hselasky, erj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D39466
2023-04-12 12:20:38 +08:00
Zhenlei Huang
8bd9afe9e1 bxe(4): Use CTLFLAG_RDTUN flag definition
sysctl variables rx_budget and max_aggregation_size are read-only loader
tunable. Mark them with CTLFLAG_RD flag.

No functional change intended.

Reviewed by:	hselasky, erj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D39466
2023-04-12 12:20:38 +08:00
Zhenlei Huang
5ff8018108 ice(4): Use the existing CTLFLAG_RWTUN flag definition
Use it when possible, instead of separated flags.

No functional change intended.

Reviewed by:	hselasky, erj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D39466
2023-04-12 12:20:38 +08:00
Zhenlei Huang
69cb72b872 cam iosched: Use the existing CTLFLAG_RDTUN and CTLFLAG_RWTUN flag definitions
Use them when possible, instead of separated flags.

No functional change intended.

Reviewed by:	hselasky, erj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D39466
2023-04-12 12:20:38 +08:00
Zhenlei Huang
dc1c5138c3 powerpc: Use the existing CTLFLAG_RDTUN and CTLFLAG_RWTUN flag definitions
Use them when possible, instead of separated flags.

No functional change intended.

Reviewed by:	hselasky, erj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D39466
2023-04-12 12:20:38 +08:00
Warner Losh
7968a06a69 sysdecode: Add aarch64
FREEBSD32 API is also supported on aarch64. Refer to aarch64 instead of
arm64 because it's about the architecture (powerpc64), not the kernel
interface...

Sponsored by:		Netflix
2023-04-11 22:14:17 -06:00
Rene Ladan
6a68db4a8f misc: remove swills from the portmgr graph
Hat:	portmgr-secretary
2023-04-11 23:20:18 +02:00
John Baldwin
cd800d3c96 Enable -Warray-parameter for clang.
I fixed many of these previously for GCC 12 and make tinderbox passes
with this enabled.

Differential Revision:	https://reviews.freebsd.org/D39378
2023-04-11 13:47:59 -07:00
Rick Macklem
61330e494f mount_nfs.8: Update man page for the "syskrb5" option
Commit 896516e54a added a new NFS mount option
used for Kerberized NFSv4.1/4.2 mounts. It specifies that
AUTH_SYS be used for state maintenance (also called system)
operations. This allows the mount to be done without the
"gssname" option or a valid Kerberos TGT being held by the
user doing the mount (so it can be specified in fstab(5) for
example).

Reviewed by:	gbe (manpages), karels
MFC after:	3 months
Differential Revision:	https://reviews.freebsd.org/D39469
2023-04-11 12:17:09 -07:00
Richard Scheffenegger
2169f71277 tcp: use IPV6_FLOWLABEL_LEN
Avoid magic numbers when handling the IPv6 flow ID for
DSCP and ECN fields and use the named variable instead.

Reviewed By:		tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D39503
2023-04-11 18:53:51 +02:00
Ed Maste
af7624ed31 makefs: use %s and __func__ in printf messages
For diff reduction against NetBSD.

Obtained from:	NetBSD 0c4125e1a19f
Sponsored by:	The FreeBSD Foundation
2023-04-11 11:21:36 -04:00
Sergey A. Osokin
eed92455e6 bsd-family-tree: add FreeBSD 13.2
MFC after:	3 days
2023-04-11 10:32:53 -04:00
Konstantin Belousov
c53e990b8d DEBUG_VFS_LOCKS: restore diagnostic for the witness use case
Reviewed by:	jah, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39477
2023-04-11 15:59:55 +03:00
Konstantin Belousov
75fc6f86c3 Add witness_is_owned(9)
which returns an indicator if the current thread owns the specified
lock.

Reviewed by:	jah, markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39477
2023-04-11 15:59:49 +03:00
Konstantin Belousov
afa8f8971b vn_start_write(): consistently set *mpp to NULL on error or after failed sleep
This ensures that *mpp != NULL iff vn_finished_write() should be
called, regardless of the returned error, except for V_NOWAIT.
The only exception that must be maintained is the case where
vn_start_write(V_NOWAIT) is called with the intent of later dropping
other locks and then doing vn_start_write(V_XSLEEP), which needs the mp
value calculated from the non-waitable call above it.

Also note that V_XSLEEP is not supported by vn_start_secondary_write().

Reviewed by:	markj, mjg (previous version), rmacklem (previous version)
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39441
2023-04-11 15:59:46 +03:00
Konstantin Belousov
b2f3288747 vn_start_write(): minor style
Reviewed by:	markj
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D39441
2023-04-11 15:59:39 +03:00
Eugene Grosbein
37f4cb29bd imgact_binmisc: unbreak module build outside of kernel build environment
MFC after:	3 days
2023-04-11 17:32:29 +07:00
Gordon Bergling
d2e0204ec0 telnet.1: Fix a typo in the manual page
- s/addreess/address/

MFC after:	3 days
2023-04-11 10:42:37 +02:00
Corvin Köhne
0d29d750b9
bhyve: do not exit if LPC finds no host selector
The host selector is only required when the user likes to use the same
LPC device IDs as the physical LPC device. This is an uncommon use case.
For that reason, it makes no sense to exit when we don't find the host
selector.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39311
2023-04-11 08:39:21 +02:00
domienschepers
61605e0ae5 net80211: fail for unicast traffic without unicast key
Falling back to the multicast key may cause unicast traffic to leak.
Instead fail when no key is found.

For more information see the 'Framing Frames: Bypassing Wi-Fi Encryption
by Manipulating Transmit Queues' paper.

[ I updated the commit message to reference the paper and the code
comment to record historic behaviour as discussed in private email. ]

Security:	CVE-2022-47522
2023-04-10 23:38:57 +00:00
Rob Norris
461ccb55d5 dhclient: add ability to ignore options in offers
A machine might exist on multiple networks, all of which offer, say, default
routes or name servers. There's no easy way to indicate in the config
that those options are only valid for a single interface.

Now, we can write:

    interface "lan0" {
      request routers;
      require routers;
    }
    interface "lan1" {
      ignore routers;
    }

And only take action on default routes offered on lan0.

Tested by:	Jose Luis Duran <jlduran at gmail dot com>
MFC after:	2 months
Reviewed by:	allanjude, imp
Sponsored by:	Zenith Electronics LLC
Sponsored by:	Klara, Inc.
Pull Request:	#693
2023-04-10 23:13:18 +00:00
Ed Maste
22db5e5d03 makefs: set the validation entry system type
Obtained from:	NetBSD c3cb4dcc9c43
Sponsored by:	The FreeBSD Foundation
2023-04-10 19:07:14 -04:00
Ed Maste
1d1ffa2efd makefs: use size_t or ssize_t where appropriate
Obtained from:	NetBSD af7bc97830ac
2023-04-10 18:50:27 -04:00
Sergey A. Osokin
7f8953991f bsd-family-tree: add OpenBSD 7.3
MFC after:	3 days
2023-04-10 18:12:29 -04:00
Randall Stewart
a2b33c9a7a tcp: Rack - in the absence of LRO fixed rate pacing (loopback or interfaces with no LRO) does not work correctly.
Rack is capable of fixed rate or dynamic rate pacing. Both of these can get mixed up when
LRO is not available. This is because LRO will hold off waking up the tcp connection to
processing the inbound packets until the pacing timer is up. Without LRO the pacing only
sort-of works. Sometimes we pace correctly, other times not so much.

This set of changes will make it so pacing works properly in the absence of LRO.

Reviewed by: tuexen
Sponsored by: Netflix Inc
Differential Revision:https://reviews.freebsd.org/D39494
2023-04-10 16:33:56 -04:00
Ed Maste
c3dbcadca2 mail: fix build if TIOCSTI is not defined
Sponsored by:	The FreeBSD Foundation
2023-04-10 16:08:20 -04:00
John Baldwin
e222461790 rack: mask and tclass are only used for INET6.
This fixes the LINT-NOINET6 build.
2023-04-10 12:21:03 -07:00
Joseph Koshy
0e9e9048ae
procfs: Sync a documentation comment with the code.
Approved by:	gnn (mentor)
Differential Revision: https://reviews.freebsd.org/D39488
2023-04-10 17:58:46 +00:00
John Baldwin
3b3762c34e sys: Enable -Wunused-but-set-variable for GCC.
It has been enabled for clang for a while now.

Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39358
2023-04-10 10:36:33 -07:00
John Baldwin
8e9db62e74 zfs: Appease set by unused warnings for spl_fstrans_*mark stubs.
Use a void cast to mark the cookie value as used in spl_fstrans_unmark.

Reported by:	GCC
Differential Revision:	https://reviews.freebsd.org/D39357
2023-04-10 10:36:14 -07:00
John Baldwin
5328efb3d0 if_mos: Remove set but unused variable.
Reviewed by:	hselasky
Reported by:	GCC
Differential Revision:	https://reviews.freebsd.org/D39356
2023-04-10 10:35:48 -07:00
John Baldwin
4b6228906f libalias: Mark set but unused variables as unused.
This function is clearly a stub, but it seems better to leave the stub
bits in place than to remove the function entirely.

Differential Revision:	https://reviews.freebsd.org/D39355
2023-04-10 10:35:29 -07:00